From 3c3a5eafb00eeb5dd8128c251091b82d09f4792d Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 16:09:11 +0530 Subject: [PATCH 1/8] Add aerospike-tls sample: Aerospike-Go over TLS with Keploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A Go HTTP service that talks to Aerospike on a TLS-only port (3001) behind stunnel, recorded and replayed end-to-end with Keploy. The sample demonstrates: * Keploy records and replays Aerospike traffic over TLS the same way it does over clear text — what lands in mocks.yaml is plain Aerospike wire protocol, not ciphertext, because the proxy terminates TLS upstream of the parser. * Replay stays deterministic at any concurrency the app exposes: three test-sets cover single-endpoint CRUD, /parallel (shared client, n=4..24), and /multiclient + /freshclient (multiple and per-request *as.Client). main.go ships connection-pool + retry tuning that survives the burst characteristics of mocked replay (ConnectionQueueSize=256, OpeningConnectionThreshold=16, parallelDo 10ms backoff retry, two-phase warmup). README.md and MOCKS_FLOW.md walk through the rationale and the captured mock structure. vendor-aerospike-client-go/ is a local replace of the upstream client that skips peers-tls-std / service-tls-std discovery (CE doesn't answer those); go.mod pins to it. Co-Authored-By: Claude Opus 4.7 (1M context) --- aerospike-tls/.gitignore | 1 + aerospike-tls/Dockerfile | 11 + aerospike-tls/MOCKS_FLOW.md | 240 + aerospike-tls/README.md | 157 + aerospike-tls/aerospike-conf/aerospike.conf | 47 + aerospike-tls/docker-compose.yml | 66 + aerospike-tls/gen-certs.sh | 60 + aerospike-tls/go.mod | 20 + aerospike-tls/go.sum | 34 + aerospike-tls/keploy.yml | 114 + aerospike-tls/keploy/.gitignore | 2 + aerospike-tls/keploy/test-set-0/mocks.yaml | 4104 +++ .../test-set-0/tests/delete-key-alice-1.yaml | 41 + .../test-set-0/tests/get-batch-get-1.yaml | 46 + .../test-set-0/tests/get-get-alice-1.yaml | 41 + .../keploy/test-set-0/tests/get-health-1.yaml | 41 + .../test-set-0/tests/post-batch-put-1.yaml | 45 + .../keploy/test-set-0/tests/post-put-1.yaml | 45 + .../test-set-0/tests/post-touch-alice-1.yaml | 41 + aerospike-tls/keploy/test-set-1/mocks.yaml | 8820 +++++ .../keploy/test-set-1/tests/get-health-1.yaml | 41 + .../test-set-1/tests/post-parallel-1.yaml | 45 + .../test-set-1/tests/post-parallel-2.yaml | 45 + .../test-set-1/tests/post-parallel-3.yaml | 45 + .../test-set-1/tests/post-parallel-4.yaml | 45 + aerospike-tls/keploy/test-set-2/mocks.yaml | 30708 ++++++++++++++++ .../keploy/test-set-2/tests/get-health-1.yaml | 41 + .../test-set-2/tests/post-freshclient-1.yaml | 45 + .../test-set-2/tests/post-freshclient-2.yaml | 45 + .../test-set-2/tests/post-multiclient-1.yaml | 45 + .../test-set-2/tests/post-multiclient-2.yaml | 45 + .../test-set-2/tests/post-multiclient-3.yaml | 45 + .../test-set-2/tests/post-multiclient-4.yaml | 45 + aerospike-tls/main.go | 793 + aerospike-tls/stunnel/stunnel.conf | 9 + .../vendor-aerospike-client-go/.build.yml | 15 + .../.github/workflows/build.yml | 56 + .../vendor-aerospike-client-go/.gitignore | 30 + .../.testcoverage.yml | 69 + .../vendor-aerospike-client-go/.travis.yml | 75 + .../.travis/aerospike.conf | 60 + .../.travis/proxy_check.sh | 15 + .../.travis/wait_for_node.sh | 38 + .../vendor-aerospike-client-go/CHANGELOG.md | 2331 ++ .../vendor-aerospike-client-go/LICENSE | 202 + .../vendor-aerospike-client-go/README.md | 189 + .../admin_command.go | 742 + .../admin_policy.go | 48 + .../vendor-aerospike-client-go/aerospike.go | 3 + .../aerospike_bench_reflect_test.go | 75 + .../aerospike_bench_test.go | 116 + .../aerospike_suite_test.go | 525 + .../anonymous_fields_test.go | 129 + .../vendor-aerospike-client-go/auth_mode.go | 34 + .../vendor-aerospike-client-go/batch_attr.go | 293 + .../batch_command.go | 128 + .../batch_command_delete.go | 213 + .../batch_command_exists.go | 152 + .../batch_command_get.go | 269 + .../batch_command_get_reflect.go | 90 + .../batch_command_operate.go | 303 + .../batch_command_reflect.go | 91 + .../batch_command_udf.go | 223 + .../batch_delete.go | 97 + .../batch_delete_policy.go | 75 + .../batch_executer.go | 44 + .../batch_index_command_get.go | 109 + .../vendor-aerospike-client-go/batch_node.go | 41 + .../batch_node_list.go | 318 + .../batch_policy.go | 122 + .../vendor-aerospike-client-go/batch_read.go | 159 + .../batch_read_policy.go | 70 + .../batch_record.go | 172 + .../vendor-aerospike-client-go/batch_test.go | 941 + .../vendor-aerospike-client-go/batch_udf.go | 127 + .../batch_udf_policy.go | 72 + .../vendor-aerospike-client-go/batch_write.go | 113 + .../batch_write_policy.go | 103 + .../bench_batchget_test.go | 172 + .../bench_cdt_list_test.go | 108 + .../bench_get_test.go | 169 + .../bench_interface_allocs_test.go | 106 + .../bench_key_test.go | 73 + .../bench_packing_test.go | 244 + .../bench_rand_gen_test.go | 64 + .../bench_read_command_test.go | 161 + .../bench_recordset_test.go | 83 + .../bench_values_test.go | 118 + .../bench_write_command_test.go | 161 + .../vendor-aerospike-client-go/bin.go | 41 + .../bit_overflow_action.go | 31 + .../vendor-aerospike-client-go/bit_policy.go | 30 + .../bit_resize_flags.go | 32 + .../bit_write_flags.go | 39 + .../buffered_connection.go | 148 + .../bytes_buffer.go | 148 + .../vendor-aerospike-client-go/cdt.go | 135 + .../vendor-aerospike-client-go/cdt_bitwise.go | 516 + .../cdt_bitwise_test.go | 966 + .../vendor-aerospike-client-go/cdt_context.go | 203 + .../cdt_context_test.go | 42 + .../vendor-aerospike-client-go/cdt_list.go | 882 + .../cdt_list_test.go | 816 + .../vendor-aerospike-client-go/cdt_map.go | 753 + .../cdt_map_test.go | 953 + .../vendor-aerospike-client-go/client.go | 1925 + .../client_appengine_exclusions.go | 154 + .../client_builder.go | 26 + .../client_builder_native.go | 36 + .../client_builder_proxy.go | 39 + .../vendor-aerospike-client-go/client_ifc.go | 138 + .../client_ifc_app_engine.go | 141 + .../client_ifc_app_engine_perf.go | 139 + .../client_ifc_as_performance.go | 141 + .../client_object_test.go | 1436 + .../client_policy.go | 216 + .../client_reflect.go | 277 + .../client_reflect_test.go | 280 + .../vendor-aerospike-client-go/client_test.go | 1768 + .../vendor-aerospike-client-go/cluster.go | 1010 + .../vendor-aerospike-client-go/command.go | 2907 ++ .../commit_policy.go | 29 + .../complex_index_test.go | 103 + .../complex_query_test.go | 238 + .../vendor-aerospike-client-go/connection.go | 596 + .../connection_heap.go | 280 + .../connection_heap_test.go | 89 + .../delete_command.go | 115 + .../vendor-aerospike-client-go/docs/README.md | 34 + .../docs/aerospike.md | 103 + .../vendor-aerospike-client-go/docs/client.md | 745 + .../docs/datamodel.md | 237 + .../vendor-aerospike-client-go/docs/log.md | 24 + .../docs/performance.md | 41 + .../docs/policies.md | 254 + .../vendor-aerospike-client-go/error.go | 528 + .../vendor-aerospike-client-go/error_test.go | 145 + .../example_client_test.go | 98 + .../example_listiter_int_test.go | 75 + .../example_listiter_string_test.go | 74 + .../example_listiter_time_test.go | 78 + .../example_mapiter_test.go | 82 + .../example_pagination_cursor_test.go | 88 + .../examples/add/add.go | 86 + .../examples/append/append.go | 67 + .../examples/batch/batch.go | 163 + .../examples/blob/blob.go | 76 + .../count_set_objects_using_request_info.go | 104 + .../custom_list_iter/custom_list_iter.go | 135 + .../examples/expire/expire.go | 140 + .../examples/expressions/expressions.go | 85 + .../examples/generation/generation.go | 123 + .../examples/geojson_query/geojson_query.go | 92 + .../examples/get/.gitignore | 1 + .../examples/get/get.go | 92 + .../examples/info/info.go | 55 + .../examples/list_map/list_map.go | 282 + .../examples/operate/operate.go | 61 + .../examples/prepend/prepend.go | 69 + .../examples/put/.gitignore | 1 + .../examples/put/put.go | 108 + .../examples/putget/putget.go | 100 + .../query-aggregate/average/average.go | 72 + .../single_bin_sum/single_bin_sum.go | 68 + .../examples/query-aggregate/udf/average.lua | 18 + .../query-aggregate/udf/sum_single_bin.lua | 11 + .../examples/replace/replace.go | 98 + .../examples/scan_paginate/scan_paginate.go | 66 + .../examples/scan_parallel/scan_parallel.go | 64 + .../examples/scan_serial/scan_serial.go | 94 + .../examples/shared/shared.go | 132 + .../examples/simple/simple.go | 98 + .../tls_secure_connection.go | 140 + .../examples/touch/touch.go | 81 + .../examples/udf/udf.go | 281 + .../execute_command.go | 81 + .../execute_task.go | 148 + .../execute_task_native.go | 22 + .../exists_command.go | 109 + .../vendor-aerospike-client-go/exp_bit.go | 424 + .../exp_bit_test.go | 455 + .../vendor-aerospike-client-go/exp_hll.go | 213 + .../exp_hll_test.go | 200 + .../vendor-aerospike-client-go/exp_list.go | 675 + .../exp_list_test.go | 569 + .../vendor-aerospike-client-go/exp_map.go | 926 + .../exp_map_test.go | 674 + .../exp_operation.go | 116 + .../exp_ops_test.go | 389 + .../vendor-aerospike-client-go/expression.go | 1430 + .../expression_ops_test.go | 347 + .../expression_test.go | 1058 + .../vendor-aerospike-client-go/field_type.go | 53 + .../vendor-aerospike-client-go/filter.go | 228 + .../generation_policy.go | 30 + .../vendor-aerospike-client-go/generics.go | 3643 ++ .../vendor-aerospike-client-go/geo_test.go | 203 + .../vendor-aerospike-client-go/go.mod | 35 + .../vendor-aerospike-client-go/go.sum | 82 + .../vendor-aerospike-client-go/helper_test.go | 52 + .../hll_operation.go | 303 + .../hll_operation_test.go | 901 + .../vendor-aerospike-client-go/hll_policy.go | 30 + .../hll_write_flags.go | 40 + .../vendor-aerospike-client-go/host.go | 71 + .../vendor-aerospike-client-go/host_test.go | 43 + .../index_collection_type.go | 73 + .../vendor-aerospike-client-go/index_test.go | 113 + .../vendor-aerospike-client-go/index_type.go | 32 + .../vendor-aerospike-client-go/info.go | 105 + .../vendor-aerospike-client-go/info_policy.go | 51 + .../internal/atomic/array.go | 72 + .../internal/atomic/atomic_test.go | 27 + .../internal/atomic/bool.go | 83 + .../internal/atomic/bool_test.go | 77 + .../internal/atomic/guard.go | 82 + .../internal/atomic/guard_test.go | 118 + .../internal/atomic/int.go | 157 + .../internal/atomic/int_test.go | 52 + .../internal/atomic/map/map.go | 118 + .../internal/atomic/queue.go | 81 + .../internal/atomic/queue_test.go | 72 + .../internal/atomic/sync_val.go | 61 + .../internal/atomic/typed_val.go | 23 + .../internal/atomic/typed_val_test.go | 126 + .../internal/lua/instance.go | 70 + .../internal/lua/lua.go | 158 + .../internal/lua/lua_aerospike.go | 64 + .../internal/lua/lua_aerospike_test.go | 56 + .../internal/lua/lua_list.go | 404 + .../internal/lua/lua_list_test.go | 124 + .../internal/lua/lua_map.go | 393 + .../internal/lua/lua_map_test.go | 77 + .../internal/lua/lua_stream.go | 132 + .../internal/lua/lua_suite_test.go | 30 + .../internal/lua/resources/aerospike.go | 205 + .../internal/lua/resources/stream_ops.go | 362 + .../internal/seq/seq.go | 82 + .../vendor-aerospike-client-go/key.go | 166 + .../key_bench_test.go | 167 + .../vendor-aerospike-client-go/key_helper.go | 155 + .../key_reflect_test.go | 41 + .../vendor-aerospike-client-go/key_test.go | 141 + .../vendor-aerospike-client-go/language.go | 24 + .../vendor-aerospike-client-go/load_test.go | 91 + .../logger/logger.go | 131 + .../login_command.go | 207 + .../vendor-aerospike-client-go/marshal.go | 362 + .../metrics_policy.go | 61 + .../multi_command.go | 430 + .../multi_policy.go | 88 + .../vendor-aerospike-client-go/node.go | 963 + .../vendor-aerospike-client-go/node_stats.go | 400 + .../vendor-aerospike-client-go/node_test.go | 364 + .../node_validator.go | 316 + .../operate_args.go | 100 + .../operate_command.go | 71 + .../vendor-aerospike-client-go/operation.go | 137 + .../vendor-aerospike-client-go/packer.go | 681 + .../packer_reflect.go | 77 + .../packing_test.go | 408 + .../vendor-aerospike-client-go/partition.go | 329 + .../partition_filter.go | 107 + .../partition_parser.go | 279 + .../partition_status.go | 49 + .../partition_tracker.go | 498 + .../vendor-aerospike-client-go/partitions.go | 188 + .../vendor-aerospike-client-go/peers.go | 98 + .../peers_parser.go | 322 + .../pkg/bcrypt/.gitignore | 5 + .../pkg/bcrypt/LICENSE | 29 + .../pkg/bcrypt/README | 46 + .../pkg/bcrypt/bcrypt.go | 190 + .../pkg/bcrypt/cipher.go | 415 + .../pkg/ripemd160/ripemd160.go | 121 + .../pkg/ripemd160/ripemd160_test.go | 64 + .../pkg/ripemd160/ripemd160block.go | 161 + .../vendor-aerospike-client-go/policy.go | 241 + .../vendor-aerospike-client-go/privilege.go | 146 + .../proto/auth/aerospike_proxy_auth.pb.go | 230 + .../proto/auth/aerospike_proxy_auth.proto | 21 + .../auth/aerospike_proxy_auth_grpc.pb.go | 109 + .../proto/kvs/aerospike_proxy_kv.pb.go | 3616 ++ .../proto/kvs/aerospike_proxy_kv.proto | 831 + .../proto/kvs/aerospike_proxy_kv_grpc.pb.go | 1926 + .../proxy_auth_interceptor.go | 218 + .../proxy_client.go | 1531 + .../proxy_client_app_engine_exclusions.go | 28 + .../proxy_client_reflect.go | 231 + .../proxy_client_test.go | 42 + .../proxy_commands.go | 517 + .../vendor-aerospike-client-go/proxy_conv.go | 479 + .../proxy_execute_task.go | 89 + .../proxy_query_partition_command.go | 162 + .../proxy_scan_command.go | 165 + .../query_aggregate_command.go | 155 + .../query_aggregate_test.go | 147 + .../query_command.go | 62 + .../query_context_test.go | 92 + .../query_duration.go | 48 + .../query_executor.go | 74 + .../query_objects_executor.go | 98 + .../query_partition_command.go | 68 + .../query_partitiopn_objects_command.go | 67 + .../query_policy.go | 56 + .../vendor-aerospike-client-go/query_test.go | 557 + .../random_operation_test.go | 137 + .../read_command.go | 271 + .../read_command_reflect.go | 473 + .../read_command_reflect_test.go | 96 + .../read_header_command.go | 106 + .../read_mode_ap.go | 32 + .../read_mode_sc.go | 40 + .../vendor-aerospike-client-go/record.go | 73 + .../record_exists_action.go | 45 + .../vendor-aerospike-client-go/recordset.go | 209 + .../recordset_test.go | 46 + .../replica_policy.go | 48 + .../vendor-aerospike-client-go/role.go | 67 + .../scan_executor.go | 73 + .../scan_objects_executor.go | 96 + .../scan_partition_command.go | 79 + .../scan_partition_objects_command.go | 83 + .../vendor-aerospike-client-go/scan_policy.go | 42 + .../vendor-aerospike-client-go/scan_test.go | 411 + .../security_test.go | 289 + .../server_command.go | 96 + .../single_command.go | 63 + .../vendor-aerospike-client-go/statement.go | 115 + .../vendor-aerospike-client-go/task.go | 82 + .../task_drop_index.go | 62 + .../vendor-aerospike-client-go/task_index.go | 82 + .../task_register.go | 65 + .../vendor-aerospike-client-go/task_remove.go | 65 + .../test/resources/average.lua | 18 + .../test/resources/sum_single_bin.lua | 11 + .../test_utils_test.go | 138 + .../touch_command.go | 143 + .../truncate_test.go | 121 + .../vendor-aerospike-client-go/types/epoc.go | 30 + .../types/histogram/bench_histogram_test.go | 83 + .../types/histogram/histogram.go | 218 + .../types/histogram/histogram_test.go | 167 + .../types/histogram/log2hist.go | 141 + .../types/histogram/sync_histogram.go | 236 + .../types/message.go | 107 + .../types/particle_type/particle_type.go | 33 + .../vendor-aerospike-client-go/types/pool.go | 72 + .../types/pool/buffer_pool_test.go | 70 + .../types/pool/tiered_buffer.go | 147 + .../types/rand/xor_shift128.go | 56 + .../types/result_code.go | 793 + .../vendor-aerospike-client-go/types/types.go | 15 + .../types/types_test.go | 27 + .../vendor-aerospike-client-go/udf.go | 11 + .../vendor-aerospike-client-go/udf_test.go | 441 + .../vendor-aerospike-client-go/unpacker.go | 420 + .../vendor-aerospike-client-go/user_roles.go | 50 + .../utils/buffer/buffer.go | 142 + .../vendor-aerospike-client-go/value.go | 1318 + .../value_helpers.go | 61 + .../value_reflect.go | 57 + .../vendor-aerospike-client-go/value_test.go | 216 + .../vendor-aerospike-client-go/werrgroup.go | 73 + .../write_command.go | 116 + .../write_policy.go | 95 + 366 files changed, 126731 insertions(+) create mode 100644 aerospike-tls/.gitignore create mode 100644 aerospike-tls/Dockerfile create mode 100644 aerospike-tls/MOCKS_FLOW.md create mode 100644 aerospike-tls/README.md create mode 100644 aerospike-tls/aerospike-conf/aerospike.conf create mode 100644 aerospike-tls/docker-compose.yml create mode 100755 aerospike-tls/gen-certs.sh create mode 100644 aerospike-tls/go.mod create mode 100644 aerospike-tls/go.sum create mode 100755 aerospike-tls/keploy.yml create mode 100644 aerospike-tls/keploy/.gitignore create mode 100644 aerospike-tls/keploy/test-set-0/mocks.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/delete-key-alice-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/get-batch-get-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml create mode 100644 aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml create mode 100644 aerospike-tls/keploy/test-set-1/mocks.yaml create mode 100644 aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml create mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml create mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml create mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml create mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml create mode 100644 aerospike-tls/keploy/test-set-2/mocks.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml create mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml create mode 100644 aerospike-tls/main.go create mode 100644 aerospike-tls/stunnel/stunnel.conf create mode 100644 aerospike-tls/vendor-aerospike-client-go/.build.yml create mode 100644 aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml create mode 100644 aerospike-tls/vendor-aerospike-client-go/.gitignore create mode 100644 aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml create mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis.yml create mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf create mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh create mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh create mode 100644 aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/LICENSE create mode 100644 aerospike-tls/vendor-aerospike-client-go/README.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/admin_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/admin_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/auth_mode.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_attr.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_get.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_delete.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_executer.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_node.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_node_list.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_read.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_record.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_udf.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_write.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_get_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_key_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_values_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bin.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/buffered_connection.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_context.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_list.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_map.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder_native.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_object_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/client_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/cluster.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/commit_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/complex_index_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/complex_query_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/connection.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/connection_heap.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/delete_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/README.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/client.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/log.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/performance.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/policies.md create mode 100644 aerospike-tls/vendor-aerospike-client-go/error.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/error_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_client_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/add/add.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/append/append.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/get/get.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/info/info.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/put/put.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_task.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_task_native.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exists_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_bit.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_hll.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_list.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_list_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_map.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_map_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_operation.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/expression.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/expression_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/field_type.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/filter.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/generation_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/generics.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/geo_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/go.mod create mode 100644 aerospike-tls/vendor-aerospike-client-go/go.sum create mode 100644 aerospike-tls/vendor-aerospike-client-go/helper_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_operation.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/host.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/host_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/index_collection_type.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/index_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/index_type.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/info.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/info_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/key.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/key_bench_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/key_helper.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/key_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/language.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/load_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/logger/logger.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/login_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/marshal.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/metrics_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/multi_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/multi_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/node.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/node_stats.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/node_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/node_validator.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/operate_args.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/operate_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/operation.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/packer.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/packer_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/packing_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partition.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_filter.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_parser.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_status.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_tracker.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/partitions.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/peers.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/peers_parser.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/privilege.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto create mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_commands.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_conv.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_context_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_duration.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_executor.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_partition_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/query_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/random_operation_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_header_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/record.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/record_exists_action.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/recordset.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/recordset_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/replica_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/role.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_executor.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_policy.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/security_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/server_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/single_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/statement.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/task.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/task_drop_index.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/task_index.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/task_register.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/task_remove.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua create mode 100644 aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua create mode 100644 aerospike-tls/vendor-aerospike-client-go/test_utils_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/touch_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/truncate_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/epoc.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/message.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool/tiered_buffer.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/result_code.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/types.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/types/types_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/udf.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/udf_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/unpacker.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/user_roles.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/value.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/value_helpers.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/value_reflect.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/value_test.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/werrgroup.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/write_command.go create mode 100644 aerospike-tls/vendor-aerospike-client-go/write_policy.go diff --git a/aerospike-tls/.gitignore b/aerospike-tls/.gitignore new file mode 100644 index 00000000..df912870 --- /dev/null +++ b/aerospike-tls/.gitignore @@ -0,0 +1 @@ +certs/ diff --git a/aerospike-tls/Dockerfile b/aerospike-tls/Dockerfile new file mode 100644 index 00000000..78f4ab82 --- /dev/null +++ b/aerospike-tls/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.26 AS build +WORKDIR /src +COPY go.mod go.sum ./ +RUN go mod download +COPY main.go ./ +RUN CGO_ENABLED=0 go build -o /out/aerospike-tls-sample . + +FROM gcr.io/distroless/static-debian12 +COPY --from=build /out/aerospike-tls-sample /aerospike-tls-sample +EXPOSE 8080 +ENTRYPOINT ["/aerospike-tls-sample"] diff --git a/aerospike-tls/MOCKS_FLOW.md b/aerospike-tls/MOCKS_FLOW.md new file mode 100644 index 00000000..d3c2afec --- /dev/null +++ b/aerospike-tls/MOCKS_FLOW.md @@ -0,0 +1,240 @@ +# Keploy Mocks — End-to-End Flow + +This document walks through every Keploy mock captured for the +`e2e-tls-run` sample app, in the exact order Keploy recorded them, and +maps them onto the HTTP tests in `keploy/test-set-0/tests/`. The +sample app is an Aerospike-Go client talking to Aerospike over TLS +(port 3001) via Keploy's TLS-terminating proxy, so every entry in +`mocks.yaml` is an Aerospike wire-protocol exchange that the proxy +intercepted in front of the parser. + +* Source recording: `keploy/test-set-0/mocks.yaml` (4104 lines, 114 + mocks numbered `mock-0` … `mock-113`). +* Source tests: `keploy/test-set-0/tests/*.yaml` (7 HTTP tests). + +--- + +## 1. Mock anatomy + +Every mock is one Aerospike request/response pair with the same +top-level shape: + +```yaml +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-N +spec: + metadata: + protocol: aerospike + reqType: Info | Message + respType: Info | Message + type: config | mocks + requests: [ { header, meta, message } ] + responses: [ { header, meta, message } ] + ReqTimestampMock: + ResTimestampMock: +``` + +Two `metadata.type` buckets cover the whole file: + +| `metadata.type` | Wire | `packet_type` | Protocol byte (header.type) | What it carries | +|-----------------|------|---------------|-----------------------------|------------------------------------------------| +| `config` | Info | `Info` | `1` | ASCII info commands: `build`, `node`, `peers-clear-std`, `partition-generation`, … | +| `mocks` | Data | `Message` | `3` | Binary Aerospike Message protocol: PUT, GET, BATCH, TOUCH, DELETE, … | + +The `meta` block is parser-decoded sugar (the human-readable view of +`raw_body`, base64 of the original bytes). `message: null` means the +parser did not need a structured `message` field — the `meta` + raw +bytes are authoritative. + +--- + +## 2. The two big phases + +The recording splits cleanly into two phases: + +1. **Bootstrap + tend chatter (`type: config`, packet `Info`).** + The Aerospike Go client uses ASCII info commands to learn cluster + topology at startup and to keep its view fresh via a ~250 ms tend + loop. Most of `mocks.yaml` is this background traffic. + +2. **Actual application traffic (`type: mocks`, packet `Message`).** + Each HTTP test in `tests/` is backed by one or more binary + Aerospike Message requests. There are only a handful of these + compared to the tend chatter. + +Counts in this run: + +* `type: config` mocks: ~107 +* `type: mocks` mocks: 7 — one per data operation the app issued + +--- + +## 3. Bootstrap (mocks 0–4) — initial cluster discovery + +These fire once, before any HTTP test runs, while +`as.NewClientWithPolicyAndHost` is establishing the cluster view. + +| Mock | `info_command` (request) | Response highlights | Purpose | +|-----------|--------------------------|----------------------------------------------|----------------------------------------| +| `mock-0` | `build` | `build\t7.2.0.1` | Server version probe | +| `mock-1` | `node\npartition-generation\nfeatures` | `node\tBB9D8CBBBBACB36` + `partition-generation\t0` + long `features\t…` list (`batch-any;batch-index;cdt-list;cdt-map;udf;…`) | Identify node + read its capabilities | +| `mock-2` | `node\npeers-generation\npartition-generation` | same node id + generations `0` / `0` | First combined tend probe | +| `mock-3` | `peers-clear-std` | `peers-clear-std\t0,3000,[]` (no peers, port 3000) | Peer list (empty — single-node) | +| `mock-4` | `partition-generation` | `partition-generation\t0` | Partition-map version (still 0) | + +The empty `peers-clear-std` response is why `main.go` sets +`policy.SeedOnlyCluster = true` — Aerospike CE only advertises the +clear-text peer endpoint, which is unreachable behind the TLS +terminator, so the client must stay pinned to the seed. + +--- + +## 4. Tend loop pattern (mocks 5–26, and sprinkled throughout) + +After bootstrap, the Aerospike Go client's tend goroutine repeats a +two-mock pair roughly every 250–500 ms while the app is idle: + +* **`node` + `peers-generation` + `partition-generation`** — node id + + whether peers or partitions have changed. Always responds with the + same id and generations `0` (no topology drift in this single-node + recording). +* **`peers-clear-std`** — full peer list. Always empty. + +These pairs (mocks 5/6, 7/8, 9/10, …) make up the bulk of +`mocks.yaml`. They are **only there to satisfy the client's +periodic refresh**; they do not correspond to any HTTP test. Replays +serve them on demand so the client stays "connected" between data +ops. + +You will see exactly this `node` / `peers-clear-std` pair re-appear +between every pair of HTTP tests below. + +--- + +## 5. The seven application operations (Message mocks) + +The seven binary-protocol mocks line up one-to-one with the seven HTTP +tests, in capture order: + +| Mock | Test file | App endpoint | Aerospike op (decoded) | Notes | +|------------|---------------------------------|-------------------------|------------------------------------|------------------------------------------------------| +| `mock-27` | `post-put-1.yaml` | `POST /put` | PUT `test/demo/alice` | Bins `{name:"Alice", age:30}`. Request 101 B → 22 B ack. | +| `mock-30` | `get-get-alice-1.yaml` | `GET /get/alice` | GET `test/demo/alice` | Request 65 B → 22 B + bin payload. | +| `mock-33` | `post-batch-put-1.yaml` (1/2) | `POST /batch/put` | PUT `test/demo/a` `{n:1}` | Implemented as a sequential PUT loop in `main.go`. | +| `mock-34` | `post-batch-put-1.yaml` (2/2) | `POST /batch/put` | PUT `test/demo/b` `{n:2}` | Second PUT in the same handler. | +| `mock-37` | `get-batch-get-1.yaml` | `GET /batch/get?k=a&k=b`| BATCH_READ digests for `a`, `b` | Request 105 B → 78 B with two records. | +| `mock-42` | `get-batch-get-1.yaml` (retry) | (same) | Large BATCH_READ retry | 8259 B request, fires after the test handler already returned `500 TIMEOUT` — see §6. | +| `mock-55` | `post-touch-alice-1.yaml` | `POST /touch/alice` | TOUCH `test/demo/alice` | `Operate(... 0x0B)` — touch generation/TTL. | +| `mock-58` | `delete-key-alice-1.yaml` | `DELETE /key/alice` | DELETE `test/demo/alice` | Final cleanup. info3 flag `0x04` = delete. | + +Every Message mock carries `namespace: test`, `set: demo`, matching +the keys `main.go` constructs with `as.NewKey("test","demo",…)`. + +### How to spot which is which + +* Look at `requests[0].header.header.length` and the leading byte of + the decoded `raw_body`: + * info1/info2/info3 byte 1 of the body tells you the opcode flags + (READ / WRITE / DELETE / TOUCH / BATCH). +* `meta.namespace` and `meta.set` confirm the target. +* Pair it with the nearest test by timestamp (`ReqTimestampMock` vs. + the test's `req.timestamp`). + +--- + +## 6. Special case — the BatchGet timeout (mocks 37 → 42) + +`get-batch-get-1.yaml` is the only test that did **not** return 200. +Its recorded response is: + +``` +status_code: 500 +body: | + ResultCode: TIMEOUT, Iteration: 1, InDoubt: false, … + read tcp 127.0.0.1:50236->127.0.0.1:3001: i/o timeout +``` + +That timeout is exactly what produces the unusual pair: + +1. `mock-37` (`14:06:28.494`) — the first BATCH_READ attempt for + `{a, b}`. Server returns successfully (78 B), but the client + considers the call timed out. +2. The HTTP handler returns 500 to the curl at `14:06:29.490`. +3. `mock-42` (`14:06:30.501`) — the Aerospike client's retry path + fires a much larger BATCH_READ (8259 B) on its own goroutine, + well after the HTTP response was already sent. The response is + 164 B containing the two records' digests. + +The same shape repeats much later in the recording as `mock-101` +(`14:07:00.622`, 8300 B), an even later orphaned retry — both are +artifacts of the timeout path, not new application traffic. + +--- + +## 7. End-to-end flow diagram + +``` +T=0 App starts → Aerospike client constructor + ├─ mock-0 .. mock-4 : bootstrap (build, node+features, peers, partition-gen) + └─ (tend goroutine begins; mock-5..mock-26 fire every ~250 ms) + +T+12s curl GET /health + └─ no Aerospike traffic (handler only calls client.GetNodes() in-process) + + curl POST /put alice ───────────────────► mock-27 (PUT alice, ack) + + [tend pair: mock-28 / mock-29] + + curl GET /get/alice ───────────────────► mock-30 (GET alice) + + [tend pair: mock-31 / mock-32] + + curl POST /batch/put ───────────────────► mock-33 (PUT a {n:1}) + ─────────────────────► mock-34 (PUT b {n:2}) + + [tend pairs: mock-35 / mock-36] + + curl GET /batch/get?k=a&k=b ──────────────► mock-37 (BATCH_READ {a,b}) + ↓ client-side timeout + HTTP 500 TIMEOUT to curl + [tend pairs: mock-38 .. mock-41] + mock-42 (retry, 8259 B request) + + [long tend stretch: mock-43 .. mock-54] + + curl POST /touch/alice ──────────────────► mock-55 (TOUCH alice) + + [tend pair: mock-56 / mock-57] + + curl DELETE /key/alice ──────────────────► mock-58 (DELETE alice) + + [tail tend stretch: mock-59 .. mock-100] + mock-101 (late BATCH_READ retry) + [tail tend stretch: mock-102 .. mock-113] +``` + +The numbered mocks not explicitly called out are all tend-loop +`node` / `peers-clear-std` pairs — the same two requests, with the +same two responses, replayed by Keploy to keep the Aerospike Go +client happy while it waits for the next HTTP test. + +--- + +## 8. What the parser sees vs. what the proxy sees + +Because the proxy terminates TLS upstream of the Aerospike parser, +every byte you see in `mocks.yaml` is **plain Aerospike wire +protocol** — there is no TLS framing in `raw_body`, even though the +app dials port 3001 with a real TLS ClientHello. That is the second +claim called out in `main.go`'s header comment: + +> Proxy TLS detection is byte-pattern driven, not port driven. +> This client sends a real TLS ClientHello on a non-3306, non-443 +> port; the proxy still recognises it via `Peek(5) → IsTLSHandshake` +> and MITMs the connection. + +If you want to verify, base64-decode any `raw_body` and confirm the +leading byte is the Aerospike message header (`0x16` for Message +ops, ASCII text for Info ops) — never a TLS record (`0x16 0x03 …` +ClientHello). diff --git a/aerospike-tls/README.md b/aerospike-tls/README.md new file mode 100644 index 00000000..91341157 --- /dev/null +++ b/aerospike-tls/README.md @@ -0,0 +1,157 @@ +# aerospike-tls — Aerospike-Go sample with Keploy record/replay over TLS + +A small Go HTTP service that talks to **Aerospike on a TLS-only +port (3001)** via the official `aerospike-client-go/v7` driver. It is +recorded and replayed end-to-end through Keploy, which transparently +MITMs the TLS connection and serves binary Aerospike traffic from +captured mocks at replay time. + +The point of the sample is to demonstrate three things: + +* **Keploy records Aerospike traffic over TLS** the same way it does + over clear text — the proxy detects the TLS handshake by byte + pattern (not by port) and terminates it upstream of the parser. + What lands in `keploy/*/mocks.yaml` is plaintext Aerospike wire + protocol, not ciphertext. +* **The recordings replay deterministically** at any concurrency the + app exposes — single-client parallel ops, multiple-client + round-robin, and per-request fresh-client construction all pass + 3× in a row. +* **Realistic Aerospike usage shapes** — connection pool sizing, + retry policy, and warmup that survive the burst-load characteristics + of mocked replay (which is much faster than real Aerospike and + exposes pool-acquire races a regular load test would never hit). + +## Layout + +``` +aerospike-tls/ +├── main.go # the HTTP service +├── go.mod / go.sum +├── gen-certs.sh # self-signed CA + server + (optional) client certs +├── aerospike-conf/ +│ └── aerospike.conf # CE config: TLS-only service on 3001 +├── docker-compose.yml # Aerospike CE + stunnel TLS terminator +├── Dockerfile # builds the sample binary +├── keploy.yml # Keploy CLI config (command, ports) +├── keploy/ # captured test-sets + mocks +│ ├── test-set-0/ # single-endpoint CRUD: put/get/batch/touch/delete +│ ├── test-set-1/ # /parallel: shared client, n = 4..24 +│ └── test-set-2/ # /multiclient + /freshclient +├── MOCKS_FLOW.md # annotated walk-through of test-set-0's mocks.yaml +├── stunnel/ # (referenced by docker-compose for TLS termination) +└── vendor-aerospike-client-go/ # local patch — see "Why the vendor dir" +``` + +## Endpoints + +| Method | Path | What it does | +| ------ | -------------------------- | ---------------------------------------------------------------------------- | +| GET | `/health` | `info "build" + "namespaces"` | +| POST | `/put` | single-record PUT | +| GET | `/get/{key}` | single-record GET | +| POST | `/batch/put` | sequential write loop | +| GET | `/batch/get?k=a&k=b` | BATCH_READ | +| POST | `/scan` | full namespace scan | +| POST | `/query` | secondary-index range query | +| POST | `/udf` | UDF_EXECUTE | +| POST | `/cdt/list/append` | CDT list append | +| POST | `/cdt/map/put` | CDT map put | +| POST | `/touch/{key}` | TOUCH | +| DELETE | `/key/{key}` | DELETE | +| POST | `/parallel?n=N&prefix=P` | fans out N goroutines, each PUT+GET a unique key — **one shared client** | +| POST | `/multiclient?n=N&prefix=P`| same, but round-robins across **4 pre-built `*as.Client` instances** | +| POST | `/freshclient?n=N&prefix=P`| **each goroutine builds its own `*as.Client`** inside the request | + +## Run it + +```bash +cd aerospike-tls + +# 1) Self-signed PKI under ./certs (CN = aerospike.local). +./gen-certs.sh + +# 2) Start the TLS-only Aerospike + stunnel. +docker compose up -d aerospike stunnel + +# 3) Build + run the app. +go build -o aerospike-tls . +./aerospike-tls --aerospike-port=3001 --tls-name=aerospike.local --tls-ca=./certs/ca.pem --tls-insecure=true + +# 4) Hit it. +curl -s localhost:8080/health +curl -s -XPOST localhost:8080/put -d '{"key":"alice","bins":{"age":30}}' +curl -s localhost:8080/get/alice +curl -s -XPOST 'localhost:8080/parallel?n=24&prefix=run4' +curl -s -XPOST 'localhost:8080/multiclient?n=24&prefix=mc4' +curl -s -XPOST 'localhost:8080/freshclient?n=8&prefix=fc' +``` + +## Record / replay with Keploy + +`keploy.yml` is already wired with the command line above. To record: + +```bash +sudo keploy record +# in another shell — fire the curls from "Run it" +# then Ctrl+C the recorder +``` + +To replay only one test-set: + +```bash +sudo keploy test --test-sets test-set-2 +``` + +The bundled `keploy/test-set-{0,1,2}/` directories were recorded with +the dev Aerospike parser; the replay path serves binary Aerospike +ops from `mocks.yaml` so the app never touches the real cluster. + +## Concurrency notes — what makes replay deterministic + +Mocked replay through Keploy is roughly 20× faster than real +Aerospike for the same op. A burst of N concurrent goroutines on +a cold client pool then races to open N fresh TLS-MITM'd sockets, +and the goroutine that loses the race surfaces as +`MAX_RETRIES_EXCEEDED` at the application — even though every peer +in the same burst succeeds. + +`main.go` paints over this with four layered changes; together they +make N up to 24 (the largest burst in `test-set-1`) replay 5/5 on +every run: + +1. **Sized pool** — `ClientPolicy.ConnectionQueueSize = 256`, + `OpeningConnectionThreshold = 16`. The threshold is kept low so + stunnel's `fork()` model on the upstream doesn't get hammered. +2. **Tolerant per-op policy** — `parallelWritePolicy` and + `parallelReadPolicy` set `SocketTimeout 10s`, `TotalTimeout 30s`, + `MaxRetries 10`, `SleepBetweenRetries 5ms`. +3. **Two-phase warmup** on the main client at startup: an 8-op + sequential prelude (walks the proxy past cold-start TLS) followed + by a 32-op parallel fill (puts 32 idle connections in the pool). +4. **App-level retry wrapper** (`parallelDo`) around each PUT and + GET in `/parallel`, `/multiclient`, and `/freshclient`. Cooperative + goroutines in the same burst return their connections during the + 10 ms backoff, so the retry hits a warm pool. + +`/multiclient`'s extra clients are deliberately NOT warmed at +startup — five clients warming in parallel produces hundreds of +concurrent TLS dials and starves stunnel's fork rate. The retry +wrapper covers their first burst instead. + +## Why the vendor dir + +`vendor-aerospike-client-go/` is a local copy of the upstream +`aerospike-client-go/v7` with one behavior changed: it stops +trying to discover `peers-tls-std` / `service-tls-std`, which +Aerospike CE doesn't answer. Without the patch, the client floods +the cluster discovery loop with unanswered info commands during +TLS-only bring-up. `go.mod` pins to the vendored copy via a local +`replace` directive. + +## What `MOCKS_FLOW.md` is for + +It walks through `test-set-0/mocks.yaml` mock-by-mock and shows +how each HTTP test maps onto the binary Aerospike traffic the +proxy captured. It is intentionally `test-set-0`-specific — +test-set-1 and test-set-2 follow the same shape. diff --git a/aerospike-tls/aerospike-conf/aerospike.conf b/aerospike-tls/aerospike-conf/aerospike.conf new file mode 100644 index 00000000..3fee77bf --- /dev/null +++ b/aerospike-tls/aerospike-conf/aerospike.conf @@ -0,0 +1,47 @@ +# Aerospike CE config — clear-text only on port 3000 inside the docker +# network. TLS is terminated by stunnel sitting in front of this service +# (see docker-compose.yml + stunnel/stunnel.conf). From the app and the +# Keploy proxy's perspective the wire is TLS on 3001 either way. + +service { + proto-fd-max 15000 + cluster-name aerospike-tls-sample +} + +logging { + console { + context any info + } +} + +network { + service { + address any + port 3000 + } + + heartbeat { + mode mesh + address local + port 3002 + interval 150 + timeout 10 + } + + fabric { + address local + port 3001 + } + + info { + port 3003 + } +} + +namespace test { + replication-factor 1 + default-ttl 0 + storage-engine memory { + data-size 1G + } +} diff --git a/aerospike-tls/docker-compose.yml b/aerospike-tls/docker-compose.yml new file mode 100644 index 00000000..39c86d99 --- /dev/null +++ b/aerospike-tls/docker-compose.yml @@ -0,0 +1,66 @@ +# Aerospike CE on plain 3000 (inside docker network), stunnel in front +# terminating TLS on 3001 (exposed to host). Run ./gen-certs.sh first. +services: + aerospike: + image: aerospike/aerospike-server:7.2.0.1 + container_name: aerospike-tls + networks: + - aerospike-net + volumes: + - ./aerospike-conf/aerospike.conf:/etc/aerospike/aerospike.conf:ro + entrypoint: ["/usr/bin/asd", "--foreground", "--config-file", "/etc/aerospike/aerospike.conf"] + command: [] + ulimits: + nofile: + soft: 65536 + hard: 65536 + healthcheck: + test: ["CMD", "asinfo", "-h", "127.0.0.1", "-p", "3000", "-v", "build"] + interval: 5s + timeout: 3s + retries: 20 + + stunnel: + image: alpine/socat:latest + container_name: aerospike-stunnel + depends_on: + aerospike: + condition: service_healthy + networks: + - aerospike-net + ports: + - "3001:3001" # TLS endpoint + volumes: + - ./certs/server.pem:/certs/server.pem:ro + - ./certs/server.key:/certs/server.key:ro + command: + - "-d" + - "-d" + - "OPENSSL-LISTEN:3001,reuseaddr,fork,cert=/certs/server.pem,key=/certs/server.key,verify=0" + - "TCP:aerospike:3000" + + sample: + build: + context: . + dockerfile: Dockerfile + container_name: aerospike-tls-sample + depends_on: + stunnel: + condition: service_started + aerospike: + condition: service_healthy + environment: + AEROSPIKE_HOST: stunnel + AEROSPIKE_PORT: "3001" + AEROSPIKE_TLS_NAME: aerospike.local + AEROSPIKE_TLS_CA: /certs/ca.pem + LISTEN: ":8080" + ports: + - "8080:8080" + networks: + - aerospike-net + volumes: + - ./certs:/certs:ro + +networks: + aerospike-net: diff --git a/aerospike-tls/gen-certs.sh b/aerospike-tls/gen-certs.sh new file mode 100755 index 00000000..41ffb314 --- /dev/null +++ b/aerospike-tls/gen-certs.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# Generate a self-signed PKI for the TLS sample: +# certs/ca.{pem,key} — root CA +# certs/server.{pem,key} — Aerospike server cert with +# CN/SAN = aerospike.local (and 127.0.0.1) +# certs/client.{pem,key} — client cert (optional mTLS) +# +# Re-run any time. Existing files are overwritten. +set -euo pipefail + +DIR="$(cd "$(dirname "$0")" && pwd)/certs" +mkdir -p "$DIR" +cd "$DIR" + +TLS_NAME="${TLS_NAME:-aerospike.local}" +DAYS="${DAYS:-825}" + +cat > openssl.cnf < ./vendor-aerospike-client-go + +require ( + github.com/yuin/gopher-lua v1.1.1 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect + google.golang.org/grpc v1.63.3 // indirect + google.golang.org/protobuf v1.34.2 // indirect +) diff --git a/aerospike-tls/go.sum b/aerospike-tls/go.sum new file mode 100644 index 00000000..bbfa8f96 --- /dev/null +++ b/aerospike-tls/go.sum @@ -0,0 +1,34 @@ +github.com/aerospike/aerospike-client-go/v7 v7.7.3 h1:8uU+GvHm6VQ0WaTIUorWTmEPEnZA1XuUdq6zFHCXYL0= +github.com/aerospike/aerospike-client-go/v7 v7.7.3/go.mod h1:STlBtOkKT8nmp7iD+sEkr/JGEOu+4e2jGlNN0Jiu2a4= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.63.3 h1:FGVegD7MHo/zhaGduk/R85WvSFJ+si70UQIJ0fg+BiU= +google.golang.org/grpc v1.63.3/go.mod h1:5FFeE/YiGPD2flWFCrCx8K3Ay7hALATnKiI8U3avIuw= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/aerospike-tls/keploy.yml b/aerospike-tls/keploy.yml new file mode 100755 index 00000000..2240944a --- /dev/null +++ b/aerospike-tls/keploy.yml @@ -0,0 +1,114 @@ +# Generated by Keploy (3-dev-aerospike) +path: "" +appName: aerospike-tls +appId: 0 +command: ./aerospike-tls -aerospike-host=127.0.0.1 -aerospike-port=3001 -tls-name=aerospike.local -tls-ca=./certs/ca.pem -tls-insecure=true -listen=:8090 +templatize: + testSets: [] +port: 0 +e2e: false +dnsPort: 26789 +proxyPort: 16789 +incomingProxyPort: 36789 +debug: false +disableTele: false +disableANSI: false +jsonOutput: false +containerName: "" +networkName: "" +buildDelay: 30 +test: + selectedTests: {} + globalNoise: + global: {} + test-sets: {} + replaceWith: + global: + url: {} + port: {} + test-sets: {} + delay: 5 + healthUrl: "" + healthPollTimeout: 1m0s + host: localhost + port: 0 + grpcPort: 0 + ssePort: 0 + protocol: + grpc: + port: 0 + http: + port: 0 + sse: + port: 0 + apiTimeout: 5 + skipCoverage: false + coverageReportPath: "" + ignoreOrdering: true + mongoPassword: default@123 + language: "" + removeUnusedMocks: false + preserveFailedMocks: false + fallBackOnMiss: false + jacocoAgentPath: "" + basePath: "" + mocking: true + ignoredTests: {} + disableLineCoverage: false + updateTemplate: false + mustPass: false + maxFailAttempts: 5 + maxFlakyChecks: 1 + protoFile: "" + protoDir: "" + protoInclude: [] + compareAll: false + schemaMatch: false + updateTestMapping: false + disableAutoHeaderNoise: false + strictMockWindow: true +record: + filters: [] + basePath: "" + recordTimer: 0s + metadata: "" + testCaseNaming: descriptive + sync: false + enableSampling: 0 + memoryLimit: 0 + globalPassthrough: false + tlsPrivateKeyPath: "" + capturePackets: false + opportunisticTlsIntercept: false + recordBuffer: + maxMemoryPerConnection: 67108864 + queueSize: 1024 +report: + selectedTestSets: {} + showFullBody: false + reportPath: "" + summary: false + testCaseIDs: [] + format: "" +disableMapping: true +retryPassing: false +configPath: "" +bypassRules: [] +generateGithubActions: false +keployContainer: keploy-v3 +keployNetwork: keploy-network +cmdType: native +contract: + services: [] + tests: [] + path: "" + download: false + generate: false + driven: consumer + mappings: + servicesMapping: {} + self: s1 +inCi: false +serverPort: 0 + +# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file. diff --git a/aerospike-tls/keploy/.gitignore b/aerospike-tls/keploy/.gitignore new file mode 100644 index 00000000..5137843b --- /dev/null +++ b/aerospike-tls/keploy/.gitignore @@ -0,0 +1,2 @@ + +/reports/ diff --git a/aerospike-tls/keploy/test-set-0/mocks.yaml b/aerospike-tls/keploy/test-set-0/mocks.yaml new file mode 100644 index 00000000..d74b62d7 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/mocks.yaml @@ -0,0 +1,4104 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-0 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:13.316770637+05:30 + ResTimestampMock: 2026-05-11T14:06:13.359259206+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-1 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T14:06:13.359844482+05:30 + ResTimestampMock: 2026-05-11T14:06:13.401368324+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-2 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:13.408928998+05:30 + ResTimestampMock: 2026-05-11T14:06:13.450943918+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-3 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:13.451487515+05:30 + ResTimestampMock: 2026-05-11T14:06:13.493850087+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-4 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T14:06:13.494558487+05:30 + ResTimestampMock: 2026-05-11T14:06:13.537727763+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-5 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:13.539285628+05:30 + ResTimestampMock: 2026-05-11T14:06:13.581195802+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-6 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:13.581484851+05:30 + ResTimestampMock: 2026-05-11T14:06:13.623805687+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-7 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:14.629055793+05:30 + ResTimestampMock: 2026-05-11T14:06:14.672851367+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-8 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:14.673256658+05:30 + ResTimestampMock: 2026-05-11T14:06:14.715294962+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-9 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:15.719942712+05:30 + ResTimestampMock: 2026-05-11T14:06:15.761991312+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-10 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:15.762579474+05:30 + ResTimestampMock: 2026-05-11T14:06:15.80505576+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-11 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:16.809755386+05:30 + ResTimestampMock: 2026-05-11T14:06:16.852003813+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-12 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:16.852140387+05:30 + ResTimestampMock: 2026-05-11T14:06:16.895013157+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-13 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:17.898796441+05:30 + ResTimestampMock: 2026-05-11T14:06:17.940090541+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-14 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:17.94021134+05:30 + ResTimestampMock: 2026-05-11T14:06:17.983597423+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-15 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:18.988062615+05:30 + ResTimestampMock: 2026-05-11T14:06:19.030706905+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-16 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:19.030977404+05:30 + ResTimestampMock: 2026-05-11T14:06:19.072720289+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-17 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:20.078105705+05:30 + ResTimestampMock: 2026-05-11T14:06:20.120620328+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-18 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:20.120895065+05:30 + ResTimestampMock: 2026-05-11T14:06:20.163625164+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-19 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:21.168519201+05:30 + ResTimestampMock: 2026-05-11T14:06:21.210440218+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-20 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:21.210823464+05:30 + ResTimestampMock: 2026-05-11T14:06:21.252165532+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-21 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:22.256094764+05:30 + ResTimestampMock: 2026-05-11T14:06:22.300270743+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-22 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:22.300705853+05:30 + ResTimestampMock: 2026-05-11T14:06:22.343633555+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-23 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:23.347826005+05:30 + ResTimestampMock: 2026-05-11T14:06:23.38971919+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-24 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:23.390871972+05:30 + ResTimestampMock: 2026-05-11T14:06:23.432892275+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-25 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:24.437875843+05:30 + ResTimestampMock: 2026-05-11T14:06:24.479389329+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-26 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:24.479555719+05:30 + ResTimestampMock: 2026-05-11T14:06:24.521317816+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-27 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 101 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAAPjAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJ7/lCxqosJ9pPsj/7c5Qt6b4XXkAAAAPAgIAA2FnZUA+AAAAAAAAAAAADQIDAARuYW1lQWxpY2U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:25.285826729+05:30 + ResTimestampMock: 2026-05-11T14:06:25.32717692+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-28 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:25.522702871+05:30 + ResTimestampMock: 2026-05-11T14:06:25.565679431+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-29 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:25.565814482+05:30 + ResTimestampMock: 2026-05-11T14:06:25.607315852+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-30 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAAPnAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJ7/lCxqosJ9pPsj/7c5Qt6b4XXk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 58 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAAAAgAAAA8BAgADYWdlQD4AAAAAAAAAAAANAQMABG5hbWVBbGljZQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:26.338394773+05:30 + ResTimestampMock: 2026-05-11T14:06:26.381387355+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-31 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:26.609491534+05:30 + ResTimestampMock: 2026-05-11T14:06:26.652329281+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-32 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:26.652702579+05:30 + ResTimestampMock: 2026-05-11T14:06:26.694626617+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-33 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 82 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAAPnAAMAAQAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQAE7PvCLYfLRYhpgLW5aqXEbbvkAAAANAgIAAW4/8AAAAAAAAA== + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:27.392311299+05:30 + ResTimestampMock: 2026-05-11T14:06:27.434080082+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-34 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 82 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAAPnAAMAAQAAAAUAdGVzdAAAAAUBZGVtbwAAABUEPxuVffRzXF4SFE2lDu4RE9Ui8REAAAANAgIAAW5AAAAAAAAAAA== + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:27.434321875+05:30 + ResTimestampMock: 2026-05-11T14:06:27.476059544+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-35 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:27.695685362+05:30 + ResTimestampMock: 2026-05-11T14:06:27.73809149+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-36 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:27.738721297+05:30 + ResTimestampMock: 2026-05-11T14:06:27.780271764+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-37 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 105 + packet_type: Message + meta: + namespace: "" + raw_body: FgkAAAAAAAAAAAAAAAAAAAPnAAEAAAAAAE8qAAAAAgEAAAAAQAE7PvCLYfLRYhpgLW5aqXEbbvkAAwACAAAAAAAFAHRlc3QAAAAFAWRlbW8AAAABPxuVffRzXF4SFE2lDu4RE9Ui8REB + set: "" + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 78 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAA0BAgABbj/wAAAAAAAAFgAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAA0BAgABbkAAAAAAAAAA + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:28.490520446+05:30 + ResTimestampMock: 2026-05-11T14:06:28.531816523+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-38 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:28.780789961+05:30 + ResTimestampMock: 2026-05-11T14:06:28.822644096+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-39 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:28.822837952+05:30 + ResTimestampMock: 2026-05-11T14:06:28.865386075+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-40 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:29.867788978+05:30 + ResTimestampMock: 2026-05-11T14:06:29.909244136+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-41 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:29.909357291+05:30 + ResTimestampMock: 2026-05-11T14:06:29.951590612+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-42 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 8259 + packet_type: Message + meta: + namespace: test + raw_body: FgEABAAAAAAAAAAAAAAAAknvAAUAAAAAAAUAdGVzdAAAAAUBZGVtbwAAIAELAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAVwBYAFkAWgBbAFwAXQBeAF8AYABhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHoAewB8AH0AfgB/AIAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAKEAogCjAKQApQCmAKcAqACpAKoAqwCsAK0ArgCvALAAsQCyALMAtAC1ALYAtwC4ALkAugC7ALwAvQC+AL8AwADBAMIAwwDEAMUAxgDHAMgAyQDKAMsAzADNAM4AzwDQANEA0gDTANQA1QDWANcA2ADZANoA2wDcAN0A3gDfAOAA4QDiAOMA5ADlAOYA5wDoAOkA6gDrAOwA7QDuAO8A8ADxAPIA8wD0APUA9gD3APgA+QD6APsA/AD9AP4A/wAAAQEBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAEhASIBIwEkASUBJgEnASgBKQEqASsBLAEtAS4BLwEwATEBMgEzATQBNQE2ATcBOAE5AToBOwE8AT0BPgE/AUABQQFCAUMBRAFFAUYBRwFIAUkBSgFLAUwBTQFOAU8BUAFRAVIBUwFUAVUBVgFXAVgBWQFaAVsBXAFdAV4BXwFgAWEBYgFjAWQBZQFmAWcBaAFpAWoBawFsAW0BbgFvAXABcQFyAXMBdAF1AXYBdwF4AXkBegF7AXwBfQF+AX8BgAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAfQB9QH2AfcB+AH5AfoB+wH8Af0B/gH/AQACAQICAgMCBAIFAgYCBwIIAgkCCgILAgwCDQIOAg8CEAIRAhICEwIUAhUCFgIXAhgCGQIaAhsCHAIdAh4CHwIgAiECIgIjAiQCJQImAicCKAIpAioCKwIsAi0CLgIvAjACMQIyAjMCNAI1AjYCNwI4AjkCOgI7AjwCPQI+Aj8CQAJBAkICQwJEAkUCRgJHAkgCSQJKAksCTAJNAk4CTwJQAlECUgJTAlQCVQJWAlcCWAJZAloCWwJcAl0CXgJfAmACYQJiAmMCZAJlAmYCZwJoAmkCagJrAmwCbQJuAm8CcAJxAnICcwJ0AnUCdgJ3AngCeQJ6AnsCfAJ9An4CfwKAAoECggKDAoQChQKGAocCiAKJAooCiwKMAo0CjgKPApACkQKSApMClAKVApYClwKYApkCmgKbApwCnQKeAp8CoAKhAqICowKkAqUCpgKnAqgCqQKqAqsCrAKtAq4CrwKwArECsgKzArQCtQK2ArcCuAK5AroCuwK8Ar0CvgK/AsACwQLCAsMCxALFAsYCxwLIAskCygLLAswCzQLOAs8C0ALRAtIC0wLUAtUC1gLXAtgC2QLaAtsC3ALdAt4C3wLgAuEC4gLjAuQC5QLmAucC6ALpAuoC6wLsAu0C7gLvAvAC8QLyAvMC9AL1AvYC9wL4AvkC+gL7AvwC/QL+Av8CAAMBAwIDAwMEAwUDBgMHAwgDCQMKAwsDDAMNAw4DDwMQAxEDEgMTAxQDFQMWAxcDGAMZAxoDGwMcAx0DHgMfAyADIQMiAyMDJAMlAyYDJwMoAykDKgMrAywDLQMuAy8DMAMxAzIDMwM0AzUDNgM3AzgDOQM6AzsDPAM9Az4DPwNAA0EDQgNDA0QDRQNGA0cDSANJA0oDSwNMA00DTgNPA1ADUQNSA1MDVANVA1YDVwNYA1kDWgNbA1wDXQNeA18DYANhA2IDYwNkA2UDZgNnA2gDaQNqA2sDbANtA24DbwNwA3EDcgNzA3QDdQN2A3cDeAN5A3oDewN8A30DfgN/A4ADgQOCA4MDhAOFA4YDhwOIA4kDigOLA4wDjQOOA48DkAORA5IDkwOUA5UDlgOXA5gDmQOaA5sDnAOdA54DnwOgA6EDogOjA6QDpQOmA6cDqAOpA6oDqwOsA60DrgOvA7ADsQOyA7MDtAO1A7YDtwO4A7kDugO7A7wDvQO+A78DwAPBA8IDwwPEA8UDxgPHA8gDyQPKA8sDzAPNA84DzwPQA9ED0gPTA9QD1QPWA9cD2APZA9oD2wPcA90D3gPfA+AD4QPiA+MD5APlA+YD5wPoA+kD6gPrA+wD7QPuA+8D8APxA/ID8wP0A/UD9gP3A/gD+QP6A/sD/AP9A/4D/wMABAEEAgQDBAQEBQQGBAcECAQJBAoECwQMBA0EDgQPBBAEEQQSBBMEFAQVBBYEFwQYBBkEGgQbBBwEHQQeBB8EIAQhBCIEIwQkBCUEJgQnBCgEKQQqBCsELAQtBC4ELwQwBDEEMgQzBDQENQQ2BDcEOAQ5BDoEOwQ8BD0EPgQ/BEAEQQRCBEMERARFBEYERwRIBEkESgRLBEwETQROBE8EUARRBFIEUwRUBFUEVgRXBFgEWQRaBFsEXARdBF4EXwRgBGEEYgRjBGQEZQRmBGcEaARpBGoEawRsBG0EbgRvBHAEcQRyBHMEdAR1BHYEdwR4BHkEegR7BHwEfQR+BH8EgASBBIIEgwSEBIUEhgSHBIgEiQSKBIsEjASNBI4EjwSQBJEEkgSTBJQElQSWBJcEmASZBJoEmwScBJ0EngSfBKAEoQSiBKMEpASlBKYEpwSoBKkEqgSrBKwErQSuBK8EsASxBLIEswS0BLUEtgS3BLgEuQS6BLsEvAS9BL4EvwTABMEEwgTDBMQExQTGBMcEyATJBMoEywTMBM0EzgTPBNAE0QTSBNME1ATVBNYE1wTYBNkE2gTbBNwE3QTeBN8E4AThBOIE4wTkBOUE5gTnBOgE6QTqBOsE7ATtBO4E7wTwBPEE8gTzBPQE9QT2BPcE+AT5BPoE+wT8BP0E/gT/BAAFAQUCBQMFBAUFBQYFBwUIBQkFCgULBQwFDQUOBQ8FEAURBRIFEwUUBRUFFgUXBRgFGQUaBRsFHAUdBR4FHwUgBSEFIgUjBSQFJQUmBScFKAUpBSoFKwUsBS0FLgUvBTAFMQUyBTMFNAU1BTYFNwU4BTkFOgU7BTwFPQU+BT8FQAVBBUIFQwVEBUUFRgVHBUgFSQVKBUsFTAVNBU4FTwVQBVEFUgVTBVQFVQVWBVcFWAVZBVoFWwVcBV0FXgVfBWAFYQViBWMFZAVlBWYFZwVoBWkFagVrBWwFbQVuBW8FcAVxBXIFcwV0BXUFdgV3BXgFeQV6BXsFfAV9BX4FfwWABYEFggWDBYQFhQWGBYcFiAWJBYoFiwWMBY0FjgWPBZAFkQWSBZMFlAWVBZYFlwWYBZkFmgWbBZwFnQWeBZ8FoAWhBaIFowWkBaUFpgWnBagFqQWqBasFrAWtBa4FrwWwBbEFsgWzBbQFtQW2BbcFuAW5BboFuwW8Bb0FvgW/BcAFwQXCBcMFxAXFBcYFxwXIBckFygXLBcwFzQXOBc8F0AXRBdIF0wXUBdUF1gXXBdgF2QXaBdsF3AXdBd4F3wXgBeEF4gXjBeQF5QXmBecF6AXpBeoF6wXsBe0F7gXvBfAF8QXyBfMF9AX1BfYF9wX4BfkF+gX7BfwF/QX+Bf8FAAYBBgIGAwYEBgUGBgYHBggGCQYKBgsGDAYNBg4GDwYQBhEGEgYTBhQGFQYWBhcGGAYZBhoGGwYcBh0GHgYfBiAGIQYiBiMGJAYlBiYGJwYoBikGKgYrBiwGLQYuBi8GMAYxBjIGMwY0BjUGNgY3BjgGOQY6BjsGPAY9Bj4GPwZABkEGQgZDBkQGRQZGBkcGSAZJBkoGSwZMBk0GTgZPBlAGUQZSBlMGVAZVBlYGVwZYBlkGWgZbBlwGXQZeBl8GYAZhBmIGYwZkBmUGZgZnBmgGaQZqBmsGbAZtBm4GbwZwBnEGcgZzBnQGdQZ2BncGeAZ5BnoGewZ8Bn0GfgZ/BoAGgQaCBoMGhAaFBoYGhwaIBokGigaLBowGjQaOBo8GkAaRBpIGkwaUBpUGlgaXBpgGmQaaBpsGnAadBp4GnwagBqEGogajBqQGpQamBqcGqAapBqoGqwasBq0GrgavBrAGsQayBrMGtAa1BrYGtwa4BrkGuga7BrwGvQa+Br8GwAbBBsIGwwbEBsUGxgbHBsgGyQbKBssGzAbNBs4GzwbQBtEG0gbTBtQG1QbWBtcG2AbZBtoG2wbcBt0G3gbfBuAG4QbiBuMG5AblBuYG5wboBukG6gbrBuwG7QbuBu8G8AbxBvIG8wb0BvUG9gb3BvgG+Qb6BvsG/Ab9Bv4G/wYABwEHAgcDBwQHBQcGBwcHCAcJBwoHCwcMBw0HDgcPBxAHEQcSBxMHFAcVBxYHFwcYBxkHGgcbBxwHHQceBx8HIAchByIHIwckByUHJgcnBygHKQcqBysHLActBy4HLwcwBzEHMgczBzQHNQc2BzcHOAc5BzoHOwc8Bz0HPgc/B0AHQQdCB0MHRAdFB0YHRwdIB0kHSgdLB0wHTQdOB08HUAdRB1IHUwdUB1UHVgdXB1gHWQdaB1sHXAddB14HXwdgB2EHYgdjB2QHZQdmB2cHaAdpB2oHawdsB20HbgdvB3AHcQdyB3MHdAd1B3YHdwd4B3kHegd7B3wHfQd+B38HgAeBB4IHgweEB4UHhgeHB4gHiQeKB4sHjAeNB44HjweQB5EHkgeTB5QHlQeWB5cHmAeZB5oHmwecB50HngefB6AHoQeiB6MHpAelB6YHpweoB6kHqgerB6wHrQeuB68HsAexB7IHswe0B7UHtge3B7gHuQe6B7sHvAe9B74HvwfAB8EHwgfDB8QHxQfGB8cHyAfJB8oHywfMB80HzgfPB9AH0QfSB9MH1AfVB9YH1wfYB9kH2gfbB9wH3QfeB98H4AfhB+IH4wfkB+UH5gfnB+gH6QfqB+sH7AftB+4H7wfwB/EH8gfzB/QH9Qf2B/cH+Af5B/oH+wf8B/0H/gf/BwAIAQgCCAMIBAgFCAYIBwgICAkICggLCAwIDQgOCA8IEAgRCBIIEwgUCBUIFggXCBgIGQgaCBsIHAgdCB4IHwggCCEIIggjCCQIJQgmCCcIKAgpCCoIKwgsCC0ILggvCDAIMQgyCDMINAg1CDYINwg4CDkIOgg7CDwIPQg+CD8IQAhBCEIIQwhECEUIRghHCEgISQhKCEsITAhNCE4ITwhQCFEIUghTCFQIVQhWCFcIWAhZCFoIWwhcCF0IXghfCGAIYQhiCGMIZAhlCGYIZwhoCGkIaghrCGwIbQhuCG8IcAhxCHIIcwh0CHUIdgh3CHgIeQh6CHsIfAh9CH4IfwiACIEIggiDCIQIhQiGCIcIiAiJCIoIiwiMCI0IjgiPCJAIkQiSCJMIlAiVCJYIlwiYCJkImgibCJwInQieCJ8IoAihCKIIowikCKUIpginCKgIqQiqCKsIrAitCK4IrwiwCLEIsgizCLQItQi2CLcIuAi5CLoIuwi8CL0Ivgi/CMAIwQjCCMMIxAjFCMYIxwjICMkIygjLCMwIzQjOCM8I0AjRCNII0wjUCNUI1gjXCNgI2QjaCNsI3AjdCN4I3wjgCOEI4gjjCOQI5QjmCOcI6AjpCOoI6wjsCO0I7gjvCPAI8QjyCPMI9Aj1CPYI9wj4CPkI+gj7CPwI/Qj+CP8IAAkBCQIJAwkECQUJBgkHCQgJCQkKCQsJDAkNCQ4JDwkQCREJEgkTCRQJFQkWCRcJGAkZCRoJGwkcCR0JHgkfCSAJIQkiCSMJJAklCSYJJwkoCSkJKgkrCSwJLQkuCS8JMAkxCTIJMwk0CTUJNgk3CTgJOQk6CTsJPAk9CT4JPwlACUEJQglDCUQJRQlGCUcJSAlJCUoJSwlMCU0JTglPCVAJUQlSCVMJVAlVCVYJVwlYCVkJWglbCVwJXQleCV8JYAlhCWIJYwlkCWUJZglnCWgJaQlqCWsJbAltCW4JbwlwCXEJcglzCXQJdQl2CXcJeAl5CXoJewl8CX0Jfgl/CYAJgQmCCYMJhAmFCYYJhwmICYkJigmLCYwJjQmOCY8JkAmRCZIJkwmUCZUJlgmXCZgJmQmaCZsJnAmdCZ4JnwmgCaEJogmjCaQJpQmmCacJqAmpCaoJqwmsCa0JrgmvCbAJsQmyCbMJtAm1CbYJtwm4CbkJugm7CbwJvQm+Cb8JwAnBCcIJwwnECcUJxgnHCcgJyQnKCcsJzAnNCc4JzwnQCdEJ0gnTCdQJ1QnWCdcJ2AnZCdoJ2wncCd0J3gnfCeAJ4QniCeMJ5AnlCeYJ5wnoCekJ6gnrCewJ7QnuCe8J8AnxCfIJ8wn0CfUJ9gn3CfgJ+Qn6CfsJ/An9Cf4J/wkACgEKAgoDCgQKBQoGCgcKCAoJCgoKCwoMCg0KDgoPChAKEQoSChMKFAoVChYKFwoYChkKGgobChwKHQoeCh8KIAohCiIKIwokCiUKJgonCigKKQoqCisKLAotCi4KLwowCjEKMgozCjQKNQo2CjcKOAo5CjoKOwo8Cj0KPgo/CkAKQQpCCkMKRApFCkYKRwpICkkKSgpLCkwKTQpOCk8KUApRClIKUwpUClUKVgpXClgKWQpaClsKXApdCl4KXwpgCmEKYgpjCmQKZQpmCmcKaAppCmoKawpsCm0KbgpvCnAKcQpyCnMKdAp1CnYKdwp4CnkKegp7CnwKfQp+Cn8KgAqBCoIKgwqECoUKhgqHCogKiQqKCosKjAqNCo4KjwqQCpEKkgqTCpQKlQqWCpcKmAqZCpoKmwqcCp0KngqfCqAKoQqiCqMKpAqlCqYKpwqoCqkKqgqrCqwKrQquCq8KsAqxCrIKswq0CrUKtgq3CrgKuQq6CrsKvAq9Cr4KvwrACsEKwgrDCsQKxQrGCscKyArJCsoKywrMCs0KzgrPCtAK0QrSCtMK1ArVCtYK1wrYCtkK2grbCtwK3QreCt8K4ArhCuIK4wrkCuUK5grnCugK6QrqCusK7ArtCu4K7wrwCvEK8grzCvQK9Qr2CvcK+Ar5CvoK+wr8Cv0K/gr/CgALAQsCCwMLBAsFCwYLBwsICwkLCgsLCwwLDQsOCw8LEAsRCxILEwsUCxULFgsXCxgLGQsaCxsLHAsdCx4LHwsgCyELIgsjCyQLJQsmCycLKAspCyoLKwssCy0LLgsvCzALMQsyCzMLNAs1CzYLNws4CzkLOgs7CzwLPQs+Cz8LQAtBC0ILQwtEC0ULRgtHC0gLSQtKC0sLTAtNC04LTwtQC1ELUgtTC1QLVQtWC1cLWAtZC1oLWwtcC10LXgtfC2ALYQtiC2MLZAtlC2YLZwtoC2kLagtrC2wLbQtuC28LcAtxC3ILcwt0C3ULdgt3C3gLeQt6C3sLfAt9C34LfwuAC4ELgguDC4QLhQuGC4cLiAuJC4oLiwuMC40LjguPC5ALkQuSC5MLlAuVC5YLlwuYC5kLmgubC5wLnQueC58LoAuhC6ILowukC6ULpgunC6gLqQuqC6sLrAutC64LrwuwC7ELsguzC7QLtQu2C7cLuAu5C7oLuwu8C70Lvgu/C8ALwQvCC8MLxAvFC8YLxwvIC8kLygvLC8wLzQvOC88L0AvRC9IL0wvUC9UL1gvXC9gL2QvaC9sL3AvdC94L3wvgC+EL4gvjC+QL5QvmC+cL6AvpC+oL6wvsC+0L7gvvC/AL8QvyC/ML9Av1C/YL9wv4C/kL+gv7C/wL/Qv+C/8LAAwBDAIMAwwEDAUMBgwHDAgMCQwKDAsMDAwNDA4MDwwQDBEMEgwTDBQMFQwWDBcMGAwZDBoMGwwcDB0MHgwfDCAMIQwiDCMMJAwlDCYMJwwoDCkMKgwrDCwMLQwuDC8MMAwxDDIMMww0DDUMNgw3DDgMOQw6DDsMPAw9DD4MPwxADEEMQgxDDEQMRQxGDEcMSAxJDEoMSwxMDE0MTgxPDFAMUQxSDFMMVAxVDFYMVwxYDFkMWgxbDFwMXQxeDF8MYAxhDGIMYwxkDGUMZgxnDGgMaQxqDGsMbAxtDG4MbwxwDHEMcgxzDHQMdQx2DHcMeAx5DHoMewx8DH0Mfgx/DIAMgQyCDIMMhAyFDIYMhwyIDIkMigyLDIwMjQyODI8MkAyRDJIMkwyUDJUMlgyXDJgMmQyaDJsMnAydDJ4MnwygDKEMogyjDKQMpQymDKcMqAypDKoMqwysDK0MrgyvDLAMsQyyDLMMtAy1DLYMtwy4DLkMugy7DLwMvQy+DL8MwAzBDMIMwwzEDMUMxgzHDMgMyQzKDMsMzAzNDM4MzwzQDNEM0gzTDNQM1QzWDNcM2AzZDNoM2wzcDN0M3gzfDOAM4QziDOMM5AzlDOYM5wzoDOkM6gzrDOwM7QzuDO8M8AzxDPIM8wz0DPUM9gz3DPgM+Qz6DPsM/Az9DP4M/wwADQENAg0DDQQNBQ0GDQcNCA0JDQoNCw0MDQ0NDg0PDRANEQ0SDRMNFA0VDRYNFw0YDRkNGg0bDRwNHQ0eDR8NIA0hDSINIw0kDSUNJg0nDSgNKQ0qDSsNLA0tDS4NLw0wDTENMg0zDTQNNQ02DTcNOA05DToNOw08DT0NPg0/DUANQQ1CDUMNRA1FDUYNRw1IDUkNSg1LDUwNTQ1ODU8NUA1RDVINUw1UDVUNVg1XDVgNWQ1aDVsNXA1dDV4NXw1gDWENYg1jDWQNZQ1mDWcNaA1pDWoNaw1sDW0Nbg1vDXANcQ1yDXMNdA11DXYNdw14DXkNeg17DXwNfQ1+DX8NgA2BDYINgw2EDYUNhg2HDYgNiQ2KDYsNjA2NDY4Njw2QDZENkg2TDZQNlQ2WDZcNmA2ZDZoNmw2cDZ0Nng2fDaANoQ2iDaMNpA2lDaYNpw2oDakNqg2rDawNrQ2uDa8NsA2xDbINsw20DbUNtg23DbgNuQ26DbsNvA29Db4Nvw3ADcENwg3DDcQNxQ3GDccNyA3JDcoNyw3MDc0Nzg3PDdAN0Q3SDdMN1A3VDdYN1w3YDdkN2g3bDdwN3Q3eDd8N4A3hDeIN4w3kDeUN5g3nDegN6Q3qDesN7A3tDe4N7w3wDfEN8g3zDfQN9Q32DfcN+A35DfoN+w38Df0N/g3/DQAOAQ4CDgMOBA4FDgYOBw4IDgkOCg4LDgwODQ4ODg8OEA4RDhIOEw4UDhUOFg4XDhgOGQ4aDhsOHA4dDh4OHw4gDiEOIg4jDiQOJQ4mDicOKA4pDioOKw4sDi0OLg4vDjAOMQ4yDjMONA41DjYONw44DjkOOg47DjwOPQ4+Dj8OQA5BDkIOQw5EDkUORg5HDkgOSQ5KDksOTA5NDk4OTw5QDlEOUg5TDlQOVQ5WDlcOWA5ZDloOWw5cDl0OXg5fDmAOYQ5iDmMOZA5lDmYOZw5oDmkOag5rDmwObQ5uDm8OcA5xDnIOcw50DnUOdg53DngOeQ56DnsOfA59Dn4Ofw6ADoEOgg6DDoQOhQ6GDocOiA6JDooOiw6MDo0Ojg6PDpAOkQ6SDpMOlA6VDpYOlw6YDpkOmg6bDpwOnQ6eDp8OoA6hDqIOow6kDqUOpg6nDqgOqQ6qDqsOrA6tDq4Orw6wDrEOsg6zDrQOtQ62DrcOuA65DroOuw68Dr0Ovg6/DsAOwQ7CDsMOxA7FDsYOxw7IDskOyg7LDswOzQ7ODs8O0A7RDtIO0w7UDtUO1g7XDtgO2Q7aDtsO3A7dDt4O3w7gDuEO4g7jDuQO5Q7mDucO6A7pDuoO6w7sDu0O7g7vDvAO8Q7yDvMO9A71DvYO9w74DvkO+g77DvwO/Q7+Dv8OAA8BDwIPAw8EDwUPBg8HDwgPCQ8KDwsPDA8NDw4PDw8QDxEPEg8TDxQPFQ8WDxcPGA8ZDxoPGw8cDx0PHg8fDyAPIQ8iDyMPJA8lDyYPJw8oDykPKg8rDywPLQ8uDy8PMA8xDzIPMw80DzUPNg83DzgPOQ86DzsPPA89Dz4PPw9AD0EPQg9DD0QPRQ9GD0cPSA9JD0oPSw9MD00PTg9PD1APUQ9SD1MPVA9VD1YPVw9YD1kPWg9bD1wPXQ9eD18PYA9hD2IPYw9kD2UPZg9nD2gPaQ9qD2sPbA9tD24Pbw9wD3EPcg9zD3QPdQ92D3cPeA95D3oPew98D30Pfg9/D4APgQ+CD4MPhA+FD4YPhw+ID4kPig+LD4wPjQ+OD48PkA+RD5IPkw+UD5UPlg+XD5gPmQ+aD5sPnA+dD54Pnw+gD6EPog+jD6QPpQ+mD6cPqA+pD6oPqw+sD60Prg+vD7APsQ+yD7MPtA+1D7YPtw+4D7kPug+7D7wPvQ++D78PwA/BD8IPww/ED8UPxg/HD8gPyQ/KD8sPzA/ND84Pzw/QD9EP0g/TD9QP1Q/WD9cP2A/ZD9oP2w/cD90P3g/fD+AP4Q/iD+MP5A/lD+YP5w/oD+kP6g/rD+wP7Q/uD+8P8A/xD/IP8w/0D/UP9g/3D/gP+Q/6D/sP/A/9D/4P/w8AAAAFCQAAdTAAAAAJB8vOV8xxCNM5 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 164 + packet_type: Message + meta: + namespace: test + raw_body: FgAAAAAAAAAAAgAAAAAAAAAAAAMAAQAAAAUAdGVzdAAAABUEQAE7PvCLYfLRYhpgLW5aqXEbbvkAAAAFAWRlbW8AAAANAQIAAW4/8AAAAAAAABYAAAAAAAAAAAIAAAAAAAAAAAADAAEAAAAFAHRlc3QAAAAVBD8blX30c1xeEhRNpQ7uERPVIvERAAAABQFkZW1vAAAADQECAAFuQAAAAAAAAAA= + set: demo + message: null + ReqTimestampMock: 2026-05-11T14:06:30.501423189+05:30 + ResTimestampMock: 2026-05-11T14:06:30.619819771+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-43 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:30.953023703+05:30 + ResTimestampMock: 2026-05-11T14:06:30.99481328+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-44 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:30.995279248+05:30 + ResTimestampMock: 2026-05-11T14:06:31.037182611+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-45 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:32.041970407+05:30 + ResTimestampMock: 2026-05-11T14:06:32.0833242+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-46 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:32.08360715+05:30 + ResTimestampMock: 2026-05-11T14:06:32.124866161+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-47 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:33.129520026+05:30 + ResTimestampMock: 2026-05-11T14:06:33.171272437+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-48 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:33.171582457+05:30 + ResTimestampMock: 2026-05-11T14:06:33.214449497+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-49 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:34.218849414+05:30 + ResTimestampMock: 2026-05-11T14:06:34.260577969+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-50 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:34.260737646+05:30 + ResTimestampMock: 2026-05-11T14:06:34.303304616+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-51 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:35.307804543+05:30 + ResTimestampMock: 2026-05-11T14:06:35.349823511+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-52 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:35.349954983+05:30 + ResTimestampMock: 2026-05-11T14:06:35.391325138+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-53 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:36.395848408+05:30 + ResTimestampMock: 2026-05-11T14:06:36.437888485+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-54 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:36.438425543+05:30 + ResTimestampMock: 2026-05-11T14:06:36.48067001+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-55 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 73 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAAPnAAMAAQAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJ7/lCxqosJ9pPsj/7c5Qt6b4XXkAAAAECwAAAA== + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAwAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:36.515960764+05:30 + ResTimestampMock: 2026-05-11T14:06:36.55777846+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-56 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:37.485153212+05:30 + ResTimestampMock: 2026-05-11T14:06:37.52603052+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-57 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:37.526527058+05:30 + ResTimestampMock: 2026-05-11T14:06:37.568413423+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-58 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgADAAAAAAAAAAAAAAAAAAPnAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJ7/lCxqosJ9pPsj/7c5Qt6b4XXk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:06:37.567439401+05:30 + ResTimestampMock: 2026-05-11T14:06:37.60923548+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-59 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:38.571979029+05:30 + ResTimestampMock: 2026-05-11T14:06:38.615104911+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-60 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:38.615641633+05:30 + ResTimestampMock: 2026-05-11T14:06:38.657474649+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-61 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:39.662243981+05:30 + ResTimestampMock: 2026-05-11T14:06:39.705835295+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-62 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:39.706264511+05:30 + ResTimestampMock: 2026-05-11T14:06:39.747095709+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-63 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:40.751389676+05:30 + ResTimestampMock: 2026-05-11T14:06:40.793652041+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-64 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:40.794225689+05:30 + ResTimestampMock: 2026-05-11T14:06:40.836094664+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-65 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:41.836515698+05:30 + ResTimestampMock: 2026-05-11T14:06:41.879148411+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-66 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:41.879240446+05:30 + ResTimestampMock: 2026-05-11T14:06:41.921510268+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-67 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:42.926224576+05:30 + ResTimestampMock: 2026-05-11T14:06:42.970165243+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-68 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:42.970677339+05:30 + ResTimestampMock: 2026-05-11T14:06:43.01361986+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-69 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:44.018368109+05:30 + ResTimestampMock: 2026-05-11T14:06:44.061667913+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-70 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:44.061934465+05:30 + ResTimestampMock: 2026-05-11T14:06:44.107156473+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-71 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:45.112353273+05:30 + ResTimestampMock: 2026-05-11T14:06:45.15454904+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-72 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:45.155093241+05:30 + ResTimestampMock: 2026-05-11T14:06:45.19635834+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-73 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:46.200367627+05:30 + ResTimestampMock: 2026-05-11T14:06:46.242850141+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-74 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:46.243043356+05:30 + ResTimestampMock: 2026-05-11T14:06:46.285586424+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-75 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:47.289687158+05:30 + ResTimestampMock: 2026-05-11T14:06:47.331274913+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-76 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:47.331702086+05:30 + ResTimestampMock: 2026-05-11T14:06:47.37335887+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-77 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:48.377832176+05:30 + ResTimestampMock: 2026-05-11T14:06:48.419741119+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-78 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:48.41991289+05:30 + ResTimestampMock: 2026-05-11T14:06:48.461941441+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-79 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:49.466020995+05:30 + ResTimestampMock: 2026-05-11T14:06:49.508193078+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-80 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:49.508628265+05:30 + ResTimestampMock: 2026-05-11T14:06:49.550498845+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-81 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:50.555488187+05:30 + ResTimestampMock: 2026-05-11T14:06:50.597961534+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-82 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:50.598275961+05:30 + ResTimestampMock: 2026-05-11T14:06:50.639749306+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-83 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:51.644038254+05:30 + ResTimestampMock: 2026-05-11T14:06:51.686231608+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-84 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:51.686641465+05:30 + ResTimestampMock: 2026-05-11T14:06:51.728743773+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-85 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:52.732970825+05:30 + ResTimestampMock: 2026-05-11T14:06:52.77459751+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-86 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:52.774850297+05:30 + ResTimestampMock: 2026-05-11T14:06:52.816308532+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-87 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:53.819964319+05:30 + ResTimestampMock: 2026-05-11T14:06:53.862265571+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-88 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:53.862636063+05:30 + ResTimestampMock: 2026-05-11T14:06:53.90458271+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-89 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:54.908934316+05:30 + ResTimestampMock: 2026-05-11T14:06:54.951579995+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-90 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:54.951676621+05:30 + ResTimestampMock: 2026-05-11T14:06:54.994176871+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-91 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:55.998765352+05:30 + ResTimestampMock: 2026-05-11T14:06:56.041038287+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-92 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:56.041412947+05:30 + ResTimestampMock: 2026-05-11T14:06:56.083678802+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-93 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:57.088199162+05:30 + ResTimestampMock: 2026-05-11T14:06:57.1304052+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-94 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:57.130704205+05:30 + ResTimestampMock: 2026-05-11T14:06:57.17192107+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-95 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:58.174538138+05:30 + ResTimestampMock: 2026-05-11T14:06:58.21636064+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-96 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:58.216698243+05:30 + ResTimestampMock: 2026-05-11T14:06:58.260008059+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-97 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:06:59.262452127+05:30 + ResTimestampMock: 2026-05-11T14:06:59.305645739+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-98 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:06:59.305813627+05:30 + ResTimestampMock: 2026-05-11T14:06:59.347485154+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-99 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:00.352011375+05:30 + ResTimestampMock: 2026-05-11T14:07:00.39371072+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-100 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:00.394021742+05:30 + ResTimestampMock: 2026-05-11T14:07:00.435894509+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-101 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 8300 + packet_type: Message + meta: + namespace: test + raw_body: FgEABAAAAAAAAAAAAAAAAknvAAYAAAAAAAUAdGVzdAAAAAUBZGVtbwAAH/0LAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAVwBYAFkAWgBbAFwAXQBeAF8AYABhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHoAewB8AH0AfgB/AIAAgQCCAIMAhACFAIYAhwCIAIkAigCLAIwAjQCOAI8AkACRAJIAkwCUAJUAlgCXAJgAmQCaAJsAnACdAJ4AnwCgAKEAogCjAKQApQCmAKcAqACpAKoAqwCsAK0ArgCvALAAsQCyALMAtAC1ALYAtwC4ALkAugC7ALwAvQC+AL8AwADBAMIAwwDEAMUAxgDHAMgAyQDKAMsAzADNAM4AzwDQANEA0gDTANQA1QDWANcA2ADZANoA2wDcAN0A3gDfAOAA4QDiAOMA5ADlAOYA5wDoAOkA6gDrAOwA7QDuAO8A8ADxAPIA8wD0APUA9gD3APgA+QD6APsA/AD9AP4A/wAAAQEBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAEhASIBIwEkASUBJgEnASgBKQEqASsBLAEtAS4BLwEwATEBMgEzATQBNQE2ATcBOAE5AToBOwE8AT0BPgE/AUEBQgFDAUQBRQFGAUcBSAFJAUoBSwFMAU0BTgFPAVABUQFSAVMBVAFVAVYBVwFYAVkBWgFbAVwBXQFeAV8BYAFhAWIBYwFkAWUBZgFnAWgBaQFqAWsBbAFtAW4BbwFwAXEBcgFzAXQBdQF2AXcBeAF5AXoBewF8AX0BfgF/AYABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMB5AHlAeYB5wHoAekB6gHrAewB7QHuAe8B8AHxAfIB8wH0AfUB9gH3AfgB+QH6AfsB/AH9Af4B/wEAAgECAgIDAgQCBQIGAgcCCAIJAgoCCwIMAg0CDgIPAhACEQISAhMCFAIVAhYCFwIYAhkCGgIbAhwCHQIeAh8CIAIhAiICIwIkAiUCJgInAigCKQIqAisCLAItAi4CLwIwAjECMgIzAjQCNQI2AjcCOAI5AjoCOwI8Aj0CPgI/AkACQQJCAkMCRAJFAkYCRwJIAkkCSgJLAkwCTQJOAk8CUAJRAlICUwJUAlUCVgJXAlgCWQJaAlsCXAJdAl4CXwJgAmECYgJjAmQCZQJmAmcCaAJpAmoCawJsAm0CbgJvAnACcQJyAnMCdAJ1AnYCdwJ4AnkCegJ7AnwCfQJ+An8CgAKBAoICgwKEAoUChgKHAogCiQKKAosCjAKNAo4CjwKQApECkgKTApQClQKWApcCmAKZApoCmwKcAp0CngKfAqACoQKiAqMCpAKlAqYCpwKoAqkCqgKrAqwCrQKuAq8CsAKxArICswK0ArUCtgK3ArgCuQK6ArsCvAK9Ar4CvwLAAsECwgLDAsQCxQLGAscCyALJAsoCywLMAs0CzgLPAtAC0QLSAtMC1ALVAtYC1wLYAtkC2gLbAtwC3QLeAt8C4ALhAuIC4wLkAuUC5gLnAugC6QLqAusC7ALtAu4C7wLwAvEC8gLzAvQC9QL2AvcC+AL5AvoC+wL8Av0C/gL/AgADAQMCAwMDBAMFAwYDBwMIAwkDCgMLAwwDDQMOAw8DEAMRAxIDEwMUAxUDFgMXAxgDGQMaAxsDHAMdAx4DHwMgAyEDIgMjAyQDJQMmAycDKAMpAyoDKwMsAy0DLgMvAzADMQMyAzMDNAM1AzYDNwM4AzkDOgM7AzwDPQM+Az8DQANBA0IDQwNEA0UDRgNHA0gDSQNKA0sDTANNA04DTwNQA1EDUgNTA1QDVQNWA1cDWANZA1oDWwNcA10DXgNfA2ADYQNiA2MDZANlA2YDZwNoA2kDagNrA2wDbQNuA28DcANxA3IDcwN0A3UDdgN3A3gDeQN6A3sDfAN9A34DfwOAA4EDggODA4QDhQOGA4cDiAOJA4oDiwOMA40DjgOPA5ADkQOSA5MDlAOVA5YDlwOYA5kDmgObA5wDnQOeA58DoAOhA6IDowOkA6UDpgOnA6gDqQOqA6sDrAOtA64DrwOwA7EDsgOzA7QDtQO2A7cDuAO5A7oDuwO8A70DvgO/A8ADwQPCA8MDxAPFA8YDxwPIA8kDygPLA8wDzQPOA88D0APRA9ID0wPUA9UD1gPXA9gD2QPaA9sD3APdA94D3wPgA+ED4gPjA+QD5QPmA+cD6APpA+oD6wPsA+0D7gPvA/AD8QPyA/MD9AP1A/YD9wP4A/kD+gP7A/wD/QP+A/8DAAQBBAIEAwQEBAUEBgQHBAgECQQKBAsEDAQNBA4EDwQQBBEEEgQTBBQEFQQWBBcEGAQZBBoEGwQcBB0EHgQfBCAEIQQiBCMEJAQlBCYEJwQoBCkEKgQrBCwELQQuBC8EMAQxBDIEMwQ0BDUENgQ3BDgEOQQ6BDsEPAQ9BD4EPwRABEEEQgRDBEQERQRGBEcESARJBEoESwRMBE0ETgRPBFAEUQRSBFMEVARVBFYEVwRYBFkEWgRbBFwEXQReBF8EYARhBGIEYwRkBGUEZgRnBGgEaQRqBGsEbARtBG4EbwRwBHEEcgRzBHQEdQR2BHcEeAR5BHoEewR8BH0EfgR/BIAEgQSCBIMEhASFBIYEhwSIBIkEigSLBIwEjQSOBI8EkASRBJIEkwSUBJUElgSXBJgEmQSaBJsEnASdBJ4EnwSgBKEEogSjBKQEpQSmBKcEqASpBKoEqwSsBK0ErgSvBLAEsQSyBLMEtAS1BLYEtwS4BLkEugS7BLwEvQS+BL8EwATBBMIEwwTEBMUExgTHBMgEyQTKBMsEzATNBM4EzwTQBNEE0gTTBNQE1QTWBNcE2ATZBNoE2wTcBN0E3gTfBOAE4QTiBOME5ATlBOYE5wToBOkE6gTrBOwE7QTuBO8E8ATxBPIE8wT0BPUE9gT3BPgE+QT6BPsE/AT9BP4E/wQABQEFAgUDBQQFBQUGBQcFCAUJBQoFCwUMBQ0FDgUPBRAFEQUSBRMFFAUVBRYFFwUYBRkFGgUbBRwFHQUeBR8FIAUhBSIFIwUkBSUFJgUnBSgFKQUqBSsFLAUtBS4FLwUwBTEFMgUzBTQFNQU2BTcFOAU5BToFOwU8BT0FPgU/BUAFQQVCBUMFRAVFBUYFRwVIBUkFSgVLBUwFTQVOBU8FUAVRBVIFUwVUBVUFVgVXBVgFWQVaBVsFXAVdBV4FXwVgBWEFYgVjBWQFZQVmBWcFaAVpBWoFawVsBW0FbgVvBXAFcQVyBXMFdAV1BXYFdwV4BXkFegV7BXwFfQV+BX8FgAWBBYIFgwWEBYUFhgWHBYgFiQWKBYsFjAWNBY4FjwWQBZEFkgWTBZQFlQWWBZcFmAWZBZoFmwWcBZ0FngWfBaAFoQWiBaMFpAWlBaYFpwWoBakFqgWrBawFrQWuBa8FsAWxBbIFswW0BbUFtgW3BbgFuQW6BbsFvAW9Bb4FvwXABcEFwgXDBcQFxQXGBccFyAXJBcoFywXMBc0FzgXPBdAF0QXSBdMF1AXVBdYF1wXYBdkF2gXbBdwF3QXeBd8F4AXhBeIF4wXkBeUF5gXnBegF6QXqBesF7AXtBe4F7wXwBfEF8gXzBfQF9QX2BfcF+AX5BfoF+wX8Bf0F/gX/BQAGAQYCBgMGBAYFBgYGBwYIBgkGCgYLBgwGDQYOBg8GEAYRBhIGEwYUBhUGFgYXBhgGGQYaBhsGHAYdBh4GHwYgBiEGIgYjBiQGJQYmBicGKAYpBioGKwYsBi0GLgYvBjAGMQYyBjMGNAY1BjYGNwY4BjkGOgY7BjwGPQY+Bj8GQAZBBkIGQwZEBkUGRgZHBkgGSQZKBksGTAZNBk4GTwZQBlEGUgZTBlQGVQZWBlcGWAZZBloGWwZcBl0GXgZfBmAGYQZiBmMGZAZlBmYGZwZoBmkGagZrBmwGbQZuBm8GcAZxBnIGcwZ0BnUGdgZ3BngGeQZ6BnsGfAZ9Bn4GfwaABoEGggaDBoQGhQaGBocGiAaJBooGiwaMBo0GjgaPBpAGkQaSBpMGlAaVBpYGlwaYBpkGmgabBpwGnQaeBp8GoAahBqIGowakBqUGpganBqgGqQaqBqsGrAatBq4GrwawBrEGsgazBrQGtQa2BrcGuAa5BroGuwa8Br0Gvga/BsAGwQbCBsMGxAbFBsYGxwbIBskGygbLBswGzQbOBs8G0AbRBtIG0wbUBtUG1gbXBtgG2QbaBtsG3AbdBt4G3wbgBuEG4gbjBuQG5QbmBucG6AbpBuoG6wbsBu0G7gbvBvAG8QbyBvMG9Ab1BvYG9wb4BvkG+gb7BvwG/Qb+Bv8GAAcBBwIHAwcEBwUHBgcHBwgHCQcKBwsHDAcNBw4HDwcQBxEHEgcTBxQHFQcWBxcHGAcZBxoHGwccBx0HHgcfByAHIQciByMHJAclByYHJwcoBykHKgcrBywHLQcuBy8HMAcxBzIHMwc0BzUHNgc3BzgHOQc6BzsHPAc9Bz4HPwdAB0EHQgdDB0QHRQdGB0cHSAdJB0oHSwdMB00HTgdPB1AHUQdSB1MHVAdVB1YHVwdYB1kHWgdbB1wHXQdeB18HYAdhB2IHYwdkB2UHZgdnB2gHaQdqB2sHbAdtB24HbwdwB3EHcgdzB3QHdQd2B3cHeAd5B3oHewd8B30Hfgd/B4AHgQeCB4MHhAeFB4YHhweIB4kHigeLB4wHjQeOB48HkAeRB5IHkweUB5UHlgeXB5gHmQeaB5sHnAedB54HnwegB6EHogejB6QHpQemB6cHqAepB6oHqwesB60HrgevB7AHsQeyB7MHtAe1B7YHtwe4B7kHuge7B7wHvQe+B78HwAfBB8IHwwfEB8UHxgfHB8gHyQfKB8sHzAfNB84HzwfQB9EH0gfTB9QH1QfWB9cH2AfZB9oH2wfcB90H3gffB+AH4QfiB+MH5AflB+YH5wfoB+kH6gfrB+wH7QfuB+8H8AfxB/IH8wf0B/UH9gf3B/gH+Qf6B/sH/Af9B/4H/wcACAEIAggDCAQIBQgGCAcICAgJCAoICwgMCA0IDggPCBAIEQgSCBMIFAgVCBYIFwgYCBkIGggbCBwIHQgeCB8IIAghCCIIIwgkCCUIJggnCCgIKQgqCCsILAgtCC4ILwgwCDEIMggzCDQINQg2CDcIOAg5CDoIOwg8CD0IPgg/CEAIQQhCCEMIRAhFCEYIRwhICEkISghLCEwITQhOCE8IUAhRCFIIUwhUCFUIVghXCFgIWQhaCFsIXAhdCF4IXwhgCGEIYghjCGQIZQhmCGcIaAhpCGoIawhsCG0IbghvCHAIcQhyCHMIdAh1CHYIdwh4CHkIegh7CHwIfQh+CH8IgAiBCIIIgwiECIUIhgiHCIgIiQiKCIsIjAiNCI4IjwiQCJEIkgiTCJQIlQiWCJcImAiZCJoImwicCJ0IngifCKAIoQiiCKMIpAilCKYIpwioCKkIqgirCKwIrQiuCK8IsAixCLIIswi0CLUItgi3CLgIuQi6CLsIvAi9CL4IvwjACMEIwgjDCMQIxQjGCMcIyAjJCMoIywjMCM0IzgjPCNAI0QjSCNMI1AjVCNYI1wjYCNkI2gjbCNwI3QjeCN8I4AjhCOII4wjkCOUI5gjnCOgI6QjqCOsI7AjtCO4I7wjwCPEI8gjzCPQI9Qj2CPcI+Aj5CPoI+wj8CP0I/gj/CAAJAQkCCQMJBAkFCQYJBwkICQkJCgkLCQwJDQkOCQ8JEAkRCRIJEwkUCRUJFgkXCRgJGQkaCRsJHAkdCR4JHwkgCSEJIgkjCSQJJQkmCScJKAkpCSoJKwksCS0JLgkvCTAJMQkyCTMJNAk1CTYJNwk4CTkJOgk7CTwJPQk+CT8JQAlBCUIJQwlECUUJRglHCUgJSQlKCUsJTAlNCU4JTwlQCVEJUglTCVQJVQlWCVcJWAlZCVoJWwlcCV0JXglfCWAJYQliCWMJZAllCWYJZwloCWkJaglrCWwJbQluCW8JcAlxCXIJcwl0CXUJdgl3CXgJeQl6CXsJfAl9CX4JfwmACYEJggmDCYQJhQmGCYcJiAmJCYoJiwmMCY0JjgmPCZAJkQmSCZMJlAmVCZYJlwmYCZkJmgmbCZwJnQmeCZ8JoAmhCaIJowmkCaUJpgmnCagJqQmqCasJrAmtCa4JrwmwCbEJsgmzCbQJtQm2CbcJuAm5CboJuwm8Cb0Jvgm/CcAJwQnCCcMJxAnFCcYJxwnICckJygnLCcwJzQnOCc8J0AnRCdIJ0wnUCdUJ1gnXCdgJ2QnaCdsJ3AndCd4J3wngCeEJ4gnjCeQJ5QnmCecJ6AnpCeoJ6wnsCe0J7gnvCfAJ8QnyCfMJ9An1CfYJ9wn4CfkJ+gn7CfwJ/Qn+Cf8JAAoBCgIKAwoECgUKBgoHCggKCQoKCgsKDAoNCg4KDwoQChEKEgoTChQKFQoWChcKGAoZChoKGwocCh0KHgofCiAKIQoiCiMKJAolCiYKJwooCikKKgorCiwKLQouCi8KMAoxCjIKMwo0CjUKNgo3CjgKOQo6CjsKPAo9Cj4KPwpACkEKQgpDCkQKRQpGCkcKSApJCkoKSwpMCk0KTgpPClAKUQpSClMKVApVClYKVwpYClkKWgpbClwKXQpeCl8KYAphCmIKYwpkCmUKZgpnCmgKaQpqCmsKbAptCm4KbwpwCnEKcgpzCnQKdQp2CncKeAp5CnoKewp8Cn0Kfgp/CoAKgQqCCoMKhAqFCoYKhwqICokKigqLCowKjQqOCo8KkAqRCpIKkwqUCpUKlgqXCpgKmQqaCpsKnAqdCp4KnwqgCqEKogqjCqQKpQqmCqcKqAqpCqoKqwqsCq0KrgqvCrAKsQqyCrMKtAq1CrYKtwq4CrkKugq7CrwKvQq+Cr8KwArBCsIKwwrECsUKxgrHCsgKyQrKCssKzArNCs4KzwrQCtEK0grTCtQK1QrWCtcK2ArZCtoK2wrcCt0K3grfCuAK4QriCuMK5ArlCuYK5wroCukK6grrCuwK7QruCu8K8ArxCvIK8wr0CvUK9gr3CvgK+Qr6CvsK/Ar9Cv4K/woACwELAgsDCwQLBQsGCwcLCAsJCwoLCwsMCw0LDgsPCxALEQsSCxMLFAsVCxYLFwsYCxkLGgsbCxwLHQseCx8LIAshCyILIwskCyULJgsnCygLKQsqCysLLAstCy4LLwswCzELMgszCzQLNQs2CzcLOAs5CzoLOws8Cz0LPgtAC0ELQgtDC0QLRQtGC0cLSAtJC0oLSwtMC00LTgtPC1ALUQtSC1MLVAtVC1YLVwtYC1kLWgtbC1wLXQteC18LYAthC2ILYwtkC2ULZgtnC2gLaQtqC2sLbAttC24LbwtwC3ELcgtzC3QLdQt2C3cLeAt5C3oLewt8C30Lfgt/C4ALgQuCC4MLhAuFC4YLhwuIC4kLiguLC4wLjQuOC48LkAuRC5ILkwuUC5ULlguXC5gLmQuaC5sLnAudC54LnwugC6ELogujC6QLpQumC6cLqAupC6oLqwusC60LrguvC7ALsQuyC7MLtAu1C7YLtwu4C7kLugu7C7wLvQu+C78LwAvBC8ILwwvEC8ULxgvHC8gLyQvKC8sLzAvNC84LzwvQC9EL0gvTC9QL1QvWC9cL2AvZC9oL2wvcC90L3gvfC+AL4QviC+ML5AvlC+YL5wvoC+kL6gvrC+wL7QvuC+8L8AvxC/IL8wv0C/UL9gv3C/gL+Qv6C/sL/Av9C/4L/wsADAEMAgwDDAQMBQwGDAcMCAwJDAoMCwwMDA0MDgwPDBAMEQwSDBMMFAwVDBYMFwwYDBkMGgwbDBwMHQweDB8MIAwhDCIMIwwkDCUMJgwnDCgMKQwqDCsMLAwtDC4MLwwwDDEMMgwzDDQMNQw2DDcMOAw5DDoMOww8DD0MPgw/DEAMQQxCDEMMRAxFDEYMRwxIDEkMSgxLDEwMTQxODE8MUAxRDFIMUwxUDFUMVgxXDFgMWQxaDFsMXAxdDF4MXwxgDGEMYgxjDGQMZQxmDGcMaAxpDGoMawxsDG0MbgxvDHAMcQxyDHMMdAx1DHYMdwx4DHkMegx7DHwMfQx+DH8MgAyBDIIMgwyEDIUMhgyHDIgMiQyKDIsMjAyNDI4MjwyQDJEMkgyTDJQMlQyWDJcMmAyZDJoMmwycDJ0MngyfDKAMoQyiDKMMpAylDKYMpwyoDKkMqgyrDKwMrQyuDK8MsAyxDLIMswy0DLUMtgy3DLgMuQy6DLsMvAy9DL4MvwzADMEMwgzDDMQMxQzGDMcMyAzJDMoMywzMDM0MzgzPDNAM0QzSDNMM1AzVDNYM1wzYDNkM2gzbDNwM3QzeDN8M4AzhDOIM4wzkDOUM5gznDOgM6QzqDOsM7AztDO4M7wzwDPEM8gzzDPQM9Qz2DPcM+Az5DPoM+wz8DP0M/gz/DAANAQ0CDQMNBA0FDQYNBw0IDQkNCg0LDQwNDQ0ODQ8NEA0RDRINEw0UDRUNFg0XDRgNGQ0aDRsNHA0dDR4NHw0gDSENIg0jDSQNJQ0mDScNKA0pDSoNKw0sDS0NLg0vDTANMQ0yDTMNNA01DTYNNw04DTkNOg07DTwNPQ0+DT8NQA1BDUINQw1EDUUNRg1HDUgNSQ1KDUsNTA1NDU4NTw1QDVENUg1TDVQNVQ1WDVcNWA1ZDVoNWw1cDV0NXg1fDWANYQ1iDWMNZA1lDWYNZw1oDWkNag1rDWwNbQ1uDW8NcA1xDXINcw10DXUNdg13DXgNeQ16DXsNfA19DX4Nfw2ADYENgg2DDYQNhQ2GDYcNiA2JDYoNiw2MDY0Njg2PDZANkQ2SDZMNlA2VDZYNlw2YDZkNmg2bDZwNnQ2eDZ8NoA2hDaINow2kDaUNpg2nDagNqQ2qDasNrA2tDa4Nrw2wDbENsg2zDbQNtQ22DbcNuA25DboNuw28Db0Nvg2/DcANwQ3CDcMNxA3FDcYNxw3IDckNyg3LDcwNzQ3ODc8N0A3RDdIN0w3UDdUN1g3XDdgN2Q3aDdsN3A3dDd4N3w3gDeEN4g3jDeQN5Q3mDecN6A3pDeoN6w3sDe0N7g3vDfAN8Q3yDfMN9A31DfYN9w34DfkN+g37DfwN/Q3+Df8NAA4BDgIOAw4EDgUOBg4HDggOCQ4KDgsODA4NDg4ODw4QDhEOEg4TDhQOFQ4WDhcOGA4ZDhoOGw4cDh0OHg4fDiAOIQ4iDiMOJA4lDiYOJw4oDikOKg4rDiwOLQ4uDi8OMA4xDjIOMw40DjUONg43DjgOOQ46DjsOPA49Dj4OPw5ADkEOQg5DDkQORQ5GDkcOSA5JDkoOSw5MDk0OTg5PDlAOUQ5SDlMOVA5VDlYOVw5YDlkOWg5bDlwOXQ5eDl8OYA5hDmIOYw5kDmUOZg5nDmgOaQ5qDmsObA5tDm4Obw5wDnEOcg5zDnQOdQ52DncOeA55DnoOew58Dn0Ofg5/DoAOgQ6CDoMOhA6FDoYOhw6IDokOig6LDowOjQ6ODo8OkA6RDpIOkw6UDpUOlg6XDpgOmQ6aDpsOnA6dDp4Onw6gDqEOog6jDqQOpQ6mDqcOqA6pDqoOqw6sDq0Org6vDrAOsQ6yDrMOtA61DrYOtw64DrkOug67DrwOvQ6+Dr8OwA7BDsIOww7EDsUOxg7HDsgOyQ7KDssOzA7NDs4Ozw7QDtEO0g7TDtQO1Q7WDtcO2A7ZDtoO2w7cDt0O3g7fDuAO4Q7iDuMO5A7lDuYO5w7oDukO6g7rDuwO7Q7uDu8O8A7xDvIO8w70DvUO9g73DvgO+Q76DvsO/A79Dv4O/w4ADwEPAg8DDwQPBQ8GDwcPCA8JDwoPCw8MDw0PDg8PDxAPEQ8SDxMPFA8VDxYPFw8YDxkPGg8bDxwPHQ8eDx8PIA8hDyIPIw8kDyUPJg8nDygPKQ8qDysPLA8tDy4PLw8wDzEPMg8zDzQPNQ82DzcPOA85DzoPOw88Dz0PPg8/D0APQQ9CD0MPRA9FD0YPRw9ID0kPSg9LD0wPTQ9OD08PUA9RD1IPUw9UD1UPVg9XD1gPWQ9aD1sPXA9dD14PXw9gD2EPYg9jD2QPZQ9mD2cPaA9pD2oPaw9sD20Pbg9vD3APcQ9yD3MPdA91D3YPdw94D3kPeg97D3wPfQ9+D38PgA+BD4IPgw+ED4UPhg+HD4gPiQ+KD4sPjA+ND44Pjw+QD5EPkg+TD5QPlQ+WD5cPmA+ZD5oPmw+cD50Png+fD6APoQ+iD6MPpA+lD6YPpw+oD6kPqg+rD6wPrQ+uD68PsA+xD7IPsw+0D7UPtg+3D7gPuQ+6D7sPvA+9D74Pvw/AD8EPwg/DD8QPxQ/GD8cPyA/JD8oPyw/MD80Pzg/PD9AP0Q/SD9MP1A/VD9YP1w/YD9kP2g/bD9wP3Q/eD98P4A/hD+IP4w/kD+UP5g/nD+gP6Q/qD+sP7A/tD+4P7w/wD/EP8g/zD/QP9Q/2D/cP+A/5D/oP+w/8D/0P/g//DwAAACkMQAE7PvCLYfLRYhpgLW5aqXEbbvk/G5V99HNcXhIUTaUO7hET1SLxEQAAAAUJAAB1MAAAAAkH0+xdTFpk3Ts= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAQAAAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T14:07:00.622044198+05:30 + ResTimestampMock: 2026-05-11T14:07:00.6702548+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-102 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:01.439712242+05:30 + ResTimestampMock: 2026-05-11T14:07:01.481569631+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-103 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:01.481955302+05:30 + ResTimestampMock: 2026-05-11T14:07:01.524299662+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-104 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:02.528863747+05:30 + ResTimestampMock: 2026-05-11T14:07:02.57166832+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-105 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:02.572069778+05:30 + ResTimestampMock: 2026-05-11T14:07:02.614428253+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-106 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:03.617747732+05:30 + ResTimestampMock: 2026-05-11T14:07:03.659423302+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-107 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:03.659969315+05:30 + ResTimestampMock: 2026-05-11T14:07:03.70127773+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-108 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:04.705131452+05:30 + ResTimestampMock: 2026-05-11T14:07:04.747806316+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-109 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:04.748436998+05:30 + ResTimestampMock: 2026-05-11T14:07:04.790346538+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-110 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:05.794936296+05:30 + ResTimestampMock: 2026-05-11T14:07:05.83622022+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-111 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:05.836288231+05:30 + ResTimestampMock: 2026-05-11T14:07:05.879387735+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-112 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9D8CBBBBACB36" + info_kind: unknown + raw_body: bm9kZQlCQjlEOENCQkJCQUNCMzYKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T14:07:06.883951463+05:30 + ResTimestampMock: 2026-05-11T14:07:06.925271318+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-113 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T14:07:06.925427556+05:30 + ResTimestampMock: 2026-05-11T14:07:06.968629754+05:30 diff --git a/aerospike-tls/keploy/test-set-0/tests/delete-key-alice-1.yaml b/aerospike-tls/keploy/test-set-0/tests/delete-key-alice-1.yaml new file mode 100644 index 00000000..40b1baf3 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/delete-key-alice-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: delete-key-alice-1 +spec: + metadata: {} + req: + method: DELETE + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/key/alice + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T14:06:37.566975709+05:30 + resp: + status_code: 200 + header: + Content-Length: "17" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:37 GMT + body: | + {"deleted":true} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:37.609667813+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488597 + app_port: 8090 +curl: | + curl --request DELETE \ + --url http://127.0.0.1:8090/key/alice \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/get-batch-get-1.yaml b/aerospike-tls/keploy/test-set-0/tests/get-batch-get-1.yaml new file mode 100644 index 00000000..dfc9d0dd --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/get-batch-get-1.yaml @@ -0,0 +1,46 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: get-batch-get-1 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/batch/get?k=a&k=b + url_params: + k: a, b + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T14:06:28.485756451+05:30 + resp: + status_code: 500 + header: + Content-Length: "304" + Content-Type: text/plain; charset=utf-8 + Date: Mon, 11 May 2026 08:36:29 GMT + X-Content-Type-Options: nosniff + body: | + ResultCode: TIMEOUT, Iteration: 1, InDoubt: false, Node: BB9D8CBBBBACB36 127.0.0.1:3001: command execution timed out on client: See `Policy.Timeout` + ResultCode: TIMEOUT, Iteration: 0, InDoubt: false, Node: BB9D8CBBBBACB36 127.0.0.1:3001: Timeout + read tcp 127.0.0.1:50236->127.0.0.1:3001: i/o timeout + status_message: Internal Server Error + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:29.490010468+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488589 + app_port: 8090 +curl: | + curl --request GET \ + --url http://127.0.0.1:8090/batch/get?k=a&k=b \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml b/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml new file mode 100644 index 00000000..ad074958 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: get-get-alice-1 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/get/alice + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T14:06:26.337947982+05:30 + resp: + status_code: 200 + header: + Content-Length: "26" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:26 GMT + body: | + {"age":30,"name":"Alice"} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:26.381983885+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488586 + app_port: 8090 +curl: | + curl --request GET \ + --url http://127.0.0.1:8090/get/alice \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml new file mode 100644 index 00000000..37a06567 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: get-health-1 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/health + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T14:06:25.267608531+05:30 + resp: + status_code: 200 + header: + Content-Length: "32" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:25 GMT + body: | + {"namespaces":"test","nodes":1} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:25.268882767+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488585 + app_port: 8090 +curl: | + curl --request GET \ + --url http://127.0.0.1:8090/health \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml new file mode 100644 index 00000000..13c602a1 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-batch-put-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/batch/put + header: + Accept: '*/*' + Content-Length: "55" + Content-Type: application/x-www-form-urlencoded + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: '[{"key":"a","bins":{"n":1}},{"key":"b","bins":{"n":2}}]' + timestamp: 2026-05-11T14:06:27.391618301+05:30 + resp: + status_code: 200 + header: + Content-Length: "14" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:27 GMT + body: | + {"written":2} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:27.476590033+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488587 + app_port: 8090 +curl: |- + curl --request POST \ + --url http://127.0.0.1:8090/batch/put \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --header 'Host: 127.0.0.1:8090' \ + --data "[{\"key\":\"a\",\"bins\":{\"n\":1}},{\"key\":\"b\",\"bins\":{\"n\":2}}]" diff --git a/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml new file mode 100644 index 00000000..399ca2bb --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-put-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/put + header: + Accept: '*/*' + Content-Length: "48" + Content-Type: application/x-www-form-urlencoded + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: '{"key":"alice","bins":{"age":30,"name":"Alice"}}' + timestamp: 2026-05-11T14:06:25.275482695+05:30 + resp: + status_code: 200 + header: + Content-Length: "16" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:25 GMT + body: | + {"status":"ok"} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:25.327629738+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488585 + app_port: 8090 +curl: |- + curl --request POST \ + --url http://127.0.0.1:8090/put \ + --header 'Content-Type: application/x-www-form-urlencoded' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ + --data "{\"key\":\"alice\",\"bins\":{\"age\":30,\"name\":\"Alice\"}}" diff --git a/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml new file mode 100644 index 00000000..ebf32759 --- /dev/null +++ b/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-touch-alice-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/touch/alice + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T14:06:36.511778713+05:30 + resp: + status_code: 200 + header: + Content-Length: "21" + Content-Type: application/json + Date: Mon, 11 May 2026 08:36:36 GMT + body: | + {"status":"touched"} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T14:06:36.558020606+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778488596 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/touch/alice \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/mocks.yaml b/aerospike-tls/keploy/test-set-1/mocks.yaml new file mode 100644 index 00000000..1d0319b5 --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/mocks.yaml @@ -0,0 +1,8820 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-0 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:15.094099667+05:30 + ResTimestampMock: 2026-05-11T15:08:15.134870927+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-1 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:08:15.135424237+05:30 + ResTimestampMock: 2026-05-11T15:08:15.177802699+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-2 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:15.184588645+05:30 + ResTimestampMock: 2026-05-11T15:08:15.225962614+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-3 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:15.226102715+05:30 + ResTimestampMock: 2026-05-11T15:08:15.268804124+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-4 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:08:15.269564996+05:30 + ResTimestampMock: 2026-05-11T15:08:15.311383418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-5 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:15.312817434+05:30 + ResTimestampMock: 2026-05-11T15:08:15.35556731+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-6 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:15.356112243+05:30 + ResTimestampMock: 2026-05-11T15:08:15.39794675+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-7 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm7Z8HoDojq5sExP90yq0/vy0Es= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.407462339+05:30 + ResTimestampMock: 2026-05-11T15:08:15.448959281+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-8 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEyjW+uSujaSSpLkvcjJx526MXP3s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.449045521+05:30 + ResTimestampMock: 2026-05-11T15:08:15.490449226+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-9 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUbk90BIccGQEzT0EjCjmPuTdfbY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.491085737+05:30 + ResTimestampMock: 2026-05-11T15:08:15.533838609+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-10 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELk9B6gLZul7w3rZUkdLt3oCk8Mc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.534492664+05:30 + ResTimestampMock: 2026-05-11T15:08:15.57815772+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-11 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+u0Wl6Zbe+2U56imaXcc4pDGlEY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.578323925+05:30 + ResTimestampMock: 2026-05-11T15:08:15.620354346+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-12 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdoIqKZd8llL4FjreA3uX8Sa1VxI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.62078845+05:30 + ResTimestampMock: 2026-05-11T15:08:15.663748557+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-13 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUESa3CiabUr9TS3DOSFtRvW9PL6Sc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.664188435+05:30 + ResTimestampMock: 2026-05-11T15:08:15.706486509+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-14 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/RcjySXX6UJuuZyoQFB+/jFe0M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.707204725+05:30 + ResTimestampMock: 2026-05-11T15:08:15.749383267+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-15 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeCqzmqhoxj5KH8h3hUosBTY5fOA= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.750122272+05:30 + ResTimestampMock: 2026-05-11T15:08:15.792985069+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-16 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcHz2ThFz5IG0rOFzA3OHLsZ7VvM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.765784789+05:30 + ResTimestampMock: 2026-05-11T15:08:15.806877579+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-17 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3vg7UwLzyPVPuB6KgYgYLMrl320= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.766406302+05:30 + ResTimestampMock: 2026-05-11T15:08:15.807837707+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-18 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIp7YXQBKMDd878u1aM5Xd5xpRXU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.768124736+05:30 + ResTimestampMock: 2026-05-11T15:08:15.809697681+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-19 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUiAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEhNj2vZ5iG/o+5sVovV9pTgLKvco= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.770269362+05:30 + ResTimestampMock: 2026-05-11T15:08:15.810860345+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-20 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFnJdVIgGp5T+nXxVkFrPL6qW3zs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.769248911+05:30 + ResTimestampMock: 2026-05-11T15:08:15.810860425+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-21 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfoeVd8un+Ruyu1/RbStzNIpB4i8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.768021947+05:30 + ResTimestampMock: 2026-05-11T15:08:15.810916457+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-22 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkxDg97mW8wzTJku+YctR+hSR7pE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.770211721+05:30 + ResTimestampMock: 2026-05-11T15:08:15.810945226+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-23 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEuFyUPdp5uhobFE9ERfp0xak7Zpc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.769944174+05:30 + ResTimestampMock: 2026-05-11T15:08:15.81097327+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-24 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcCSkDCRS7ntdSxqs9rrh3xpFWuY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.769562027+05:30 + ResTimestampMock: 2026-05-11T15:08:15.810980374+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-25 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AuK1AqTddC1uICi6xezW2B+pXs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.769876134+05:30 + ResTimestampMock: 2026-05-11T15:08:15.811927659+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-26 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUlAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGJ7MitZe3Ggl/3+VMYcsOP1gJSY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.771114541+05:30 + ResTimestampMock: 2026-05-11T15:08:15.811989817+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-27 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+hZY9lzv+F8AI3Q+fK4kms28mUY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.770748323+05:30 + ResTimestampMock: 2026-05-11T15:08:15.812005638+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-28 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVuBZop6gxSc1AqAZgR656D6is0A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.779963218+05:30 + ResTimestampMock: 2026-05-11T15:08:15.822917749+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-29 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7uGPnFz6/JTw2eY2BOa1I4hp+2g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.788848649+05:30 + ResTimestampMock: 2026-05-11T15:08:15.829900855+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-30 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzuT6goK4w2WA6FItl7L/rK+jgJo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.788438784+05:30 + ResTimestampMock: 2026-05-11T15:08:15.831225671+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-31 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4n+knG98esZS5Yb7OZZi2sNpENM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.788440087+05:30 + ResTimestampMock: 2026-05-11T15:08:15.831857052+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-32 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE25G6l2Ks35hkEEM19gdQD5nyft4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.789454094+05:30 + ResTimestampMock: 2026-05-11T15:08:15.831944249+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-33 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvkBTJHi1UdvMEzG558Eq7ZofNVw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.791054593+05:30 + ResTimestampMock: 2026-05-11T15:08:15.832599578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-34 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6PRXbuHynEfQsryFas9bYawoGd4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.792101855+05:30 + ResTimestampMock: 2026-05-11T15:08:15.83269393+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-35 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEL5XfeNiO/E/EOcZzydKOBEKz/z0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.791722552+05:30 + ResTimestampMock: 2026-05-11T15:08:15.832720659+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-36 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEktDyftO1+p/jx06GYn+eAiE9Qos= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.791447253+05:30 + ResTimestampMock: 2026-05-11T15:08:15.832727748+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-37 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/oKHaTSUAtQIHEKEJpx9xqBklc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.792087223+05:30 + ResTimestampMock: 2026-05-11T15:08:15.832738176+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-38 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE764awLdaGMTMQKwPNItoaxebDrI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.788514134+05:30 + ResTimestampMock: 2026-05-11T15:08:15.832820677+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-39 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEiV2n29yj1tTyBOAQpR3jD9B99BM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.792911602+05:30 + ResTimestampMock: 2026-05-11T15:08:15.833716404+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-40 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFIDeQlHYxiq6MekYWEpT9f5hB8U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.792624493+05:30 + ResTimestampMock: 2026-05-11T15:08:15.834944419+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-41 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUElc0WFcO2m+uxVRQr/E1Dyhv/HcY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.793239963+05:30 + ResTimestampMock: 2026-05-11T15:08:15.834952464+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-42 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZioxhu1q7P1hMzcmS/wTuTE6dHI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.794472234+05:30 + ResTimestampMock: 2026-05-11T15:08:15.835820325+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-43 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUECzKdb8zf/y77ElQT0q53OW17Mvg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.796863655+05:30 + ResTimestampMock: 2026-05-11T15:08:15.837971607+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-44 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/+ahIZTsC8XT2nTJyK4IIngLubs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.796777274+05:30 + ResTimestampMock: 2026-05-11T15:08:15.838010739+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-45 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEelzl+o/cOX38GpPGcdnXDijYl8M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:15.799963066+05:30 + ResTimestampMock: 2026-05-11T15:08:15.841727976+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-46 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:16.398761866+05:30 + ResTimestampMock: 2026-05-11T15:08:16.44028297+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-47 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:16.440745787+05:30 + ResTimestampMock: 2026-05-11T15:08:16.482807963+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-48 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEsQYK1+nDliXATczhHtFqPyB+fxw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.800545288+05:30 + ResTimestampMock: 2026-05-11T15:08:16.842253144+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-49 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEgtypEIIP2pJn1ELAXabfAb24JGk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.800759624+05:30 + ResTimestampMock: 2026-05-11T15:08:16.842254515+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-50 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKMRc+hiEhwC9MWup9R2MiKKgk34= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.800815309+05:30 + ResTimestampMock: 2026-05-11T15:08:16.842301454+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-51 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETSaNkFILKbNgj8iCCG4LDy98QSU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.80054538+05:30 + ResTimestampMock: 2026-05-11T15:08:16.84229638+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-52 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7wS8Va9ccFZOoD7lVMRXbKf4z0g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.803724522+05:30 + ResTimestampMock: 2026-05-11T15:08:16.845011807+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-53 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDJEUpkgUCt8k8KoUp0DTPoyT5Rw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.803511573+05:30 + ResTimestampMock: 2026-05-11T15:08:16.845031683+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-54 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqqA46Dtokv802UZc5Oca5vM3sMs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.803008136+05:30 + ResTimestampMock: 2026-05-11T15:08:16.845085679+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-55 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYIrzLeAUTzYZEfjyirsgWPJW07M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.802869957+05:30 + ResTimestampMock: 2026-05-11T15:08:16.846301523+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-56 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHERAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3YgNabidB3m4T8X0iM5TUnT+qnY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.806922796+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849605489+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-57 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHEQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVXMxpB2zL6pyIh1YsthkL8ISlUE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.808152385+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849760015+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-58 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHEaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEsEfmx49lzZY7ihyhZwAggC1myfU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.808368756+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849954585+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-59 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHEPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2Hce5mS+SRp4X6oRj/zhtdg0k6M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.808354911+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849966888+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-60 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHEOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2HHs+PA+07pTLn5jq0b8Mn27jSg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.808375639+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849953009+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-61 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHEVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7LeYYlrf6bvohLp5W/5kY8HzDmM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:16.808354765+05:30 + ResTimestampMock: 2026-05-11T15:08:16.849966942+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-62 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:17.484190423+05:30 + ResTimestampMock: 2026-05-11T15:08:17.527936501+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-63 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:17.528586579+05:30 + ResTimestampMock: 2026-05-11T15:08:17.570001076+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-64 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwrVFuoSqePBd4HGZDdQJEBGzvck= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.823803274+05:30 + ResTimestampMock: 2026-05-11T15:08:17.865380072+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-65 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZfG/i/i3Of1GOvaQbGNIBKTSaCg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.82386119+05:30 + ResTimestampMock: 2026-05-11T15:08:17.86612574+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-66 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETres2lCD6qj6CWNaiz48TbC1iRs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.823799664+05:30 + ResTimestampMock: 2026-05-11T15:08:17.866125605+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-67 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfVSZb4nrpUQ6IYmnsvfbD+fKWwI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.826393361+05:30 + ResTimestampMock: 2026-05-11T15:08:17.867655882+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-68 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjz1PE3036rbk/ubHRSDNkyKnj4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.82640228+05:30 + ResTimestampMock: 2026-05-11T15:08:17.867753283+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-69 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHQ46JSEZ597WemoXtNTj12l8prY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.826069689+05:30 + ResTimestampMock: 2026-05-11T15:08:17.867819948+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-70 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAnKrVebX6Z/hxinN8eJshnB1lEo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.826316509+05:30 + ResTimestampMock: 2026-05-11T15:08:17.868226131+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-71 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUERr4ANKatEvHcx+j558LxopMdjKc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.82631646+05:30 + ResTimestampMock: 2026-05-11T15:08:17.868321864+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-72 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu0wwQ8xl+zBaA1sxGHqEfBNGPYo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:17.826426679+05:30 + ResTimestampMock: 2026-05-11T15:08:17.86833519+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-73 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxHAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQY9aD49BW9kYI1oFfsh7JZyNZnQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033779025+05:30 + ResTimestampMock: 2026-05-11T15:08:18.074975242+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-74 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxJAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUaTnYhEbMCoV4lSftpOW6L8oZ30= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033723226+05:30 + ResTimestampMock: 2026-05-11T15:08:18.074975072+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-75 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxEAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKjrYJHZ0fhzBaxg5vp06IBhcOyg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033688005+05:30 + ResTimestampMock: 2026-05-11T15:08:18.075015791+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-76 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxHAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpl+duSGuhkZvEJdtWlmtxwcXJZA= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033675156+05:30 + ResTimestampMock: 2026-05-11T15:08:18.07503187+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-77 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxGAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEaZBs4AGhoU7luWwEni90LxgWPM0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033708799+05:30 + ResTimestampMock: 2026-05-11T15:08:18.07502697+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-78 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxGAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEthZJrs97U1So2VXs2/TJZNZllQs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.0337784+05:30 + ResTimestampMock: 2026-05-11T15:08:18.075134578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-79 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfCxw5iFpLedvWrNf/Jcq2UtWHPU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033768564+05:30 + ResTimestampMock: 2026-05-11T15:08:18.075230383+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-80 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxIAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAIdgviivFMWUmbxGWHtXOmwGwt8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033675141+05:30 + ResTimestampMock: 2026-05-11T15:08:18.075230513+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-81 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxFAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEknpy17QJxd6R+UIoxfw5uiOJAhI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.033768313+05:30 + ResTimestampMock: 2026-05-11T15:08:18.075265292+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-82 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAGxEAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJoF4v/5insbDuZmjBybfklzGsLw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:18.038703575+05:30 + ResTimestampMock: 2026-05-11T15:08:18.080901048+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-83 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:18.571183634+05:30 + ResTimestampMock: 2026-05-11T15:08:18.613330972+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-84 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:18.613525998+05:30 + ResTimestampMock: 2026-05-11T15:08:18.655290405+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-85 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:19.655651536+05:30 + ResTimestampMock: 2026-05-11T15:08:19.697672994+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-86 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:19.69789115+05:30 + ResTimestampMock: 2026-05-11T15:08:19.74036841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-87 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:20.741213909+05:30 + ResTimestampMock: 2026-05-11T15:08:20.783177578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-88 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:20.783344194+05:30 + ResTimestampMock: 2026-05-11T15:08:20.825912422+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-89 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:21.826958211+05:30 + ResTimestampMock: 2026-05-11T15:08:21.868529704+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-90 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:21.868789585+05:30 + ResTimestampMock: 2026-05-11T15:08:21.910060874+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-91 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:22.911526174+05:30 + ResTimestampMock: 2026-05-11T15:08:22.953535019+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-92 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:22.953677477+05:30 + ResTimestampMock: 2026-05-11T15:08:22.996561321+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-93 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:23.998127004+05:30 + ResTimestampMock: 2026-05-11T15:08:24.040476636+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-94 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:24.040949351+05:30 + ResTimestampMock: 2026-05-11T15:08:24.082598664+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-95 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:25.083518441+05:30 + ResTimestampMock: 2026-05-11T15:08:25.125645816+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-96 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:25.126249528+05:30 + ResTimestampMock: 2026-05-11T15:08:25.169446119+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-97 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:26.169934202+05:30 + ResTimestampMock: 2026-05-11T15:08:26.212295144+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-98 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:26.212367217+05:30 + ResTimestampMock: 2026-05-11T15:08:26.252767849+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-99 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:27.253872705+05:30 + ResTimestampMock: 2026-05-11T15:08:27.295550018+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-100 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:27.295658546+05:30 + ResTimestampMock: 2026-05-11T15:08:27.337376382+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-101 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:28.33889236+05:30 + ResTimestampMock: 2026-05-11T15:08:28.381354067+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-102 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:28.381713985+05:30 + ResTimestampMock: 2026-05-11T15:08:28.423536689+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-103 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:29.42402774+05:30 + ResTimestampMock: 2026-05-11T15:08:29.465850014+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-104 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:29.466381385+05:30 + ResTimestampMock: 2026-05-11T15:08:29.508531733+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-105 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+9T4kIC9uEWoHUHpyrRfeVxWWGcAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4x + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.844461853+05:30 + ResTimestampMock: 2026-05-11T15:08:29.887107256+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-106 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUELFOL/Kge3l3sPdQOVrRKgiFHx5oAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW4x + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.844506356+05:30 + ResTimestampMock: 2026-05-11T15:08:29.88724793+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-107 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP+0J0iXd+gOukOofPpNqmlccDcYAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4x + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.844505877+05:30 + ResTimestampMock: 2026-05-11T15:08:29.887309196+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-108 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtnPiAy8ss4/5niQj5pe4IJkazkQAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4x + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.844461798+05:30 + ResTimestampMock: 2026-05-11T15:08:29.887409801+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-109 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP+0J0iXd+gOukOofPpNqmlccDcY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjE= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.887332377+05:30 + ResTimestampMock: 2026-05-11T15:08:29.928217096+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-110 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELFOL/Kge3l3sPdQOVrRKgiFHx5o= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjE= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.887289204+05:30 + ResTimestampMock: 2026-05-11T15:08:29.928659193+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-111 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtnPiAy8ss4/5niQj5pe4IJkazkQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjE= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.887471282+05:30 + ResTimestampMock: 2026-05-11T15:08:29.929361743+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-112 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+9T4kIC9uEWoHUHpyrRfeVxWWGc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjE= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:29.887387718+05:30 + ResTimestampMock: 2026-05-11T15:08:29.930575031+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-113 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:30.509646465+05:30 + ResTimestampMock: 2026-05-11T15:08:30.551645965+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-114 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:30.551750185+05:30 + ResTimestampMock: 2026-05-11T15:08:30.593294795+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-115 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:31.594008115+05:30 + ResTimestampMock: 2026-05-11T15:08:31.637606585+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-116 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:31.638009453+05:30 + ResTimestampMock: 2026-05-11T15:08:31.679120403+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-117 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE283bj3osBukXFdp/sILehSUYCRUAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941335057+05:30 + ResTimestampMock: 2026-05-11T15:08:31.983642816+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-118 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDKGY3izaRm4vm2pFvWl/vvQAnQ0AAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.94135248+05:30 + ResTimestampMock: 2026-05-11T15:08:31.983637701+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-119 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeM63vWofhmXb99Np7t1gYEM2boAAAAAPAgEAA2lkeAAAAAAAAAAHAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941437483+05:30 + ResTimestampMock: 2026-05-11T15:08:31.983646873+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-120 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+n//VDIJF+S0JkGY3qlZAS+WEa4AAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941414494+05:30 + ResTimestampMock: 2026-05-11T15:08:31.984096656+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-121 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9WHojh3iZAw+HziwhDN1r66C20IAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941438847+05:30 + ResTimestampMock: 2026-05-11T15:08:31.984093873+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-122 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEd8m9P8Klr3XpPtuN9yjk5Nr1s4cAAAAPAgEAA2lkeAAAAAAAAAAFAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941378958+05:30 + ResTimestampMock: 2026-05-11T15:08:31.984125345+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-123 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnNvGFpckWb1Nuve1r2Ox8Zz/3MoAAAALAgMAA3RhZ3J1bjIAAAAPAgEAA2lkeAAAAAAAAAAD + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941577187+05:30 + ResTimestampMock: 2026-05-11T15:08:31.984127153+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-124 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQmEKvnS/duo8rsgUvySnylY073AAAAAPAgEAA2lkeAAAAAAAAAAEAAAACwIDAAN0YWdydW4y + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.941395787+05:30 + ResTimestampMock: 2026-05-11T15:08:31.98489336+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-125 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE283bj3osBukXFdp/sILehSUYCRU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.983743292+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025225582+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-126 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeM63vWofhmXb99Np7t1gYEM2boA= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.9837592+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025324757+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-127 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEd8m9P8Klr3XpPtuN9yjk5Nr1s4c= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.984233677+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025401394+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-128 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDKGY3izaRm4vm2pFvWl/vvQAnQ0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.983750588+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025616059+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-129 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+n//VDIJF+S0JkGY3qlZAS+WEa4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.984246835+05:30 + ResTimestampMock: 2026-05-11T15:08:32.02563715+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-130 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnNvGFpckWb1Nuve1r2Ox8Zz/3Mo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.984234536+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025679548+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-131 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9WHojh3iZAw+HziwhDN1r66C20I= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.984253267+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025685461+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-132 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQmEKvnS/duo8rsgUvySnylY073A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjI= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:31.984954466+05:30 + ResTimestampMock: 2026-05-11T15:08:32.025735213+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-133 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:32.68014683+05:30 + ResTimestampMock: 2026-05-11T15:08:32.722619152+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-134 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:32.723097396+05:30 + ResTimestampMock: 2026-05-11T15:08:32.76411118+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-135 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:33.764798817+05:30 + ResTimestampMock: 2026-05-11T15:08:33.807196264+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-136 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:33.807294221+05:30 + ResTimestampMock: 2026-05-11T15:08:33.848102722+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-137 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKL3FE+e59PbajRwhKH7S12Jey1UAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAF + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035923378+05:30 + ResTimestampMock: 2026-05-11T15:08:34.076985412+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-138 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnXkUSzOT/QCNUokxIsLggNqB1coAAAAPAgEAA2lkeAAAAAAAAAAHAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.03588514+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077069873+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-139 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4Msyj6xM3TAg1XHuV8317rFCtVEAAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035875942+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077082862+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-140 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEajBifl9epW4pmiGJs+OXfY7rxAQAAAAPAgEAA2lkeAAAAAAAAAAKAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035931513+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077164092+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-141 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGRlCDASH1q/mf+WZaPTn135AV2sAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035943725+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077430957+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-142 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvLSxmBcOpQAoZMxtAS56J0OSw/UAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035884935+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077601941+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-143 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqoNYQ1HlcKcchY9nGICOniNZdvkAAAAPAgEAA2lkeAAAAAAAAAAJAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035836501+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077702404+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-144 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFYN84OKf+CxFTAmRU9hjaKZu7mMAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAL + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.03590646+05:30 + ResTimestampMock: 2026-05-11T15:08:34.07783004+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-145 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEitH7ZTrXVs2FvZ3MrbxbIh/BuiEAAAAPAgEAA2lkeAAAAAAAAAAIAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035836507+05:30 + ResTimestampMock: 2026-05-11T15:08:34.077889418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-146 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmbOz2m9PmqLAm1nexWktrdYpSEkAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035884942+05:30 + ResTimestampMock: 2026-05-11T15:08:34.078103299+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-147 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu5LTZbKscLhj8BR3Vf81IKaEN64AAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4z + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.035890443+05:30 + ResTimestampMock: 2026-05-11T15:08:34.078890555+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-148 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtV9n5gbX6wHmj+Gz/lTw3mOILPoAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAE + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.040724004+05:30 + ResTimestampMock: 2026-05-11T15:08:34.081842336+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-149 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvLSxmBcOpQAoZMxtAS56J0OSw/U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077643626+05:30 + ResTimestampMock: 2026-05-11T15:08:34.118997806+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-150 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEajBifl9epW4pmiGJs+OXfY7rxAQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077546005+05:30 + ResTimestampMock: 2026-05-11T15:08:34.118997815+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-151 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4Msyj6xM3TAg1XHuV8317rFCtVE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077509647+05:30 + ResTimestampMock: 2026-05-11T15:08:34.118997733+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-152 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFYN84OKf+CxFTAmRU9hjaKZu7mM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077884868+05:30 + ResTimestampMock: 2026-05-11T15:08:34.11902842+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-153 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnXkUSzOT/QCNUokxIsLggNqB1co= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.07751341+05:30 + ResTimestampMock: 2026-05-11T15:08:34.11905397+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-154 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGRlCDASH1q/mf+WZaPTn135AV2s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077529611+05:30 + ResTimestampMock: 2026-05-11T15:08:34.119047987+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-155 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqoNYQ1HlcKcchY9nGICOniNZdvk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077802404+05:30 + ResTimestampMock: 2026-05-11T15:08:34.119082686+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-156 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEitH7ZTrXVs2FvZ3MrbxbIh/BuiE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.07792607+05:30 + ResTimestampMock: 2026-05-11T15:08:34.119413724+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-157 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKL3FE+e59PbajRwhKH7S12Jey1U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.077504257+05:30 + ResTimestampMock: 2026-05-11T15:08:34.119580562+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-158 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmbOz2m9PmqLAm1nexWktrdYpSEk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.078590614+05:30 + ResTimestampMock: 2026-05-11T15:08:34.120227488+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-159 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu5LTZbKscLhj8BR3Vf81IKaEN64= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.078930966+05:30 + ResTimestampMock: 2026-05-11T15:08:34.120252265+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-160 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtV9n5gbX6wHmj+Gz/lTw3mOILPo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjM= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:34.081910317+05:30 + ResTimestampMock: 2026-05-11T15:08:34.124228401+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-161 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:34.84901049+05:30 + ResTimestampMock: 2026-05-11T15:08:34.89264285+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-162 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:34.89301955+05:30 + ResTimestampMock: 2026-05-11T15:08:34.934692402+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-163 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:35.93519691+05:30 + ResTimestampMock: 2026-05-11T15:08:35.979683003+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-164 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:35.980183814+05:30 + ResTimestampMock: 2026-05-11T15:08:36.023336201+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-165 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE18sB6RDczwa1lJVXwjqtm/WH0+wAAAAPAgEAA2lkeAAAAAAAAAAVAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135651476+05:30 + ResTimestampMock: 2026-05-11T15:08:36.176915305+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-166 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpaCksbscfgFTZNnqLOwyPWMFvF8AAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAT + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135667183+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177003863+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-167 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7E5HSwalAJWCLIkQXY3tK7EHMlMAAAAPAgEAA2lkeAAAAAAAAAAWAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135611964+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177002301+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-168 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEN4Es3SsFtjV0rbNkmrav5qOulgEAAAAPAgEAA2lkeAAAAAAAAAAOAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.13563567+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177020228+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-169 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUERUCvUgZRqLsdItQvzxiUeIuYco0AAAAPAgEAA2lkeAAAAAAAAAAXAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135374744+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177039223+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-170 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUENQgqr+t1LGQ6xbUvTRW/taJXPdsAAAAPAgEAA2lkeAAAAAAAAAASAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135674169+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177023201+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-171 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfBEGMLFWobcRihEmdCCvgE3nN5sAAAAPAgEAA2lkeAAAAAAAAAAFAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135574496+05:30 + ResTimestampMock: 2026-05-11T15:08:36.177086398+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-172 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDvMnneIbhJFTPd9IQh9jv02C6koAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.136036715+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178886637+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-173 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEl95tyS0ZItIQnmxO1I6gx1cmmTcAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135589186+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178888647+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-174 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJg+tcUGpU9qivTLm3KE2hFNaFk0AAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135580463+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178886546+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-175 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHh/vzJD+PYZqQr8tR419r2FbF0AAAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAR + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135696433+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178894899+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-176 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDpAHtvbWZduSawJ8FE9X/7jkNUoAAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAE + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135583813+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178900968+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-177 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUETqxkj79K1pGrk4QSTotF2AxCztQAAAAPAgEAA2lkeAAAAAAAAAALAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135611155+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178906954+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-178 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEipS4oGbR1YwLc543Yzp8XZx9Wc4AAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAH + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135599866+05:30 + ResTimestampMock: 2026-05-11T15:08:36.17891802+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-179 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEC66hzfdC5P15pa2xJK9zQ9eozlkAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135602292+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178920076+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-180 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZCnAY+QZDkWSCdHU6CIUB6YBjWMAAAAPAgEAA2lkeAAAAAAAAAAUAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135681756+05:30 + ResTimestampMock: 2026-05-11T15:08:36.1789276+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-181 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEr1PD9/2ssuJvMFc6rAdt/8BYV1oAAAAPAgEAA2lkeAAAAAAAAAANAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135708005+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178932945+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-182 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHs/2tKwpsbxKqcC/uhTe+edc4ssAAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135598049+05:30 + ResTimestampMock: 2026-05-11T15:08:36.17894247+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-183 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEO+2tCvhkgmHXzyBLwvaGf2rkJcMAAAAPAgEAA2lkeAAAAAAAAAAQAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135556603+05:30 + ResTimestampMock: 2026-05-11T15:08:36.17895121+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-184 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIpTHopKDH670j3LyOJ9yNBAs1e8AAAAPAgEAA2lkeAAAAAAAAAAKAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135629936+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178958033+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-185 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZNgOBB9068sjh7KRn/E9u2UKU9IAAAAPAgEAA2lkeAAAAAAAAAAIAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135584111+05:30 + ResTimestampMock: 2026-05-11T15:08:36.17897841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-186 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMXzCOrlEq+sL6bsFvQ/z3TdtO74AAAAPAgEAA2lkeAAAAAAAAAAPAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135682875+05:30 + ResTimestampMock: 2026-05-11T15:08:36.178984955+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-187 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6+R4FWEU/VxeFAJEHNgQOGnjHdoAAAAPAgEAA2lkeAAAAAAAAAAJAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.135694184+05:30 + ResTimestampMock: 2026-05-11T15:08:36.179107777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-188 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 99 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMqIr8TW1nxn2f/XCVx2c484bVSwAAAAPAgEAA2lkeAAAAAAAAAAMAAAACwIDAAN0YWdydW40 + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.139737598+05:30 + ResTimestampMock: 2026-05-11T15:08:36.181586069+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-189 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEN4Es3SsFtjV0rbNkmrav5qOulgE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAAsBAwADdGFncnVuNAAAAA8BAQADaWR4AAAAAAAAAA4= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178962044+05:30 + ResTimestampMock: 2026-05-11T15:08:36.220715787+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-190 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEipS4oGbR1YwLc543Yzp8XZx9Wc4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179226598+05:30 + ResTimestampMock: 2026-05-11T15:08:36.220801928+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-191 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMXzCOrlEq+sL6bsFvQ/z3TdtO74= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA8AAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.17924937+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221072844+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-192 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZNgOBB9068sjh7KRn/E9u2UKU9I= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179252293+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221103856+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-193 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHh/vzJD+PYZqQr8tR419r2FbF0A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABEAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.17929825+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221141553+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-194 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHs/2tKwpsbxKqcC/uhTe+edc4ss= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.17927388+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221153672+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-195 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUERUCvUgZRqLsdItQvzxiUeIuYco0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABcAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178965495+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221200153+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-196 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEO+2tCvhkgmHXzyBLwvaGf2rkJcM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABAAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179215349+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221201573+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-197 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpaCksbscfgFTZNnqLOwyPWMFvF8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABMAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178945473+05:30 + ResTimestampMock: 2026-05-11T15:08:36.22120814+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-198 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEC66hzfdC5P15pa2xJK9zQ9eozlk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179199443+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221217217+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-199 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIpTHopKDH670j3LyOJ9yNBAs1e8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179235426+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221223837+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-200 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDvMnneIbhJFTPd9IQh9jv02C6ko= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179197388+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221231148+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-201 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEr1PD9/2ssuJvMFc6rAdt/8BYV1o= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAAsBAwADdGFncnVuNAAAAA8BAQADaWR4AAAAAAAAAA0= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179259371+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221231128+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-202 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDpAHtvbWZduSawJ8FE9X/7jkNUo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179203554+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221252001+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-203 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUENQgqr+t1LGQ6xbUvTRW/taJXPds= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABIAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.17894748+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221252087+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-204 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJg+tcUGpU9qivTLm3KE2hFNaFk0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179240729+05:30 + ResTimestampMock: 2026-05-11T15:08:36.2212548+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-205 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZCnAY+QZDkWSCdHU6CIUB6YBjWM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABQAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179217365+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221252379+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-206 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE18sB6RDczwa1lJVXwjqtm/WH0+w= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABUAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178908296+05:30 + ResTimestampMock: 2026-05-11T15:08:36.22127841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-207 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7E5HSwalAJWCLIkQXY3tK7EHMlM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABYAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178928262+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221334571+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-208 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfBEGMLFWobcRihEmdCCvgE3nN5s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.178943391+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221518181+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-209 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETqxkj79K1pGrk4QSTotF2AxCztQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179225784+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221612866+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-210 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6+R4FWEU/VxeFAJEHNgQOGnjHdo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179208347+05:30 + ResTimestampMock: 2026-05-11T15:08:36.22170584+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-211 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEl95tyS0ZItIQnmxO1I6gx1cmmTc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.179197316+05:30 + ResTimestampMock: 2026-05-11T15:08:36.221797467+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-212 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMqIr8TW1nxn2f/XCVx2c484bVSw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 56 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAwAAAALAQMAA3RhZ3J1bjQ= + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:08:36.182106072+05:30 + ResTimestampMock: 2026-05-11T15:08:36.224693797+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-213 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:37.024083995+05:30 + ResTimestampMock: 2026-05-11T15:08:37.067613457+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-214 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:37.067782117+05:30 + ResTimestampMock: 2026-05-11T15:08:37.110155882+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-215 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:38.110958555+05:30 + ResTimestampMock: 2026-05-11T15:08:38.152453675+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-216 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:38.152629884+05:30 + ResTimestampMock: 2026-05-11T15:08:38.196437655+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-217 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:39.196943704+05:30 + ResTimestampMock: 2026-05-11T15:08:39.238310917+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-218 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:39.238506989+05:30 + ResTimestampMock: 2026-05-11T15:08:39.280185382+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-219 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:40.281611528+05:30 + ResTimestampMock: 2026-05-11T15:08:40.324462562+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-220 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:40.324778366+05:30 + ResTimestampMock: 2026-05-11T15:08:40.367957549+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-221 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:41.368999995+05:30 + ResTimestampMock: 2026-05-11T15:08:41.411380238+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-222 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:41.411524954+05:30 + ResTimestampMock: 2026-05-11T15:08:41.453752298+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-223 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:42.454185109+05:30 + ResTimestampMock: 2026-05-11T15:08:42.496307982+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-224 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:42.49642027+05:30 + ResTimestampMock: 2026-05-11T15:08:42.538834183+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-225 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:43.539849907+05:30 + ResTimestampMock: 2026-05-11T15:08:43.583731971+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-226 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:43.583947753+05:30 + ResTimestampMock: 2026-05-11T15:08:43.625765392+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-227 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:44.626874994+05:30 + ResTimestampMock: 2026-05-11T15:08:44.669302274+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-228 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:44.669899854+05:30 + ResTimestampMock: 2026-05-11T15:08:44.711818702+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-229 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:45.713778378+05:30 + ResTimestampMock: 2026-05-11T15:08:45.756370204+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-230 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:45.756908882+05:30 + ResTimestampMock: 2026-05-11T15:08:45.798483097+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-231 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:46.799623094+05:30 + ResTimestampMock: 2026-05-11T15:08:46.842196204+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-232 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:46.842581439+05:30 + ResTimestampMock: 2026-05-11T15:08:46.884565764+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-233 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:47.885070573+05:30 + ResTimestampMock: 2026-05-11T15:08:47.92634107+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-234 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:47.926663173+05:30 + ResTimestampMock: 2026-05-11T15:08:47.968649022+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-235 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:48.970033288+05:30 + ResTimestampMock: 2026-05-11T15:08:49.012169777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-236 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:49.012297288+05:30 + ResTimestampMock: 2026-05-11T15:08:49.055897853+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-237 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:50.057434136+05:30 + ResTimestampMock: 2026-05-11T15:08:50.100175734+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-238 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:50.100329332+05:30 + ResTimestampMock: 2026-05-11T15:08:50.141362275+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-239 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:51.142167266+05:30 + ResTimestampMock: 2026-05-11T15:08:51.183623635+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-240 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:51.183946628+05:30 + ResTimestampMock: 2026-05-11T15:08:51.22663209+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-241 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:52.228088254+05:30 + ResTimestampMock: 2026-05-11T15:08:52.269974283+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-242 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:52.27009579+05:30 + ResTimestampMock: 2026-05-11T15:08:52.310912535+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-243 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB9DD7F191BBC4A" + info_kind: unknown + raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:08:53.311932474+05:30 + ResTimestampMock: 2026-05-11T15:08:53.353917691+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-244 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:08:53.354722265+05:30 + ResTimestampMock: 2026-05-11T15:08:53.396966687+05:30 diff --git a/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml new file mode 100644 index 00000000..169ffbe7 --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: get-health-1 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/health + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:08:27.832765535+05:30 + resp: + status_code: 200 + header: + Content-Length: "32" + Content-Type: application/json + Date: Mon, 11 May 2026 09:38:27 GMT + body: | + {"namespaces":"test","nodes":1} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:08:27.83372744+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778492307 + app_port: 8090 +curl: | + curl --request GET \ + --url http://127.0.0.1:8090/health \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml new file mode 100644 index 00000000..8a4c0173 --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-parallel-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/parallel?n=4&prefix=run1 + url_params: + "n": "4" + prefix: run1 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:08:29.843545766+05:30 + resp: + status_code: 200 + header: + Content-Length: "255" + Content-Type: application/json + Date: Mon, 11 May 2026 09:38:29 GMT + body: | + {"duration":"86.786344ms","prefix":"run1","results":[{"key":"run1-0","bins":{"idx":0,"tag":"run1"}},{"key":"run1-1","bins":{"idx":1,"tag":"run1"}},{"key":"run1-2","bins":{"idx":2,"tag":"run1"}},{"key":"run1-3","bins":{"idx":3,"tag":"run1"}}],"workers":4} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:08:29.931449044+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492309 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/parallel?n=4&prefix=run1 \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml new file mode 100644 index 00000000..b43c3aff --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-parallel-2 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/parallel?n=8&prefix=run2 + url_params: + "n": "8" + prefix: run2 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:08:31.940384552+05:30 + resp: + status_code: 200 + header: + Content-Length: "443" + Content-Type: application/json + Date: Mon, 11 May 2026 09:38:32 GMT + body: | + {"duration":"84.873283ms","prefix":"run2","results":[{"key":"run2-0","bins":{"idx":0,"tag":"run2"}},{"key":"run2-1","bins":{"idx":1,"tag":"run2"}},{"key":"run2-2","bins":{"idx":2,"tag":"run2"}},{"key":"run2-3","bins":{"idx":3,"tag":"run2"}},{"key":"run2-4","bins":{"idx":4,"tag":"run2"}},{"key":"run2-5","bins":{"idx":5,"tag":"run2"}},{"key":"run2-6","bins":{"idx":6,"tag":"run2"}},{"key":"run2-7","bins":{"idx":7,"tag":"run2"}}],"workers":8} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:08:32.026009717+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492312 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/parallel?n=8&prefix=run2 \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml new file mode 100644 index 00000000..aeea369f --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-parallel-3 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/parallel?n=12&prefix=run3 + url_params: + "n": "12" + prefix: run3 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:08:34.035290318+05:30 + resp: + status_code: 200 + header: + Content-Length: "636" + Content-Type: application/json + Date: Mon, 11 May 2026 09:38:34 GMT + body: | + {"duration":"88.719056ms","prefix":"run3","results":[{"key":"run3-0","bins":{"idx":0,"tag":"run3"}},{"key":"run3-1","bins":{"idx":1,"tag":"run3"}},{"key":"run3-2","bins":{"idx":2,"tag":"run3"}},{"key":"run3-3","bins":{"idx":3,"tag":"run3"}},{"key":"run3-4","bins":{"idx":4,"tag":"run3"}},{"key":"run3-5","bins":{"idx":5,"tag":"run3"}},{"key":"run3-6","bins":{"idx":6,"tag":"run3"}},{"key":"run3-7","bins":{"idx":7,"tag":"run3"}},{"key":"run3-8","bins":{"idx":8,"tag":"run3"}},{"key":"run3-9","bins":{"idx":9,"tag":"run3"}},{"key":"run3-10","bins":{"idx":10,"tag":"run3"}},{"key":"run3-11","bins":{"idx":11,"tag":"run3"}}],"workers":12} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:08:34.124672722+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492314 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/parallel?n=12&prefix=run3 \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml new file mode 100644 index 00000000..dcf48824 --- /dev/null +++ b/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-parallel-4 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/parallel?n=24&prefix=run4 + url_params: + "n": "24" + prefix: run4 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:08:36.134786796+05:30 + resp: + status_code: 200 + header: + Content-Length: "1223" + Content-Type: application/json + Date: Mon, 11 May 2026 09:38:36 GMT + body: | + {"duration":"89.55741ms","prefix":"run4","results":[{"key":"run4-0","bins":{"idx":0,"tag":"run4"}},{"key":"run4-1","bins":{"idx":1,"tag":"run4"}},{"key":"run4-2","bins":{"idx":2,"tag":"run4"}},{"key":"run4-3","bins":{"idx":3,"tag":"run4"}},{"key":"run4-4","bins":{"idx":4,"tag":"run4"}},{"key":"run4-5","bins":{"idx":5,"tag":"run4"}},{"key":"run4-6","bins":{"idx":6,"tag":"run4"}},{"key":"run4-7","bins":{"idx":7,"tag":"run4"}},{"key":"run4-8","bins":{"idx":8,"tag":"run4"}},{"key":"run4-9","bins":{"idx":9,"tag":"run4"}},{"key":"run4-10","bins":{"idx":10,"tag":"run4"}},{"key":"run4-11","bins":{"idx":11,"tag":"run4"}},{"key":"run4-12","bins":{"idx":12,"tag":"run4"}},{"key":"run4-13","bins":{"idx":13,"tag":"run4"}},{"key":"run4-14","bins":{"idx":14,"tag":"run4"}},{"key":"run4-15","bins":{"idx":15,"tag":"run4"}},{"key":"run4-16","bins":{"idx":16,"tag":"run4"}},{"key":"run4-17","bins":{"idx":17,"tag":"run4"}},{"key":"run4-18","bins":{"idx":18,"tag":"run4"}},{"key":"run4-19","bins":{"idx":19,"tag":"run4"}},{"key":"run4-20","bins":{"idx":20,"tag":"run4"}},{"key":"run4-21","bins":{"idx":21,"tag":"run4"}},{"key":"run4-22","bins":{"idx":22,"tag":"run4"}},{"key":"run4-23","bins":{"idx":23,"tag":"run4"}}],"workers":24} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:08:36.225172317+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492316 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/parallel?n=24&prefix=run4 \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-2/mocks.yaml b/aerospike-tls/keploy/test-set-2/mocks.yaml new file mode 100644 index 00000000..96096b15 --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/mocks.yaml @@ -0,0 +1,30708 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-0 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.187630184+05:30 + ResTimestampMock: 2026-05-11T15:15:29.228900833+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-1 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.229555273+05:30 + ResTimestampMock: 2026-05-11T15:15:29.271059826+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-2 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:29.279130946+05:30 + ResTimestampMock: 2026-05-11T15:15:29.320743018+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-3 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.320910818+05:30 + ResTimestampMock: 2026-05-11T15:15:29.362627751+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-4 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:15:29.362760132+05:30 + ResTimestampMock: 2026-05-11T15:15:29.404590534+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-5 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:29.406014214+05:30 + ResTimestampMock: 2026-05-11T15:15:29.447203321+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-6 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.447307322+05:30 + ResTimestampMock: 2026-05-11T15:15:29.489822558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-7 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm7Z8HoDojq5sExP90yq0/vy0Es= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.500903626+05:30 + ResTimestampMock: 2026-05-11T15:15:29.542819566+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-8 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEyjW+uSujaSSpLkvcjJx526MXP3s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.543060387+05:30 + ResTimestampMock: 2026-05-11T15:15:29.584435419+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-9 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUbk90BIccGQEzT0EjCjmPuTdfbY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.58466497+05:30 + ResTimestampMock: 2026-05-11T15:15:29.627228303+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-10 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELk9B6gLZul7w3rZUkdLt3oCk8Mc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.627326258+05:30 + ResTimestampMock: 2026-05-11T15:15:29.668963317+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-11 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+u0Wl6Zbe+2U56imaXcc4pDGlEY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.669228719+05:30 + ResTimestampMock: 2026-05-11T15:15:29.711446301+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-12 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdoIqKZd8llL4FjreA3uX8Sa1VxI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.711602177+05:30 + ResTimestampMock: 2026-05-11T15:15:29.754517905+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-13 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUESa3CiabUr9TS3DOSFtRvW9PL6Sc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.75504845+05:30 + ResTimestampMock: 2026-05-11T15:15:29.797890323+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-14 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/RcjySXX6UJuuZyoQFB+/jFe0M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.798289659+05:30 + ResTimestampMock: 2026-05-11T15:15:29.841090652+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-15 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvkBTJHi1UdvMEzG558Eq7ZofNVw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.841317555+05:30 + ResTimestampMock: 2026-05-11T15:15:29.882828508+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-16 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE764awLdaGMTMQKwPNItoaxebDrI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.853097963+05:30 + ResTimestampMock: 2026-05-11T15:15:29.894049019+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-17 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKjrYJHZ0fhzBaxg5vp06IBhcOyg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.853792894+05:30 + ResTimestampMock: 2026-05-11T15:15:29.894575949+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-18 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2HHs+PA+07pTLn5jq0b8Mn27jSg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.853451997+05:30 + ResTimestampMock: 2026-05-11T15:15:29.894625516+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-19 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAnKrVebX6Z/hxinN8eJshnB1lEo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.852699346+05:30 + ResTimestampMock: 2026-05-11T15:15:29.894679797+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-20 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEL5XfeNiO/E/EOcZzydKOBEKz/z0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.853809422+05:30 + ResTimestampMock: 2026-05-11T15:15:29.895994496+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-21 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUoAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4n+knG98esZS5Yb7OZZi2sNpENM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.855579226+05:30 + ResTimestampMock: 2026-05-11T15:15:29.897097298+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-22 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVuBZop6gxSc1AqAZgR656D6is0A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.854818338+05:30 + ResTimestampMock: 2026-05-11T15:15:29.897765326+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-23 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUkAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu0wwQ8xl+zBaA1sxGHqEfBNGPYo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.859515148+05:30 + ResTimestampMock: 2026-05-11T15:15:29.901913468+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-24 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7wS8Va9ccFZOoD7lVMRXbKf4z0g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.860891346+05:30 + ResTimestampMock: 2026-05-11T15:15:29.902653237+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-25 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEelzl+o/cOX38GpPGcdnXDijYl8M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.860719434+05:30 + ResTimestampMock: 2026-05-11T15:15:29.903691913+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-26 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUkAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7uGPnFz6/JTw2eY2BOa1I4hp+2g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.861082+05:30 + ResTimestampMock: 2026-05-11T15:15:29.90371665+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-27 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3YgNabidB3m4T8X0iM5TUnT+qnY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.861071115+05:30 + ResTimestampMock: 2026-05-11T15:15:29.90372803+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-28 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFIDeQlHYxiq6MekYWEpT9f5hB8U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.864137297+05:30 + ResTimestampMock: 2026-05-11T15:15:29.905019137+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-29 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZfG/i/i3Of1GOvaQbGNIBKTSaCg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.866311043+05:30 + ResTimestampMock: 2026-05-11T15:15:29.906596079+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-30 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/oKHaTSUAtQIHEKEJpx9xqBklc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.866198336+05:30 + ResTimestampMock: 2026-05-11T15:15:29.906646554+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-31 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQY9aD49BW9kYI1oFfsh7JZyNZnQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.864765948+05:30 + ResTimestampMock: 2026-05-11T15:15:29.906651865+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-32 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7LeYYlrf6bvohLp5W/5kY8HzDmM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.867302546+05:30 + ResTimestampMock: 2026-05-11T15:15:29.907669889+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-33 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYIrzLeAUTzYZEfjyirsgWPJW07M= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.867215702+05:30 + ResTimestampMock: 2026-05-11T15:15:29.907718546+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-34 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETres2lCD6qj6CWNaiz48TbC1iRs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.866356565+05:30 + ResTimestampMock: 2026-05-11T15:15:29.907724577+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-35 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfoeVd8un+Ruyu1/RbStzNIpB4i8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.866304227+05:30 + ResTimestampMock: 2026-05-11T15:15:29.908714829+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-36 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEgtypEIIP2pJn1ELAXabfAb24JGk= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.869137153+05:30 + ResTimestampMock: 2026-05-11T15:15:29.909605505+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-37 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfCxw5iFpLedvWrNf/Jcq2UtWHPU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.86891949+05:30 + ResTimestampMock: 2026-05-11T15:15:29.910637256+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-38 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEktDyftO1+p/jx06GYn+eAiE9Qos= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.870869484+05:30 + ResTimestampMock: 2026-05-11T15:15:29.911941749+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-39 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEaZBs4AGhoU7luWwEni90LxgWPM0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.869772678+05:30 + ResTimestampMock: 2026-05-11T15:15:29.912030839+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-40 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEknpy17QJxd6R+UIoxfw5uiOJAhI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.870661253+05:30 + ResTimestampMock: 2026-05-11T15:15:29.912035619+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-41 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkxDg97mW8wzTJku+YctR+hSR7pE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.870052993+05:30 + ResTimestampMock: 2026-05-11T15:15:29.912049249+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-42 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUaTnYhEbMCoV4lSftpOW6L8oZ30= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.872246584+05:30 + ResTimestampMock: 2026-05-11T15:15:29.913829455+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-43 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcCSkDCRS7ntdSxqs9rrh3xpFWuY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.871212315+05:30 + ResTimestampMock: 2026-05-11T15:15:29.913924238+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-44 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwrVFuoSqePBd4HGZDdQJEBGzvck= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.877871183+05:30 + ResTimestampMock: 2026-05-11T15:15:29.918747761+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-45 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEthZJrs97U1So2VXs2/TJZNZllQs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.878089942+05:30 + ResTimestampMock: 2026-05-11T15:15:29.919602684+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-46 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FiEAAAAAAAAAAAAAAAAAAHURAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAIdgviivFMWUmbxGWHtXOmwGwt8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:29.87852394+05:30 + ResTimestampMock: 2026-05-11T15:15:29.92062949+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-47 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.928178684+05:30 + ResTimestampMock: 2026-05-11T15:15:29.969889375+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-48 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:15:29.970014711+05:30 + ResTimestampMock: 2026-05-11T15:15:30.01229099+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-49 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.020563239+05:30 + ResTimestampMock: 2026-05-11T15:15:30.062974387+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-50 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.063211308+05:30 + ResTimestampMock: 2026-05-11T15:15:30.104543579+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-51 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:15:30.104922291+05:30 + ResTimestampMock: 2026-05-11T15:15:30.146743869+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-52 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.148335303+05:30 + ResTimestampMock: 2026-05-11T15:15:30.190426944+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-53 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.190921023+05:30 + ResTimestampMock: 2026-05-11T15:15:30.232078239+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-54 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.242118109+05:30 + ResTimestampMock: 2026-05-11T15:15:30.284962884+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-55 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.285526102+05:30 + ResTimestampMock: 2026-05-11T15:15:30.327136814+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-56 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.334940646+05:30 + ResTimestampMock: 2026-05-11T15:15:30.375740521+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-57 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.376266584+05:30 + ResTimestampMock: 2026-05-11T15:15:30.419341349+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-58 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:15:30.419760729+05:30 + ResTimestampMock: 2026-05-11T15:15:30.462528259+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-59 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.463904477+05:30 + ResTimestampMock: 2026-05-11T15:15:30.505708361+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-60 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.491253932+05:30 + ResTimestampMock: 2026-05-11T15:15:30.53321712+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-61 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.506057482+05:30 + ResTimestampMock: 2026-05-11T15:15:30.548434329+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-62 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.533727285+05:30 + ResTimestampMock: 2026-05-11T15:15:30.575285444+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-63 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.554898139+05:30 + ResTimestampMock: 2026-05-11T15:15:30.595827394+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-64 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.596068213+05:30 + ResTimestampMock: 2026-05-11T15:15:30.637574574+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-65 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.645338349+05:30 + ResTimestampMock: 2026-05-11T15:15:30.686891389+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-66 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.68702088+05:30 + ResTimestampMock: 2026-05-11T15:15:30.728346233+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-67 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:15:30.728521056+05:30 + ResTimestampMock: 2026-05-11T15:15:30.771337755+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-68 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.77313175+05:30 + ResTimestampMock: 2026-05-11T15:15:30.814276595+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-69 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.814387925+05:30 + ResTimestampMock: 2026-05-11T15:15:30.855047804+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-70 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.861367676+05:30 + ResTimestampMock: 2026-05-11T15:15:30.902723452+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-71 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.902802624+05:30 + ResTimestampMock: 2026-05-11T15:15:30.945510562+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-72 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:30.953094514+05:30 + ResTimestampMock: 2026-05-11T15:15:30.995784685+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-73 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:30.99618096+05:30 + ResTimestampMock: 2026-05-11T15:15:31.038351282+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-74 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:15:31.038528379+05:30 + ResTimestampMock: 2026-05-11T15:15:31.080042684+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-75 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:31.081468235+05:30 + ResTimestampMock: 2026-05-11T15:15:31.124255505+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-76 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:31.124392765+05:30 + ResTimestampMock: 2026-05-11T15:15:31.166668377+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-77 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:31.232907416+05:30 + ResTimestampMock: 2026-05-11T15:15:31.274741113+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-78 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:31.275080416+05:30 + ResTimestampMock: 2026-05-11T15:15:31.317249838+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-79 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:31.54988015+05:30 + ResTimestampMock: 2026-05-11T15:15:31.593891658+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-80 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:31.576180158+05:30 + ResTimestampMock: 2026-05-11T15:15:31.618716477+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-81 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:31.59438367+05:30 + ResTimestampMock: 2026-05-11T15:15:31.637667086+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-82 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:31.619013087+05:30 + ResTimestampMock: 2026-05-11T15:15:31.659961735+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-83 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:31.856090276+05:30 + ResTimestampMock: 2026-05-11T15:15:31.898535234+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-84 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:31.898789601+05:30 + ResTimestampMock: 2026-05-11T15:15:31.941163524+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-85 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:32.167810941+05:30 + ResTimestampMock: 2026-05-11T15:15:32.209104035+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-86 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:32.209206294+05:30 + ResTimestampMock: 2026-05-11T15:15:32.251503825+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-87 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:32.318292985+05:30 + ResTimestampMock: 2026-05-11T15:15:32.361516953+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-88 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:32.361983274+05:30 + ResTimestampMock: 2026-05-11T15:15:32.404340709+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-89 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:32.638986649+05:30 + ResTimestampMock: 2026-05-11T15:15:32.68091948+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-90 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:32.661335707+05:30 + ResTimestampMock: 2026-05-11T15:15:32.703217661+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-91 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:32.681065053+05:30 + ResTimestampMock: 2026-05-11T15:15:32.7231327+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-92 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:32.703746546+05:30 + ResTimestampMock: 2026-05-11T15:15:32.746040735+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-93 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:32.941984041+05:30 + ResTimestampMock: 2026-05-11T15:15:32.983569753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-94 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:32.983790585+05:30 + ResTimestampMock: 2026-05-11T15:15:33.025355007+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-95 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:33.252967234+05:30 + ResTimestampMock: 2026-05-11T15:15:33.295082392+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-96 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:33.295544068+05:30 + ResTimestampMock: 2026-05-11T15:15:33.338731962+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-97 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:33.405769512+05:30 + ResTimestampMock: 2026-05-11T15:15:33.447476864+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-98 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:33.447788595+05:30 + ResTimestampMock: 2026-05-11T15:15:33.489375596+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-99 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:33.724034509+05:30 + ResTimestampMock: 2026-05-11T15:15:33.766445824+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-100 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:33.747250611+05:30 + ResTimestampMock: 2026-05-11T15:15:33.789539549+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-101 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:33.766636793+05:30 + ResTimestampMock: 2026-05-11T15:15:33.80830842+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-102 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:33.789741022+05:30 + ResTimestampMock: 2026-05-11T15:15:33.83128544+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-103 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:34.025824003+05:30 + ResTimestampMock: 2026-05-11T15:15:34.067511575+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-104 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:34.067624216+05:30 + ResTimestampMock: 2026-05-11T15:15:34.109755903+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-105 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:34.339803608+05:30 + ResTimestampMock: 2026-05-11T15:15:34.382427077+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-106 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:34.382957761+05:30 + ResTimestampMock: 2026-05-11T15:15:34.42430765+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-107 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:34.489981408+05:30 + ResTimestampMock: 2026-05-11T15:15:34.531368746+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-108 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:34.531685725+05:30 + ResTimestampMock: 2026-05-11T15:15:34.573250822+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-109 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:34.809741884+05:30 + ResTimestampMock: 2026-05-11T15:15:34.850972784+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-110 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:34.832257816+05:30 + ResTimestampMock: 2026-05-11T15:15:34.875473198+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-111 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:34.851367571+05:30 + ResTimestampMock: 2026-05-11T15:15:34.892978822+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-112 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:34.875599313+05:30 + ResTimestampMock: 2026-05-11T15:15:34.918070836+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-113 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:35.110981319+05:30 + ResTimestampMock: 2026-05-11T15:15:35.153224033+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-114 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:35.1535781+05:30 + ResTimestampMock: 2026-05-11T15:15:35.19627662+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-115 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:35.424926429+05:30 + ResTimestampMock: 2026-05-11T15:15:35.466272558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-116 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:35.466726703+05:30 + ResTimestampMock: 2026-05-11T15:15:35.50811035+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-117 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:35.574403448+05:30 + ResTimestampMock: 2026-05-11T15:15:35.61650918+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-118 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:35.616866687+05:30 + ResTimestampMock: 2026-05-11T15:15:35.658297585+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-119 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:35.895021351+05:30 + ResTimestampMock: 2026-05-11T15:15:35.936616464+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-120 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:35.919515443+05:30 + ResTimestampMock: 2026-05-11T15:15:35.961385704+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-121 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:35.936757003+05:30 + ResTimestampMock: 2026-05-11T15:15:35.979447308+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-122 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:35.961901+05:30 + ResTimestampMock: 2026-05-11T15:15:36.003303871+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-123 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:36.197791144+05:30 + ResTimestampMock: 2026-05-11T15:15:36.23967374+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-124 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:36.239975675+05:30 + ResTimestampMock: 2026-05-11T15:15:36.283284298+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-125 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:36.508989352+05:30 + ResTimestampMock: 2026-05-11T15:15:36.551226155+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-126 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:36.551382126+05:30 + ResTimestampMock: 2026-05-11T15:15:36.593380053+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-127 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:36.65903285+05:30 + ResTimestampMock: 2026-05-11T15:15:36.700427352+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-128 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:36.700831211+05:30 + ResTimestampMock: 2026-05-11T15:15:36.743466288+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-129 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:36.980999785+05:30 + ResTimestampMock: 2026-05-11T15:15:37.02218717+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-130 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:37.004203395+05:30 + ResTimestampMock: 2026-05-11T15:15:37.04541429+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-131 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:37.022509398+05:30 + ResTimestampMock: 2026-05-11T15:15:37.063975042+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-132 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:37.045613807+05:30 + ResTimestampMock: 2026-05-11T15:15:37.087101291+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-133 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:37.28370431+05:30 + ResTimestampMock: 2026-05-11T15:15:37.326200651+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-134 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:37.326320327+05:30 + ResTimestampMock: 2026-05-11T15:15:37.368267612+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-135 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:37.594792224+05:30 + ResTimestampMock: 2026-05-11T15:15:37.637229801+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-136 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:37.637783931+05:30 + ResTimestampMock: 2026-05-11T15:15:37.681220149+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-137 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:37.744724548+05:30 + ResTimestampMock: 2026-05-11T15:15:37.787193782+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-138 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:37.787431199+05:30 + ResTimestampMock: 2026-05-11T15:15:37.829417822+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-139 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:38.06552548+05:30 + ResTimestampMock: 2026-05-11T15:15:38.107646724+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-140 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:38.087928545+05:30 + ResTimestampMock: 2026-05-11T15:15:38.131624342+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-141 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:38.10816108+05:30 + ResTimestampMock: 2026-05-11T15:15:38.150170168+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-142 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:38.132071959+05:30 + ResTimestampMock: 2026-05-11T15:15:38.175142258+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-143 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:38.369227583+05:30 + ResTimestampMock: 2026-05-11T15:15:38.41062469+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-144 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:38.410942705+05:30 + ResTimestampMock: 2026-05-11T15:15:38.454343431+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-145 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:38.682039643+05:30 + ResTimestampMock: 2026-05-11T15:15:38.724564472+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-146 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:38.725111353+05:30 + ResTimestampMock: 2026-05-11T15:15:38.768021284+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-147 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:38.830723156+05:30 + ResTimestampMock: 2026-05-11T15:15:38.873206113+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-148 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:38.873550317+05:30 + ResTimestampMock: 2026-05-11T15:15:38.915192555+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-149 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:39.150918557+05:30 + ResTimestampMock: 2026-05-11T15:15:39.192760824+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-150 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:39.176466636+05:30 + ResTimestampMock: 2026-05-11T15:15:39.218540035+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-151 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:39.192977454+05:30 + ResTimestampMock: 2026-05-11T15:15:39.235361718+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-152 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:39.218657155+05:30 + ResTimestampMock: 2026-05-11T15:15:39.26034964+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-153 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:39.455733311+05:30 + ResTimestampMock: 2026-05-11T15:15:39.497091189+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-154 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:39.497633085+05:30 + ResTimestampMock: 2026-05-11T15:15:39.539282556+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-155 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:39.768654803+05:30 + ResTimestampMock: 2026-05-11T15:15:39.810156745+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-156 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:39.810555621+05:30 + ResTimestampMock: 2026-05-11T15:15:39.85240864+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-157 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:39.916460681+05:30 + ResTimestampMock: 2026-05-11T15:15:39.95847233+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-158 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:39.958583142+05:30 + ResTimestampMock: 2026-05-11T15:15:39.999905272+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-159 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:40.236054493+05:30 + ResTimestampMock: 2026-05-11T15:15:40.277846944+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-160 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:40.261156933+05:30 + ResTimestampMock: 2026-05-11T15:15:40.303902769+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-161 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:40.277912838+05:30 + ResTimestampMock: 2026-05-11T15:15:40.319062855+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-162 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:40.3043195+05:30 + ResTimestampMock: 2026-05-11T15:15:40.346370588+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-163 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:40.53991905+05:30 + ResTimestampMock: 2026-05-11T15:15:40.581646877+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-164 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:40.581840181+05:30 + ResTimestampMock: 2026-05-11T15:15:40.623062938+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-165 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:40.853976108+05:30 + ResTimestampMock: 2026-05-11T15:15:40.896230759+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-166 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:40.896332939+05:30 + ResTimestampMock: 2026-05-11T15:15:40.938570422+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-167 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:41.000405164+05:30 + ResTimestampMock: 2026-05-11T15:15:41.043339406+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-168 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:41.043678772+05:30 + ResTimestampMock: 2026-05-11T15:15:41.085627841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-169 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:41.320051129+05:30 + ResTimestampMock: 2026-05-11T15:15:41.361556151+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-170 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:41.347826361+05:30 + ResTimestampMock: 2026-05-11T15:15:41.39125167+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-171 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:41.361633109+05:30 + ResTimestampMock: 2026-05-11T15:15:41.404002532+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-172 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:41.391822447+05:30 + ResTimestampMock: 2026-05-11T15:15:41.433217206+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-173 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:41.623929413+05:30 + ResTimestampMock: 2026-05-11T15:15:41.665917175+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-174 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:41.666291886+05:30 + ResTimestampMock: 2026-05-11T15:15:41.708778547+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-175 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:41.939856277+05:30 + ResTimestampMock: 2026-05-11T15:15:41.981539102+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-176 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:41.981940299+05:30 + ResTimestampMock: 2026-05-11T15:15:42.023856817+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-177 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:42.086547757+05:30 + ResTimestampMock: 2026-05-11T15:15:42.127553885+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-178 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:42.127667941+05:30 + ResTimestampMock: 2026-05-11T15:15:42.17072984+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-179 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:42.405566705+05:30 + ResTimestampMock: 2026-05-11T15:15:42.44864621+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-180 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:42.434189876+05:30 + ResTimestampMock: 2026-05-11T15:15:42.475466732+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-181 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:42.448852284+05:30 + ResTimestampMock: 2026-05-11T15:15:42.489904986+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-182 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:42.476081757+05:30 + ResTimestampMock: 2026-05-11T15:15:42.517592757+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-183 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:42.710148038+05:30 + ResTimestampMock: 2026-05-11T15:15:42.75129018+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-184 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:42.751638586+05:30 + ResTimestampMock: 2026-05-11T15:15:42.793412794+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-185 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:43.025130856+05:30 + ResTimestampMock: 2026-05-11T15:15:43.067310502+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-186 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:43.068120389+05:30 + ResTimestampMock: 2026-05-11T15:15:43.110192174+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-187 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:43.171362748+05:30 + ResTimestampMock: 2026-05-11T15:15:43.213069712+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-188 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:43.213222855+05:30 + ResTimestampMock: 2026-05-11T15:15:43.254828076+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-189 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:43.490817339+05:30 + ResTimestampMock: 2026-05-11T15:15:43.532775704+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-190 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:43.518095053+05:30 + ResTimestampMock: 2026-05-11T15:15:43.560667494+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-191 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:43.532993654+05:30 + ResTimestampMock: 2026-05-11T15:15:43.574337697+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-192 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:43.561024395+05:30 + ResTimestampMock: 2026-05-11T15:15:43.604315822+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-193 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:43.794288438+05:30 + ResTimestampMock: 2026-05-11T15:15:43.836684333+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-194 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:43.837046039+05:30 + ResTimestampMock: 2026-05-11T15:15:43.878487215+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-195 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:44.111128271+05:30 + ResTimestampMock: 2026-05-11T15:15:44.1534783+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-196 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:44.153853747+05:30 + ResTimestampMock: 2026-05-11T15:15:44.195478418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-197 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:44.255588825+05:30 + ResTimestampMock: 2026-05-11T15:15:44.29708048+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-198 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:44.297541064+05:30 + ResTimestampMock: 2026-05-11T15:15:44.338877894+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-199 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:44.575968451+05:30 + ResTimestampMock: 2026-05-11T15:15:44.618597316+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-200 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:44.605403018+05:30 + ResTimestampMock: 2026-05-11T15:15:44.647445176+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-201 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:44.619031728+05:30 + ResTimestampMock: 2026-05-11T15:15:44.661404601+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-202 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:44.647889109+05:30 + ResTimestampMock: 2026-05-11T15:15:44.689098744+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-203 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:44.87981454+05:30 + ResTimestampMock: 2026-05-11T15:15:44.922105351+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-204 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:44.92245484+05:30 + ResTimestampMock: 2026-05-11T15:15:44.964541877+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-205 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:45.196957344+05:30 + ResTimestampMock: 2026-05-11T15:15:45.239554085+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-206 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:45.239955874+05:30 + ResTimestampMock: 2026-05-11T15:15:45.281620976+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-207 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:45.339644556+05:30 + ResTimestampMock: 2026-05-11T15:15:45.38155727+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-208 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:45.381847088+05:30 + ResTimestampMock: 2026-05-11T15:15:45.423505664+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-209 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:45.662931702+05:30 + ResTimestampMock: 2026-05-11T15:15:45.704977133+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-210 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:45.69032478+05:30 + ResTimestampMock: 2026-05-11T15:15:45.732468408+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-211 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:45.705241706+05:30 + ResTimestampMock: 2026-05-11T15:15:45.747616625+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-212 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:45.732857929+05:30 + ResTimestampMock: 2026-05-11T15:15:45.774270452+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-213 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:45.966145508+05:30 + ResTimestampMock: 2026-05-11T15:15:46.009035412+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-214 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:46.009166737+05:30 + ResTimestampMock: 2026-05-11T15:15:46.051402388+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-215 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:46.283096795+05:30 + ResTimestampMock: 2026-05-11T15:15:46.324591313+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-216 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:46.325041183+05:30 + ResTimestampMock: 2026-05-11T15:15:46.366283361+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-217 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:46.425030541+05:30 + ResTimestampMock: 2026-05-11T15:15:46.467117946+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-218 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:46.46771804+05:30 + ResTimestampMock: 2026-05-11T15:15:46.509059983+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-219 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:46.749551792+05:30 + ResTimestampMock: 2026-05-11T15:15:46.79122578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-220 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:46.774962498+05:30 + ResTimestampMock: 2026-05-11T15:15:46.817724028+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-221 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:46.79156676+05:30 + ResTimestampMock: 2026-05-11T15:15:46.834666841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-222 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:46.818181937+05:30 + ResTimestampMock: 2026-05-11T15:15:46.859193094+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-223 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:47.052873606+05:30 + ResTimestampMock: 2026-05-11T15:15:47.095322686+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-224 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:47.095614695+05:30 + ResTimestampMock: 2026-05-11T15:15:47.137474749+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-225 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:47.366754762+05:30 + ResTimestampMock: 2026-05-11T15:15:47.409415563+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-226 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:47.409790025+05:30 + ResTimestampMock: 2026-05-11T15:15:47.451070222+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-227 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:47.51076079+05:30 + ResTimestampMock: 2026-05-11T15:15:47.552484841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-228 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:47.552630895+05:30 + ResTimestampMock: 2026-05-11T15:15:47.595151645+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-229 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:47.836042574+05:30 + ResTimestampMock: 2026-05-11T15:15:47.877069612+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-230 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:47.860205074+05:30 + ResTimestampMock: 2026-05-11T15:15:47.902140891+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-231 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:47.877317516+05:30 + ResTimestampMock: 2026-05-11T15:15:47.918693843+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-232 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:47.902569364+05:30 + ResTimestampMock: 2026-05-11T15:15:47.944291253+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-233 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:48.138826734+05:30 + ResTimestampMock: 2026-05-11T15:15:48.181385495+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-234 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:48.181505323+05:30 + ResTimestampMock: 2026-05-11T15:15:48.224255741+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-235 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:48.452549837+05:30 + ResTimestampMock: 2026-05-11T15:15:48.494170599+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-236 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:48.494317503+05:30 + ResTimestampMock: 2026-05-11T15:15:48.536231818+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-237 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:48.595774392+05:30 + ResTimestampMock: 2026-05-11T15:15:48.637866639+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-238 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:48.638160516+05:30 + ResTimestampMock: 2026-05-11T15:15:48.679990072+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-239 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:48.919992096+05:30 + ResTimestampMock: 2026-05-11T15:15:48.962236588+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-240 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:48.945673347+05:30 + ResTimestampMock: 2026-05-11T15:15:48.988354342+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-241 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:48.962308587+05:30 + ResTimestampMock: 2026-05-11T15:15:49.003426062+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-242 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:48.988514574+05:30 + ResTimestampMock: 2026-05-11T15:15:49.031131517+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-243 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:49.224966194+05:30 + ResTimestampMock: 2026-05-11T15:15:49.266790713+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-244 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:49.266914152+05:30 + ResTimestampMock: 2026-05-11T15:15:49.308374603+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-245 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:49.536938604+05:30 + ResTimestampMock: 2026-05-11T15:15:49.578005455+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-246 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:49.578469024+05:30 + ResTimestampMock: 2026-05-11T15:15:49.620503639+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-247 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:49.680932622+05:30 + ResTimestampMock: 2026-05-11T15:15:49.722659725+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-248 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:49.723106875+05:30 + ResTimestampMock: 2026-05-11T15:15:49.76510935+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-249 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:50.004988272+05:30 + ResTimestampMock: 2026-05-11T15:15:50.047150384+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-250 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:50.032359684+05:30 + ResTimestampMock: 2026-05-11T15:15:50.074604794+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-251 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:50.047542382+05:30 + ResTimestampMock: 2026-05-11T15:15:50.090363274+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-252 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:50.074977572+05:30 + ResTimestampMock: 2026-05-11T15:15:50.11758933+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-253 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:50.308774301+05:30 + ResTimestampMock: 2026-05-11T15:15:50.350363368+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-254 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:50.350485549+05:30 + ResTimestampMock: 2026-05-11T15:15:50.393299341+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-255 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:50.621857206+05:30 + ResTimestampMock: 2026-05-11T15:15:50.665185069+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-256 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:50.665866239+05:30 + ResTimestampMock: 2026-05-11T15:15:50.708162428+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-257 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:50.766294503+05:30 + ResTimestampMock: 2026-05-11T15:15:50.809592893+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-258 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:50.810038942+05:30 + ResTimestampMock: 2026-05-11T15:15:50.85265666+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-259 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:51.091289852+05:30 + ResTimestampMock: 2026-05-11T15:15:51.133281287+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-260 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:51.11792199+05:30 + ResTimestampMock: 2026-05-11T15:15:51.159963791+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-261 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:51.133490447+05:30 + ResTimestampMock: 2026-05-11T15:15:51.175078827+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-262 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:51.160136151+05:30 + ResTimestampMock: 2026-05-11T15:15:51.201892993+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-263 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:51.393941753+05:30 + ResTimestampMock: 2026-05-11T15:15:51.435372704+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-264 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:51.435476909+05:30 + ResTimestampMock: 2026-05-11T15:15:51.477189544+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-265 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:51.709033787+05:30 + ResTimestampMock: 2026-05-11T15:15:51.750444847+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-266 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:51.750657873+05:30 + ResTimestampMock: 2026-05-11T15:15:51.793565627+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-267 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:51.853478597+05:30 + ResTimestampMock: 2026-05-11T15:15:51.895614399+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-268 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:51.89615748+05:30 + ResTimestampMock: 2026-05-11T15:15:51.937428994+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-269 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:52.175990357+05:30 + ResTimestampMock: 2026-05-11T15:15:52.217150306+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-270 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:52.203541518+05:30 + ResTimestampMock: 2026-05-11T15:15:52.245522757+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-271 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:52.217453563+05:30 + ResTimestampMock: 2026-05-11T15:15:52.259374455+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-272 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:52.245727965+05:30 + ResTimestampMock: 2026-05-11T15:15:52.287087604+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-273 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:52.478315647+05:30 + ResTimestampMock: 2026-05-11T15:15:52.520588523+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-274 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:52.520758747+05:30 + ResTimestampMock: 2026-05-11T15:15:52.562111644+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-275 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEol4pUGVTiYONebE6bmoNJ7fRVCUAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.578534491+05:30 + ResTimestampMock: 2026-05-11T15:15:52.620107286+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-276 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjaD4kxhYJ8kDxrvTjXmaDtMJUQAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.578146598+05:30 + ResTimestampMock: 2026-05-11T15:15:52.620107311+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-277 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7u21MFpAukucPgyasDzdTc8s0AEAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.578567602+05:30 + ResTimestampMock: 2026-05-11T15:15:52.62010729+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-278 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkMnm3rdGGz9VPE4yIoERBoXIC8EAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.578643388+05:30 + ResTimestampMock: 2026-05-11T15:15:52.620137668+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-279 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7u21MFpAukucPgyasDzdTc8s0AE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.620274026+05:30 + ResTimestampMock: 2026-05-11T15:15:52.662456246+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-280 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEol4pUGVTiYONebE6bmoNJ7fRVCU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.620272849+05:30 + ResTimestampMock: 2026-05-11T15:15:52.662454232+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-281 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjaD4kxhYJ8kDxrvTjXmaDtMJUQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.620285779+05:30 + ResTimestampMock: 2026-05-11T15:15:52.66280578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-282 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkMnm3rdGGz9VPE4yIoERBoXIC8E= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:52.62025354+05:30 + ResTimestampMock: 2026-05-11T15:15:52.663025359+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-283 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:52.795051448+05:30 + ResTimestampMock: 2026-05-11T15:15:52.836301755+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-284 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:52.836399775+05:30 + ResTimestampMock: 2026-05-11T15:15:52.878526436+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-285 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:52.938998869+05:30 + ResTimestampMock: 2026-05-11T15:15:52.980461091+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-286 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:52.980760998+05:30 + ResTimestampMock: 2026-05-11T15:15:53.022122791+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-287 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:53.260861825+05:30 + ResTimestampMock: 2026-05-11T15:15:53.302046044+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-288 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:53.288192431+05:30 + ResTimestampMock: 2026-05-11T15:15:53.330118924+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-289 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:53.302113236+05:30 + ResTimestampMock: 2026-05-11T15:15:53.343077339+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-290 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:53.330453494+05:30 + ResTimestampMock: 2026-05-11T15:15:53.371527202+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-291 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:53.56287822+05:30 + ResTimestampMock: 2026-05-11T15:15:53.60475836+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-292 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:53.605310522+05:30 + ResTimestampMock: 2026-05-11T15:15:53.648068547+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-293 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:53.879619224+05:30 + ResTimestampMock: 2026-05-11T15:15:53.922551734+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-294 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:53.923026633+05:30 + ResTimestampMock: 2026-05-11T15:15:53.96527238+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-295 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:54.023200111+05:30 + ResTimestampMock: 2026-05-11T15:15:54.065787556+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-296 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:54.0664263+05:30 + ResTimestampMock: 2026-05-11T15:15:54.108154676+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-297 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:54.344648344+05:30 + ResTimestampMock: 2026-05-11T15:15:54.386224709+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-298 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:54.37213432+05:30 + ResTimestampMock: 2026-05-11T15:15:54.413075065+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-299 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:54.386292275+05:30 + ResTimestampMock: 2026-05-11T15:15:54.428815867+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-300 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:54.41314744+05:30 + ResTimestampMock: 2026-05-11T15:15:54.455174844+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-301 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:54.64910052+05:30 + ResTimestampMock: 2026-05-11T15:15:54.690514925+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-302 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEg7Q/XqKUnp1DD+SfchP00tC2yvoAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.673893583+05:30 + ResTimestampMock: 2026-05-11T15:15:54.715455003+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-303 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEbTk+kqm7BNJcGX1XsuLj/TR472AAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.673457013+05:30 + ResTimestampMock: 2026-05-11T15:15:54.715559036+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-304 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBmTXL7hgC7aqoD4kv1RHAkrH1JQAAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.67342463+05:30 + ResTimestampMock: 2026-05-11T15:15:54.718871511+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-305 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP1L4XD4nOIA4knv8KLpkqaGGHxUAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.673823096+05:30 + ResTimestampMock: 2026-05-11T15:15:54.721718389+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-306 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcPPMWyMnblH7LK4YfjRloW8rGl4AAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.683422849+05:30 + ResTimestampMock: 2026-05-11T15:15:54.72465054+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-307 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEEF4H/XLHMdvHccMDMnzBz0IFrmcAAAAPAgEAA2lkeAAAAAAAAAAGAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.683482347+05:30 + ResTimestampMock: 2026-05-11T15:15:54.724768111+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-308 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFfw2XnvmialBZ3bOAvpzBYL9AWEAAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.683140405+05:30 + ResTimestampMock: 2026-05-11T15:15:54.724816284+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-309 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtCdYHDFDrQrtnwZ++JDWOar8APQAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.683482353+05:30 + ResTimestampMock: 2026-05-11T15:15:54.724907476+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-310 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:54.690929848+05:30 + ResTimestampMock: 2026-05-11T15:15:54.734564753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-311 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEbTk+kqm7BNJcGX1XsuLj/TR472A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.715738287+05:30 + ResTimestampMock: 2026-05-11T15:15:54.757562+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-312 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEg7Q/XqKUnp1DD+SfchP00tC2yvo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.715705067+05:30 + ResTimestampMock: 2026-05-11T15:15:54.75774504+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-313 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBmTXL7hgC7aqoD4kv1RHAkrH1JQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.719249316+05:30 + ResTimestampMock: 2026-05-11T15:15:54.760830985+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-314 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP1L4XD4nOIA4knv8KLpkqaGGHxU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.722189459+05:30 + ResTimestampMock: 2026-05-11T15:15:54.762794945+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-315 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcPPMWyMnblH7LK4YfjRloW8rGl4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.724726926+05:30 + ResTimestampMock: 2026-05-11T15:15:54.766796772+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-316 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEEF4H/XLHMdvHccMDMnzBz0IFrmc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.726309447+05:30 + ResTimestampMock: 2026-05-11T15:15:54.767816092+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-317 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtCdYHDFDrQrtnwZ++JDWOar8APQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.726308636+05:30 + ResTimestampMock: 2026-05-11T15:15:54.768013777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-318 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFfw2XnvmialBZ3bOAvpzBYL9AWE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ21jMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:54.726319483+05:30 + ResTimestampMock: 2026-05-11T15:15:54.768077152+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-319 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:54.965764156+05:30 + ResTimestampMock: 2026-05-11T15:15:55.00833787+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-320 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:55.008632967+05:30 + ResTimestampMock: 2026-05-11T15:15:55.050342295+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-321 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:55.10912317+05:30 + ResTimestampMock: 2026-05-11T15:15:55.151754236+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-322 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:55.151983876+05:30 + ResTimestampMock: 2026-05-11T15:15:55.194240936+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-323 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:55.430606033+05:30 + ResTimestampMock: 2026-05-11T15:15:55.47260675+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-324 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:55.455733197+05:30 + ResTimestampMock: 2026-05-11T15:15:55.497298101+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-325 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:55.472864845+05:30 + ResTimestampMock: 2026-05-11T15:15:55.515203025+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-326 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:55.497835221+05:30 + ResTimestampMock: 2026-05-11T15:15:55.539231617+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-327 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:55.735205315+05:30 + ResTimestampMock: 2026-05-11T15:15:55.777409882+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-328 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:55.777668668+05:30 + ResTimestampMock: 2026-05-11T15:15:55.819456032+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-329 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:56.050873896+05:30 + ResTimestampMock: 2026-05-11T15:15:56.092285889+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-330 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:56.092441796+05:30 + ResTimestampMock: 2026-05-11T15:15:56.134470911+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-331 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:56.195267431+05:30 + ResTimestampMock: 2026-05-11T15:15:56.238298944+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-332 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:56.238410381+05:30 + ResTimestampMock: 2026-05-11T15:15:56.282363687+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-333 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:56.517028463+05:30 + ResTimestampMock: 2026-05-11T15:15:56.558525329+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-334 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:56.540562797+05:30 + ResTimestampMock: 2026-05-11T15:15:56.582740476+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-335 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:56.558672144+05:30 + ResTimestampMock: 2026-05-11T15:15:56.601011815+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-336 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:56.583145378+05:30 + ResTimestampMock: 2026-05-11T15:15:56.625366729+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-337 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUExb9LzEJ6bbVCx446a8xbbdlLI1AAAAAPAgEAA2lkeAAAAAAAAAAJAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779458903+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821146305+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-338 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AtU4sD3VP8Mgw17mf1oYxTtBK4AAAAPAgEAA2lkeAAAAAAAAAALAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779379807+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821276544+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-339 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIPW9B3UUh/cbG+MdGxSN7ykXAOIAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779515964+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821276549+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-340 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9kr9HbZKLRyiNgW8TXq3BFj9e0UAAAAPAgEAA2lkeAAAAAAAAAAIAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779540726+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821279021+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-341 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWatu2U3LOr9wqs9j0FKY8DhiCIcAAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779478226+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821297409+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-342 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEk4hvuZQGJmXSlqLd0YeY6ovFmCYAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779418172+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821348034+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-343 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUElhW4v4BgZzVBRJfVg4XxH3Ze2P4AAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779457419+05:30 + ResTimestampMock: 2026-05-11T15:15:56.821611348+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-344 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtZ9TSzURfsD71Rw/vsEpGr6mvl0AAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.779439638+05:30 + ResTimestampMock: 2026-05-11T15:15:56.82170531+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-345 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJyv28xpt+SZjrrpxBg886Kb1RiMAAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.789567044+05:30 + ResTimestampMock: 2026-05-11T15:15:56.830962699+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-346 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUExei3UEj5JdDW5AFjvVTxCTyd41sAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.789906671+05:30 + ResTimestampMock: 2026-05-11T15:15:56.830965789+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-347 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzwI9nhTqNdZkW3Aqbq3tcbnJAD4AAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.791004488+05:30 + ResTimestampMock: 2026-05-11T15:15:56.831641805+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-348 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEByhCKauhZC6qZwnTmgYtgd6TdioAAAAPAgEAA2lkeAAAAAAAAAAGAAAACgIDAAN0YWdtYzM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.7899237+05:30 + ResTimestampMock: 2026-05-11T15:15:56.831576768+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-349 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AtU4sD3VP8Mgw17mf1oYxTtBK4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821322843+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862215708+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-350 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEk4hvuZQGJmXSlqLd0YeY6ovFmCY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821371731+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862407468+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-351 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIPW9B3UUh/cbG+MdGxSN7ykXAOI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821340506+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862701165+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-352 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:56.820796222+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862827261+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-353 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9kr9HbZKLRyiNgW8TXq3BFj9e0U= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.82133856+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862937131+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-354 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUElhW4v4BgZzVBRJfVg4XxH3Ze2P4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821667306+05:30 + ResTimestampMock: 2026-05-11T15:15:56.862977521+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-355 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtZ9TSzURfsD71Rw/vsEpGr6mvl0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAABA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821739056+05:30 + ResTimestampMock: 2026-05-11T15:15:56.863190551+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-356 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUExb9LzEJ6bbVCx446a8xbbdlLI1A= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821223466+05:30 + ResTimestampMock: 2026-05-11T15:15:56.863235274+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-357 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWatu2U3LOr9wqs9j0FKY8DhiCIc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAACg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.821391215+05:30 + ResTimestampMock: 2026-05-11T15:15:56.863251766+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-358 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEByhCKauhZC6qZwnTmgYtgd6Tdio= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.831678378+05:30 + ResTimestampMock: 2026-05-11T15:15:56.872821866+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-359 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJyv28xpt+SZjrrpxBg886Kb1RiM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAAAQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.831199684+05:30 + ResTimestampMock: 2026-05-11T15:15:56.872940667+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-360 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUExei3UEj5JdDW5AFjvVTxCTyd41s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.831193735+05:30 + ResTimestampMock: 2026-05-11T15:15:56.872969378+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-361 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzwI9nhTqNdZkW3Aqbq3tcbnJAD4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAABw== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:56.831796255+05:30 + ResTimestampMock: 2026-05-11T15:15:56.874084743+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-362 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:56.863007309+05:30 + ResTimestampMock: 2026-05-11T15:15:56.904229389+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-363 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:57.136150754+05:30 + ResTimestampMock: 2026-05-11T15:15:57.177150587+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-364 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:57.177281807+05:30 + ResTimestampMock: 2026-05-11T15:15:57.219398176+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-365 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:57.283310661+05:30 + ResTimestampMock: 2026-05-11T15:15:57.325970507+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-366 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:57.326361482+05:30 + ResTimestampMock: 2026-05-11T15:15:57.368776756+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-367 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:57.602907662+05:30 + ResTimestampMock: 2026-05-11T15:15:57.644435164+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-368 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:57.626024116+05:30 + ResTimestampMock: 2026-05-11T15:15:57.6689313+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-369 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:57.644538652+05:30 + ResTimestampMock: 2026-05-11T15:15:57.687632627+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-370 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:57.669587265+05:30 + ResTimestampMock: 2026-05-11T15:15:57.711090396+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-371 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:57.905095407+05:30 + ResTimestampMock: 2026-05-11T15:15:57.948768164+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-372 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:57.949180379+05:30 + ResTimestampMock: 2026-05-11T15:15:57.991070821+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-373 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:58.220738193+05:30 + ResTimestampMock: 2026-05-11T15:15:58.263618094+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-374 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:58.263749201+05:30 + ResTimestampMock: 2026-05-11T15:15:58.306251641+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-375 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:58.370360887+05:30 + ResTimestampMock: 2026-05-11T15:15:58.412583862+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-376 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:58.412948728+05:30 + ResTimestampMock: 2026-05-11T15:15:58.455211772+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-377 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:58.689033365+05:30 + ResTimestampMock: 2026-05-11T15:15:58.731119738+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-378 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:58.712203952+05:30 + ResTimestampMock: 2026-05-11T15:15:58.755881969+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-379 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:58.731569634+05:30 + ResTimestampMock: 2026-05-11T15:15:58.774368152+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-380 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:58.7565998+05:30 + ResTimestampMock: 2026-05-11T15:15:58.799724959+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-381 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUENOPuBgbSnblnAyIHR1eUWZ82Ru0AAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884458008+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926407986+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-382 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+U5P636ziHWN3/TKsarN/qAILNsAAAAPAgEAA2lkeAAAAAAAAAAOAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884453072+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926574416+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-383 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEukTS0kXDOnDUhWTYlWH4DFBFQmYAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884478058+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926574104+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-384 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6nDpQJu4e++EkV7sjQ17NRjvfygAAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884592132+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926857153+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-385 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEXLX/yMackbjOKbaRd1LmIkpBM7oAAAAPAgEAA2lkeAAAAAAAAAALAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884422061+05:30 + ResTimestampMock: 2026-05-11T15:15:58.92695013+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-386 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkvLhNnyghi5bWusLUIlK+7cLRbgAAAAPAgEAA2lkeAAAAAAAAAANAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884531353+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926955552+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-387 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBhQ96WawPqt1aKOkrCtttxsngnYAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.88440416+05:30 + ResTimestampMock: 2026-05-11T15:15:58.926998363+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-388 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdBJFmptpjSLNyJojdGUlxxzSzXcAAAAPAgEAA2lkeAAAAAAAAAAXAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884364466+05:30 + ResTimestampMock: 2026-05-11T15:15:58.927009219+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-389 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu7CWZAE4TpOjif6/ZOs1FLzXTWYAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884590944+05:30 + ResTimestampMock: 2026-05-11T15:15:58.927032274+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-390 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpQb8oqjTm8Nr34sA1iEG8xRbeDQAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884557379+05:30 + ResTimestampMock: 2026-05-11T15:15:58.927044151+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-391 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGf0TNWn/0de87Bu78n9Bip+gGUMAAAAPAgEAA2lkeAAAAAAAAAAKAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884502546+05:30 + ResTimestampMock: 2026-05-11T15:15:58.927051344+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-392 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMeKQs5rz5/m30N0yNJQmF1UYRFwAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.884611498+05:30 + ResTimestampMock: 2026-05-11T15:15:58.927528992+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-393 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/66MAck5CxsRBuZweSEn+a0NLyQAAAAPAgEAA2lkeAAAAAAAAAAWAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.896640971+05:30 + ResTimestampMock: 2026-05-11T15:15:58.937840272+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-394 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEB8HiI+CW0HhQQ1ArABjB/+dMgCwAAAAPAgEAA2lkeAAAAAAAAAAQAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.895432307+05:30 + ResTimestampMock: 2026-05-11T15:15:58.937846204+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-395 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm6+j2yvdF5pyyS5dCp4whNf0sUAAAAPAgEAA2lkeAAAAAAAAAAPAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.895667385+05:30 + ResTimestampMock: 2026-05-11T15:15:58.937889367+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-396 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYUOf/s0oNXa0zQKacUddedNASF4AAAAPAgEAA2lkeAAAAAAAAAAUAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.896924088+05:30 + ResTimestampMock: 2026-05-11T15:15:58.93827155+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-397 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2VNae/x1Xl4gDpSiBXm04tN9QZ8AAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.899390539+05:30 + ResTimestampMock: 2026-05-11T15:15:58.940703508+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-398 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUlAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWeEfmvw6EQingr+4ixSd3/s5O/sAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.900656636+05:30 + ResTimestampMock: 2026-05-11T15:15:58.943076821+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-399 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUkAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmoOSMquiMMRcyCuMBtzoWfS94KsAAAAPAgEAA2lkeAAAAAAAAAAIAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.900675727+05:30 + ResTimestampMock: 2026-05-11T15:15:58.94307664+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-400 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUlAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEOOAy4D/MU3mbjYMq0a7WxJQ20J4AAAAPAgEAA2lkeAAAAAAAAAATAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.900700568+05:30 + ResTimestampMock: 2026-05-11T15:15:58.94308263+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-401 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5FOaNfb4SOhMx7am29eNJr7evvIAAAAPAgEAA2lkeAAAAAAAAAAJAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.902459454+05:30 + ResTimestampMock: 2026-05-11T15:15:58.943672932+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-402 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE1KqREddauKC1AJ7H6aEne9Z0GQ0AAAAPAgEAA2lkeAAAAAAAAAARAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.902713344+05:30 + ResTimestampMock: 2026-05-11T15:15:58.94367266+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-403 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwZkBh2MTCGBlN84Sw6wY5EArL/gAAAAPAgEAA2lkeAAAAAAAAAASAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.90208188+05:30 + ResTimestampMock: 2026-05-11T15:15:58.943741247+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-404 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVBWqNh0vxyIkyC3l+VBtgz4mxH8AAAAPAgEAA2lkeAAAAAAAAAAVAAAACgIDAAN0YWdtYzQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.90478441+05:30 + ResTimestampMock: 2026-05-11T15:15:58.94668085+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-405 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+U5P636ziHWN3/TKsarN/qAILNs= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA4AAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.926887036+05:30 + ResTimestampMock: 2026-05-11T15:15:58.967917466+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-406 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUENOPuBgbSnblnAyIHR1eUWZ82Ru0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.926534328+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968036101+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-407 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6nDpQJu4e++EkV7sjQ17NRjvfyg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.92696317+05:30 + ResTimestampMock: 2026-05-11T15:15:58.96808384+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-408 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpQb8oqjTm8Nr34sA1iEG8xRbeDQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAAAg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927165641+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968085155+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-409 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkvLhNnyghi5bWusLUIlK+7cLRbg= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA0AAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927021101+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968097874+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-410 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBhQ96WawPqt1aKOkrCtttxsngnY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAADA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927140585+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968103999+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-411 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEukTS0kXDOnDUhWTYlWH4DFBFQmY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.926741963+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968110848+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-412 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEXLX/yMackbjOKbaRd1LmIkpBM7o= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927161084+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968740829+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-413 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdBJFmptpjSLNyJojdGUlxxzSzXc= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABcAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927045014+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968815383+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-414 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMeKQs5rz5/m30N0yNJQmF1UYRFw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927606948+05:30 + ResTimestampMock: 2026-05-11T15:15:58.968826204+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-415 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu7CWZAE4TpOjif6/ZOs1FLzXTWY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927083508+05:30 + ResTimestampMock: 2026-05-11T15:15:58.969053494+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-416 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGf0TNWn/0de87Bu78n9Bip+gGUM= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.927130337+05:30 + ResTimestampMock: 2026-05-11T15:15:58.970412849+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-417 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEB8HiI+CW0HhQQ1ArABjB/+dMgCw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABAAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.938241398+05:30 + ResTimestampMock: 2026-05-11T15:15:58.978874283+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-418 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm6+j2yvdF5pyyS5dCp4whNf0sU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA8AAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.938233468+05:30 + ResTimestampMock: 2026-05-11T15:15:58.979056164+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-419 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/66MAck5CxsRBuZweSEn+a0NLyQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABYAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.93824281+05:30 + ResTimestampMock: 2026-05-11T15:15:58.979106083+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-420 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYUOf/s0oNXa0zQKacUddedNASF4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABQAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.938306693+05:30 + ResTimestampMock: 2026-05-11T15:15:58.980666673+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-421 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2VNae/x1Xl4gDpSiBXm04tN9QZ8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.940862102+05:30 + ResTimestampMock: 2026-05-11T15:15:58.981881558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-422 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEOOAy4D/MU3mbjYMq0a7WxJQ20J4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABMAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943175397+05:30 + ResTimestampMock: 2026-05-11T15:15:58.983942803+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-423 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmoOSMquiMMRcyCuMBtzoWfS94Ks= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943218404+05:30 + ResTimestampMock: 2026-05-11T15:15:58.984129077+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-424 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWeEfmvw6EQingr+4ixSd3/s5O/s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAABg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943199952+05:30 + ResTimestampMock: 2026-05-11T15:15:58.985967978+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-425 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5FOaNfb4SOhMx7am29eNJr7evvI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943909753+05:30 + ResTimestampMock: 2026-05-11T15:15:58.986019486+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-426 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE1KqREddauKC1AJ7H6aEne9Z0GQ0= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABEAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943905131+05:30 + ResTimestampMock: 2026-05-11T15:15:58.986666601+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-427 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwZkBh2MTCGBlN84Sw6wY5EArL/g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABIAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.943863808+05:30 + ResTimestampMock: 2026-05-11T15:15:58.986839301+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-428 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVBWqNh0vxyIkyC3l+VBtgz4mxH8= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABUAAAAKAQMAA3RhZ21jNA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:15:58.946764488+05:30 + ResTimestampMock: 2026-05-11T15:15:58.988885727+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-429 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:58.991646106+05:30 + ResTimestampMock: 2026-05-11T15:15:59.032846767+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-430 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:59.033068372+05:30 + ResTimestampMock: 2026-05-11T15:15:59.074201123+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-431 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:59.30676515+05:30 + ResTimestampMock: 2026-05-11T15:15:59.348118926+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-432 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:59.348535908+05:30 + ResTimestampMock: 2026-05-11T15:15:59.392135444+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-433 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:59.456246116+05:30 + ResTimestampMock: 2026-05-11T15:15:59.496977831+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-434 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:59.497050539+05:30 + ResTimestampMock: 2026-05-11T15:15:59.53921285+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-435 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:59.775977185+05:30 + ResTimestampMock: 2026-05-11T15:15:59.818371752+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-436 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:15:59.80073005+05:30 + ResTimestampMock: 2026-05-11T15:15:59.842982687+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-437 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:59.819139596+05:30 + ResTimestampMock: 2026-05-11T15:15:59.861536282+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-438 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:15:59.843191282+05:30 + ResTimestampMock: 2026-05-11T15:15:59.885418221+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-439 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:00.074657569+05:30 + ResTimestampMock: 2026-05-11T15:16:00.116440133+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-440 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:00.11657413+05:30 + ResTimestampMock: 2026-05-11T15:16:00.158523477+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-441 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:00.393120426+05:30 + ResTimestampMock: 2026-05-11T15:16:00.434363975+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-442 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:00.434514142+05:30 + ResTimestampMock: 2026-05-11T15:16:00.476692178+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-443 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:00.540317536+05:30 + ResTimestampMock: 2026-05-11T15:16:00.58215081+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-444 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:00.582263553+05:30 + ResTimestampMock: 2026-05-11T15:16:00.623069303+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-445 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:00.8627612+05:30 + ResTimestampMock: 2026-05-11T15:16:00.905816853+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-446 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:00.886155929+05:30 + ResTimestampMock: 2026-05-11T15:16:00.927107686+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-447 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:00.906530427+05:30 + ResTimestampMock: 2026-05-11T15:16:00.949701679+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-448 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:00.927543605+05:30 + ResTimestampMock: 2026-05-11T15:16:00.96929283+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-449 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:01.159964202+05:30 + ResTimestampMock: 2026-05-11T15:16:01.20117712+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-450 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:01.201375547+05:30 + ResTimestampMock: 2026-05-11T15:16:01.243382062+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-451 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:01.478161173+05:30 + ResTimestampMock: 2026-05-11T15:16:01.520044221+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-452 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:01.520599499+05:30 + ResTimestampMock: 2026-05-11T15:16:01.561588322+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-453 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:01.623656864+05:30 + ResTimestampMock: 2026-05-11T15:16:01.666336075+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-454 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:01.666463209+05:30 + ResTimestampMock: 2026-05-11T15:16:01.708587178+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-455 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:01.950964532+05:30 + ResTimestampMock: 2026-05-11T15:16:01.992700186+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-456 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:01.970223675+05:30 + ResTimestampMock: 2026-05-11T15:16:02.010995035+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-457 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:01.993243439+05:30 + ResTimestampMock: 2026-05-11T15:16:02.036668254+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-458 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.006901469+05:30 + ResTimestampMock: 2026-05-11T15:16:02.048001068+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-459 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.006901505+05:30 + ResTimestampMock: 2026-05-11T15:16:02.048066289+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-460 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.005446622+05:30 + ResTimestampMock: 2026-05-11T15:16:02.048083383+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-461 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.006574233+05:30 + ResTimestampMock: 2026-05-11T15:16:02.048185838+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-462 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.011158868+05:30 + ResTimestampMock: 2026-05-11T15:16:02.052005171+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-463 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.048278087+05:30 + ResTimestampMock: 2026-05-11T15:16:02.089748439+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-464 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.04807545+05:30 + ResTimestampMock: 2026-05-11T15:16:02.0897501+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-465 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.048246748+05:30 + ResTimestampMock: 2026-05-11T15:16:02.089756109+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-466 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.04812282+05:30 + ResTimestampMock: 2026-05-11T15:16:02.089781266+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-467 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.098328513+05:30 + ResTimestampMock: 2026-05-11T15:16:02.140380605+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-468 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.098555477+05:30 + ResTimestampMock: 2026-05-11T15:16:02.140380549+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-469 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.098605791+05:30 + ResTimestampMock: 2026-05-11T15:16:02.140631428+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-470 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.098785201+05:30 + ResTimestampMock: 2026-05-11T15:16:02.140628279+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-471 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.140730321+05:30 + ResTimestampMock: 2026-05-11T15:16:02.182185776+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-472 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.140564838+05:30 + ResTimestampMock: 2026-05-11T15:16:02.182196697+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-473 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.140769003+05:30 + ResTimestampMock: 2026-05-11T15:16:02.182401494+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-474 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.140685535+05:30 + ResTimestampMock: 2026-05-11T15:16:02.182565505+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-475 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:02.182562777+05:30 + ResTimestampMock: 2026-05-11T15:16:02.224442306+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-476 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:02.18268728+05:30 + ResTimestampMock: 2026-05-11T15:16:02.22451795+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-477 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:02.182531414+05:30 + ResTimestampMock: 2026-05-11T15:16:02.224482966+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-478 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:02.182505873+05:30 + ResTimestampMock: 2026-05-11T15:16:02.224517182+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-479 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.22597784+05:30 + ResTimestampMock: 2026-05-11T15:16:02.26743199+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-480 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.225951751+05:30 + ResTimestampMock: 2026-05-11T15:16:02.267906413+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-481 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.225887562+05:30 + ResTimestampMock: 2026-05-11T15:16:02.267954218+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-482 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.226107855+05:30 + ResTimestampMock: 2026-05-11T15:16:02.267991822+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-483 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.244507661+05:30 + ResTimestampMock: 2026-05-11T15:16:02.286241996+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-484 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.267673695+05:30 + ResTimestampMock: 2026-05-11T15:16:02.309232215+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-485 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.267990308+05:30 + ResTimestampMock: 2026-05-11T15:16:02.309656065+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-486 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.2680769+05:30 + ResTimestampMock: 2026-05-11T15:16:02.310800809+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-487 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.268060445+05:30 + ResTimestampMock: 2026-05-11T15:16:02.311692928+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-488 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.286362139+05:30 + ResTimestampMock: 2026-05-11T15:16:02.328241418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-489 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3smb5joTF2kRQgsk6eBPYGGh34QAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdmYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.321803505+05:30 + ResTimestampMock: 2026-05-11T15:16:02.363003386+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-490 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi8aaJ0cxMpVePhwGjutZKwUAWKEAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdmYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.322659592+05:30 + ResTimestampMock: 2026-05-11T15:16:02.363785745+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-491 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi2ZMNTTV0CN8AXdfvS5KjqL1I6gAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdmYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.325004015+05:30 + ResTimestampMock: 2026-05-11T15:16:02.36577053+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-492 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE66pGBU5KUB9bGk97z2aMgA2dtToAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdmYzE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.325004074+05:30 + ResTimestampMock: 2026-05-11T15:16:02.366911777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-493 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3smb5joTF2kRQgsk6eBPYGGh34Q= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ2ZjMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.363239108+05:30 + ResTimestampMock: 2026-05-11T15:16:02.405327612+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-494 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi8aaJ0cxMpVePhwGjutZKwUAWKE= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ2ZjMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.364036998+05:30 + ResTimestampMock: 2026-05-11T15:16:02.405894192+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-495 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi2ZMNTTV0CN8AXdfvS5KjqL1I6g= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ2ZjMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.366020254+05:30 + ResTimestampMock: 2026-05-11T15:16:02.407962176+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-496 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE66pGBU5KUB9bGk97z2aMgA2dtTo= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ2ZjMQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:02.368995897+05:30 + ResTimestampMock: 2026-05-11T15:16:02.41155246+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-497 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.562198257+05:30 + ResTimestampMock: 2026-05-11T15:16:02.603580965+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-498 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.603740813+05:30 + ResTimestampMock: 2026-05-11T15:16:02.645563198+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-499 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:02.709996956+05:30 + ResTimestampMock: 2026-05-11T15:16:02.751989853+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-500 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:02.752443873+05:30 + ResTimestampMock: 2026-05-11T15:16:02.795417998+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-501 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:03.037762259+05:30 + ResTimestampMock: 2026-05-11T15:16:03.080847627+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-502 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:03.053021799+05:30 + ResTimestampMock: 2026-05-11T15:16:03.095226195+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-503 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:03.080981703+05:30 + ResTimestampMock: 2026-05-11T15:16:03.122371217+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-504 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:03.095564494+05:30 + ResTimestampMock: 2026-05-11T15:16:03.138118679+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-505 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:03.329396216+05:30 + ResTimestampMock: 2026-05-11T15:16:03.371207451+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-506 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:03.371343709+05:30 + ResTimestampMock: 2026-05-11T15:16:03.413923565+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-507 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:03.64721014+05:30 + ResTimestampMock: 2026-05-11T15:16:03.689386091+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-508 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:03.689486422+05:30 + ResTimestampMock: 2026-05-11T15:16:03.732209423+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-509 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:03.796746888+05:30 + ResTimestampMock: 2026-05-11T15:16:03.838619582+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-510 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:03.838710973+05:30 + ResTimestampMock: 2026-05-11T15:16:03.881876581+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-511 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:04.123424+05:30 + ResTimestampMock: 2026-05-11T15:16:04.165532505+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-512 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:04.138966619+05:30 + ResTimestampMock: 2026-05-11T15:16:04.183324074+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-513 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:04.165787251+05:30 + ResTimestampMock: 2026-05-11T15:16:04.207322077+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-514 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:04.184039234+05:30 + ResTimestampMock: 2026-05-11T15:16:04.226199563+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-515 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:04.415051027+05:30 + ResTimestampMock: 2026-05-11T15:16:04.456427641+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-516 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:04.456674319+05:30 + ResTimestampMock: 2026-05-11T15:16:04.499059211+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-517 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:04.733281302+05:30 + ResTimestampMock: 2026-05-11T15:16:04.774342753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-518 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:04.774419995+05:30 + ResTimestampMock: 2026-05-11T15:16:04.817240574+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-519 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:04.882169839+05:30 + ResTimestampMock: 2026-05-11T15:16:04.923132435+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-520 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:04.923547383+05:30 + ResTimestampMock: 2026-05-11T15:16:04.965554927+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-521 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.208980648+05:30 + ResTimestampMock: 2026-05-11T15:16:05.250511965+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-522 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.22748439+05:30 + ResTimestampMock: 2026-05-11T15:16:05.270959839+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-523 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.251026654+05:30 + ResTimestampMock: 2026-05-11T15:16:05.294080498+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-524 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.271094198+05:30 + ResTimestampMock: 2026-05-11T15:16:05.313506843+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-525 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.429095551+05:30 + ResTimestampMock: 2026-05-11T15:16:05.469875367+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-526 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.428668561+05:30 + ResTimestampMock: 2026-05-11T15:16:05.469987305+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-527 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.428668555+05:30 + ResTimestampMock: 2026-05-11T15:16:05.469993444+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-528 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.428674156+05:30 + ResTimestampMock: 2026-05-11T15:16:05.470069088+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-529 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.470301785+05:30 + ResTimestampMock: 2026-05-11T15:16:05.511846159+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-530 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.470349912+05:30 + ResTimestampMock: 2026-05-11T15:16:05.51214818+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-531 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.470233157+05:30 + ResTimestampMock: 2026-05-11T15:16:05.51240364+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-532 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.470383999+05:30 + ResTimestampMock: 2026-05-11T15:16:05.512426787+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-533 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.500824774+05:30 + ResTimestampMock: 2026-05-11T15:16:05.542520988+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-534 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.518913868+05:30 + ResTimestampMock: 2026-05-11T15:16:05.560968448+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-535 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.519699348+05:30 + ResTimestampMock: 2026-05-11T15:16:05.561576058+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-536 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.520715778+05:30 + ResTimestampMock: 2026-05-11T15:16:05.561630137+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-537 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.520362209+05:30 + ResTimestampMock: 2026-05-11T15:16:05.562854157+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-538 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.542851258+05:30 + ResTimestampMock: 2026-05-11T15:16:05.584306461+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-539 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.561067917+05:30 + ResTimestampMock: 2026-05-11T15:16:05.602504199+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-540 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.561672848+05:30 + ResTimestampMock: 2026-05-11T15:16:05.603965759+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-541 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.561655492+05:30 + ResTimestampMock: 2026-05-11T15:16:05.604434539+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-542 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.563364141+05:30 + ResTimestampMock: 2026-05-11T15:16:05.606933435+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-543 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:05.602614578+05:30 + ResTimestampMock: 2026-05-11T15:16:05.645269174+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-544 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:05.604047979+05:30 + ResTimestampMock: 2026-05-11T15:16:05.64616638+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-545 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:05.605851222+05:30 + ResTimestampMock: 2026-05-11T15:16:05.648247666+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-546 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:05.607317344+05:30 + ResTimestampMock: 2026-05-11T15:16:05.650082709+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-547 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.647518195+05:30 + ResTimestampMock: 2026-05-11T15:16:05.689557296+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-548 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.648364404+05:30 + ResTimestampMock: 2026-05-11T15:16:05.690643655+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-549 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.649533496+05:30 + ResTimestampMock: 2026-05-11T15:16:05.6909382+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-550 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.651531569+05:30 + ResTimestampMock: 2026-05-11T15:16:05.693734393+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-551 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.68970261+05:30 + ResTimestampMock: 2026-05-11T15:16:05.731187233+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-552 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.690724649+05:30 + ResTimestampMock: 2026-05-11T15:16:05.73206748+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-553 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.690996543+05:30 + ResTimestampMock: 2026-05-11T15:16:05.732281182+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-554 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.693957413+05:30 + ResTimestampMock: 2026-05-11T15:16:05.735619075+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-555 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEY/nUHM7KmmNev4pgGXL9wCY87QUAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.741682115+05:30 + ResTimestampMock: 2026-05-11T15:16:05.784299991+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-556 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUETf0wqtcDzNBYG7yznG0a7s9KBrQAAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.74193508+05:30 + ResTimestampMock: 2026-05-11T15:16:05.784319739+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-557 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzmGjaMxKYbGi8vieBlEKjuLTU+sAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.741935835+05:30 + ResTimestampMock: 2026-05-11T15:16:05.784319712+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-558 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeftghePRbJlJ3rdktpK54q8cEiwAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.746790005+05:30 + ResTimestampMock: 2026-05-11T15:16:05.789364675+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-559 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzmGjaMxKYbGi8vieBlEKjuLTU+s= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.784804969+05:30 + ResTimestampMock: 2026-05-11T15:16:05.826902772+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-560 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETf0wqtcDzNBYG7yznG0a7s9KBrQ= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.784813819+05:30 + ResTimestampMock: 2026-05-11T15:16:05.826981144+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-561 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEY/nUHM7KmmNev4pgGXL9wCY87QU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.784805278+05:30 + ResTimestampMock: 2026-05-11T15:16:05.826994091+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-562 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeftghePRbJlJ3rdktpK54q8cEiw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:05.78945179+05:30 + ResTimestampMock: 2026-05-11T15:16:05.831080463+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-563 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.819009034+05:30 + ResTimestampMock: 2026-05-11T15:16:05.861541558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-564 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.837066013+05:30 + ResTimestampMock: 2026-05-11T15:16:05.878854352+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-565 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.838732008+05:30 + ResTimestampMock: 2026-05-11T15:16:05.879646292+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-566 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.837429117+05:30 + ResTimestampMock: 2026-05-11T15:16:05.879680727+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-567 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 6 + packet_type: Info + meta: + info_command: build + info_kind: discovery + raw_body: YnVpbGQK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 14 + packet_type: Info + meta: + info_command: "build\t7.2.0.1" + info_kind: unknown + raw_body: YnVpbGQJNy4yLjAuMQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.837574968+05:30 + ResTimestampMock: 2026-05-11T15:16:05.879678154+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-568 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.86190795+05:30 + ResTimestampMock: 2026-05-11T15:16:05.90419152+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-569 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.879063218+05:30 + ResTimestampMock: 2026-05-11T15:16:05.91999309+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-570 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.880005412+05:30 + ResTimestampMock: 2026-05-11T15:16:05.921794551+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-571 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.879988897+05:30 + ResTimestampMock: 2026-05-11T15:16:05.921880361+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-572 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 35 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 278 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.879992782+05:30 + ResTimestampMock: 2026-05-11T15:16:05.921959636+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-573 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.926864765+05:30 + ResTimestampMock: 2026-05-11T15:16:05.969146174+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-574 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.928697912+05:30 + ResTimestampMock: 2026-05-11T15:16:05.969626719+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-575 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.930128334+05:30 + ResTimestampMock: 2026-05-11T15:16:05.970653722+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-576 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.929760442+05:30 + ResTimestampMock: 2026-05-11T15:16:05.970656601+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-577 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:05.966377177+05:30 + ResTimestampMock: 2026-05-11T15:16:06.009635753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-578 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.969303552+05:30 + ResTimestampMock: 2026-05-11T15:16:06.011397578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-579 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.969962148+05:30 + ResTimestampMock: 2026-05-11T15:16:06.011463484+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-580 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.970717656+05:30 + ResTimestampMock: 2026-05-11T15:16:06.012082207+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-581 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:05.970763454+05:30 + ResTimestampMock: 2026-05-11T15:16:06.012225712+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-582 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.009810438+05:30 + ResTimestampMock: 2026-05-11T15:16:06.052116778+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-583 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:06.011827652+05:30 + ResTimestampMock: 2026-05-11T15:16:06.054194348+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-584 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:06.011860608+05:30 + ResTimestampMock: 2026-05-11T15:16:06.054194338+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-585 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:06.012144074+05:30 + ResTimestampMock: 2026-05-11T15:16:06.054206775+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-586 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 30 + packet_type: Info + meta: + info_command: partition-generation + info_kind: partition + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 726 + packet_type: Info + meta: + info_command: "partition-generation\t0" + info_kind: unknown + raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K + message: null + ReqTimestampMock: 2026-05-11T15:16:06.012293566+05:30 + ResTimestampMock: 2026-05-11T15:16:06.054277128+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-587 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.056222896+05:30 + ResTimestampMock: 2026-05-11T15:16:06.096943126+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-588 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.055698905+05:30 + ResTimestampMock: 2026-05-11T15:16:06.097969234+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-589 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.056222624+05:30 + ResTimestampMock: 2026-05-11T15:16:06.098280989+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-590 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.056224684+05:30 + ResTimestampMock: 2026-05-11T15:16:06.098338015+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-591 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.097164943+05:30 + ResTimestampMock: 2026-05-11T15:16:06.13867593+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-592 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.09818939+05:30 + ResTimestampMock: 2026-05-11T15:16:06.139599623+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-593 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.098633271+05:30 + ResTimestampMock: 2026-05-11T15:16:06.14114526+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-594 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.098518154+05:30 + ResTimestampMock: 2026-05-11T15:16:06.141139453+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-595 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEooWWr26zzvTRppMjJAV9rJfMsHwAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.150676173+05:30 + ResTimestampMock: 2026-05-11T15:16:06.193114627+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-596 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEc70Z1e2gAZs7rYTl1gcoiZPEzaoAAAAKAgMAA3RhZ2ZjMgAAAA8CAQADaWR4AAAAAAAAAAY= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.152228525+05:30 + ResTimestampMock: 2026-05-11T15:16:06.193115847+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-597 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcd7CswyqY+geeRdw3ZuPH8UhtY4AAAAKAgMAA3RhZ2ZjMgAAAA8CAQADaWR4AAAAAAAAAAU= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.151026378+05:30 + ResTimestampMock: 2026-05-11T15:16:06.193195029+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-598 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 98 + packet_type: Message + meta: + namespace: test + raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZAkvoW/VlRmuvUwVs9CJGsqiIS4AAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdmYzI= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 22 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.152698998+05:30 + ResTimestampMock: 2026-05-11T15:16:06.193705632+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-599 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEc70Z1e2gAZs7rYTl1gcoiZPEzao= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnZmMyAAAADwEBAANpZHgAAAAAAAAABg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.19328036+05:30 + ResTimestampMock: 2026-05-11T15:16:06.234299014+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-600 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEooWWr26zzvTRppMjJAV9rJfMsHw= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.193288835+05:30 + ResTimestampMock: 2026-05-11T15:16:06.234910683+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-601 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcd7CswyqY+geeRdw3ZuPH8UhtY4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnZmMyAAAADwEBAANpZHgAAAAAAAAABQ== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.193319454+05:30 + ResTimestampMock: 2026-05-11T15:16:06.234942424+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-602 +spec: + metadata: + protocol: aerospike + reqType: Message + respType: Message + type: mocks + requests: + - header: + header: + version: 2 + type: 3 + length: 65 + packet_type: Message + meta: + namespace: test + raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZAkvoW/VlRmuvUwVs9CJGsqiIS4= + set: demo + message: null + responses: + - header: + header: + version: 2 + type: 3 + length: 55 + packet_type: Message + meta: + namespace: "" + raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ2ZjMg== + set: "" + message: null + ReqTimestampMock: 2026-05-11T15:16:06.193807233+05:30 + ResTimestampMock: 2026-05-11T15:16:06.237169003+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-603 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.294780554+05:30 + ResTimestampMock: 2026-05-11T15:16:06.336988052+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-604 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.313871472+05:30 + ResTimestampMock: 2026-05-11T15:16:06.355004271+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-605 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.337132576+05:30 + ResTimestampMock: 2026-05-11T15:16:06.379361497+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-606 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.355157305+05:30 + ResTimestampMock: 2026-05-11T15:16:06.398199472+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-607 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.584818642+05:30 + ResTimestampMock: 2026-05-11T15:16:06.627035793+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-608 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.627155501+05:30 + ResTimestampMock: 2026-05-11T15:16:06.669372542+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-609 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:06.906153278+05:30 + ResTimestampMock: 2026-05-11T15:16:06.94865473+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-610 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:06.949379835+05:30 + ResTimestampMock: 2026-05-11T15:16:06.992216761+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-611 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:07.053222206+05:30 + ResTimestampMock: 2026-05-11T15:16:07.094472895+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-612 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:07.094595146+05:30 + ResTimestampMock: 2026-05-11T15:16:07.136995768+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-613 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:07.381018519+05:30 + ResTimestampMock: 2026-05-11T15:16:07.423282305+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-614 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:07.399289427+05:30 + ResTimestampMock: 2026-05-11T15:16:07.441167566+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-615 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:07.423356867+05:30 + ResTimestampMock: 2026-05-11T15:16:07.464198313+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-616 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:07.441249688+05:30 + ResTimestampMock: 2026-05-11T15:16:07.482540327+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-617 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:07.671027597+05:30 + ResTimestampMock: 2026-05-11T15:16:07.713441861+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-618 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:07.713762756+05:30 + ResTimestampMock: 2026-05-11T15:16:07.755247339+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-619 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:07.993138384+05:30 + ResTimestampMock: 2026-05-11T15:16:08.034222996+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-620 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:08.034491636+05:30 + ResTimestampMock: 2026-05-11T15:16:08.077418578+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-621 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:08.138035305+05:30 + ResTimestampMock: 2026-05-11T15:16:08.180769112+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-622 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:08.181175224+05:30 + ResTimestampMock: 2026-05-11T15:16:08.222220143+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-623 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:08.465761676+05:30 + ResTimestampMock: 2026-05-11T15:16:08.508188981+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-624 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:08.483236664+05:30 + ResTimestampMock: 2026-05-11T15:16:08.526546437+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-625 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:08.508675368+05:30 + ResTimestampMock: 2026-05-11T15:16:08.551000863+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-626 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:08.526765619+05:30 + ResTimestampMock: 2026-05-11T15:16:08.568145422+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-627 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:08.755978874+05:30 + ResTimestampMock: 2026-05-11T15:16:08.798501838+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-628 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:08.798769124+05:30 + ResTimestampMock: 2026-05-11T15:16:08.841222287+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-629 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:09.077771072+05:30 + ResTimestampMock: 2026-05-11T15:16:09.119052566+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-630 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:09.119178794+05:30 + ResTimestampMock: 2026-05-11T15:16:09.161049299+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-631 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:09.223570329+05:30 + ResTimestampMock: 2026-05-11T15:16:09.266214857+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-632 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:09.266356593+05:30 + ResTimestampMock: 2026-05-11T15:16:09.308081913+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-633 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:09.551818617+05:30 + ResTimestampMock: 2026-05-11T15:16:09.59281558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-634 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:09.569177382+05:30 + ResTimestampMock: 2026-05-11T15:16:09.610904053+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-635 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:09.592957374+05:30 + ResTimestampMock: 2026-05-11T15:16:09.634152381+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-636 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:09.611335238+05:30 + ResTimestampMock: 2026-05-11T15:16:09.653087364+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-637 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:09.842528641+05:30 + ResTimestampMock: 2026-05-11T15:16:09.884613615+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-638 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:09.884990167+05:30 + ResTimestampMock: 2026-05-11T15:16:09.926554883+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-639 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:10.161869022+05:30 + ResTimestampMock: 2026-05-11T15:16:10.203427579+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-640 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:10.203735913+05:30 + ResTimestampMock: 2026-05-11T15:16:10.245465416+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-641 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:10.309463817+05:30 + ResTimestampMock: 2026-05-11T15:16:10.352616993+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-642 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:10.352743988+05:30 + ResTimestampMock: 2026-05-11T15:16:10.395082986+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-643 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:10.63584935+05:30 + ResTimestampMock: 2026-05-11T15:16:10.678689793+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-644 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:10.654145859+05:30 + ResTimestampMock: 2026-05-11T15:16:10.696012095+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-645 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:10.679070503+05:30 + ResTimestampMock: 2026-05-11T15:16:10.720591213+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-646 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:10.696339519+05:30 + ResTimestampMock: 2026-05-11T15:16:10.737481922+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-647 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:10.927929347+05:30 + ResTimestampMock: 2026-05-11T15:16:10.969854899+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-648 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:10.970503749+05:30 + ResTimestampMock: 2026-05-11T15:16:11.013318518+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-649 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:11.247174301+05:30 + ResTimestampMock: 2026-05-11T15:16:11.289564316+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-650 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:11.289693698+05:30 + ResTimestampMock: 2026-05-11T15:16:11.331262096+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-651 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:11.3970696+05:30 + ResTimestampMock: 2026-05-11T15:16:11.438107956+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-652 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:11.438295389+05:30 + ResTimestampMock: 2026-05-11T15:16:11.479724888+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-653 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:11.72183655+05:30 + ResTimestampMock: 2026-05-11T15:16:11.764498752+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-654 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:11.738018942+05:30 + ResTimestampMock: 2026-05-11T15:16:11.779188553+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-655 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:11.76460304+05:30 + ResTimestampMock: 2026-05-11T15:16:11.80695178+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-656 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:11.779291275+05:30 + ResTimestampMock: 2026-05-11T15:16:11.821506621+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-657 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:12.014960766+05:30 + ResTimestampMock: 2026-05-11T15:16:12.056526953+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-658 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:12.056694258+05:30 + ResTimestampMock: 2026-05-11T15:16:12.099206153+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-659 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:12.331690375+05:30 + ResTimestampMock: 2026-05-11T15:16:12.374846387+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-660 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:12.375361984+05:30 + ResTimestampMock: 2026-05-11T15:16:12.417845137+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-661 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:12.480517777+05:30 + ResTimestampMock: 2026-05-11T15:16:12.522739423+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-662 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:12.523008399+05:30 + ResTimestampMock: 2026-05-11T15:16:12.564697988+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-663 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:12.808267535+05:30 + ResTimestampMock: 2026-05-11T15:16:12.849274929+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-664 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:12.822208812+05:30 + ResTimestampMock: 2026-05-11T15:16:12.864096375+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-665 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:12.849654973+05:30 + ResTimestampMock: 2026-05-11T15:16:12.891353137+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-666 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:12.86415916+05:30 + ResTimestampMock: 2026-05-11T15:16:12.905390522+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-667 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:13.100095254+05:30 + ResTimestampMock: 2026-05-11T15:16:13.141549013+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-668 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:13.141728163+05:30 + ResTimestampMock: 2026-05-11T15:16:13.183115546+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-669 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:13.419252349+05:30 + ResTimestampMock: 2026-05-11T15:16:13.461651843+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-670 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:13.461759944+05:30 + ResTimestampMock: 2026-05-11T15:16:13.504691721+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-671 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:13.565740002+05:30 + ResTimestampMock: 2026-05-11T15:16:13.607458318+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-672 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:13.607617583+05:30 + ResTimestampMock: 2026-05-11T15:16:13.649908745+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-673 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:13.891710933+05:30 + ResTimestampMock: 2026-05-11T15:16:13.934517029+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-674 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:13.90617078+05:30 + ResTimestampMock: 2026-05-11T15:16:13.94818841+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-675 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:13.934987543+05:30 + ResTimestampMock: 2026-05-11T15:16:13.976960756+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-676 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:13.948323327+05:30 + ResTimestampMock: 2026-05-11T15:16:13.990739672+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-677 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:14.184073846+05:30 + ResTimestampMock: 2026-05-11T15:16:14.225067292+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-678 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:14.225483283+05:30 + ResTimestampMock: 2026-05-11T15:16:14.267344034+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-679 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:14.505804556+05:30 + ResTimestampMock: 2026-05-11T15:16:14.548239765+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-680 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:14.54838762+05:30 + ResTimestampMock: 2026-05-11T15:16:14.591098891+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-681 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:14.65099795+05:30 + ResTimestampMock: 2026-05-11T15:16:14.693708251+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-682 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:14.693995446+05:30 + ResTimestampMock: 2026-05-11T15:16:14.73727379+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-683 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:14.978571343+05:30 + ResTimestampMock: 2026-05-11T15:16:15.021232024+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-684 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:14.991692297+05:30 + ResTimestampMock: 2026-05-11T15:16:15.034311081+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-685 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:15.021866734+05:30 + ResTimestampMock: 2026-05-11T15:16:15.063211763+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-686 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:15.034413859+05:30 + ResTimestampMock: 2026-05-11T15:16:15.075816157+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-687 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:15.269297569+05:30 + ResTimestampMock: 2026-05-11T15:16:15.312266044+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-688 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:15.312472683+05:30 + ResTimestampMock: 2026-05-11T15:16:15.35436046+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-689 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:15.592174884+05:30 + ResTimestampMock: 2026-05-11T15:16:15.634213815+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-690 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:15.63443884+05:30 + ResTimestampMock: 2026-05-11T15:16:15.676732759+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-691 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:15.737659463+05:30 + ResTimestampMock: 2026-05-11T15:16:15.780581248+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-692 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:15.781116741+05:30 + ResTimestampMock: 2026-05-11T15:16:15.822656308+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-693 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:16.064169712+05:30 + ResTimestampMock: 2026-05-11T15:16:16.106069819+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-694 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:16.076597735+05:30 + ResTimestampMock: 2026-05-11T15:16:16.119872413+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-695 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:16.106534896+05:30 + ResTimestampMock: 2026-05-11T15:16:16.148535461+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-696 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:16.120214788+05:30 + ResTimestampMock: 2026-05-11T15:16:16.161827561+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-697 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:16.355034778+05:30 + ResTimestampMock: 2026-05-11T15:16:16.396657188+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-698 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:16.396812937+05:30 + ResTimestampMock: 2026-05-11T15:16:16.438606814+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-699 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:16.678006596+05:30 + ResTimestampMock: 2026-05-11T15:16:16.719311476+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-700 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:16.719456921+05:30 + ResTimestampMock: 2026-05-11T15:16:16.761578168+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-701 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:16.823240662+05:30 + ResTimestampMock: 2026-05-11T15:16:16.865277039+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-702 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:16.865840595+05:30 + ResTimestampMock: 2026-05-11T15:16:16.908014005+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-703 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:17.150012661+05:30 + ResTimestampMock: 2026-05-11T15:16:17.191677146+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-704 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:17.163175914+05:30 + ResTimestampMock: 2026-05-11T15:16:17.205469909+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-705 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:17.192446972+05:30 + ResTimestampMock: 2026-05-11T15:16:17.234279127+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-706 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:17.205689162+05:30 + ResTimestampMock: 2026-05-11T15:16:17.247655478+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-707 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:17.43985023+05:30 + ResTimestampMock: 2026-05-11T15:16:17.482298293+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-708 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:17.482437487+05:30 + ResTimestampMock: 2026-05-11T15:16:17.524476806+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-709 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:17.762842132+05:30 + ResTimestampMock: 2026-05-11T15:16:17.804293609+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-710 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:17.804711003+05:30 + ResTimestampMock: 2026-05-11T15:16:17.846356918+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-711 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:17.908752729+05:30 + ResTimestampMock: 2026-05-11T15:16:17.951019953+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-712 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:17.951182754+05:30 + ResTimestampMock: 2026-05-11T15:16:17.992659153+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-713 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:18.235006897+05:30 + ResTimestampMock: 2026-05-11T15:16:18.276524934+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-714 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:18.248427346+05:30 + ResTimestampMock: 2026-05-11T15:16:18.290579248+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-715 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:18.276773295+05:30 + ResTimestampMock: 2026-05-11T15:16:18.318231123+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-716 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:18.290702333+05:30 + ResTimestampMock: 2026-05-11T15:16:18.332038777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-717 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:18.5249215+05:30 + ResTimestampMock: 2026-05-11T15:16:18.566193484+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-718 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:18.56651817+05:30 + ResTimestampMock: 2026-05-11T15:16:18.607804895+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-719 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:18.847709955+05:30 + ResTimestampMock: 2026-05-11T15:16:18.889772772+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-720 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:18.889921765+05:30 + ResTimestampMock: 2026-05-11T15:16:18.93225575+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-721 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:18.993915347+05:30 + ResTimestampMock: 2026-05-11T15:16:19.035777799+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-722 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:19.036140838+05:30 + ResTimestampMock: 2026-05-11T15:16:19.080384075+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-723 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:19.318851277+05:30 + ResTimestampMock: 2026-05-11T15:16:19.360009371+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-724 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:19.333315067+05:30 + ResTimestampMock: 2026-05-11T15:16:19.374323352+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-725 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:19.360362439+05:30 + ResTimestampMock: 2026-05-11T15:16:19.402928912+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-726 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:19.374450534+05:30 + ResTimestampMock: 2026-05-11T15:16:19.41626267+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-727 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:19.608826512+05:30 + ResTimestampMock: 2026-05-11T15:16:19.650034473+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-728 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:19.650316442+05:30 + ResTimestampMock: 2026-05-11T15:16:19.692108197+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-729 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:19.933464286+05:30 + ResTimestampMock: 2026-05-11T15:16:19.976107489+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-730 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:19.976316498+05:30 + ResTimestampMock: 2026-05-11T15:16:20.018928969+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-731 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:20.080743838+05:30 + ResTimestampMock: 2026-05-11T15:16:20.123121149+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-732 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:20.123252814+05:30 + ResTimestampMock: 2026-05-11T15:16:20.166892071+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-733 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:20.404683186+05:30 + ResTimestampMock: 2026-05-11T15:16:20.446828327+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-734 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:20.41707498+05:30 + ResTimestampMock: 2026-05-11T15:16:20.460293721+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-735 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:20.446957748+05:30 + ResTimestampMock: 2026-05-11T15:16:20.488605072+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-736 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:20.460617114+05:30 + ResTimestampMock: 2026-05-11T15:16:20.503192605+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-737 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:20.69367266+05:30 + ResTimestampMock: 2026-05-11T15:16:20.736479868+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-738 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:20.736903679+05:30 + ResTimestampMock: 2026-05-11T15:16:20.779401114+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-739 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:21.019995234+05:30 + ResTimestampMock: 2026-05-11T15:16:21.061331275+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-740 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:21.061676644+05:30 + ResTimestampMock: 2026-05-11T15:16:21.103586408+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-741 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:21.167323531+05:30 + ResTimestampMock: 2026-05-11T15:16:21.209702016+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-742 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:21.210093318+05:30 + ResTimestampMock: 2026-05-11T15:16:21.251021341+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-743 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:21.490318794+05:30 + ResTimestampMock: 2026-05-11T15:16:21.532594378+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-744 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:21.504334816+05:30 + ResTimestampMock: 2026-05-11T15:16:21.546242777+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-745 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:21.533073788+05:30 + ResTimestampMock: 2026-05-11T15:16:21.576180459+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-746 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:21.546359477+05:30 + ResTimestampMock: 2026-05-11T15:16:21.589552817+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-747 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:21.78008349+05:30 + ResTimestampMock: 2026-05-11T15:16:21.82251371+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-748 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:21.823257108+05:30 + ResTimestampMock: 2026-05-11T15:16:21.86535923+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-749 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:22.104843+05:30 + ResTimestampMock: 2026-05-11T15:16:22.147032914+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-750 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:22.147148597+05:30 + ResTimestampMock: 2026-05-11T15:16:22.188847856+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-751 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:22.252675674+05:30 + ResTimestampMock: 2026-05-11T15:16:22.294270145+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-752 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:22.294418742+05:30 + ResTimestampMock: 2026-05-11T15:16:22.336245703+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-753 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:22.577930515+05:30 + ResTimestampMock: 2026-05-11T15:16:22.620525753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-754 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:22.591243309+05:30 + ResTimestampMock: 2026-05-11T15:16:22.63569507+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-755 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:22.620783875+05:30 + ResTimestampMock: 2026-05-11T15:16:22.663827158+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-756 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:22.636089589+05:30 + ResTimestampMock: 2026-05-11T15:16:22.678581969+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-757 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:22.866912579+05:30 + ResTimestampMock: 2026-05-11T15:16:22.908827192+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-758 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:22.90943224+05:30 + ResTimestampMock: 2026-05-11T15:16:22.951219893+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-759 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:23.19002207+05:30 + ResTimestampMock: 2026-05-11T15:16:23.232344353+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-760 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:23.232533161+05:30 + ResTimestampMock: 2026-05-11T15:16:23.275880094+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-761 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:23.336756888+05:30 + ResTimestampMock: 2026-05-11T15:16:23.380008219+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-762 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:23.380413187+05:30 + ResTimestampMock: 2026-05-11T15:16:23.424165932+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-763 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:23.664967394+05:30 + ResTimestampMock: 2026-05-11T15:16:23.706319579+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-764 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:23.679404076+05:30 + ResTimestampMock: 2026-05-11T15:16:23.722832619+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-765 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:23.706546404+05:30 + ResTimestampMock: 2026-05-11T15:16:23.748639114+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-766 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:23.722984844+05:30 + ResTimestampMock: 2026-05-11T15:16:23.764784138+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-767 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:23.951947233+05:30 + ResTimestampMock: 2026-05-11T15:16:23.993259422+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-768 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:23.993710238+05:30 + ResTimestampMock: 2026-05-11T15:16:24.035320762+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-769 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:24.277562109+05:30 + ResTimestampMock: 2026-05-11T15:16:24.319602064+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-770 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:24.319673353+05:30 + ResTimestampMock: 2026-05-11T15:16:24.361317485+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-771 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:24.424925376+05:30 + ResTimestampMock: 2026-05-11T15:16:24.466547333+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-772 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:24.466903439+05:30 + ResTimestampMock: 2026-05-11T15:16:24.509443649+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-773 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:24.750328803+05:30 + ResTimestampMock: 2026-05-11T15:16:24.792387976+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-774 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:24.765842801+05:30 + ResTimestampMock: 2026-05-11T15:16:24.808334818+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-775 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:24.7926394+05:30 + ResTimestampMock: 2026-05-11T15:16:24.834373128+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-776 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:24.808662165+05:30 + ResTimestampMock: 2026-05-11T15:16:24.851418364+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-777 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:25.036215196+05:30 + ResTimestampMock: 2026-05-11T15:16:25.077331308+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-778 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:25.077963291+05:30 + ResTimestampMock: 2026-05-11T15:16:25.119575171+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-779 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:25.362698146+05:30 + ResTimestampMock: 2026-05-11T15:16:25.40466852+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-780 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:25.405153841+05:30 + ResTimestampMock: 2026-05-11T15:16:25.447316741+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-781 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:25.510351791+05:30 + ResTimestampMock: 2026-05-11T15:16:25.552741618+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-782 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:25.552857235+05:30 + ResTimestampMock: 2026-05-11T15:16:25.595787004+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-783 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:25.835546236+05:30 + ResTimestampMock: 2026-05-11T15:16:25.878037137+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-784 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:25.852397258+05:30 + ResTimestampMock: 2026-05-11T15:16:25.895332834+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-785 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:25.87832907+05:30 + ResTimestampMock: 2026-05-11T15:16:25.919269933+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-786 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:25.896922356+05:30 + ResTimestampMock: 2026-05-11T15:16:25.938568292+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-787 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:26.120950299+05:30 + ResTimestampMock: 2026-05-11T15:16:26.16238418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-788 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:26.162672534+05:30 + ResTimestampMock: 2026-05-11T15:16:26.204673403+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-789 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:26.44809327+05:30 + ResTimestampMock: 2026-05-11T15:16:26.490976591+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-790 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:26.491301614+05:30 + ResTimestampMock: 2026-05-11T15:16:26.533127418+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-791 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:26.596938657+05:30 + ResTimestampMock: 2026-05-11T15:16:26.639644809+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-792 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:26.639798758+05:30 + ResTimestampMock: 2026-05-11T15:16:26.682062236+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-793 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:26.920717426+05:30 + ResTimestampMock: 2026-05-11T15:16:26.962634022+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-794 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:26.938921758+05:30 + ResTimestampMock: 2026-05-11T15:16:26.981311753+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-795 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:26.963107603+05:30 + ResTimestampMock: 2026-05-11T15:16:27.005044219+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-796 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:26.981814183+05:30 + ResTimestampMock: 2026-05-11T15:16:27.023146474+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-797 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:27.206039173+05:30 + ResTimestampMock: 2026-05-11T15:16:27.247437154+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-798 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:27.247577102+05:30 + ResTimestampMock: 2026-05-11T15:16:27.290660802+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-799 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:27.534775434+05:30 + ResTimestampMock: 2026-05-11T15:16:27.576991809+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-800 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:27.577668721+05:30 + ResTimestampMock: 2026-05-11T15:16:27.619539043+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-801 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:27.683688619+05:30 + ResTimestampMock: 2026-05-11T15:16:27.727138222+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-802 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:27.727342586+05:30 + ResTimestampMock: 2026-05-11T15:16:27.768065912+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-803 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:28.006251608+05:30 + ResTimestampMock: 2026-05-11T15:16:28.048875294+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-804 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:28.023984784+05:30 + ResTimestampMock: 2026-05-11T15:16:28.065672068+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-805 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:28.049265303+05:30 + ResTimestampMock: 2026-05-11T15:16:28.090943322+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-806 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:28.06590623+05:30 + ResTimestampMock: 2026-05-11T15:16:28.108010214+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-807 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:28.292022211+05:30 + ResTimestampMock: 2026-05-11T15:16:28.334805558+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-808 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:28.335453952+05:30 + ResTimestampMock: 2026-05-11T15:16:28.377441104+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-809 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:28.621408135+05:30 + ResTimestampMock: 2026-05-11T15:16:28.6633149+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-810 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:28.663742399+05:30 + ResTimestampMock: 2026-05-11T15:16:28.705596884+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-811 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:28.768663528+05:30 + ResTimestampMock: 2026-05-11T15:16:28.810747073+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-812 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:28.810884334+05:30 + ResTimestampMock: 2026-05-11T15:16:28.853036485+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-813 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:29.091718331+05:30 + ResTimestampMock: 2026-05-11T15:16:29.133943776+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-814 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:29.109141757+05:30 + ResTimestampMock: 2026-05-11T15:16:29.152323444+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-815 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:29.134021547+05:30 + ResTimestampMock: 2026-05-11T15:16:29.176988467+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-816 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:29.152545364+05:30 + ResTimestampMock: 2026-05-11T15:16:29.19431926+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-817 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:29.378996519+05:30 + ResTimestampMock: 2026-05-11T15:16:29.42035222+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-818 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:29.420552276+05:30 + ResTimestampMock: 2026-05-11T15:16:29.462091553+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-819 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:29.706292293+05:30 + ResTimestampMock: 2026-05-11T15:16:29.74969898+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-820 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:29.750392357+05:30 + ResTimestampMock: 2026-05-11T15:16:29.793404778+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-821 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:29.854688058+05:30 + ResTimestampMock: 2026-05-11T15:16:29.897491086+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-822 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:29.898222393+05:30 + ResTimestampMock: 2026-05-11T15:16:29.939199642+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-823 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:30.178011592+05:30 + ResTimestampMock: 2026-05-11T15:16:30.220567979+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-824 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:30.195394803+05:30 + ResTimestampMock: 2026-05-11T15:16:30.23831103+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-825 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:30.220752436+05:30 + ResTimestampMock: 2026-05-11T15:16:30.262326666+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-826 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:30.238547015+05:30 + ResTimestampMock: 2026-05-11T15:16:30.281945588+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-827 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:30.462875155+05:30 + ResTimestampMock: 2026-05-11T15:16:30.504612036+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-828 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:30.504953029+05:30 + ResTimestampMock: 2026-05-11T15:16:30.546651177+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-829 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:30.795261278+05:30 + ResTimestampMock: 2026-05-11T15:16:30.836323462+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-830 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:30.836429178+05:30 + ResTimestampMock: 2026-05-11T15:16:30.879126271+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-831 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:30.940596493+05:30 + ResTimestampMock: 2026-05-11T15:16:30.981923601+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-832 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:30.982343313+05:30 + ResTimestampMock: 2026-05-11T15:16:31.025276905+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-833 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:31.263824488+05:30 + ResTimestampMock: 2026-05-11T15:16:31.305538268+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-834 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:31.283185374+05:30 + ResTimestampMock: 2026-05-11T15:16:31.324425436+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-835 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:31.305869698+05:30 + ResTimestampMock: 2026-05-11T15:16:31.348344349+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-836 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:31.32456908+05:30 + ResTimestampMock: 2026-05-11T15:16:31.367622962+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-837 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:31.54793301+05:30 + ResTimestampMock: 2026-05-11T15:16:31.589373307+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-838 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:31.589709868+05:30 + ResTimestampMock: 2026-05-11T15:16:31.631338186+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-839 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:31.880986754+05:30 + ResTimestampMock: 2026-05-11T15:16:31.924002635+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-840 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:31.924542423+05:30 + ResTimestampMock: 2026-05-11T15:16:31.966581023+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-841 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:32.026341848+05:30 + ResTimestampMock: 2026-05-11T15:16:32.069469911+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-842 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:32.07014415+05:30 + ResTimestampMock: 2026-05-11T15:16:32.114316216+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-843 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:32.349755599+05:30 + ResTimestampMock: 2026-05-11T15:16:32.39188686+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-844 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:32.368192318+05:30 + ResTimestampMock: 2026-05-11T15:16:32.409859401+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-845 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:32.391986817+05:30 + ResTimestampMock: 2026-05-11T15:16:32.43399438+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-846 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:32.410092766+05:30 + ResTimestampMock: 2026-05-11T15:16:32.451332007+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-847 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:32.632033962+05:30 + ResTimestampMock: 2026-05-11T15:16:32.673543293+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-848 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:32.673847461+05:30 + ResTimestampMock: 2026-05-11T15:16:32.715637356+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-849 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:32.968112593+05:30 + ResTimestampMock: 2026-05-11T15:16:33.010432096+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-850 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:33.010567545+05:30 + ResTimestampMock: 2026-05-11T15:16:33.053230005+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-851 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 43 + packet_type: Info + meta: + info_command: node + info_kind: discovery + raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 63 + packet_type: Info + meta: + info_command: "node\tBB90009D298873E" + info_kind: unknown + raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK + message: null + ReqTimestampMock: 2026-05-11T15:16:33.115449883+05:30 + ResTimestampMock: 2026-05-11T15:16:33.157636009+05:30 +--- +version: api.keploy.io/v1beta1 +kind: Aerospike +name: mock-852 +spec: + metadata: + protocol: aerospike + reqType: Info + respType: Info + type: config + requests: + - header: + header: + version: 2 + type: 1 + length: 16 + packet_type: Info + meta: + info_command: peers-clear-std + info_kind: discovery + raw_body: cGVlcnMtY2xlYXItc3RkCg== + message: null + responses: + - header: + header: + version: 2 + type: 1 + length: 26 + packet_type: Info + meta: + info_command: "peers-clear-std\t0,3000,[]" + info_kind: unknown + raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= + message: null + ReqTimestampMock: 2026-05-11T15:16:33.158189526+05:30 + ResTimestampMock: 2026-05-11T15:16:33.20039901+05:30 diff --git a/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml new file mode 100644 index 00000000..03f19f17 --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml @@ -0,0 +1,41 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: get-health-1 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/health + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:15:50.555704136+05:30 + resp: + status_code: 200 + header: + Content-Length: "32" + Content-Type: application/json + Date: Mon, 11 May 2026 09:45:50 GMT + body: | + {"namespaces":"test","nodes":1} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:15:50.556615223+05:30 + objects: [] + assertions: + noise: + header.Date: [] + created: 1778492750 + app_port: 8090 +curl: | + curl --request GET \ + --url http://127.0.0.1:8090/health \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml new file mode 100644 index 00000000..a4e851b5 --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-freshclient-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/freshclient?n=4&prefix=fc1 + url_params: + "n": "4" + prefix: fc1 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:16:01.999103113+05:30 + resp: + status_code: 200 + header: + Content-Length: "263" + Content-Type: application/json + Date: Mon, 11 May 2026 09:46:02 GMT + body: | + {"concurrency":4,"duration":"412.236727ms","prefix":"fc1","results":[{"key":"fc1-0","bins":{"idx":0,"tag":"fc1"}},{"key":"fc1-1","bins":{"idx":1,"tag":"fc1"}},{"key":"fc1-2","bins":{"idx":2,"tag":"fc1"}},{"key":"fc1-3","bins":{"idx":3,"tag":"fc1"}}],"workers":4} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:16:02.411880367+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492762 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/freshclient?n=4&prefix=fc1 \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml new file mode 100644 index 00000000..382caa6a --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-freshclient-2 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/freshclient?n=8&prefix=fc2 + url_params: + "n": "8" + prefix: fc2 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:16:05.4210859+05:30 + resp: + status_code: 200 + header: + Content-Length: "443" + Content-Type: application/json + Date: Mon, 11 May 2026 09:46:06 GMT + body: | + {"concurrency":4,"duration":"815.933891ms","prefix":"fc2","results":[{"key":"fc2-0","bins":{"idx":0,"tag":"fc2"}},{"key":"fc2-1","bins":{"idx":1,"tag":"fc2"}},{"key":"fc2-2","bins":{"idx":2,"tag":"fc2"}},{"key":"fc2-3","bins":{"idx":3,"tag":"fc2"}},{"key":"fc2-4","bins":{"idx":4,"tag":"fc2"}},{"key":"fc2-5","bins":{"idx":5,"tag":"fc2"}},{"key":"fc2-6","bins":{"idx":6,"tag":"fc2"}},{"key":"fc2-7","bins":{"idx":7,"tag":"fc2"}}],"workers":8} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:16:06.237781077+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492766 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/freshclient?n=8&prefix=fc2 \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml new file mode 100644 index 00000000..3a8e493a --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-multiclient-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/multiclient?n=4&prefix=mc1 + url_params: + "n": "4" + prefix: mc1 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:15:52.567028786+05:30 + resp: + status_code: 200 + header: + Content-Length: "258" + Content-Type: application/json + Date: Mon, 11 May 2026 09:45:52 GMT + body: | + {"clients":4,"duration":"95.639593ms","prefix":"mc1","results":[{"key":"mc1-0","bins":{"idx":0,"tag":"mc1"}},{"key":"mc1-1","bins":{"idx":1,"tag":"mc1"}},{"key":"mc1-2","bins":{"idx":2,"tag":"mc1"}},{"key":"mc1-3","bins":{"idx":3,"tag":"mc1"}}],"workers":4} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:15:52.663574359+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492752 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/multiclient?n=4&prefix=mc1 \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml new file mode 100644 index 00000000..8ef5b94b --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-multiclient-2 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/multiclient?n=8&prefix=mc2 + url_params: + "n": "8" + prefix: mc2 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:15:54.6732111+05:30 + resp: + status_code: 200 + header: + Content-Length: "438" + Content-Type: application/json + Date: Mon, 11 May 2026 09:45:54 GMT + body: | + {"clients":4,"duration":"94.903299ms","prefix":"mc2","results":[{"key":"mc2-0","bins":{"idx":0,"tag":"mc2"}},{"key":"mc2-1","bins":{"idx":1,"tag":"mc2"}},{"key":"mc2-2","bins":{"idx":2,"tag":"mc2"}},{"key":"mc2-3","bins":{"idx":3,"tag":"mc2"}},{"key":"mc2-4","bins":{"idx":4,"tag":"mc2"}},{"key":"mc2-5","bins":{"idx":5,"tag":"mc2"}},{"key":"mc2-6","bins":{"idx":6,"tag":"mc2"}},{"key":"mc2-7","bins":{"idx":7,"tag":"mc2"}}],"workers":8} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:15:54.768687513+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492754 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/multiclient?n=8&prefix=mc2 \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml new file mode 100644 index 00000000..c6146ea2 --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-multiclient-3 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/multiclient?n=12&prefix=mc3 + url_params: + "n": "12" + prefix: mc3 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:15:56.779207301+05:30 + resp: + status_code: 200 + header: + Content-Length: "623" + Content-Type: application/json + Date: Mon, 11 May 2026 09:45:56 GMT + body: | + {"clients":4,"duration":"94.817758ms","prefix":"mc3","results":[{"key":"mc3-0","bins":{"idx":0,"tag":"mc3"}},{"key":"mc3-1","bins":{"idx":1,"tag":"mc3"}},{"key":"mc3-2","bins":{"idx":2,"tag":"mc3"}},{"key":"mc3-3","bins":{"idx":3,"tag":"mc3"}},{"key":"mc3-4","bins":{"idx":4,"tag":"mc3"}},{"key":"mc3-5","bins":{"idx":5,"tag":"mc3"}},{"key":"mc3-6","bins":{"idx":6,"tag":"mc3"}},{"key":"mc3-7","bins":{"idx":7,"tag":"mc3"}},{"key":"mc3-8","bins":{"idx":8,"tag":"mc3"}},{"key":"mc3-9","bins":{"idx":9,"tag":"mc3"}},{"key":"mc3-10","bins":{"idx":10,"tag":"mc3"}},{"key":"mc3-11","bins":{"idx":11,"tag":"mc3"}}],"workers":12} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:15:56.874364014+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492756 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/multiclient?n=12&prefix=mc3 \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ + --header 'Host: 127.0.0.1:8090' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml new file mode 100644 index 00000000..e54b91bd --- /dev/null +++ b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml @@ -0,0 +1,45 @@ +# Generated by Keploy (3-dev) +version: api.keploy.io/v1beta1 +kind: Http +name: post-multiclient-4 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://127.0.0.1:8090/multiclient?n=24&prefix=mc4 + url_params: + "n": "24" + prefix: mc4 + header: + Accept: '*/*' + Host: 127.0.0.1:8090 + User-Agent: curl/8.18.0 + body: "" + timestamp: 2026-05-11T15:15:58.883957184+05:30 + resp: + status_code: 200 + header: + Content-Length: "1188" + Content-Type: application/json + Date: Mon, 11 May 2026 09:45:58 GMT + body: | + {"clients":4,"duration":"104.681216ms","prefix":"mc4","results":[{"key":"mc4-0","bins":{"idx":0,"tag":"mc4"}},{"key":"mc4-1","bins":{"idx":1,"tag":"mc4"}},{"key":"mc4-2","bins":{"idx":2,"tag":"mc4"}},{"key":"mc4-3","bins":{"idx":3,"tag":"mc4"}},{"key":"mc4-4","bins":{"idx":4,"tag":"mc4"}},{"key":"mc4-5","bins":{"idx":5,"tag":"mc4"}},{"key":"mc4-6","bins":{"idx":6,"tag":"mc4"}},{"key":"mc4-7","bins":{"idx":7,"tag":"mc4"}},{"key":"mc4-8","bins":{"idx":8,"tag":"mc4"}},{"key":"mc4-9","bins":{"idx":9,"tag":"mc4"}},{"key":"mc4-10","bins":{"idx":10,"tag":"mc4"}},{"key":"mc4-11","bins":{"idx":11,"tag":"mc4"}},{"key":"mc4-12","bins":{"idx":12,"tag":"mc4"}},{"key":"mc4-13","bins":{"idx":13,"tag":"mc4"}},{"key":"mc4-14","bins":{"idx":14,"tag":"mc4"}},{"key":"mc4-15","bins":{"idx":15,"tag":"mc4"}},{"key":"mc4-16","bins":{"idx":16,"tag":"mc4"}},{"key":"mc4-17","bins":{"idx":17,"tag":"mc4"}},{"key":"mc4-18","bins":{"idx":18,"tag":"mc4"}},{"key":"mc4-19","bins":{"idx":19,"tag":"mc4"}},{"key":"mc4-20","bins":{"idx":20,"tag":"mc4"}},{"key":"mc4-21","bins":{"idx":21,"tag":"mc4"}},{"key":"mc4-22","bins":{"idx":22,"tag":"mc4"}},{"key":"mc4-23","bins":{"idx":23,"tag":"mc4"}}],"workers":24} + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2026-05-11T15:15:58.989266689+05:30 + objects: [] + assertions: + noise: + header.Date: [] + body.duration: [] + created: 1778492758 + app_port: 8090 +curl: | + curl --request POST \ + --url http://127.0.0.1:8090/multiclient?n=24&prefix=mc4 \ + --header 'Host: 127.0.0.1:8090' \ + --header 'User-Agent: curl/8.18.0' \ + --header 'Accept: */*' \ diff --git a/aerospike-tls/main.go b/aerospike-tls/main.go new file mode 100644 index 00000000..15971ad3 --- /dev/null +++ b/aerospike-tls/main.go @@ -0,0 +1,793 @@ +// Sample Aerospike-Go application that exercises the parser over a +// TLS-protected wire. It mirrors e2e-run/main.go endpoint-for-endpoint +// but talks to Aerospike on port 3001 with a *tls.Conn underneath. +// +// The point of this binary is to confirm two claims about the parser: +// +// 1. The Aerospike parser is TLS-blind: it imports no crypto/tls and +// does not branch on PortClear/PortTLS/PortXDR. With this app +// pointed at port 3001 over TLS, the parser still receives plain +// Aerospike wire bytes — because Keploy's proxy terminates TLS +// upstream and hands the parser a transport that already speaks +// decrypted bytes. +// +// 2. Proxy TLS detection is byte-pattern driven, not port driven. +// This client sends a real TLS ClientHello on a non-3306, non-443 +// port; the proxy still recognises it via Peek(5) → IsTLSHandshake +// and MITMs the connection. Port 3001 is incidental. +// +// Endpoints (identical contract to e2e-run): +// +// GET /health — info "build" + "namespaces" +// POST /put — single-record PUT +// GET /get/{key} — single-record GET +// POST /batch/put — BATCH_WRITE +// GET /batch/get — BATCH_READ +// POST /scan — full namespace scan +// POST /query — secondary-index range query +// POST /udf — UDF_EXECUTE +// POST /cdt/list/append — CDT list append +// POST /cdt/map/put — CDT map put +// POST /touch/{key} — TOUCH +// DELETE /key/{key} — DELETE +package main + +import ( + "crypto/tls" + "crypto/x509" + "encoding/json" + "flag" + "fmt" + "log" + "net/http" + "os" + "strconv" + "strings" + "sync" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + aslog "github.com/aerospike/aerospike-client-go/v7/logger" +) + +func main() { + host := flag.String("aerospike-host", env("AEROSPIKE_HOST", "127.0.0.1"), "aerospike server host") + port := flag.Int("aerospike-port", envInt("AEROSPIKE_PORT", 3001), "aerospike server port (TLS service)") + tlsName := flag.String("tls-name", env("AEROSPIKE_TLS_NAME", "aerospike.local"), "TLS hostname expected on the server certificate") + caFile := flag.String("tls-ca", env("AEROSPIKE_TLS_CA", "certs/ca.pem"), "PEM file containing CA cert(s) that signed the server cert") + certFile := flag.String("tls-cert", env("AEROSPIKE_TLS_CERT", ""), "optional client cert PEM (mutual TLS)") + keyFile := flag.String("tls-key", env("AEROSPIKE_TLS_KEY", ""), "optional client key PEM (mutual TLS)") + insecure := flag.Bool("tls-insecure", envBool("AEROSPIKE_TLS_INSECURE", false), "skip server cert verification (debug only)") + listen := flag.String("listen", env("LISTEN", ":8080"), "http listen address") + flag.Parse() + + aslog.Logger.SetLevel(aslog.DEBUG) + + tlsCfg, err := buildTLSConfig(*caFile, *certFile, *keyFile, *tlsName, *insecure) + if err != nil { + log.Fatalf("build tls config: %v", err) + } + + policy := as.NewClientPolicy() + policy.TlsConfig = tlsCfg + // Aerospike CE only advertises clear-text peer addresses + // (peers-clear-std); behind a TLS terminator like stunnel those + // addresses are unreachable. Pin the client to the seed so it + // doesn't try to open clear-text connections to peers. + policy.SeedOnlyCluster = true + // Pool sizing for the parallel handler: a single /parallel?n=N + // curl fans out N goroutines, each grabbing its own pooled + // connection. The default queue size (256) is fine, but the open + // path is the real bottleneck under TLS-MITM replay — limit how + // many fresh TLS dials race the pool's connect-or-wait latch by + // pinning a generous concurrent-open budget. ConnectionQueueSize + // is set explicitly so it survives a future default-tuning drift. + policy.ConnectionQueueSize = 256 + // Hold OpeningConnectionThreshold low: stunnel's fork model on + // the docker side forks one child per accepted connection, and + // fork() is slow enough that a burst of 64+ concurrent dials + // can outpace the kernel's accept-queue + stunnel's fork rate + // at record time, producing EOFs on the proxy's upstream dial. + // 16 is a comfortable number for stunnel and big enough that + // /parallel?n=24 still fans out usefully. + policy.OpeningConnectionThreshold = 16 + // Without TLSName on the Host, the client will not negotiate TLS + // for this host even with TlsConfig set. + h := as.NewHost(*host, *port) + h.TLSName = *tlsName + + client, err := as.NewClientWithPolicyAndHost(policy, h) + if err != nil { + log.Fatalf("connect aerospike (tls): %v", err) + } + defer client.Close() + + // Pre-warm the pool. A burst of N parallel ops on a cold pool + // has every goroutine racing to open its own TLS connection + // through Keploy's proxy at replay time. The proxy is fast but + // the kernel-level TLS handshakes serialise enough to push some + // opens past Policy.Timeout, which surfaces as MAX_RETRIES_ + // EXCEEDED at the application and "mock not found" at the + // proxy (closing bytes on a connection the client already gave + // up on). Issuing a short sequential burst here populates the + // pool with hot, reusable connections before the HTTP server + // accepts the first /parallel request, so the burst hits a + // warm pool and never tries to open more than a handful of + // fresh sockets in parallel. + // warmupPool floor must exceed the largest /parallel?n=N burst + // we expect to handle. Anything below the burst size leaves a + // window where the tend goroutine + an in-flight previous burst + // can briefly hold the pool's idle count under N — and the one + // goroutine that loses that race surfaces as MAX_RETRIES on + // replay even though every other peer in its burst succeeds. + // 64 lands comfortably above the documented /parallel cap of + // 128's mid-range working set (n<=32 + tend + previous burst's + // in-flight returns) without blowing through Keploy's TLS-MITM + // throughput at warmup time. + if err := warmupPool(client, 32); err != nil { + log.Printf("warmupPool: %v (non-fatal)", err) + } + + // Multi-client pool: a small bank of *as.Client instances each + // with its own tend goroutine + connection pool. The /multiclient + // handler round-robins HTTP requests across them — modelling a + // service that, for example, runs one client per namespace or + // per credential profile. + // + // We deliberately do NOT call warmupPool here. Five clients each + // warming up in parallel produces hundreds of concurrent TLS + // dials at startup, which the stunnel/socat fork model in the + // compose stack can't accept fast enough — record then dies with + // EOFs on the upstream dial path before any test runs. The + // /multiclient handler instead uses parallelDo (10ms backoff, + // 5 attempts) to ride out a cold pool on first contact, and the + // per-op SleepBetweenRetries inside the policy gives the pool + // time to recycle between attempts. + multiClients := make([]*as.Client, 4) + for i := range multiClients { + mc, err := as.NewClientWithPolicyAndHost(policy, h) + if err != nil { + log.Fatalf("multi-client %d: %v", i, err) + } + multiClients[i] = mc + } + defer func() { + for _, mc := range multiClients { + mc.Close() + } + }() + + mux := http.NewServeMux() + mux.HandleFunc("/health", healthHandler(client)) + mux.HandleFunc("/put", putHandler(client)) + mux.HandleFunc("/get/", getHandler(client)) + mux.HandleFunc("/batch/put", batchPutHandler(client)) + mux.HandleFunc("/batch/get", batchGetHandler(client)) + mux.HandleFunc("/scan", scanHandler(client)) + mux.HandleFunc("/query", queryHandler(client)) + mux.HandleFunc("/udf", udfHandler(client)) + mux.HandleFunc("/cdt/list/append", cdtListAppendHandler(client)) + mux.HandleFunc("/cdt/map/put", cdtMapPutHandler(client)) + mux.HandleFunc("/touch/", touchHandler(client)) + mux.HandleFunc("/key/", deleteHandler(client)) + mux.HandleFunc("/parallel", parallelHandler(client)) + mux.HandleFunc("/multiclient", multiClientHandler(multiClients)) + mux.HandleFunc("/freshclient", freshClientHandler(policy, h)) + + log.Printf("aerospike-tls sample listening on %s (server %s:%d tls-name=%s)", + *listen, *host, *port, *tlsName) + srv := &http.Server{Addr: *listen, Handler: mux, ReadHeaderTimeout: 5 * time.Second} + if err := srv.ListenAndServe(); err != nil { + log.Fatal(err) + } +} + +func buildTLSConfig(caFile, certFile, keyFile, tlsName string, insecure bool) (*tls.Config, error) { + cfg := &tls.Config{ + ServerName: tlsName, + MinVersion: tls.VersionTLS12, + InsecureSkipVerify: insecure, + } + if caFile != "" { + caPEM, err := os.ReadFile(caFile) + if err != nil { + return nil, fmt.Errorf("read CA %q: %w", caFile, err) + } + pool := x509.NewCertPool() + if !pool.AppendCertsFromPEM(caPEM) { + return nil, fmt.Errorf("CA %q: no certs parsed", caFile) + } + cfg.RootCAs = pool + } + if certFile != "" && keyFile != "" { + pair, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, fmt.Errorf("load client keypair: %w", err) + } + cfg.Certificates = []tls.Certificate{pair} + } + return cfg, nil +} + +func env(k, def string) string { + if v := os.Getenv(k); v != "" { + return v + } + return def +} + +func envInt(k string, def int) int { + v := os.Getenv(k) + if v == "" { + return def + } + var n int + if _, err := fmt.Sscanf(v, "%d", &n); err != nil { + return def + } + return n +} + +func envBool(k string, def bool) bool { + v := os.Getenv(k) + if v == "" { + return def + } + switch strings.ToLower(v) { + case "1", "t", "true", "y", "yes": + return true + case "0", "f", "false", "n", "no": + return false + } + return def +} + +func healthHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, _ *http.Request) { + nodes := c.GetNodes() + writeJSON(w, http.StatusOK, map[string]any{ + "nodes": len(nodes), + "namespaces": "test", + }) + } +} + +type putReq struct { + Key string `json:"key"` + Bins map[string]any `json:"bins"` +} + +func putHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var body putReq + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + k, _ := as.NewKey("test", "demo", body.Key) + bins := as.BinMap{} + for n, v := range body.Bins { + bins[n] = v + } + if err := c.Put(nil, k, bins); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]string{"status": "ok"}) + } +} + +func getHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + key := strings.TrimPrefix(r.URL.Path, "/get/") + k, _ := as.NewKey("test", "demo", key) + rec, err := c.Get(nil, k) + if err != nil { + http.Error(w, err.Error(), http.StatusNotFound) + return + } + writeJSON(w, http.StatusOK, rec.Bins) + } +} + +func batchPutHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var body []putReq + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + for _, p := range body { + k, _ := as.NewKey("test", "demo", p.Key) + bins := as.BinMap{} + for n, v := range p.Bins { + bins[n] = v + } + if err := c.Put(nil, k, bins); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + } + writeJSON(w, http.StatusOK, map[string]int{"written": len(body)}) + } +} + +func batchGetHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + keys := r.URL.Query()["k"] + batch := make([]*as.Key, 0, len(keys)) + for _, k := range keys { + ak, _ := as.NewKey("test", "demo", k) + batch = append(batch, ak) + } + recs, err := c.BatchGet(nil, batch) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + out := make([]map[string]any, 0, len(recs)) + for _, r := range recs { + if r == nil { + out = append(out, nil) + } else { + out = append(out, r.Bins) + } + } + writeJSON(w, http.StatusOK, out) + } +} + +func scanHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, _ *http.Request) { + rs, err := c.ScanAll(nil, "test", "demo") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + count := 0 + for range rs.Results() { + count++ + } + writeJSON(w, http.StatusOK, map[string]int{"scanned": count}) + } +} + +func queryHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, _ *http.Request) { + stmt := as.NewStatement("test", "demo") + _ = stmt.SetFilter(as.NewRangeFilter("age", 0, 99)) + rs, err := c.Query(nil, stmt) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + count := 0 + for range rs.Results() { + count++ + } + writeJSON(w, http.StatusOK, map[string]int{"matched": count}) + } +} + +func udfHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var body putReq + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + k, _ := as.NewKey("test", "demo", body.Key) + v, err := c.Execute(nil, k, "transform", "apply", as.NewValue("bin"), as.NewValue(1)) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]any{"result": v}) + } +} + +func cdtListAppendHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var body putReq + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + k, _ := as.NewKey("test", "demo", body.Key) + _, err := c.Operate(nil, k, + as.ListAppendOp("items", body.Bins["value"]), + ) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]string{"status": "appended"}) + } +} + +func cdtMapPutHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var body putReq + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + k, _ := as.NewKey("test", "demo", body.Key) + mapKey := body.Bins["mapKey"] + mapVal := body.Bins["mapVal"] + _, err := c.Operate(nil, k, + as.MapPutOp(as.DefaultMapPolicy(), "mapBin", mapKey, mapVal), + ) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]string{"status": "put"}) + } +} + +func touchHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + key := strings.TrimPrefix(r.URL.Path, "/touch/") + k, _ := as.NewKey("test", "demo", key) + if err := c.Touch(nil, k); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]string{"status": "touched"}) + } +} + +func deleteHandler(c *as.Client) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + key := strings.TrimPrefix(r.URL.Path, "/key/") + k, _ := as.NewKey("test", "demo", key) + ok, err := c.Delete(nil, k) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + writeJSON(w, http.StatusOK, map[string]bool{"deleted": ok}) + } +} + +// parallelHandler fans out N goroutines that each PUT and GET a unique +// key concurrently. The point is to stress Keploy's proxy with many +// simultaneous Aerospike connections from a single application, since +// the shared aerospike-Go client opens fresh sockets per concurrent op. +// +// POST /parallel?n=8&prefix=p +type parallelResult struct { + Key string `json:"key"` + Bins map[string]any `json:"bins,omitempty"` + Error string `json:"error,omitempty"` +} + +// parallelWritePolicy and parallelReadPolicy are the per-op policies +// the /parallel handler uses. They differ from the defaults in two +// ways that matter under Keploy replay: +// +// 1. SocketTimeout and TotalTimeout are bumped well past what a +// warm pool needs, so a single op can wait out a transient +// pool-acquire stall instead of erroring with TIMEOUT. +// 2. MaxRetries is raised so a transient NO_AVAILABLE_CONNECTIONS_ +// TO_NODE on op-start retries against the now-warmer pool +// instead of bubbling MAX_RETRIES_EXCEEDED to the user. +// +// Together with warmupPool, this gives every parallel worker a +// deterministic acquire-then-execute path even when N is several +// times the pool's resident size. +func parallelWritePolicy() *as.WritePolicy { + p := as.NewWritePolicy(0, 0) + p.SocketTimeout = 10 * time.Second + p.TotalTimeout = 30 * time.Second + p.MaxRetries = 10 + p.SleepBetweenRetries = 5 * time.Millisecond + return p +} + +func parallelReadPolicy() *as.BasePolicy { + p := as.NewPolicy() + p.SocketTimeout = 10 * time.Second + p.TotalTimeout = 30 * time.Second + p.MaxRetries = 10 + p.SleepBetweenRetries = 5 * time.Millisecond + return p +} + +// parallelDo runs op with up to `attempts` application-level retries +// on top of whatever in-client retry policy.MaxRetries already does. +// The client's retry path can still bubble MAX_RETRIES_EXCEEDED out +// when every retry hits an empty pool on its own goroutine slice; +// wrapping the whole PUT/GET in this outer loop gives the pool a +// few extra milliseconds — across cooperative goroutines — to +// recycle connections returned by peers in the same burst. Each +// outer attempt is its own clean acquire/execute cycle. +func parallelDo(attempts int, backoff time.Duration, op func() error) error { + var err error + for i := 0; i < attempts; i++ { + if err = op(); err == nil { + return nil + } + time.Sleep(backoff) + } + return err +} + +func parallelHandler(c *as.Client) http.HandlerFunc { + wp := parallelWritePolicy() + rp := parallelReadPolicy() + return func(w http.ResponseWriter, r *http.Request) { + n, _ := strconv.Atoi(r.URL.Query().Get("n")) + if n <= 0 { + n = 8 + } + if n > 128 { + n = 128 + } + prefix := r.URL.Query().Get("prefix") + if prefix == "" { + prefix = "p" + } + + out := make([]parallelResult, n) + var wg sync.WaitGroup + wg.Add(n) + start := time.Now() + for i := 0; i < n; i++ { + i := i + go func() { + defer wg.Done() + key := fmt.Sprintf("%s-%d", prefix, i) + k, _ := as.NewKey("test", "demo", key) + bins := as.BinMap{"idx": i, "tag": prefix} + if err := parallelDo(5, 10*time.Millisecond, func() error { + return c.Put(wp, k, bins) + }); err != nil { + out[i] = parallelResult{Key: key, Error: "put: " + err.Error()} + return + } + var rec *as.Record + if err := parallelDo(5, 10*time.Millisecond, func() error { + var err error + rec, err = c.Get(rp, k) + return err + }); err != nil { + out[i] = parallelResult{Key: key, Error: "get: " + err.Error()} + return + } + out[i] = parallelResult{Key: key, Bins: rec.Bins} + }() + } + wg.Wait() + writeJSON(w, http.StatusOK, map[string]any{ + "workers": n, + "prefix": prefix, + "duration": time.Since(start).String(), + "results": out, + }) + } +} + +// multiClientHandler round-robins each goroutine across a fixed +// bank of pre-built *as.Client instances. The point is a different +// concurrency shape than /parallel: with one shared client, all N +// goroutines compete for one pool's connect-or-wait latch; here, +// each client has its own pool + tend goroutine, so traffic fans +// out across len(clients) independent state machines simultaneously. +// +// POST /multiclient?n=8&prefix=mc +// +// `n` is the goroutine count (cap 128). Goroutine i uses +// clients[i % len(clients)]. +func multiClientHandler(clients []*as.Client) http.HandlerFunc { + wp := parallelWritePolicy() + rp := parallelReadPolicy() + return func(w http.ResponseWriter, r *http.Request) { + if len(clients) == 0 { + http.Error(w, "no clients configured", http.StatusInternalServerError) + return + } + n, _ := strconv.Atoi(r.URL.Query().Get("n")) + if n <= 0 { + n = 8 + } + if n > 128 { + n = 128 + } + prefix := r.URL.Query().Get("prefix") + if prefix == "" { + prefix = "mc" + } + + out := make([]parallelResult, n) + var wg sync.WaitGroup + wg.Add(n) + start := time.Now() + for i := 0; i < n; i++ { + i := i + c := clients[i%len(clients)] + go func() { + defer wg.Done() + key := fmt.Sprintf("%s-%d", prefix, i) + k, _ := as.NewKey("test", "demo", key) + bins := as.BinMap{"idx": i, "tag": prefix} + if err := parallelDo(5, 10*time.Millisecond, func() error { + return c.Put(wp, k, bins) + }); err != nil { + out[i] = parallelResult{Key: key, Error: "put: " + err.Error()} + return + } + var rec *as.Record + if err := parallelDo(5, 10*time.Millisecond, func() error { + var err error + rec, err = c.Get(rp, k) + return err + }); err != nil { + out[i] = parallelResult{Key: key, Error: "get: " + err.Error()} + return + } + out[i] = parallelResult{Key: key, Bins: rec.Bins} + }() + } + wg.Wait() + writeJSON(w, http.StatusOK, map[string]any{ + "workers": n, + "prefix": prefix, + "clients": len(clients), + "duration": time.Since(start).String(), + "results": out, + }) + } +} + +// freshClientHandler is the most aggressive variant: each goroutine +// constructs its OWN *as.Client inside the request, runs PUT+GET on +// it, then closes it. That means every burst of size N triggers N +// independent cluster bootstraps through Keploy's proxy in parallel +// — N copies of build/node/peers-clear-std/partition-generation +// before any data op flies. +// +// POST /freshclient?n=4&prefix=fc +// +// We cap `n` lower than /multiclient because the per-request +// bootstrap is heavy and we want the recording to stay finite. +// `freshClientConcurrency` is the in-flight client-construction +// budget — beyond this, additional goroutines wait their turn. +// Without the cap the proxy's session-tier matcher sees too many +// simultaneous discovery handshakes at replay time and TLS handshake +// throughput becomes the bottleneck. +const freshClientConcurrency = 4 + +func freshClientHandler(policy *as.ClientPolicy, h *as.Host) http.HandlerFunc { + wp := parallelWritePolicy() + rp := parallelReadPolicy() + sem := make(chan struct{}, freshClientConcurrency) + return func(w http.ResponseWriter, r *http.Request) { + n, _ := strconv.Atoi(r.URL.Query().Get("n")) + if n <= 0 { + n = 4 + } + if n > 16 { + n = 16 + } + prefix := r.URL.Query().Get("prefix") + if prefix == "" { + prefix = "fc" + } + + out := make([]parallelResult, n) + var wg sync.WaitGroup + wg.Add(n) + start := time.Now() + for i := 0; i < n; i++ { + i := i + go func() { + defer wg.Done() + sem <- struct{}{} + defer func() { <-sem }() + key := fmt.Sprintf("%s-%d", prefix, i) + // Each goroutine builds its own client. NewClient... + // performs cluster discovery synchronously, so the + // returned client is already past bootstrap before we + // issue any data op. + c, err := as.NewClientWithPolicyAndHost(policy, h) + if err != nil { + out[i] = parallelResult{Key: key, Error: "newclient: " + err.Error()} + return + } + defer c.Close() + k, _ := as.NewKey("test", "demo", key) + bins := as.BinMap{"idx": i, "tag": prefix} + if err := parallelDo(5, 10*time.Millisecond, func() error { + return c.Put(wp, k, bins) + }); err != nil { + out[i] = parallelResult{Key: key, Error: "put: " + err.Error()} + return + } + var rec *as.Record + if err := parallelDo(5, 10*time.Millisecond, func() error { + var err error + rec, err = c.Get(rp, k) + return err + }); err != nil { + out[i] = parallelResult{Key: key, Error: "get: " + err.Error()} + return + } + out[i] = parallelResult{Key: key, Bins: rec.Bins} + }() + } + wg.Wait() + writeJSON(w, http.StatusOK, map[string]any{ + "workers": n, + "prefix": prefix, + "concurrency": freshClientConcurrency, + "duration": time.Since(start).String(), + "results": out, + }) + } +} + +// warmupPool primes the aerospike-Go connection pool so a later +// /parallel burst hits idle connections instead of racing to open +// fresh TLS sockets through Keploy's proxy. It runs in two phases: +// +// 1. A short SEQUENTIAL prelude. The aerospike-Go client returns a +// used connection to the pool, so a sequential loop only ever +// keeps one connection resident — but it's enough to walk the +// proxy through its first few TLS handshakes from a cold start. +// Without this, the very first parallel batch below would itself +// hit the cold-proxy thundering herd we're trying to avoid. +// +// 2. A PARALLEL fill of size `n`. Each goroutine grabs a distinct +// pooled slot, and because the proxy is now warm, the N TLS +// handshakes mostly stagger by microseconds and all complete. +// After the wait, the pool holds up to `n` idle connections that +// the /parallel handler can reuse without ever opening a new +// socket — which is the property that makes replay deterministic +// under bursts of size <= n. +func warmupPool(c *as.Client, n int) error { + if n <= 0 { + return nil + } + pol := parallelReadPolicy() + // Phase 1 — sequential prelude. Eight ops is enough to put the + // proxy past its cold-start serialisation; more would just be + // wall-clock time wasted. + const prelude = 8 + for i := 0; i < prelude; i++ { + k, _ := as.NewKey("test", "demo", fmt.Sprintf("warmup-seq-%d", i)) + if _, err := c.Exists(pol, k); err != nil { + return err + } + } + // Phase 2 — parallel fill. `n` goroutines on distinct keys so the + // pool ends up with `n` resident connections (one per goroutine). + errs := make(chan error, n) + var wg sync.WaitGroup + wg.Add(n) + for i := 0; i < n; i++ { + i := i + go func() { + defer wg.Done() + k, _ := as.NewKey("test", "demo", fmt.Sprintf("warmup-par-%d", i)) + if _, err := c.Exists(pol, k); err != nil { + errs <- err + } + }() + } + wg.Wait() + close(errs) + for err := range errs { + if err != nil { + return err + } + } + return nil +} + +func writeJSON(w http.ResponseWriter, code int, v any) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(code) + _ = json.NewEncoder(w).Encode(v) +} diff --git a/aerospike-tls/stunnel/stunnel.conf b/aerospike-tls/stunnel/stunnel.conf new file mode 100644 index 00000000..80a05ef5 --- /dev/null +++ b/aerospike-tls/stunnel/stunnel.conf @@ -0,0 +1,9 @@ +foreground = yes +debug = 4 +output = /dev/stdout + +[aerospike-tls] +accept = 0.0.0.0:3001 +connect = aerospike:3000 +cert = /etc/stunnel/server.pem +key = /etc/stunnel/server.key diff --git a/aerospike-tls/vendor-aerospike-client-go/.build.yml b/aerospike-tls/vendor-aerospike-client-go/.build.yml new file mode 100644 index 00000000..4c74ee52 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.build.yml @@ -0,0 +1,15 @@ +name: aerospike-client-go +dir: src/github.com/aerospike/aerospike-client-go + +container: + - base: + - docker.qe.aerospike.com/build/golang:1.11 + +build: + - name: build + script: + - go get -v github.com/aerospike/aerospike-client-go + - go build -v -x github.com/aerospike/aerospike-client-go + - go install -v -x github.com/aerospike/aerospike-client-go/tools/cli + - go install -v -x github.com/aerospike/aerospike-client-go/tools/benchmark + - go install -v -x github.com/aerospike/aerospike-client-go/tools/asinfo diff --git a/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml b/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml new file mode 100644 index 00000000..bb1436e4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: Aerospike Go Client Tests +"on": + push: + pull_request: + +env: + AEROSPIKE_HOSTS: "127.0.0.1:3000" +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: + - "1.20" + - "1.21" + - "1.22" + steps: + - uses: actions/checkout@v3 + - name: "Setup Go ${{ matrix.go-version }}" + uses: actions/setup-go@v3 + with: + go-version: "${{ matrix.go-version }}" + cache: true + - name: Display Go version + run: go version + - name: Set up Aerospike Database + uses: reugn/github-action-aerospike@v1 + - name: Test Lua Code + run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites internal/lua + - name: Test types package + run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites types + - name: Test pkg tests + run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites pkg + - name: Build Benchmark tool + run: cd tools/benchmark | go build -tags as_proxy -o benchmark . + - name: Build asinfo tool + run: cd tools/asinfo | go build -o asinfo . + - name: Build cli tool + run: cd tools/cli | go build -o cli . + - name: Build example files + run: find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build + - name: Build with Reflection code removed + run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_performance" . + - name: Build for Google App Engine (unsafe package removed) + run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="app_engine" . + - name: Build for DBAAS (proxy mode) + run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_proxy" . + - name: Run the tests + run: go run github.com/onsi/ginkgo/v2/ginkgo -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" + - name: Combine Cover Profiles + run: go run github.com/wadey/gocovmerge cover_*.out > cover_all.out + - name: Check Code Coverage + uses: vladopajic/go-test-coverage@v2 + with: + # Configure action using config file (option 1) + config: ./.testcoverage.yml diff --git a/aerospike-tls/vendor-aerospike-client-go/.gitignore b/aerospike-tls/vendor-aerospike-client-go/.gitignore new file mode 100644 index 00000000..a81cd81e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.gitignore @@ -0,0 +1,30 @@ +*.prof +*.test +*.coverprofile* +tools/benchmark/benchmark +tools/asinfo/asinfo +debug/ +_debug/ +tmp/ +.DS_Store +TODO +PLAN.todo +.go_metalinter +.go_style +.golangci.yml +.travis/read-write-udf.ldif +.travis/people.ldif +.travis/modify.ldif +.travis/badwan.ldif +.travis/access.ldif +tools/ +cmd/ +.revive.toml +Makefile +testdata/ +Dockerfile* +.dockerignore +docker-compose.yml +golangci.yml +cover*.out +.vscode/settings.json diff --git a/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml b/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml new file mode 100644 index 00000000..5d2da411 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml @@ -0,0 +1,69 @@ +# (mandatory) +# Path to coverprofile file (output of `go test -coverprofile` command). +# +# For cases where there are many coverage profiles, such as when running +# unit tests and integration tests separately, you can combine all those +# profiles into one. In this case, the profile should have a comma-separated list +# of profile files, e.g., 'cover_unit.out,cover_integration.out'. +profile: cover_all.out + +# (optional; but recommended to set) +# When specified reported file paths will not contain local prefix in the output +local-prefix: "github.com/aerospike/aerospike-client-go/v7" + +# Holds coverage thresholds percentages, values should be in range [0-100] +threshold: + # (optional; default 0) + # The minimum coverage that each file should have + file: 0 + + # (optional; default 0) + # The minimum coverage that each package should have + package: 0 + + # (optional; default 0) + # The minimum total coverage project should have + total: 0 + +# Holds regexp rules which will override thresholds for matched files or packages +# using their paths. +# +# First rule from this list that matches file or package is going to apply +# new threshold to it. If project has multiple rules that match same path, +# override rules should be listed in order from specific to more general rules. +override: + # Increase coverage threshold to 100% for `foo` package + # (default is 80, as configured above in this example) + #- threshold: 100 + # path: ^pkg/lib/foo$ + +# Holds regexp rules which will exclude matched files or packages +# from coverage statistics +exclude: + # Exclude files or packages matching their paths + paths: + # - \.pb\.go$ # excludes all protobuf generated files + - proto/* + - ^pkg/* # exclude package `pkg/bar` + - client_builder.go + - info_policy.go + - commit_policy.go + - generation_policy.go + - privilege.go + - read_mode_ap.go + - read_mode_sc.go + - record_exists_action.go + - replica_policy.go + - generics.go + - proxy_auth_interceptor.go + - proxy_client.go + - proxy_client_reflect.go + - proxy_query_partition_command.go + - proxy_scan_command.go + - login_command.go + - types/histogram/histogram.go + - types/rand/xor_shift128.go + - internal/atomic/array.go +# NOTES: +# - symbol `/` in all path regexps will be replaced by current OS file path separator +# to properly work on Windows diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis.yml b/aerospike-tls/vendor-aerospike-client-go/.travis.yml new file mode 100644 index 00000000..37cb70d4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.travis.yml @@ -0,0 +1,75 @@ +language: go +os: +- linux +dist: xenial +go: +- "1.13" +- "1.14" +- "1.15" +- "1.16" +- tip +matrix: + allow_failures: + - go: tip +install: +- ifconfig +- if [ -d "$HOME/gopath/src/github.com/citrusleaf" ]; then mv $HOME/gopath/src/github.com/citrusleaf + $HOME/gopath/src/github.com/aerospike; fi +- export PATH=$PATH:$HOME/gopath/bin +- go get github.com/onsi/ginkgo/ginkgo +- go get github.com/onsi/gomega +- go get . +- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; + fi +- wget -O aerospike-server.tgz http://www.aerospike.com/download/server/latest/artifact/tgz +- tar xvzf aerospike-server.tgz +- cp -f .travis/aerospike.conf ./aerospike-server/share/etc +- cd aerospike-server +- mkdir instance1 +- mkdir instance2 +- ./bin/aerospike init --home instance1 --instance 1 --service-port 3000 +- ./bin/aerospike init --home instance2 --instance 2 --service-port 3010 +- cd instance1 +- sudo ./bin/aerospike start +- ../../.travis/wait_for_node.sh var/log/aerospike.log +- cd ../.. +- pwd +script: +- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites internal/lua +- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites types +- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites pkg +#- find tools -name "*.go" -type f -print0 | xargs -0 -n1 go build +- cd tools/benchmark | go build -o benchmark . +- cd tools/asinfo | go build -o asinfo . +- chmod +x asinfo +- cd tools/cli | go build -o cli . +- find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build +- ginkgo build -tags="as_performance" . +- ginkgo build -tags="app_engine" . +- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" +- cd aerospike-server/instance1 +- sudo ./bin/aerospike stop +- cat /dev/null > var/log/aerospike.log +- sudo ./bin/aerospike start +- ../../.travis/wait_for_node.sh var/log/aerospike.log +- cd ../instance2 +- sudo ./bin/aerospike start +- ../../.travis/wait_for_node.sh var/log/aerospike.log +- cd ../.. +- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" +# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" +- .travis/proxy_check.sh +notifications: + hipchat: + rooms: + secure: mGFpOr8JWxK0bYj6wK3ur5+qtsfK+Im1njfPgoQ2b/Sudlii/mr2QiHyQRHtstw7tr79nyoMYgQ1lc53pTxUNAVSI/PkTJTBaDE4ZkyUG5+UW8NgMsC6FYhRfgu0xq+SBNn5a6KbrL8puQq0FH6fjEDYC00QqmN5L/967WCxF8g= + email: + - qe-notices@aerospike.com + - qe-notices-clients@aerospike.com + slack: + secure: FwRNnmQZLVD3ygwu66ujNTsy1rHKFAV01wZJCad+L0r5I54lxFWZxsO0JtRbhFyZ0yb4fhls4dPpczTqQrtlRgUzWW55u2i5T/bkTWxOik8QPJW35n9EvSOMYgiTQs1PQeSYwRmiqn0aDd8Fu1RAvB71nLKeyccYbVMHGyhpAq8= diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf b/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf new file mode 100644 index 00000000..f9483ad8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf @@ -0,0 +1,60 @@ +# Aerospike database configuration file. + +# This stanza must come first. +service { + user ${user} + group ${group} + run-as-daemon + paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. + pidfile ${home}/var/run/aerospike.pid +# transaction-queues 8 +# transaction-threads-per-queue 8 + proto-fd-max 10000 + work-directory ${home}/var +} + +logging { + # Log file must be an absolute path. + file ${home}/var/log/aerospike.log { + context any info + } +} + +mod-lua { +# system-path ${home}/share/udf/lua + user-path ${home}/var/udf/lua +} + +network { + service { + address ${service_addr} + port ${service_port} +# reuse-address +# network-interface-name venet0 + } + + heartbeat { + mode multicast + multicast-group ${multicast_addr} + port ${multicast_port} + + interval 150 + timeout 10 + } + + fabric { + port ${fabric_port} + } + + info { + port ${info_port} + } +} + +namespace test { + replication-factor 1 + memory-size 1G + default-ttl 30d # 30 days, use 0 to never expire/evict. + storage-engine memory + allow-ttl-without-nsup true +} diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh b/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh new file mode 100644 index 00000000..843745a4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +./asinfo -p 3000 -v "namespace/test" | grep -q ";client_proxy_complete=0;" +if [ $? -ne 0 ] +then + exit 1 +fi + +./asinfo -p 3010 -v "namespace/test" | grep -q ";client_proxy_complete=0;" +if [ $? -ne 0 ] +then + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh b/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh new file mode 100644 index 00000000..71513c45 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh @@ -0,0 +1,38 @@ +#!/bin/bash +################################################################################ +# Copyright 2013-2020 Aerospike, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +LOG=$1 +if [ ! -f $LOG ]; then + echo "A log file does not exist at $LOG" + exit 1 +fi + +i=0 +while [ $i -le 12 ] +do + sleep 1 + grep -i "there will be cake" $LOG + if [ $? == 0 ]; then + exit 0 + else + i=$(($i + 1)) + echo -n "." + fi +done +echo "the cake is a lie!" +tail -n 1000 $LOG +exit 2 \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md b/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md new file mode 100644 index 00000000..6ae33281 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md @@ -0,0 +1,2331 @@ +# Change History + +## November 29 2024: v7.7.3 + + Minor fix release. + +- **Fixes** + - [CLIENT-3196] Parse nil keys properly in scan/query operations. + +## November 1 2024: v7.7.2 + + Minor fix release. + +- **Fixes** + - [CLIENT-3156] Fix an issue where rack policy always returns the master node. Resolves #455 + +## September 18 2024: v7.7.1 + + Hot Fix release. This version fixes a major bug introduced in v7.7.0. You should use this release instead. + +- **Fixes** + - [CLIENT-3122] Fix `nil` dereference in the tend logic. + +## September 13 2024: v7.7.0 + + Minor improvement release. + +- **Improvements** + - [CLIENT-3112] Correctly handle new error messages/error codes returned by AS 7.2. + - [CLIENT-3102] Add "XDR key busy" error code 32. + - [CLIENT-3119] Use Generics For a General Code Clean Up + Uses several new generic containers to simplify concurrent access in the client. + Uses a Guard as a monitor for the tend connection. This encapsulates synchronized tend connection management using said Guard. + - Add documentation about client.WarmUp to the client initialization API. + +- **Fixes** + - [CLIENT-3082] BatchGet with empty Keys raises gRPC EOF error. + +## August 12 2024: v7.6.1 + + Minor improvement release. + +- **Improvements** + - [CLIENT-3071] Increase info command max response buffer size to 64 MiB. + +## July 19 2024: v7.6.0 + + Minor fix release. + +- **Improvements** + - [CLIENT-3045] Move proxy client build behind a build flag. + This removes the GRPC compilation and potential namespace conflict from the default build and moves it behind the compiler build flag "as_proxy". + +- **Fixes** + - [CLIENT-3022] `Close()` throws a `nil` pointer error on `ProxyClient` without Authentication. + - [CLIENT-3044] Circular reference in between `Client`<->`Cluster` causes memory leak when the client is not closed manually. + - [CLIENT-3046] Wrong return type in Single Key Batch Operations with Multiple Ops per Bin. + - [CLIENT-3047] Fix pointer value assignment in baseMultiCommand.parseKey (#443). + - [CLIENT-3048] Use precomputed ops variable in batchIndexCommandGet.executeSingle (#442). + - [CLIENT-3049] Use a specialized pool for grpc conns to prevent premature reaping. + +## July 1 2024: v7.5.0 + + This a minor feature and fix release. + +- **New Features** + - [CLIENT-2968] Support new v7.1 proxy server features: + - `Info` command. + - `QueryPolicy.QueryDuration` + - [CLIENT-3012] Support new server 7.1 info command error response strings. + +- **Improvements** + - [CLIENT-2997] Scans should work in a mixed cluster of v5.7 and v6.4 server nodes. + - [CLIENT-3020] Change `ReadModeSC` doc from server to client perspective. + +- **Fixes** + - [CLIENT-3019] Prevent Goroutine leak in `AuthInterceptor` for the Proxy Client. + +## May 20 2024: v7.4.0 + + This a minor fix release. We strongly suggest you upgrade to this version over the v7.3.0 if you use the `Client.BatchGetOperate` API. + +- **Improvements** + - Add code coverage tests to the Github Actions workflow. + - Call the `CancelFunc` for the `context.WithTimeout` per linter suggestions in grpc calls. + - Minor clean up and remove dead code. + +- **Fixes** + - [CLIENT-2943] `Client.BatchGetOperate` does not consider ops in single key transforms. + - [CLIENT-2704] Client dev tests failing with new server map key restrictions. + - Fix `as_performance` and `app_engine` build tags. + +## May 3 2024: v7.3.0 + +> [!WARNING] +> Do not use this version if you are using the `Client.BatchGetOperate` API. + +This is a major feature release of the Go client and touches some of the fundamental aspects of the inner workings of it. +We suggest complete testing of your application before using it in production. + +- **New Features** + - [CLIENT-2238] Convert batch calls with just one key per node in sub-batches to Get requests. + If the number keys for a sub-batch to a node is equal or less then the value set in BatchPolicy.DirectGetThreshold, the client use direct get instead of batch commands to reduce the load on the server. + + - [CLIENT-2274] Use constant sized connection buffers and resize the connection buffers over time. + + The client would use a single buffer on the connection and would grow it + per demand in case it needed a bigger buffer, but would not shrink it. + This helped with avoiding using buffer pools and the associated + synchronization, but resulted in excessive memory use in case there were a + few large records in the results, even if they were infrequent. + This changeset does two things: + 1. Will use a memory pool for large records only. Large records + are defined as records bigger than `aerospike.PoolCutOffBufferSize`. + This is a tiered pool with different buffer sizes. The pool + uses `sync.Pool` under the cover, releasing unused buffers back to the + runtime. + 2. By using bigger `aerospike.DefaultBufferSize` values, the user can + imitate the old behavior, so no memory pool is used most of the time. + 3. Setting `aerospike.MinBufferSize` will prevent the pool using buffer sizes too small, + having to grow them frequently. + 4. Buffers are resized every 5 seconds to the median size of buffers used over the previous period, + within the above limits. + + This change should result in much lower memory use by the client. + + - [CLIENT-2702] Support Client Transaction Metrics. The native client can now track transaction latencies using histograms. Enable using the `Client.EnableMetrics` API. + +- **Improvements** + - [CLIENT-2862] Use default batch policies when the record level batch policy is nil. + - [CLIENT-2889] Increase grpc `MaxRecvMsgSize` to handle big records for the proxy client. + - [CLIENT-2891] Export various batch operation struct fields. Resolves #247. + - Remove dependency on `xrand` sub-package since the native API is fast enough. + - Linter Clean up. + - `WritePolicy.SendKey` documentation, thanks to [Rishabh Sairawat](https://github.com/rishabhsairawat) + - Replaced the deprecated `ioutil.ReadFile` with `os.ReadFile`. PR #430, thanks to [Swarit Pandey](https://github.com/swarit-pandey) + +- **Fixes** + - [CLIENT-2905] Fix inconsistency of handling in-doubt flag in errors. + - [CLIENT-2890] Support `[]MapPair` return in reflection. + This fix supports unmarshalling ordered maps into `map[K]V` and `[]MapPair` in the structs. + +## April 10 2024: v7.2.1 + +This release updates the dependencies to mitigate security issues. + +- **Fixes** + - [CLIENT-2869] Update modules. Fix Allocation of Resources Without Limits or Throttling for `golang.org/x/net/http2`. + +## March 28 2024: v7.2.0 + +This is a major update. Please test your code thoroughly before using in production. + +- **New Features** + - [CLIENT-2766] Support `RawBlobValue` in the Go client. + - [CLIENT-2767] Support Persistent List Indexes. + - [CLIENT-2823] Support `QueryDuration`. + - [CLIENT-2831] Support `ReadPolicy.ReadTouchTTLPercent`. + - [CLIENT-2240] Add more client statistics. + - Adds the following statistics: + - `circuit-breaker-hits`: Number of times circuit breaker was hit. + - `connections-error-other`: Connection errors other than timeouts. + - `connections-error-timeout`: Connection Timeout errors. + - `connections-idle-dropped`: The connection was idle and dropped. + - `connections-pool-overflow`: The command offered the connection to the pool, but .the pool was full and the connection was closed + - `exceeded-max-retries`: Number of transactions where exceeded maximum number of retries specified in the policy + - `exceeded-total-timeout`: Number of transactions that exceeded the specified total timeout + - `total-nodes`: Total number of nodes in the cluster + - Export private fields in `PartitionStatus` and add `Recordset.BVal`. + +- **Improvements** + - [CLIENT-2784] Do not use batch repeat flag on batch writes when `policy.SendKey` is set to `true`. + - [CLIENT-2442] Document that Only `string`, `integer`, `bytes` are allowed as map key types; `Policy.SendKey` clarification. + - Reduce the required Go version to 1.20 to support EL9; Update the dependencies. + - Update `ExpCond()` doc to say that all action expressions must return the same type. + +- **Fixes** + - [CLIENT-2811] `RespondPerEachOp` doesn't work for list operation. To allow backwards compatibility, this change will change the default value of `RespondPerEachOp` to `true`. + - [CLIENT-2818] Fix return type for `ExpListRemoveByValueRange`. + - Update the proto grpc files to resolve namespace issues. + - Improve the tests for `BatchOperations` to run on Github Actions. + - Fix tests that relied on the server nsup-period setting to be larger than zero. + - Fix Truncate test on slow servers. + +## January 25 2024: v7.1.0 + +- **New Features** + - Add `TaskId()` to `ExecuteTask`. + - [CLIENT-2721] Make `PartitionFilter.Retry` public. + +- **Improvements** + + - Clean up documentation and remove dependency of examples to the v6 version of the client. + +- **Fixes** + + - [CLIENT-2725] `QueryExecute` (background query) doesn't work without operations. + - [CLIENT-2726] Proxy doesn't handle invalid filter expression error in query. + - [CLIENT-2727] Go proxy: Query Pagination never complete. + - [CLIENT-2728] Fix an issue where Bin names were ignored if a FilterExpression was passed to the Query. + - [CLIENT-2732] Go proxy: Not able to multiple query calls with the same statement. + - [CLIENT-2759] Go proxy: Background query with Expression doesn't filter records. + +## December 11 2023: v7.0.0 + +> [!CAUTION] +> This is a breaking release. It is required to allow upgrading your programs to the Aerospike Server v7. This program upgrade process required as a prerequisite to upgrading your cluster, otherwise seemless cluster upgrade will not be possible. The changes and their rationale are documented in the following section. + +- **Breaking Changes** + + - [CLIENT-2713] Handle Normalized Integers in Maps and Lists. + Aerospike Server v7 normalizes all positive integers in Maps and Lists into unsigned values for various efficiency reasons, and returns them as uint64. This effectively means that the type of positive `int64` values will be lost. Go client supported `uint64` types in lists and maps, and this change breaks that functionality by normalizing the values and removing the sign bits in case they are not needed. To support all versions of the server before and after the v7 consistently, the Go client will now behave like other Aerospike smart clients and automatically convert all unsigned int64 values inside maps and lists into signed values. This means a `math.MaxUint64` value in a List or Map will return as two's compliment: -1. + Example: + + ```go + client.Put(wpolicy, key, BinMap{"map": map[any]any{"max": uint64(math.MaxUint64), "typed": uint64(0)}}) + ``` + + will return as: + + ```go + rec, err := client.Get(rpolicy, key) + // rec.Bins will be: + // BinMap{"map": map[any]any{"max": int64(-1), "typed": int64(0)}} + ``` + + This will break all code that used to cast `rec.Bins["map"].(map[any]any)["max].(uin64)`. As a result, all such code should cast to int64 and then convert back to `uint64` via a sign switch. + If you didn't use `uint64` values in Maps ans Lists, you should not be affected by this change. + All the test cases that depended on the old behavior have been adapted to the new behavior. + - [CLIENT-2719] Typed `GeoJSON` and `HLL` deserialization. + The Go client would read GeoJSON and HLL values back as `string` and `[]byte` respectively. So if you read a record with bins of these types and wrote it directly back to the database, the type of these fields would be lost. + The new version addresses this issue, but could be a breaking change if you have code that casts the values to the old `string` and `[]byte`. You now need to cast these values to `GeoJSONValue` and `HLLValue` types respectively. + - [CLIENT-2484] Add `returnType` to supported `ExpMapRemoveBy*` and `ExpListRemoveBy*` methods. + + - [CLIENT-2319] Revise BatchReadAPIs to accept BatchReadPolicy argument. `NewBatchReadOps` no longer takes `binNames` and changes ops parameter to variadic for consistency. + + Changes the following Public API: + + ```go + func NewBatchRead(key *Key, binNames []string) *BatchRead { + func NewBatchReadOps(key *Key, binNames []string, ops []*Operation) *BatchRead { + func NewBatchReadHeader(key *Key) *BatchRead { + ``` + + to + + ```go + func NewBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) *BatchRead { + func NewBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) *BatchRead { + func NewBatchReadHeader(policy *BatchReadPolicy, key *Key) *BatchRead { + ``` + + - Replace `WritePolicy` with `InfoPolicy` in `client.Truncate`. + - Remove the deprecated `ClientPolicy.RackId`. Use `Policy.RackIds` instead. + +- **New Features** + + - [CLIENT-2712] [CLIENT-2710] Support read replica policy in scan/query. + This includes `PREFER_RACK` which allows scan/query to be directed at local rack nodes when possible. + - [CLIENT-2434] Use 'sindex-exists' command in `DropIndexTask`. + - [CLIENT-2573] Support `ExpRecordSize()`. + - [CLIENT-2588] SINDEX Support for 'Blob' Type Elements. + - [CLIENT-2721] Make PartitionFilter.Retry public. + - Add TaskId() to ExecuteTask. + +- **Improvements** + - [CLIENT-2694] Use RawURLEncoding instead of RawStdEncoding in proxy authenticator. + - [CLIENT-2616] Update dependencies to the latest, require Go 1.21 + - Remove HyperLogLog tests from the Github Actions suite + - Remove Go v1.18-v1.20 from the Github Actions Matrix + - Rename grpc proto definition files due to compiler limitations. Resolves #414 + +- **Fixes** + - [CLIENT-2318] Fixes an issue where Expression in `BatchPolicy` takes precedence rather than `BatchDeletePolicy` in `BatchDelete`. + + +## November 1 2023: v6.14.1 + + Hotfix. + +- **Fixes** + + - [CLIENT-2624] `BatchGetOperate` triggering SIGSEGV nil pointer in the Go client. + Caching of the operation is faulty and causes race conditions when used concurrently. + This commit removes the caching which included a useless allocation and rarely, if ever, had any practical influence on performance. + + +## August 2023: v6.14.0 + +- **New Features** + + - Adds support for the AerospikeProxy and DBAAS service. + + +## July 28 2023: v6.13.0 + +- **New Features** + + - Add `ClientPolicy.SeedOnlyCluster` in clientPolicy for using only seedNodes for connection. (Github #407) thanks to [Sudhanshu Ranjan](https://github.com/sud82) + - [CLIENT-2307] Add ExpInfinityValue() and ExpWildCardValue() + - [CLIENT-2316], [CLIENT-2317] BatchResult Err and ResultCode are not always set on errors, Incorrect in-doubt flag handling during batch operation. + +- **Improvements** + + - [CLIENT-2317] Better handle setting the Error.InDoubt flag in commands + - [CLIENT-2379] Fix returning overall batch error + - Move particle type outside of internal and back to `types/` dir. + - Updated dependencies to address security advisories. + - Improve tests in slow environments. + - Remove atomic integer operations, move to Mutex. + - [CLIENT-2315] Use BatchReadPolicy in BatchRead instead of BatchPolicy. + - [CLIENT-2312] Remove support for old-style queries. + - [CLIENT-2265] Increase the required Go version to 1.17 to be able to compile a dependency which itself was updated due to security issues. + + +- **Fixes** + + - Removes race condition from the client, resolves #399. + - [CLIENT-2339] Developer tests detecting race condition after updating query protocol. + - Assign DefaultInfoPolicy on Client initialization. + - Fixed panics in Read Command Reflection API. (Github #402) thanks to [Yegor Myskin](https://github.com/un000) + - [CLIENT-2283] Set correct return types in list/map read expressions. + + +## March 20 2023: v6.12.0 + +- **Improvements** + + - [CLIENT-2235] Minor documentation cleanup. Formatting, clarification and TODOs for next major version. + - [CLIENT-2234] Export `BatchRead.Policy` + - Update Ginkgo and Gomega to the latest version to avoid security issues. + +- **Fixes** + + - [CLIENT-2230] The first row of batch records represented a server error instead of the over error in call. + - [CLIENT-2233] Wrong FilterExpression size calculation in BatchOperate commands + +## March 9 2023: v6.11.0 + +- **Improvements** + + - [CLIENT-2116] Check for completion/cancellation of the Scan/Query before firing off commands to nodes. + +- **Fixes** + + - [CLINET-2227] PARAMETER_ERROR using expressions and batch write. Wire protocol was violated when the estimateExpressionSize was called. + +## February 8 2023: v6.10.0 + +- **New Features** + + - [CLIENT-2170] Export `MapReturnTypes`, `MapOrderTypes` and `MapWriteModes`. + - [CLIENT-2129], [CLIENT-2035] Adds `Expression.Base64()` and `ExpFromBase64()` to allow for serialization of expressions. + +## January 23 2023: v6.9.1 + + Hotfix release. + +- **Fixes** + - Mark `PartitionStatus.unavailable` and `PartitionStatus.replicaIndex` as transient in `PartitionFilter.EncodeCursor`. + +## January 23 2023: v6.9.0 + + NOTICE: This release is redacted. Please use v6.9.1. + +- **New Features** + - [CLIENT-2138] Allow PartitionFilter to persist its cursor, and retrieve the encoded cursor back to allow pagination. While the Go client supported pagination, it did not export the necessary data structures to allow that cursor to be persisted by the user. These data structures remain private, but two methods (`PartitionFilter.EncodeCursor` and `PartitionFilter.DecodeCursor`) are exported on the PartitionFilter to allow this mechanism to work. + +## January 10 2023: v6.8.0 + +- **New Features** + + - [CLIENT-1988] dded base64 encoding functions `CDTContextToBase64` and `Base64ToCDTContext` for `CDTContext`. + +- **Improvements** + + - Added an example for regexp expressions in Queries. + +- **Fixes** + + - [CLIENT-1204] Retry logic will keep retrying on `KEY_NOT_FOUND` errors until `policy.MaxRetries` is hit or record is returned to the client. + +## December 5 2022: v6.7.0 + +This is a minor improvement and fix release. + +- **Improvements** + + - Improves testing for float64 precision formatting between amd64 and aarch64. + +- **Fixes** + + - [CLIENT-2019] Write Batch operation with an invalid namespace record causes all batch transactions to fail. + - [CLIENT-2020] Support `QueryPartitions` with non-nil filter (secondary index query) + +## November 8 2022: v6.6.0 + +This is a minor improvement and fix release. + +- **Improvements** + + - [CLIENT-1959] Retry a foreground scan/query partition to a different replica when a partition unavailable error occurs. + - [CLIENT-1957] Handle Query, QueryExecute and QueryAggregate on non-existing sets without timing out. + - [CLIENT-1956] Return an error when a read operation is used in a background query. + +- **Fixes** + + - [CLIENT-1958] Prevent division by zero if the node array is empty in `Cluster.GetRandomNode()`. + - [CLIENT-1955] Allow `BatchPolicy.SendKey` to be applied to all batch keys in all batch commands. Batch commands used in `BatchOperate` take an independent policy object. We used to ignore the `SendKey` attribute in those policies. + +## October 26 2022: v6.5.0 + +This is a Minor feature and fix release. We recommend you update your client if you are using batch operate API. + +- **New Features** + + - [CLIENT-1852] Add `ListSetWithPolicyOp` to list operations. + +- **Fixes** + + - [CLIENT-1852] Fix `ListRemoveByIndexRangeOp` index param type. + - [CLIENT-1855] Fix an issue where `ListGetByValueRangeOp`, `ListRemoveByValueRangeOp` with `nil` end value return empty slice. + - [CLIENT-1867] Fix an issue where `BatchOperate` returns unexpected `ResultCode` for successful records when a record within a batch returns an error. + +## September 16 2022: v6.4.0 + +This is a Major fix release. We recommend you update to this version ASAP. + +- **Fixes** + + - [CLIENT-1827] IdleTimeout new default 0 may be missing tend thread reaping. + - [CLIENT-1822] Scan/Query/Other streaming commands, including some Batch could put a faulty connection back to the pool after a cluster event where in certain conditions its buffer contents would end up in another scan and mix the results. + - Update go.mod, redact buggy versions and update required Go version to v1.16 + +- **Improvements** + + - Update the examples for the new retriable scan/queries + - Avoid indirection for `[]byte` conversion during reflection. Resolves #382. + - Change v5 to v6 in some documentation. + +## August 29 2022: v6.3.0 + +[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. + +- **New Features** + + - [CLIENT-1802] Support creating an secondary index on elements within a CDT using context. Supported by server v6.1+. + - [CLIENT-1773] Change client configuration defaults: + - Set `ClientPolicy.ConnectionQueueSize` from 256 to 100. + - Set `ClientPolicy.IdleTimeout` from 55 to 0 secs. + - Set `ClientPolicy.MaxErrorRate` from 0 to 100. + - Set `Policy.TotalTimeout from` 0 to 1000ms for all commands except scan/query. + +- **Fixes** + + - Fixed a few Linter warnings. + +- **Improvements** + + - Documented a few constraints in HLL API docs. + - Documented that PartitionFilter is both a filter and a cursor in the API docs. + +## July 27 2022: v6.2.1 + +[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. + +This is mostly a re-release of v6.2.0, with one added minor change. It seems that we bungled the github tag somehow for that release. Upgrade from v6.2.0 to this version for the changes in that version to be applied to your code. + +- **Fixes** + + - Add a nil check for error in batch retry to be on the safe side. + +## June 30 2022: v6.2.0 + +[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. + +NOTE: It seems that the tag reference for this release was incorrect on Github, or we somehow confused the `Go mod`. Do not use this version. Use v6.2.1 instead. + +This is a major fix release. We recommend upgrading to this release if you are using `BatchOperate` or `Scan/Queries`. + +- **Fixes** + + - [CLIENT-1783] Client crashes when tracker is `nil` during Scan/Queries. + - [CLIENT-1782] `BatchOperate` doesn't return error `BATCH_MAX_REQUESTS_EXCEEDED`. + - [CLIENT-1781] Fix `BatchOperate`: use offset index to pick correct record. + +## June 23 2022: v6.1.0 + +NOTE: This release contains a bug in `BatchOperate` command. If you are using that command, we strongly recommend you upgrade to v6.2.1. + +This is a minor feature and bug fix release version. + +- **New Features** + + - [CLIENT-1747] Add `EXISTS` return type for CDT read operations. + +- **Fixes** + + - [CLIENT-1754] Go SDK doesn't support MapIncrementOp for batch write. + - [CLIENT-1770] Assume background query is complete when the server 6.0+ returns 'not found' in 'query-show' info command. For the old servers, the client will check if it has already observed the job before. If it has, it will also assume the job has finished. + +## April 7 2022: v6.0.0 + +NOTE: This release contains a bug in `BatchOperate` command. If you are using that command, we strongly recommend you upgrade to v6.2.1. + +This is a major feature release. It adds several new features supported by the server v6, and drops supports for Predicate Expressions. + +- **New Features** + + - [CLIENT-1699] Support New v6 Queries. + - [CLIENT-1700] Support New Server v6 Roles and Privileges. + - [CLIENT-1701] Support New Batch Writes. + - [CLIENT-1702] Remove PredExp feature from the client. + +## April 7 2022: v5.8.0 + +This is a major fix release. We recommend upgrading to this release if you are using authentication. + +- **Improvements** + + - Adds notices regarding Auth issue to CHANGELOG and clarifies how to change code for an old breaking change in v3. + - Forward compatibility with Server v6 regarding queries and scans not sending a fresh message header per partition. + +- **Fixes** + + - [CLIENT-1695] Fixes a potential `nil` deference in `sessionInfo.isValid()` method. + - Fixes an issue where with default policies and after certain errors the replica node was not selected on retry. + +## December 6 2021: v5.7.0 + +- **Improvements** + + - Improve `Policy.deadline()` logic to use `MaxRetries` and `SocketTimeout` to calculate `TotalTimeout` when it is not set. + - [CLIENT-1635] Allow Preventing Retries on Exhausted Connection Pools. + - Do not test `PredExp` for server v5.8+. + - Explicitly remove departed nodes from the partition map on cluster change. + +## September 17 2021: v5.6.0 + +- **Fixes** + + - [CLIENT-1605] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. This fix invalidates the Session Token on unsuccessful login, Copy token from the connection buffer, and will consider tend interval in session expiration calculations. + +## September 6 2021: v5.5.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +- **New Features** + + - [CLIENT-1586] Support Batch Read Operations. + +- **Improvements** + + - Add authentication to info example. + +- **Fixes** + + - Fix the worng udf name in predexp test. + +## August 16 2021: v5.4.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +- **New Features** + + - [CLIENT-1576] Support a list of preferred racks rather than a single rack when replica is `PREFER_RACK`. + - [CLIENT-1577] Support PKI authentication where the TLS certificate's common name (CN) specifies the Aerospike user name. + - [CLIENT-1578] Support `scan-show` and `query-show` info commands. + +- **Improvements** + + - Run fewer iterations for CDT RSHIFTEX and LSHIFTEX. + - Add PKI authentication to the benchmark utility. + +## August 2 2021: v5.3.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +- **Improvements** + + - Improve seeding of cluster nodes in tend. All seeds are discovered and added on the first step. + - Add `-hosts` flag to test command arguments. + +- **Fixes** + + - Fix where Bin names were not sent to the server in GetXXX commands and all bins were retrieved. + +## June 28 2021: v5.2.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +Major fix release. We recommend updating to this version immediately. + +- **New Features** + + - Add support for boolean bins in expressions (`ExpBoolBin`). + - Add `Node.PeersGeneration`, `Node.PartitionGeneration`, `Node.RebalanceGeneration`. + - Support TLS connections in benchmark tool. Resolves #313. + - Expose Partition Health API to the user (`Cluster.Healthy()`). Resolves #334. + +- **Improvements** + + - Do not keep connection on all client-side errors + - Refactor batch commands to better reflect that keys are not created on batch requests. + - Mention List/Map WriteFlags in List/Map Policy constructors. + - Fix `ClientPolicy.ErrorRateWindow` documentation. + - Fix benchmark document. Thanks to [Koji Miyata](https://github.com/miyatakoji) + - Fix unidiomatic variable naming. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) + +- **Fixes** + + - Fix an issue where batch commands for a single node were not retried. Resolves #355. + +## June 10 2021: v5.1.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +Major fix release. We recommend updating to this version immediately. + +- **Improvements** + + - Set the error node on transaction failures. + - Add compression and minConnsPerNode to benchmark tool options. + +- **Fixes** + + - Add missing Compress commands. + - Check if error is not `nil` before chaining. Resolves issue #353. + - Handle `nil` case in `Node.String()`. + - Correctly handle errors in `Connection.Read` and `Connection.Write`. Avoids shadowing of the error. Resolves issue #352. + +## May 30 2021: v5.0.2 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +Minor fix release. + +- **Fixes** + + - Improve handling and chaining of errors in `BatchCommand` retries. + - Don't wrap in `chainErrors` if outer is `nil` and the inner error is of type `Error`. + - Support reading back keys with original `List` values. + +## May 27 2021: v5.0.1 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +Minor fix release. + +- **Fixes** + + - Handle lack of key digests in `BatchExists` command. + - Allow and handle nil arguments for `chainError`. + - Avoid race condition in chaining prefined errors. + +## May 10 2021: v5.0.0 + +[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. + +This is a major feature release. It is also a major breaking release. We have adopted Go's module system as recommended by the Go authors, so the new release moves the active branch to `v5`. +As such, the import path changes to `github.com/aerospike/aerospike-client-go/v5`. The `master` branch remains in place to allow maintenance for the older v4 classic version until most users +get the chance to upgrade. + +This release also changes the way errors work in the client, and invalidates the old way. This allows the client to support Go's somewhat new `errors.Is` and `errors.As` API, and properly +chain errors together. + +Also note that the Go Client now requires server version 4.9+ and will not work properly with older versions. + +- **New Features** + + - Adopts module system and changes the import paths to `github.com/aerospike/aerospike-client-go/v5` + - [CLIENT-1476] Support new expressions introduced in server version 5.6, including `ExpReadOp` and `ExpWriteOp`. + - [CLIENT-1463] Support boolean particle type and make it opt-in for reflection API via `UseNativeBoolTypeInReflection`. + - [CLIENT-1522] Support user quotas and statistics. + - [CLIENT-1492] Remove ability to use old authentication protocol. This works behind the scenes and doesn't have any impact on user code. + - [CLIENT-1081] Adds `Error` interface, changes all API signature to return `Error`. + - Exports `AdminCommand` and its `QueryXXX` API. + +- **Breaking Changes** + + - Limits keys to `int`, `string` and `[]byte` types. The old `ListValue` arrays as types are not supported anymore. + - Remove TLS code support for golang v1.8 and before. + - Moves `AerospikeError` from `/types` to the root of the package, and removes all other error type like `NodeError` + - [CLIENT-1526] Removes `Policy.Priority`, `ScanPolicy.ScanPercent` and `ScanPolicy.FailOnClusterChange` + - Removes `Recordset.Read()` and avoids multiplexing of `Records` channel in `Recordset.Results()`, and unexports the `Error` channel. + - Remove legacy client code for old servers. Go client now requires server version 4.9+ + - Remove `Statement.PredExp`, and only use the `Policy.PredExp` to avoid confusion. `PredExp` has been deprecated and replaced by `Expression`. + - Renames type `FilterExpression` to `Expression`. + - `Client.GetBatchXXX()` will return `ErrFilteredOut` if an expression is passed to the API and some records were filtered out, regardless of `BatchPolicy.AllowPartialResults`. + - `Client.CreateRole()` now requires quota information in the param list. + - Removed `Connection.Authenticate()` API. + - Renamed `GetOpForBin()` to `GetBinOp()` + - Removed `ScanPolicy.ConcurrentNodes`. Now only uses `.MaxConcurrentNodes` to avoid confusion. + - Moves the `RequestInfo()` under `Connection`. + +- **Improvements** + + - Implement `GomegaStringer` interface to prevent very long error messages in tests. + - Adds `ResultCode.String()`. + +## April 9 2021: v4.5.0 + +Minor feature and fix release. + +- **New Features** + + - Allows reading of boolean types from the server, supported in Aerospike server v5.6. The current client will not support writing boolean type to the server. That features will be supported in the upcoming Go client v5. + +- **Improvements** + + - [CLIENT-1495] Tentatively check if a connection is allowed to avoid launching too many goroutines. + +- **Fixes** + + - Implements correct and re-triable Scans for the Reflection API. + - Fixes an obscure var shadowing bug in TLS connection handshake error logging. + +## March 12 2021: v4.4.0 + +Minor fix and improvements release. + +- **Fixes** + + - Fixes an issue where the client's reflection API expected certain `int` value types returned from the database. That assumption was wrong for `CDT`s and free form `List`s and `Map`s. The client will now convert types to each other per Go's conversion rules where possible. + +- **Improvements** + + - Use a global TLS setting everywhere in tests. + +## March 1 2021: v4.3.0 + +Minor feature and fix and major clean up release. While there aren't many user facing changes, the quality of the code has been markedly improved. +This release puts us on a good footing for the next few bigger releases. + +- **New Features**: + + - [CLIENT-1457] Support scan pagination through `ScanPartitions()` with `PartitionFilter` + +- **Fixes** + + - Fixes an issue where if errors and filtered records happened at the same time in Batch requests, no error would be returned to the user. + +- **Improvements** + + - Makes the code samples more readable in the docs. + - Fixes a lot of code samples in documentation, along with typos, etc. + - Fixes copy/paste naming errors in the documentation. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) + - Removes a few unreachable lines from the code. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) + - Handles a few TLS connection related issues in tests. + +## February 12 2021: v4.2.0 + +Major feature and improvements release. + +- **New Features**: + + - [CLIENT-1192] Adds Support for partition scans. Queries which lack a `Statement.Filter` will be automatically converted to partition scans. If the cluster supports partition scans, all Scans and Queries will use the new protocol to allow retrying in case of some errors. + - [CLIENT-1237] Adds Support for `MultiPolicy.MaxRecords` in scans and queries without `Statement.Filter`. + - Adds `NewHosts` convenience function. (Github #320) thanks to [Yegor Myskin](https://github.com/un000) + +- **Improvements** + + - Adds a few missing error checks. + - Moves examples files to dedicated folders to avoid `multiple main function` errors for new users. + - Some documentation clean up. (Github #314) thanks to [Shin Uozumi](https://github.com/sinozu) + - Fix typo in example `NewKey()`. (Github #331) thanks to [Patrick Kuca](https://github.com/pkuca) + - Adds an example to list operations (using operate and list policy). + - Runs the XDR tests only when XDR is configured on the server. + - Add TLS config to test params. + - Mark `NewPredExpXXX` return value as the PredExp interface instead of concrete type. It will now group them under the `PredExp` interface in the docs. + +- **Changes** + - Only use `Policy.Priority` and `MultiPolicy.FailOnClusterChange` on server versions < 4.9. `Priority` is now deprecated and replaced with `MultiPolicy.RecordPerSecond`. + - `Statement.TaskID` is deprecated and will be removed in the next major version. + - `ScanPolicy.ConcurrentNodes` is deprecated and will be removed in the next major version. + +… versions < 4.9 + +## January 25 2021: v4.1.0 + +Major feature release. + +- **New Features**: + + - [CLIENT-1417] Adds Circuit-Breaker. Rejects command when assigned node's error rate exceeds `ClientPolicy.MaxErrorRate` over `ClientPolicy.ErrorRateWindow`. + - [CLIENT-1410] Adds `Client.SetXDRFilter()`. + - [CLIENT-1433] Adds `ExpMemorySize()` to expression filters. + +- **Fixes** + + - Fixes an issue where remainder miscalculation would cause the connection pool to be smaller than it should have been. (Github #332) thanks to [ShawnZhang](https://github.com/xqzhang2015) + +- **Improvements** + + - [CLIENT-1434] Reset peers, partition and rebalance generations on node tend errors. + - Use named fields in `LimitedReader` initialization. + - Skip `device_total_bytes` tests in Expressions for memory-only namespaces + - Change unexported field check in marshaller in anticipation of go 1.16 changes + +- **Changes** + + - Pack byte array header with string header codes when using msgpack to be consistent with server. + - Adds `ResultCode.LOST_CONFLICT` + - Change log level from Debug to Error for partition validation failures + +- **Fixes** + + - Fix remainder calculation in `ConnectionHeap`. + +## November 27 2020: v4.0.0 + +Major feature release. Deprecates `PredExp` filters and replaces them with the far more capable Expressions. + +- **New Features**: + + - [CLIENT-1361] Replace predicate filters with new Aerospike Expressions. + +- **Fixes** + + - Allows unmarshalling of bool fields to sub objects in reflection API. (Github #325) + - Fixes an issue where BatchIndexGet commands were not retried in some circumstances. + +- **Incompatible changes**: + + - Changes the `BitResizeFlagsXXX` enum types to `BitResizeFlags` type. This should not affect any code if the enums were used. + - Changes the `ListSortFlagsXXX` enum types to`ListSortFlags` are now typed. This should not affect any code if the enums were used. + +## November 9 2020: v3.1.1 + +Hotfix release. We recommend upgrading to this version, or cherry-picking the changeset to your vendored version if possible. + +- **Fixes** + + - Handle cleanup cases in `Offer` and `DropIdleTail` for `singleConnectionHeap`. (Github #318) + - Unlock the mutex in `singleConnectionHeap.Poll` if called after cleanup. (Github #323) thanks to [linchuan4028](https://github.com/linchuan4028) + +- **Changes** + + - Removes support for versions prior to Go v1.12 due to incompatibility in the testing library we use. Go v1.9+ should still work, though they will not be tested in our tests. + +## September 10 2020: v3.1.0 + +Minor fix release. + +- **Fixes** + + - Fixes an issue where initial tend was not adhering to the `ClientPolicy.Timeout`. (CLIENT-1344) + +## August 19 2020: v3.0.5 + +Minor fix release. + +- **Fixes** + + - Corrects the maximum bin name size in error message. + - Fixes geo coordinates in predexp tests due to more strict server validation. + - Fixes misspelled words and doc links. PR #311, thanks to [Abhay](https://github.com/pnutmath) + +## July 7 2020: v3.0.4 + +Minor fix release. + +- **Fixes** + + - Fixes `Client.SetWhitelist` API. + - Fixes an issue where `Whilelist` was not set during `QueryRole`. + +## July 3 2020: v3.0.3 + +Minor fix release. + +- **Fixes** + + - Resolves an issue where batch retry could return some nil records in some situations. + +## June 24 2020: v3.0.2 + +Minor improvement release. + +- **Fixes** + + - Fixes an issue where if a slice was pre-assigned on a struct, the data would not be allocated to it in reflection API. PR #302, thanks to [gdm85](https://github.com/gdm85) + - Fixes an issue where `Node.GetConnection()` could in rare circumstances return no connection without an `error`. This would potentially cause a panic in VERY slow production servers. + +- **Improvements** + + - Converts a few panics to errors in wire protocol encoding/decoding. Resolves issue #304. + +## June 17 2020: v3.0.1 + +Minor bug fix release. + +- **Fixes** + + - Fixes caching of embedded structs with options in alias. Resolves issue #301. + +## June 8 2020: v3.0.0 + +Major feature release. There are a few minor breaking API changes. See `ClientPolicy`. + +Note: There has been significant changes to clustering code. We recommend extensive testing before using in production. + +- **New Features** + + - Adds support for Relaxed Strong Consistency mode. `ClientPolicy.LinearizeRead = true` has been removed and should be replaced with `policy.ReadModeSC = as.ReadModeSCLinearize`. + - Adds support for whitelists in Roles. + +## May 28 2020: v2.12.0 + +Minor feature release. + +- **New Features** + + - Adds `MapCreateOp` and `ListCreateOp` in `Context` for CDTs. + +## May 27 2020: v2.11.0 + +Major feature release. + +- **New Features** + + - Adds HyperLogLog support. + +- **Improvements** + + - Exports `estimateSize` on `Value` Datastructure. PR #299, thanks to [Sainadh Devireddy](https://github.com/sainadh-d) + - Adds more detail regarding `ClientPolicy.IdleTimeout` in the documentation, and changes the default value to 55 seconds. + +## May 12 2020: v2.10.0 + +Minor feature release. + +- **New Features** + + - Adds `ClientPolicy.MinConnectionsPerNode`. + +- **Improvements** + + - Returns distinct error when empty slice is passed to BatchGetObjects. PR #297, thanks to [Mohamed Osama](https://github.com/oss92) + +## March 14 2020: v2.9.0 + +Minor feature release. + +- **New Features** + + - Supports use of anonymous structs in reflection API. PR #287, thanks to [小马哥](https://github.com/andot) + +## March 4 2020: v2.8.2 + +Hotfix. + +- **Fixes** + + - Fixes a race condition introduced in the last release. + +## March 4 2020: v2.8.1 + +Minor fix and improvements. + +- **Improvements** + + - Uses a `sync.Pool` to preserve the connection buffers on close to remove pressure from the allocator and the GC during connection churns. + +- **Fixes** + + - Cleanup the data structure cross refs on Cluster.Close to help GC free the objects. + +## February 28 2020: v2.8.0 + +Minor feature release. + +- **New Features** + + - Allows `,omitempty` tag to be used in struct tags. It behaves the same as the stdlib json. Note that there should be no whitespace between the comma and the rest of the tag. + +## January 30 2020: v2.7.2 + +Minor fix release. + +- **Fixes** + + - Resolves an issue where an invalid/malformed compressed header could cause a panic by reporting wrong compressed data size. Resolves #280. + +## January 20 2020: v2.7.1 + +Minor fix release. + +- **Fixes** + + - Fixes an issue where an error was not checked after a read in `multi_command.go` and would cause a panic. Resolves #280. + +## December 24 2019: v2.7.0 + +Minor feature and fix release. + +- **New Features** + + - Adds support for client/server wire transport compression. + - Adds support for descending CDT list order. + +- **Fixes** + + - Fixes an issue where unpacking `Value` objects would cause an infinite loop. PR #273, thanks to [small-egg](https://github.com/small-egg) + +## November 25 2019: v2.6.0 + +Minor feature release. + +- **New Features** + + - Supports correct Query/Scans via `Scan/QueryPolicy.FailOnClusterChange` + +- **Fixes** + + - Fixes an issue where the client using multiple seeds via DNS or Load Balancer would fail to connect if more than one of them were unreachable. + +## November 8 2019: v2.5.0 + +Major feature release. + +- **New Features** + + - Adds support for predicate expressions in all transactions. See `Policy.Predexp`. + +## October 29 2019: v2.4.0 + +Major feature release. + +- **New Features** + + - Adds support for bitwise operations. + - Adds support for nested CDTs. + +## October 17 2019: v2.3.0 + +Major feature release. + +- **New Features** + + - Adds support for mixed security modes in cluster to enable rolling upgrade with security changes. + - Adds support for delete record operation `DeleteOp()` in `Client.Operate()`. + - Adds support for write operations in background scan/query. + - Adds support for `Scan/QueryPolicy.RecordsPerSecond` field to limit throughput. + +## August 13 2019: v2.2.1 + +Minor improvement release. + +- **Improvements** + + - Supports the `Write` role in server v4.6.0.2+ + +## May 21 2019: v2.2.0 + +Minor Fixes and improvements release. + +- **Fixes** + + - Fixes an issue where an empty connection pool would cause a lock contention that would in turn lead to high CPU load. + - Fixes an issue where in some circumstances connection pool would be depleted of connections. + - Fixes an issue where the replica node would not be selected in case of master-node failure in `Policy.ReplicaPolicy.SEQUENCE` for reads. + +- **Improvements** + + - Transactions will not count a lack of connection in the node's connection pool as an iteration anymore. + +## April 25 2019: v2.1.1 + +Minor Fixes and improvements release. + +- **Fixes** + + - Fixes an issue where meta tags were ignored in reflection API for `ScanAllObjects`/`QueryObjects`/`BatchGetObjects`. Resolves #260. + +- **Improvements** + + - Tend won't send `rack:` command to the nodes if `ClientPolicy.RackAware` is not set. PR #259, thanks to [Dmitry Maksimov](https://github.com/kolo) + - Adds a new GeoJson example. + +## April 11 2019: v2.1.0 + +Minor Feature and Improvements release. + +- **New Features** + + - Adds `WarmUp` method for `Client`, `Cluster` and `Node`. This method will fill the connection queue to ensure maximum and smooth performance on start up. + +- **Improvements** + + - Simplify connection Timeout calculation and floor the min timeout to 1ms. + - Simplify resetting server timeout for each iteration. + - Adds a few pre-defined errors to avoid allocating them during runtime. + +- **Changes** + + - Adds a TLS connection example. + - Adds `Cap` method to `connectionHeap`. + +## March 19 2019: v2.0.0 + +Major release. There are some breaking changes, both syntactically and semantically. +Most changes are minor, and can be fixed with relative ease. +The only major issue is that the behavior of the client when a key does not exist has changed. +It used to return no error, but `nil` `Record.Bins`. Now it returns `ErrKeyNotFound` error. +This is a significant changes, and you should search your code for all instances of `Bins == nil` and adapt the code accordingly. + +- **Major**: + + - Optimizes connection creation out of the transaction pipeline and makes it async. + - Put a threshold on the number of connections allowed to open simultaneously. Controlled via `ClientPolicy.OpeningConnectionThreshold`. + - Do not clear partition map entry when a node reports that it no longer owns that partition entry. + - Uses rolling timeout instead of strict timeout for connections. + - Remove `ToValueArray` and `ToValueSlice` methods to discourage such suboptimal use. Changes `QueryAggregate` signature to remove the need for those methods. + - Remove unnecessary conversion from BinMap to Bins in reflection API to speedup the command an avoid unnecessary memory allocations. + - Use shorter intervals with exponential back-off for tasks. + +- **Breaking**: + + - `Get`/`Put`/`Touch`/`Operate` and `ExecuteUDF` commands will return an `ErrKeyNotFound` error when the key does not exist in the database. The old behavior used to be not to return an error, but have an empty `Record.Bins`. + - Renames `Statement.Addfilter` to `Statement.SetFilter`, change the name and type of `Statement.Filters` to `Statement.Filter`. + - Remove `ClientPolicy.RequestProleReplicas`. THe client will always request them. + - Removes `ScanPolicy.ServerSocketTimeout` and `QueryPolicy.ServerSocketTimeout` in favor of the already existing `Policy.SocketTimeout`. + - Renames `Policy.Timeout` to `Policy.TotalTimeout` to make the naming consistent with other clients. + - Moves `atomic` package to internal. + - Moves `ParticleType` package to internal. + - Moves `RequestNodeInfo` and `RequestNodeStats` to methods on Node object, and adds `InfoPolicy` to the relevant API signatures. + - Removes `WaitUntilMigrationIsFinished` from `Scan`/`Query` policies. + - Changes `NewConnection` method signature, makes `LoginCommand` private. + - Makes `OperationType` private. + - Remove long deprecated method for pool management. + - Removes unused `ReadN` method in `Connection`. + - Embeds Policies as values and not pointers inside `MultiPolicy`, `ScanPolicy`, `QueryPolicy` + +- **Minor**: + - Fixes a race condition in the `AdminCommand`. + - Synchronize the `XORShift` to avoid race conditions. + - Completely removes deprecated LDT code. + +## March 11 2019: v1.39.0 + +Major improvements Release. + +- **Improvements** + + - Significantly improves `Batch`/`Scan`/`Query`/`UDF`/`QueryAggregate` performance, up to 10x depending on the number of records. + +- **Changes** + + - Removes `BatchPolicy.UseBatchDirect` from the code since it is not supported on the server anymore. + +## February 21 2019: v1.38.0 + +- **New Features** + + - Support new server `truncate-namespace` command via `Client.Truncate` when `set` is not specified. + +- **Improvements** + + - The client will not clear a partition map entry when a node reports that it no longer owns that partition entry until another node claims ownership. + - Adapt UDF test for new server changes. The server will not return an error after `RemoveUDF` if the UDF did not exist. + - Improves a few tests and relaxes tolerances in tests to accommodate slower cloud test environments. + +- **Fixes** + + - Fixes a race condition in XOR shift RNG. + - Fixes a race condition in the AdminCommand. + +## December 3 2018: v1.37.0 + +- **New Features** + + - Support lut-now parameter for Client.Truncate() in servers that support and require it. + - Added support for CDT Map Relative Ops: `MapGetByKeyRelativeIndexRangeOp`, `MapGetByKeyRelativeIndexRangeCountOp`, `MapGetByValueRelativeRankRangeOp`, `MapGetByValueRelativeRankRangeCountOp`, `MapRemoveByKeyRelativeIndexRangeOp`, `MapRemoveByKeyRelativeIndexRangeCountOp`. + - Added support for CDT List Relative Ops: `ListGetByValueRelativeRankRangeOp`, `ListGetByValueRelativeRankRangeCountOp`, `ListRemoveByValueRelativeRankRangeOp`, `ListRemoveByValueRelativeRankRangeCountOp`. + - Added `INFINITY` and `WILDCARD` values for use in CDT map/list comparators. + +- **Improvements** + + - Increase default `Policy.SocketTimeout` to 30s. If `SocketTimeout` is longer than `Timeout`, `Timeout` will be used instead silently. This change is done for the client to perform more intuitively in cloud environments. + - Never return a random node if a node was not found in the partition map. + - Return more descriptive error messages on various partition map and other node related errors. + +- **Changes** + + - Remove the ability to force old batch direct protocol on the client because the server will be removing support for the old batch direct protocol. + - Update admin message version to 2. + - Remove unused error codes. + - Remove Go 1.7 and 1.8 from travis tests due to incompatibility with the test framework. + +## November 1 2018: v1.36.0 + +Feature Release. + +- **New Features** + + - Support rackaware feature. You need to set the `ClientPolicy.RackAware = true`, and set the `ClientPolicy.RackId`. All read operations will try to choose a node on the same rack if `Policy.ReplicaPolicy = PREFER_RACK`. This feature is especially useful when the app/cluster are on the cloud and network throughput over different zones are price differently. + +- **Improvements** + + - Update Operate command documentation. + - Improve an expectation in a CDT Map test. + - Move UDF object test to the proper file. + - Support float64 struct fields when the value of the field has been changed inside lua and set to int - will only affect clusters which support float. + - Fixes an issue where key value was sent and cause server PARAMETER_ERROR via the operate command if policy.SendKey was set but no write operations were passed. + - Updated README example with clarification. + +- **Fixes** + + - Fixes an issue where multiple operation results for a bin would be appended to the first result if it was a list. + +## October 2 2018: v1.35.2 + +Improvement release. + +- **Improvements** + + - Do not allocate a partition map on each tend unless needed. + - Adds `ConnectionsClosed` stat and sets the connection and dataBuffer to nil in a few places to help the GC. + - Use a heap data structure for connection pooling instead of a queue. + This allows better management of connections after a surge, since it keeps the unused connection in the bottom of the heap to close. + It also helps with performance a bit due to better caching of the data structure in CPU. + +## September 18 2018: v1.35.1 + +Hot fix release. We recommend updating to this version if you are using authentication. + +- **Fixes** + + - Fixes a regression to avoid hashing passwords per each login, using the cached password. + +- **Changes** + + - Minor code clean up and dead code removal. + +## August 29 2018: v1.35.0 + +- **New Features** + + - Support for external authentication (LDAP). + - Support Map and List WriteFlags: `NoFail` and `Partial`. + - Support load balancers as seed node. + +- **Changes** + + - Change default Scan/Query `ServerSocketTimeout` to 30s. + +- **Improvements** + + - Adds `QueryPolicy.ServerSocketTimeout` and `QueryPolicy.FailOnClusterChange` for when the queries are automatically converted to scans. + - Minor documentation improvements. + - Synchronize logging at all situations. + - Add -debug switch to allow logging at debug level in tests. + - Allow the user to define the namespace for tests to run on. + +- **Fixes** + + - Fix a few go vet errors for Go 1.11. + - Fixes minor unsigned length conversions for admin command. + +## August 29 2018: v1.34.2 + +Fix release. + +- **Fixes** + + - Use pointer receiver for `AerospikeError.SetInDoubt` and `AerospikeError.MarkInDoubt`. + - Remove unused variable in truncate test. + +- **Changes** + + - Add Go 1.11 to Travis' test versions. + - Use the last error code in MaxRetries timeout errors for Go 1.11. + +## August 9 2018: v1.34.1 + +Hot fix release. We recommend updating to this version asap, especially if you are using the Strong Consistency feature. + +- **Fixes** + + - Fixes an issue where a race condition was preventing the partition table to form correctly. (CLIENT-1028) + +## July 17 2018: v1.34.0 + +- **Changes** + + - Removed the LDT code completely. + - Adds build tag `app_engine` for compatibility with Google's App Engine. Query Aggregate features are not available in this mode due to lua limitations. + +- **Improvements** + + - Document how to use AerospikeError type in the code. + - Allow Task.OnComplete() to be listened to by multiple goroutines. Thanks to [HArmen](https://github.com/alicebob) + +- **Fixes** + + - Fixes an issue where `ClientPolicy.FailIfNotConnected` flag was not respected. + - Fixes a merging issue for PartitionMap, and add a naive validation for partition maps. (CLIENT-1027) + +## June 11 2018: v1.33.0 + +- **New Features** + + - Adds `BatchPolicy.AllowPartialResults` flag to allow the batch command return partial records returned from the cluster. + - Adds `INVERTED` flag to the `MapReturnType`. Take a look at INVERTED test in `cdt_map_test.go` to see how to use it. + - Adds a lot of new Ordered Map and List operations and brings the client up to date with the latest server API. + +- **Changes** + + - Use the default values for `BasePolicy` in `BatchPolicy` to keep the behavior consistent with the older releases. + +- **Improvements** + + - Adds a recover to the tend goroutine to guarantee the client will recover from internal crashes. + - Removes unneeded type casts. + - Uses the new stat name for migrations check. + +- **Fixes** + + - Fixes TTL in `GetObject` and `BatchGetObject` reflection API. + - Handle extension marker in List headers. + +## March 15 2018: v1.32.0 + +Major feature release. + +- **New Features** + + - Support for _Strong Consistency_ mode in Aerospike Server v4. You will need to set the `policy.LinearizeRead` to `true`. Adds `AerospikeError.InDoubt()` method. + - Set the resulting `Record.Key` value in Batch Operations to the Original User-Provided Key to preserve the original namespace/set/userValue and avoid memory allocation. + +- **Changes** + + - Does not retry on writes by default, and put a 100ms timeout on all transactions by default. + - Changed some warn logs to debug level. + - Add missing stats counters to improve statistics reports. + - Uses sync.Once instead of sync.Mutex for `Connection.close` method. + - Added `DefaultBufferSize` for initial buffer size for connections. + +- **Fixes** + + - Fix the tests for object marshalling to account for monotonic time in Go v1.8+. + - Stops the ongoing tends on initial connection errors. + +## November 29 2017: v1.31.0 + +Feature release. + +- **New Features** + + - Support for newer Batch Protocol. Add `BatchGetComplex` for complex batch queries. Old batch API upgraded to automatically support the new protocol under the hood, unless `BatchPolicy.UseBatchDirect` flag is set to `true`. + +- **Changes** + + - Renames ResultCode `NO_XDS` to `ALWAYS_FORBIDDEN`. + - Makes `SERVER_NOT_AVAILABLE` a client generated error. + +## October 12 2017: v1.30.0 + +Fix and improvements release. + +- **Changes** + + - Deprecated LDTs and removed them from the official build. + - Change supported go versions to 1.7+ due to gopher-lua requiring `Context`. + +- **Improvements** + + - Get socket timeout once per command execution, do not redefine err var in command execution loop. PR #211, thanks to [Maxim Krasilnikov](https://github.com/chapsuk) + - Allow running a UDF on a specific node only. + - Close cluster only once. PR #208, thanks to [Jun Kimura](https://github.com/bluele) + - Use actual cluster name in tests instead of assuming `null`. + - Check for the type of error as well in Duplicate Index Creation. + - Update description for error code 21. PR #207, thanks to [Maxim Krasilnikov](https://github.com/chapsuk) + +## September 5 2017: v1.29.0 + +Feature and improvements release. + +- **New Features** + + - Added `ListIncrementOp` to the CDT list operations. + - Added `SEQUENCE` to replica policies. + +- **Improvements** + + - Tweaked node removal algorithm to cover more corner cases. + - Make `predExp` interface public. Closes issue #205. + - Added more stats to the `Client.Stats()`. + +## August 17 2017: v1.28.0 + +Feature, Performance improvements and bug fix release. + +- **New Features** + + - Added `Client.Stats()` method to get client's internal statistics. + - Added `Policy.SocketTimeout` to differentiate between network timeouts and the total transaction timeouts. + - Support `policy.IncludeBinData` for queries. Only for servers that support this feature. + - Minor documentation updates. + - Return key not found exception (instead of returning nil record) for Operate() command where operations include a write. + +- **Improvements** + + - Close the tend connection when closing node connections. + - Added Connection finalizer to make sure all connections are closed eventually. + - Automatically retry failed info requests on async tasks before returning an error. + - Updated build instructions for the benchmark tool. + - Make digest_modulo test deterministic. + - Relax predexp_modulo test a bit to avoid occasional failures. + +- **Fixes** + + - Indirect CAS ops to prevent the compiler from optimizing them out. + - Return errors instead of nil. + +## April 25 2017: v1.27.0 + +Feature, Performance improvements and bug fix release. + +- **New Features** + + - Added `BatchGetObjects` method. + - Added Exponential Backoff by introducing `BasePolicy.SleepMultiplier`. Only Values > 1.0 are effective. PR #192, thanks to [Venil Noronha](https://github.com/venilnoronha) + +- **Improvements** + + - Packer tries to see if it can use generic data types before using reflection. + - Operations, including CDTs do not allocate a buffer anymore, unless reused. + +- **Incompatible changes**: + + - `BinName` and `BinValue` are not exported in `Operation` anymore. These fields shouldn't have been used anyway since `Operation`s used to cache their internal command. + +- **Fixes** + + - Documentation Fixes. Thanks to [Nassor Paulino da Silva](https://github.com/nassor) and [HArmen](https://github.com/alicebob) + +## April 5 2017: v1.26.0 + +Feature, Performance improvements and bug fix release. + +- **New Features** + + - Predicate API is supported (for server v3.12+) + - Added `Truncate` method to quickly remove all data from namespaces or sets (for server v3.12+). + - Support `ScanPolicy.ServerSocketTimeout` (for server v3.12+). + - Support `ClientPolicy.IgnoreOtherSubnetAliases` to ignore hosts from other subnets. PR #182, thanks to [wedi-dev](https://github.com/wedi-dev) + +- **Improvements** + + - Added a lot of predefined generic slice and map types in `NewValue` method to avoid hitting reflection as much as possible. + - Fix `go vet` complaints. + +- **Fixes** + + - Allow streaming commands (scan/query/aggregation) to retry unless the error occurs during parsing of the results. Fixes issue #187 + - Use `net.JoinHostPort` to concatinate host and port values instead of doing it directly. Fixes some issues in IPv6 connection strings. + - Improved initial Tend run. + - Fixes `cluster-name` checking bug. + +## March 8 2017: v1.25.1 + +Hot fix release. Updating the client is recommended. + +- **Fixes** + + - Fixed an issue where errors in Scan/Query unmarshalling would be duplicated and could cause a deadlock. + +## February 28 2017: v1.25.0 + +Performance improvements and fix release. + +- **Improvements** + + - Check tend duration and compare it to tend interval, and warn the user if tend takes longer than tend interval. + - Seed the cluster concurrently, and return as soon as any of the seeds is validated. + - Tend the cluster concurrently. Allows use of very big clusters with no delay. + - Partitions the connection queue to avoid contention. + - Cluster partition map is merged from all node fragments and updated only once per tend to reduce contention to absolute minimum. + +- **Fixes** + + - Fixed an issue where a valid but unreachable seed could timeout and stall connecting and tending the cluster.. + - Fix result code comments. + +## January 11 2017: v1.24.0 + +Minor feature and fix release. + +- **New Features** + + - TLS/SSL connections are now officially supported. + - Added Role/Privilege API. + +- **Improvements** + + - Return a client-side error when no ops are passed to the operate command. + - Export error attribute in `NodeError` + - Do not attempt to refresh peers if it is not supported by the nodes. + +- **Fixes** + + - Use namespace default-ttl for tests instead of assuming 30d + - Always drain scan connections after parsing the records. + - Fix panic in GetObject() if all bins in result is nil. PR #172, thanks to [Hamper](https://github.com/hamper) + - Fix WritePolicy usage with UDF. PR #174, thanks to [Bertrand Paquet](https://github.com/bpaquet) + - Close connection right when it has an io error and don't wait for the caller. + +## December 20 2016 : v1.23.0 + +Minor feature and fix release. + +- **New Features** + + - Exposes the internal `client.Cluster` object to the users. + - Added New API for high-performance complex data type packing, and removed the old API. + +- **Improvements** + + - Only update the partition map if the partition generatio has changed. + - Use tend connection for user management commands. + - Marks LargeList as deprecated. Use CDT methods instead. + - Always validate the message header to avoid reading the remainder of other command buffers. + - Removes GeoJson from key helper. + - Improves tend algorthm to allow complete disconnection from the cluster if none of the clusters are accessible. + - `PutObject` method will now accept objects as well. PR #156, thanks to [Sarath S Pillai](https://github.com/sarathsp06) + +- **Fixes** + + - Do not attemp to add a node which were unaccessible to avoid panic. + - Fix invalid connectionCount. PR #168, thanks to [Jun Kimura](https://github.com/bluele) + - Fixes minor bug that didn't return the error on reading from the connection during scans. + +## November 29 2016 : v1.22.0 + +Hot fix release. Please upgrade if you have been using other aerospike clients with your database parallel to Go. + +- **Fixes** + + - Fixes an issue where short strings in Lists and Maps wouldn't unpack correctly. Resolves #161. + +## November 16 2016 : v1.21.0 + +Minor fix release. + +- **New Features** + + - Added new constants for expiration in `WritePolicy`: `TTLServerDefault`, `TTLDontExpire`, `TTLDontUpdate` + +- **Improvements** + + - Corrects typos in the code. PR #142, thanks to [Muyiwa Olurin ](https://github.com/muyiwaolurin) + - Use the tend connection for `RequestInfo` commands. + +- **Fixes** + + - Fixes an issue where TTL values were calcualted wrongly when they were set not to expire. + - Fixes an issue where `PutObjects` would marshal `[]byte` to `List` in database. PR #152, thanks to [blide](https://github.com/blide) + - Fixes an issue where `Recordset` could leak goroutines. PR #153, thanks to [Deepak Prabhakara](https://github.com/deepakprabhakara) + +## October 25 2016 : v1.20.0 + +Major improvements release. There has been major changes in the library. Please test rigorously before upgrading to the new version. + +- **New Features** + + - Let user define the desired tag for bin names in structs using `SetAerospikeTag` function. + - Added `as_performance` build tag to avoid including the slow convenience API which uses reflections in the client code. + To use this feature, you should include -tags="as_performance" when building your project. + + _NOTICE_: Keep in mind that your code may not compile using this flag. That is by design. + +- **Improvements** + + - Added special packer for map[string]interface{} in `NewValue` method. + - Avoid allocating memory for Map and List values. + - Allocate commands on the stack to avoid heap allcations. + - Avoid allocating memory for `packer`. + - Avoid Allocating memory in computeHash for keys. + - Avoid allocating memory in Ripe160MD digest. + - Removed BufferPool and moved buffers to `Connection` objects to remove lock contention. + - Added `ListIter` and `MapIter` interfaces to support passing Maps and Lists to the client without using reflection. + +## October 14 2016 : v1.19.0 + +Major feature and improvement release. + +- **New Features** + + - Support TLS secured connections. (Feature will be supported in coming server releases.) + + - Support IPv6 protocol. Supported by Aerospike Server 3.10+. + + - Support `cluster-name` verification. Supported by Aerospike Server 3.10+. + + - Support new peers info protocol. Supported by Aerospike Server 3.10+. + +- **Improvements** + + - Will retry the operation even when reading from the buffer. Set `Policy.MaxRetries = 0` to avoid this behavior. PR #143, thanks to [Hector Jusforgues](https://github.com/hectorj) + + - Much improved cluster management algorithm. Will now handle the case where multiple nodes go down simultaneously, still protecting against split brain rogue nodes. + +- **Fixes** + + - Try all alias IPs in node validator. Resolves #144. + + - Updated job status check for execute tasks. + +## August 19 2016 : v1.18.0 + +Minor improvements release. + +- **New Features** + + - Support 'Durable Deletes' for the next version of Aerospike Server Enterprise. + +- **Improvements** + + - Don't run tests for features that are not supported by the server. + + - Added new server error codes. + +## July 27 2016 : v1.17.1 + +Minor improvements release. + +- **Improvements** + + - Add `TaskId()` method for `Recordset`. + + - Cleanup indexes after test cases. + + - Keep connections on recoverable server errors. + + - Return the error on unexpected keys in `BatchCommandGet/Header`. + + - Use the same client object in tests and support using replicas on travis. + +## July 19 2016 : v1.17.0 + +Major feature and improvement release. + +- **New Features** + + - Client now supports distributing reads from Replicas using `ClientPolicy.RequestProleReplicas` and `Policy.ReplicaPolicy` + +- **Improvements** + + - `Cluster.GetConnection` will now retry to acquire a connection until timeout. + + - `Client.DropIndex` method now blocks until all nodes report the index is dropped. + + - Async tasks like `CreateIndex` will retry a few times before deciding a non-existing job means it has finished. + + - Don't use math.MaxInt64, it breaks 32-bit builds. PR #139, thanks to [Cameron Sparr](https://github.com/sparrc) + +- **Fixes** + + - Maps with 0 elements will automatically shortcut to unordered empty maps. + + - Return the error in BatchCommandGet on parse error. + +## June 28 2016 : v1.16.3 + +Major bugfix release. Update recommended. + +- **Improvements** + + - Skip LDT tests if LDT is not enabled. + + - Returns last error after all retry attempts to run a command are exhausted. + + - Reserves a connection for tend operation to avoid dropping a node when high load prevents acquiring a proper connection. + + - Added Finalizers to `Client` and `Recordset`. Both will be automatically closed by the GC. + +- **Fixes** + + - Fixes an issue where `services-alternate` wasn't used in `Node.addFriends()` when instructed so in the policy. + + - Fixes an issue where object metadata wasn't cached if `QueryObjects` was called before `PutObject`. + + - Fixes an issue where idle connections were not dropped. + + - Fixes an issue where requested buffer sizes were not guarded against negative numbers. + +## June 7 2016 : v1.16.2 + +Minor bugfix release. + +- **Fixes** + + - Fixes an issue where empty unordered maps were confused with CDT maps. + +## June 6 2016 : v1.16.1 + +Minor bugfix release. + +- **Fixes** + + - Fixes an issue where complex maps and lists weren't unmarshalled correctly in `GetObject` method. + +## June 2 2016 : v1.16 + +Major feature and improvements release. + +> NOTICE: Due to the relatively extensive code overhaul, upgrade with caution. + +- **New Features** + + - Added CDT Ordered Map API. (Requires server v3.8.3+) + +- **Improvements** + + - Removed mutexes from `Cluster` and `Node` code. + + - Improved code quality using various linters. + +## May 27 2016 : v1.15 + +Minor fixes and improvements release. + +- **Fixes** + + - Fixed an issue where unmarshalling embedded structs and pointers didn't work properly if they were tagged. + +## May 16 2016 : v1.14 + +Minor fixes and improvements release. + +- **Fixes** + + - Fixed an issue in which go-routines were leaked in `Results()` method of `Recordset` on cancellation. Based on PR #128, thanks to [Noel Cower](https://github.com/nilium) + + - Fixed issues regarding leaked goroutines in `Cluster.WaitTillStablized()`, `Cluster.MigrationInProgress()`, and `Cluster.WaitUntillMigrationIsFinished()` methods. PR #126, thanks to [Anton](https://github.com/yiiton) + +- **Improvements** + + - Improved cluster `tend()` logic. + + - Added `Recordset.Read()` method. + + - Minor fixes in docs and code formatting. Thanks to [Andrew Murray](https://github.com/radarhere) and [Erik Dubbelboer](https://github.com/erikdubbelboer) + +## April 1 2016 : v1.13 + +Minor features and improvements release. + +- **New Features** + + - Added `NewGeoWithinRegionForCollectionFilter`, `NewGeoRegionsContainingPointForCollectionFilter`, `NewGeoWithinRadiusForCollectionFilter` for queries on collection bins. + +- **Fixes** + + - Fixed an issue in which bounded byte arrays were silently being dropped as map keys. + +- **Improvements** + + - Removed and fixed unused assignments and variables. + + - Fixed typos in the comments. + + - Minor changes and formatting. PR #124, thanks to [Harmen](https://github.com/alicebob) + +## March 8 2016 : v1.12 + +Minor features and improvements release. + +- **New Features** + + - Support Metadata in struct tags to fetch TTL and Generation via `GetObject`. + Notice: Metadata attributes in an struct are considered transient, and won't be persisted. + + Example: + + ```go + type SomeStruct struct { + TTL uint32 `asm:"ttl"` // record time-to-live in seconds + Gen uint32 `asm:"gen"` // record generation + A int + Self *SomeStruct + } + + key, _ := as.NewKey("ns", "set", value) + err := client.PutObject(nil, key, obj) + // handle error here + + rObj := &OtherStruct{} + err = client.GetObject(nil, key, rObj) + ``` + + - GeoJSON support in Lists and Maps + +- **Improvements** + + - Use `ClientPolicy.timeout` for connection timeout when refreshing nodes + + - Added new server error codes + + - Protect RNG pool against low-precision clocks during init + + - Better error message distingushing between timeout because of reaching deadline and exceeding maximum retries + +- **Fixes** + + - Fixed object mapping cache for anonymous structs. PR #115, thanks to [Moshe Revah](https://github.com/zippoxer) + + - Fixed an issue where `Execute()` method wasn't observing the `SendKey` flag in Policy. + +## February 9 2016 : v1.11 + +Minor features and improvements release. + +- **New Features** + + - Can now use `services-alternate` for cluster tend. + + - New CDT List API: `ListGetRangeFromOp`, `ListRemoveRangeFromOp`, `ListPopRangeFromOp` + +- **Improvements** + + - Improves marshalling of data types into and out of the Lua library and avoids marshalling values before they are needed. + + - Returns error for having more than one Filter on client-side to avoid confusion. + + - Increases default `ClientPolicy.Timeout` and return a meaningful error message when the client is not fully connected to the cluster after `waitTillStabilized` call + +## January 13 2016 : v1.10 + +Major release. Adds Aggregation. + +- **New Features** + + - Added `client.QueryAggregate` method. + + - For examples regarding how to use this feature, look at the examples directory. + + - You can find more documentation regarding the [Aggregation Feature on Aerospike Website](http://www.aerospike.com/docs/guide/aggregation.html) + +- **Improvements** + + - Improve Query/Scan performance by reading from the socket in bigger chunks + +## December 14 2015 : v1.9 + +Major release. Adds new features. + +- **New Features** + + - Added CDT List operations. + + - Added `NewGeoWithinRadiusFilter` filter for queries. + +- **Changes** + + - Renamed `NewGeoPointsWithinRegionFilter` to `NewGeoWithinRegionFilter` + +## December 1 2015 : v1.8 + +Major release. Adds new features and fixes important bugs. + +- **New Features** + + - Added `ScanAllObjects`, `ScanNodeObjects`, `QueryObjects` and `QueryNodeObjects` to the client, to facilitate automatic unmarshalling of data similar to `GetObject`. + + - NOTICE: This feature and its API are experimental, and may change in the future. Please test your code throughly, and provide feedback via Github. + + - Added `ScanPolicy.IncludeLDT` option (Usable with yet to be released server v 3.7.0) + + - Added `LargeList.Exist` method. + +- **Improvements** + + - Makes Generation and Expiration values consistent for WritePolicy and Record. + + - NOTICE! BREAKING CHANGE: Types of `Record.Generation` and `Record.Expiration`, and also `WritePolicy.Generation` and `WritePolicy.Expiration` have changed, and may require casting in older code. + + - Refactor tools/asinfo to be more idiomatic Go. PR #86, thanks to [Tyler Gibbons](https://github.com/Kavec) + + - Many documentation fixes thanks to [Charl Matthee](https://github.com/charl) and [Tyler Gibbons](https://github.com/Kavec) + +- **Fixes** + + - Changed the `KeepConnection` logic from black-list to white-list, to drop all + + - Fix RemoveNodesCopy logic error. + + - Add missing send on recordset Error channel. PR #99, thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + + - Fix skipping of errors/records in (\*recordset).Results() select after cancellation. PR #99, thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + +## October 16 2015 : v1.7 + +Major release. Adds new features and fixes important bugs. + +- **New Features** + + - Added support for Geo spatial queries. + + - Added support for creating indexes on List and Map bins, and querying them. + + - Added support for native floating point values. + + - Added `ClientPolicy.IpMap` to use IP translation for alias recognition. PR #81, Thanks to [Christopher Guiney](https://github.com/chrisguiney) + +- **Improvements** + + - Cosmetic change to improve code consistency for `PackLong` in `packer.go`. PR #78, Thanks to [Erik Dubbelboer](https://github.com/ErikDubbelboer) + +- **Fixes** + + - Fixes an issue when the info->services string was malformed and caused the client to panic. + + - Fixes an issue with unmarshalling maps of type map[ANY]struct{} into embedded structs. + + - Fixes issue with unmarshalling maps of type map[ANY]struct{} into embedded structs. + + - Fixes an issue with bound checking. PR #85, Thanks to [Tait Clarridge](https://github.com/oldmantaiter) + + - Fixes aa few typos in the docs. PR #76, Thanks to [Charl Matthee](https://github.com/charl) + +## August 2015 : v1.6.5 + +Minor maintenance release. + +- **Improvements** + + - Export `MaxBufferSize` to allow tweaking of maximum buffer size allowed to read a record. If a record is bigger than this size (e.g: A lot of LDT elements in scan), this setting wil allow to tweak the buffer size. + +## July 16 2015 : v1.6.4 + +Hot fix release. + +- **Fixes** + + - Fix panic when a scan/query fails and the connection is not dropped. + +## July 9 2015 : v1.6.3 + +Minor fix release. + +- **Improvements** + + - Improved documentation. PR #64 and #68. Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + +- **Fixes** + + - Fix a bunch of golint notices. PR #69, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + + - Connection.Read() total bytes count on error. PR #71, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + + - Fixed a race condition on objectMappings map. PR #72, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) + + - Fixed a few uint -> int convertions. + +## June 11 2015 : v1.6.2 + +Minor fix release. + +- **Improvements** + + - Improved documentation. Replaced all old API references regarding Recordset/Query/Scan to newer, more elegant API. + +- **Fixes** + + - Fixed an issue where erroring out on Scan would result a panic. + + - Fixed an issue where `Statement.TaskId` would be negative. converted `Statement.TaskId` to `uint64` + +## June 9 2015 : v1.6.1 + +Minor fix release. + +- **Fixes** + + - Fixed an issue where marshaller wouldn't marshal some embedded structs. + + - Fixed an issue where querying/scanning empty sets wouldn't drain the socket before return. + +## May 30 2015 : v1.6.0 + +There's an important performance regression bug fix in this release. We recommend everyone to upgrade. + +- **New Features** + + - Added New LargeList API. + + - NOTICE! BREAKING CHANGE: New LargeList API on the Go Client uses the New API defined on newer server versions. As Such, it has changed some signatures in LargeList. + +- **Fixes** + + - Fixed an issue where connections where not put back to the pool on some non-critical errors. + + - Fixed an issue where Object Unmarshaller wouldn't extend a slice. + + - Decode RegisterUDF() error message from base64 + + - Fixed invalid connection handling on node connections (thanks to @rndive) + +## May 15 2015 : v1.5.2 + +Hotfix release. + +- **Fixes** + + - Fixed a branch-merge mistake regarding error handling during connection authentication. + +## May 15 2015 : v1.5.1 + +Major maintenance release. + +NOTICE: All LDTs on server other than LLIST have been deprecated, and will be removed in the future. As Such, all API regarding those features are considered deprecated and will be removed in tandem. + +- **Improvements** + + - Introduces `ClientPolicy.IdleTimeout` to close stale connections to the server. Thanks to Mário Freitas (@imkira). PR #57 + + - Use type alias instead of struct for NullValue. + + - Removed workaround regarding filtering bin names on the client for `BatchGet`. Issue #60 + +- **Fixes** + + - Fixed a few race conditions. + + - Fixed #58 regarding race condition accessing `Cluster.password`. + + - Fixed minor bugs regarding handling of nulls in structs for `GetObj()` and `PutObj()`. + + - Fixed a bug regarding setting TaskIds on the client. + +- ** Other Changes ** + + - Removed deprecated `ReplaceRoles()` method. + + - Removed deprecated `SetCapacity()` and `GetCapacity()` methods for LDTs. + +## April 13 2015 : v1.5.0 + +This release includes potential BREAKING CHANGES. + +- **New Features** + + - Introduces `ClientPolicy.LimitConnectionsToQueueSize`. If set to true, the client won't attemp to create new connections to the node if the total number of pooled connections to the node is equal or more than the pool size. The client will retry to poll a connection from the queue until a timeout occurs. If no timeout is set, it will only retry for ten times. + +- **Improvements** + + - BREAKING CHANGE: | + Uses type aliases instead of structs in several XXXValue methods. This removes a memory allocation per `Value` usage. + Since every `Put` operation uses at list one value object, this has the potential to improve application performance. + Since the signature of several `NewXXXValue` methods have changed, this might break some existing code if you have used the value objects directly. + + - Improved `Logger` so that it will accept a generalized `Logger` interface. Any Logger with a `Printf(format string, values ...interface{})` method can be used. Examples include Logrus. + + - Improved `Client.BatchGet()` performance. + +- **Fixes** + + - Bin names were ignored in BatchCommands. + + - `BatchCommandGet.parseRecord()` returned wrong values when `BinNames` was empty but not nil. + +## March 31 2015 : v1.4.2 + +Maintenance release. + +- **Improvements** + + - Replace channel-based queue system with a lock-based algorithm. + - Marshaller now supports arrays of arbitrary types. + - `Client.GetObject()` now returns an error when the object is not found. + - Partition calculation uses a trick that is twice as fast. + +- **Improvements** + + - Unpacking BLOBs resulted in returning references to pooled buffers. Now copies are returned. + +## March 12 2015 : v1.4.1 + +This is a minor release to help improve the compatibility of the client on Mac OS, and to make cross compilation easier. + +- **Improvements** + + - Node validator won't call net.HostLookup if an IP is passed as a seed to it. + +## Feb 17 2015 : v1.4.0 + +This is a major release, and makes using the client much easier to develop applications. + +- **New Features** + + - Added Marshalling Support for Put and Get operations. Refer to [Marshalling Test](client_object_test.go) to see how to take advantage. + Same functionality for other APIs will follow soon. + Example: + + ```go + type SomeStruct struct { + A int `as:"a"` // alias the field to a + Self *SomeStruct `as:"-"` // will not persist the field + } + + type OtherStruct struct { + i interface{} + OtherObject *OtherStruct + } + + obj := &OtherStruct { + i: 15, + OtherObject: OtherStruct {A: 18}, + } + + key, _ := as.NewKey("ns", "set", value) + err := client.PutObject(nil, key, obj) + // handle error here + + rObj := &OtherStruct{} + err = client.GetObject(nil, key, rObj) + ``` + + - Added `Recordset.Results()`. Consumers of a recordset do not have to implement a select anymore. Instead of: + + ```go + recordset, err := client.ScanAll(...) + L: + for { + select { + case r := <-recordset.Record: + if r == nil { + break L + } + // process record here + case e := <-recordset.Errors: + // handle error here + } + } + ``` + + one should only range on `recordset.Results()`: + + ```go + recordset, err := client.ScanAll(...) + for res := range recordset.Results() { + if res.Err != nil { + // handle error here + } else { + // process record here + fmt.Println(res.Record.Bins) + } + } + ``` + + Use of the old pattern is discouraged and deprecated, and direct access to recordset.Records and recordset.Errors will be removed in a future release. + +- **Improvements** + + - Custom Types are now allowed as bin values. + +## Jan 26 2015 : v1.3.1 + +- **Improvements** + + - Removed dependency on `unsafe` package. + +## Jan 20 2015 : v1.3.0 + +- **Breaking Changes** + + - Removed `Record.Duplicates` and `GenerationPolicy/DUPLICATE` + +- **New Features** + + - Added Security Features: Please consult [Security Docs](https://www.aerospike.com/docs/guide/security.html) on Aerospike website. + + - `ClientPolicy.User`, `ClientPolicy.Password` + - `Client.CreateUser()`, `Client.DropUser()`, `Client.ChangePassword()` + - `Client.GrantRoles()`, `Client.RevokeRoles()`, `Client.ReplaceRoles()` + - `Client.QueryUser()`, `Client.QueryUsers` + + - Added `Client.QueryNode()` + + - Added `ClientPolicy.TendInterval` + +- **Improvements** + + - Cleaned up Scan/Query/Recordset concurrent code + +- **Fixes** + + - Fixed a bug in `tools/cli/cli.go`. + + - Fixed a bug when `GetHeaderOp()` would always translate into `GetOp()` + +## Dec 29 2014: v1.2.0 + +- **New Features** + + - Added `NewKeyWithDigest()` method. You can now create keys with custom digests, or only using digests without + knowing the original value. (Useful when you are getting back results with Query and Scan) + +## Dec 22 2014 + +- **New Features** + + - Added `ConsistencyLevel` to `BasePolicy`. + + - Added `CommitLevel` to `WritePolicy`. + + - Added `LargeList.Range` and `LargeList.RangeThenFilter` methods. + + - Added `LargeMap.Exists` method. + +- **Improvements** + + - We use a pooled XORShift RNG to produce random numbers in the client. It is FAST. + +## Dec 19 2014 + +- **Fixes** + + - `Record.Expiration` wasn't converted to TTL values on `Client.BatchGet`, `Client.Scan` and `Client.Query`. + +## Dec 10 2014 + +- **Fixes**: + + - Fixed issue when the size of key field would not be estimated correctly when WritePolicy.SendKey was set. + +## Nov 27 2014 + +Major Performance Enhancements. Minor new features and fixes. + +- **Improvements** + + - Go client is much faster and more memory efficient now. + In some workloads, it competes and wins against C and Java clients. + + - Complex objects are now de/serialized much faster. + +- **New Features** + + - Added Default Policies for Client object. + Instead of creating a new policy when the passed policy is nil, default policies will be used. + +## Nov 24 2014 + +- **Fixes**: + + - Fixed issue when WritePolicy.SendKey = true was not respected in Touch() and Operate() + +## Nov 22 2014 + +Hotfix in unpacker. Update strongly recommended for everyone using Complex objects, LDTs and UDFs. + +- **Fixes**: + + - When Blob, ByteArray or String size has a bit sign set, unpacker reads it wrong. + Note: This bug only affects unpacking of these objects. Packing was unaffected, and data in the database is valid. + +## Nov 2 2014 + +Minor, but very impoortant fix. + +- **Fixes**: + + - Node selection in partition map was flawed on first refresh. + +- **Incompatible changes**: + + - `Expiration` and `Generation` in `WritePolicy` are now `int32` + - `TaskId` in `Statement` is now always set in the client, and is `int64` + +- **New Features**: + + - float32, float64 and bool are now supported in map and array types + +## Oct 15 2014 (Beta 2) + +- **Hot fix**: + + - Fixed pack/unpack for uint64 + +## Aug 20 2014 (Beta 1) + +Major changes and improvements. + +- **New Features**: + + - Added client.Query() + - Added client.ScanNode()/All() + - Added client.Operate() + - Added client.CreateIndex() + - Added client.DropIndex() + - Added client.RegisterUDF() + - Added client.RegisterUDFFromFile() + - Added client.Execute() + - Added client.ExecuteUDF() + - Added client.BatchGet() + - Added client.BatchGetHeader() + - Added client.BatchExists() + - Added LDT implementation + - Added `Node` and `Key` references to the Record + +- **Changes**: + + - Many minor and major bug fixes + - Potentially breaking change: Reduced Undocumented API surface + - Fixed a few places where error results were not checked + - Breaking Change: Convert Key.namespace & Key.setName from pointer to string; affects Key API + - Renamed all `this` receivers to appropriate names + - Major performance improvements (~2X improvements in speed and memory consumption): + + - better memory management for commands; won't allocate if capacity is big enough + - better hash management in key; avoids two redundant memory allocs + - use a buffer pool to reduce GC load + - fine-grained, customizable and deterministic buffer pool implementation for command + + - Optimizations for Key & Digest + + - changed digest implementation, removed an allocation + - Added RIPEMD160 hash files from crypto to lib + - pool hash objects + + - Various Benchmark tool improvements + - now profileable using localhost:6060 + - minor bug fixes + +## Jul 26 2014 (Alpha) + +- Initial Release. diff --git a/aerospike-tls/vendor-aerospike-client-go/LICENSE b/aerospike-tls/vendor-aerospike-client-go/LICENSE new file mode 100644 index 00000000..d76ea4a6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014-2020 Aerospike, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/aerospike-tls/vendor-aerospike-client-go/README.md b/aerospike-tls/vendor-aerospike-client-go/README.md new file mode 100644 index 00000000..c6e6de09 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/README.md @@ -0,0 +1,189 @@ +# Aerospike Go Client v7 + +[![Aerospike Client Go](https://goreportcard.com/badge/github.com/aerospike/aerospike-client-go/v7)](https://goreportcard.com/report/github.com/aerospike/aerospike-client-go/v7) +[![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7) +[![Tests](https://github.com/aerospike/aerospike-client-go/actions/workflows/build.yml/badge.svg?branch=v7&event=push)](github.com/aerospike/aerospike-client-go/actions) + +An Aerospike library for Go. + +This library is compatible with Go 1.20+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested). + +Up-to-date documentation is available in the [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). + +You can refer to the test files for idiomatic use cases. + +Please refer to [`CHANGELOG.md`](CHANGELOG.md) for release notes, or if you encounter breaking changes. + +- [Aerospike Go Client v7](#aerospike-go-client-v7) + - [Usage](#usage) + - [Prerequisites](#prerequisites) + - [Installation](#installation) + - [Some Hints:](#some-hints) + - [Performance Tweaking](#performance-tweaking) + - [Tests](#tests) + - [Examples](#examples) + - [Tools](#tools) + - [Benchmarks](#benchmarks) + - [API Documentation](#api-documentation) + - [Google App Engine](#google-app-engine) + - [Reflection, and Object API](#reflection-and-object-api) + - [Proxy Client / DBAAS](#proxy-client--dbaas) + - [License](#license) + +## Usage + +The following is a very simple example of CRUD operations in an Aerospike database. + +```go +package main + +import ( + "fmt" + + aero "github.com/aerospike/aerospike-client-go/v7" +) + +// This is only for this example. +// Please handle errors properly. +func panicOnError(err error) { + if err != nil { + panic(err) + } +} + +func main() { + // define a client to connect to + client, err := aero.NewClient("127.0.0.1", 3000) + panicOnError(err) + + key, err := aero.NewKey("test", "aerospike", "key") + panicOnError(err) + + // define some bins with data + bins := aero.BinMap{ + "bin1": 42, + "bin2": "An elephant is a mouse with an operating system", + "bin3": []interface{}{"Go", 2009}, + } + + // write the bins + err = client.Put(nil, key, bins) + panicOnError(err) + + // read it back! + rec, err := client.Get(nil, key) + panicOnError(err) + + // delete the key, and check if key exists + existed, err := client.Delete(nil, key) + panicOnError(err) + fmt.Printf("Record existed before delete? %v\n", existed) +} +``` + +More examples illustrating the use of the API are located in the +[`examples`](examples) directory. + +Details about the API are available in the [`docs`](docs) directory. + + +## Prerequisites + +[Go](http://golang.org) version v1.20+ is required. + +To install the latest stable version of Go, visit +[http://golang.org/dl/](http://golang.org/dl/) + + +Aerospike Go client implements the wire protocol, and does not depend on the C client. +It is goroutine friendly, and works asynchronously. + +Supported operating systems: + +- Major Linux distributions (Ubuntu, Debian, Red Hat) +- Mac OS X +- Windows (untested) + + +## Installation + +1. Install Go 1.21+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH) here. +2. Get the client in your ```GOPATH``` : ```go get github.com/aerospike/aerospike-client-go/v7``` + - To update the client library: ```go get -u github.com/aerospike/aerospike-client-go/v7``` + +Using [gopkg.in](https://gopkg.in/) is also supported: `go get -u gopkg.in/aerospike/aerospike-client-go.v7` + +### Some Hints: + +- To run a go program directly: ```go run ``` +- to build: ```go build -o ``` +- example: ```go build -tags as_proxy -o benchmark tools/benchmark/benchmark.go``` + + +## Performance Tweaking + +We are bending all efforts to improve the client's performance. In our reference benchmarks, Go client performs almost as good as the C client. + +To read about performance variables, please refer to [`docs/performance.md`](docs/performance.md) + + +## Tests + +This library is packaged with a number of tests. Tests require Ginkgo and Gomega library. + +Before running the tests, you need to update the dependencies: + + $ go get . + +To run all the test cases with race detection: + + $ ginkgo -r -race + + + +## Examples + +A variety of example applications are provided in the [`examples`](examples) directory. + + +### Tools + +A variety of clones of original tools are provided in the [`tools`](tools) directory. +They show how to use more advanced features of the library to re-implement the same functionality in a more concise way. + + +## Benchmarks + +Benchmark utility is provided in the [`tools/benchmark`](tools/benchmark) directory. +See the [`tools/benchmark/README.md`](tools/benchmark/README.md) for details. + + +## API Documentation + +A simple API documentation is available in the [`docs`](docs/README.md) directory. The latest up-to-date docs can be found in [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). + + +## Google App Engine + +To build the library for App Engine, build it with the build tag `app_engine`. Aggregation functionality is not available in this build. + + + +## Reflection, and Object API + +To make the library both flexible and fast, we had to integrate the reflection API (methods with `[Get/Put/...]Object` names) tightly in the library. In case you wanted to avoid mixing those API in your app inadvertently, you can use the build tag `as_performance` to remove those APIs from the build. + + + +## Proxy Client / DBAAS + +To compile the client for the proxy server in our database-as-a-service (dbaas) environment, pass `-tags as_proxy` to the compiler on build. + + +## License + +The Aerospike Go Client is made available under the terms of the Apache License, Version 2, as stated in the file `LICENSE`. + +Individual files may be made available under their own specific license, +all compatible with Apache License, Version 2. Please see individual files for details. + diff --git a/aerospike-tls/vendor-aerospike-client-go/admin_command.go b/aerospike-tls/vendor-aerospike-client-go/admin_command.go new file mode 100644 index 00000000..ca1e7077 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/admin_command.go @@ -0,0 +1,742 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use acmd file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "encoding/binary" + "fmt" + "time" + + "github.com/aerospike/aerospike-client-go/v7/pkg/bcrypt" + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +const ( + // Commands + _AUTHENTICATE byte = 0 + _CREATE_USER byte = 1 + _DROP_USER byte = 2 + _SET_PASSWORD byte = 3 + _CHANGE_PASSWORD byte = 4 + _GRANT_ROLES byte = 5 + _REVOKE_ROLES byte = 6 + _QUERY_USERS byte = 9 + _CREATE_ROLE byte = 10 + _DROP_ROLE byte = 11 + _GRANT_PRIVILEGES byte = 12 + _REVOKE_PRIVILEGES byte = 13 + _SET_WHITELIST byte = 14 + _SET_QUOTAS byte = 15 + _QUERY_ROLES byte = 16 + _LOGIN byte = 20 + + // Field IDs + _USER byte = 0 + _PASSWORD byte = 1 + _OLD_PASSWORD byte = 2 + _CREDENTIAL byte = 3 + _CLEAR_PASSWORD byte = 4 + _SESSION_TOKEN byte = 5 + _SESSION_TTL byte = 6 + _ROLES byte = 10 + _ROLE byte = 11 + _PRIVILEGES byte = 12 + _WHITELIST byte = 13 + _READ_QUOTA byte = 14 + _WRITE_QUOTA byte = 15 + _READ_INFO byte = 16 + _WRITE_INFO byte = 17 + _CONNECTIONS byte = 18 + + // Misc + _MSG_VERSION int64 = 2 + _MSG_TYPE int64 = 2 + + _HEADER_SIZE int = 24 + _HEADER_REMAINING int = 16 + _RESULT_CODE int = 9 + _QUERY_END int = 50 +) + +// AdminCommand allows managing user access to the server +type AdminCommand struct { + dataBuffer []byte + dataOffset int +} + +// NewAdminCommand returns an AdminCommand object. +func NewAdminCommand(buf []byte) *AdminCommand { + if buf == nil { + buf = make([]byte, 10*1024) + } + return &AdminCommand{ + dataBuffer: buf, + dataOffset: 8, + } +} + +func (acmd *AdminCommand) createUser(conn *Connection, policy *AdminPolicy, user string, password []byte, roles []string) Error { + acmd.writeHeader(_CREATE_USER, 3) + acmd.writeFieldStr(_USER, user) + acmd.writeFieldBytes(_PASSWORD, password) + acmd.writeRoles(roles) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) dropUser(conn *Connection, policy *AdminPolicy, user string) Error { + acmd.writeHeader(_DROP_USER, 1) + acmd.writeFieldStr(_USER, user) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) setPassword(conn *Connection, policy *AdminPolicy, user string, password []byte) Error { + acmd.writeHeader(_SET_PASSWORD, 2) + acmd.writeFieldStr(_USER, user) + acmd.writeFieldBytes(_PASSWORD, password) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) changePassword(conn *Connection, policy *AdminPolicy, user string, oldPass, newPass []byte) Error { + acmd.writeHeader(_CHANGE_PASSWORD, 3) + acmd.writeFieldStr(_USER, user) + acmd.writeFieldBytes(_OLD_PASSWORD, oldPass) + acmd.writeFieldBytes(_PASSWORD, newPass) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) grantRoles(conn *Connection, policy *AdminPolicy, user string, roles []string) Error { + acmd.writeHeader(_GRANT_ROLES, 2) + acmd.writeFieldStr(_USER, user) + acmd.writeRoles(roles) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) revokeRoles(conn *Connection, policy *AdminPolicy, user string, roles []string) Error { + acmd.writeHeader(_REVOKE_ROLES, 2) + acmd.writeFieldStr(_USER, user) + acmd.writeRoles(roles) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) createRole(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { + fieldCount := 1 + if len(privileges) > 1 { + fieldCount++ + } + + if len(whitelist) > 1 { + fieldCount++ + } + + if readQuota > 0 { + fieldCount++ + } + + if writeQuota > 0 { + fieldCount++ + } + + acmd.writeHeader(_CREATE_ROLE, fieldCount) + acmd.writeFieldStr(_ROLE, roleName) + + if len(privileges) > 0 { + if err := acmd.writePrivileges(privileges); err != nil { + return err + } + } + + if len(whitelist) > 0 { + acmd.writeWhitelist(whitelist) + } + + if readQuota > 0 { + acmd.writeFieldUint32(_READ_QUOTA, readQuota) + } + + if writeQuota > 0 { + acmd.writeFieldUint32(_WRITE_QUOTA, writeQuota) + } + + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) dropRole(conn *Connection, policy *AdminPolicy, roleName string) Error { + acmd.writeHeader(_DROP_ROLE, 1) + acmd.writeFieldStr(_ROLE, roleName) + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) grantPrivileges(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege) Error { + acmd.writeHeader(_GRANT_PRIVILEGES, 2) + acmd.writeFieldStr(_ROLE, roleName) + if err := acmd.writePrivileges(privileges); err != nil { + return err + } + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) revokePrivileges(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege) Error { + acmd.writeHeader(_REVOKE_PRIVILEGES, 2) + acmd.writeFieldStr(_ROLE, roleName) + if err := acmd.writePrivileges(privileges); err != nil { + return err + } + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) setWhitelist(conn *Connection, policy *AdminPolicy, roleName string, whitelist []string) Error { + fieldCount := 1 + if len(whitelist) > 0 { + fieldCount++ + } + acmd.writeHeader(_SET_WHITELIST, fieldCount) + acmd.writeFieldStr(_ROLE, roleName) + if len(whitelist) > 0 { + acmd.writeWhitelist(whitelist) + } + return acmd.executeCommand(conn, policy) +} + +func (acmd *AdminCommand) setQuotas(conn *Connection, policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { + acmd.writeHeader(_SET_QUOTAS, 3) + acmd.writeFieldStr(_ROLE, roleName) + acmd.writeFieldUint32(_READ_QUOTA, readQuota) + acmd.writeFieldUint32(_WRITE_QUOTA, writeQuota) + return acmd.executeCommand(conn, policy) +} + +// QueryUser returns user information. +func (acmd *AdminCommand) QueryUser(conn *Connection, policy *AdminPolicy, user string) (*UserRoles, Error) { + acmd.writeHeader(_QUERY_USERS, 1) + acmd.writeFieldStr(_USER, user) + list, err := acmd.readUsers(conn, policy) + if err != nil { + return nil, err + } + + if len(list) > 0 { + return list[0], nil + } + + return nil, nil +} + +// QueryUsers returns user information for all users. +func (acmd *AdminCommand) QueryUsers(conn *Connection, policy *AdminPolicy) ([]*UserRoles, Error) { + acmd.writeHeader(_QUERY_USERS, 0) + list, err := acmd.readUsers(conn, policy) + if err != nil { + return nil, err + } + return list, nil +} + +// QueryRole returns role information. +func (acmd *AdminCommand) QueryRole(conn *Connection, policy *AdminPolicy, roleName string) (*Role, Error) { + acmd.writeHeader(_QUERY_ROLES, 1) + acmd.writeFieldStr(_ROLE, roleName) + list, err := acmd.readRoles(conn, policy) + if err != nil { + return nil, err + } + + if len(list) > 0 { + return list[0], nil + } + + return nil, nil +} + +// QueryRoles returns role information for all roles. +func (acmd *AdminCommand) QueryRoles(conn *Connection, policy *AdminPolicy) ([]*Role, Error) { + acmd.writeHeader(_QUERY_ROLES, 0) + list, err := acmd.readRoles(conn, policy) + if err != nil { + return nil, err + } + return list, nil +} + +func (acmd *AdminCommand) writeRoles(roles []string) { + offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) + acmd.dataBuffer[offset] = byte(len(roles)) + offset++ + + for _, role := range roles { + len := copy(acmd.dataBuffer[offset+1:], role) + acmd.dataBuffer[offset] = byte(len) + offset += len + 1 + } + + size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) + acmd.writeFieldHeader(_ROLES, size) + acmd.dataOffset = offset +} + +func (acmd *AdminCommand) writePrivileges(privileges []Privilege) Error { + offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) + acmd.dataBuffer[offset] = byte(len(privileges)) + offset++ + + for _, privilege := range privileges { + code := privilege.code() + + acmd.dataBuffer[offset] = byte(code) + offset++ + + if privilege.canScope() { + + if len(privilege.SetName) > 0 && len(privilege.Namespace) == 0 { + return newError(types.INVALID_PRIVILEGE, fmt.Sprintf("Admin privilege '%v' has a set scope with an empty namespace.", privilege)) + } + + acmd.dataBuffer[offset] = byte(len(privilege.Namespace)) + offset++ + copy(acmd.dataBuffer[offset:], privilege.Namespace) + offset += len(privilege.Namespace) + + acmd.dataBuffer[offset] = byte(len(privilege.SetName)) + offset++ + copy(acmd.dataBuffer[offset:], privilege.SetName) + offset += len(privilege.SetName) + } else { + if len(privilege.Namespace) > 0 || len(privilege.SetName) > 0 { + return newError(types.INVALID_PRIVILEGE, fmt.Sprintf("Admin global rivilege '%v' can't have a namespace or set.", privilege)) + } + } + } + + size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) + acmd.writeFieldHeader(_PRIVILEGES, size) + acmd.dataOffset = offset + + return nil +} + +func (acmd *AdminCommand) writeWhitelist(whitelist []string) { + offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) + + comma := false + for _, address := range whitelist { + if comma { + acmd.dataBuffer[offset] = ',' + offset++ + } else { + comma = true + } + + offset += copy(acmd.dataBuffer[offset:], address) + } + + size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) + acmd.writeFieldHeader(_WHITELIST, size) + acmd.dataOffset = offset +} + +func (acmd *AdminCommand) writeSize() { + // Write total size of message which is the current offset. + var size = int64(acmd.dataOffset-8) | (_MSG_VERSION << 56) | (_MSG_TYPE << 48) + binary.BigEndian.PutUint64(acmd.dataBuffer[0:], uint64(size)) +} + +func (acmd *AdminCommand) writeHeader(command byte, fieldCount int) { + // Authenticate header is almost all zeros + for i := acmd.dataOffset; i < acmd.dataOffset+16; i++ { + acmd.dataBuffer[i] = 0 + } + acmd.dataBuffer[acmd.dataOffset+2] = command + acmd.dataBuffer[acmd.dataOffset+3] = byte(fieldCount) + acmd.dataOffset += 16 +} + +func (acmd *AdminCommand) writeFieldStr(id byte, str string) { + len := copy(acmd.dataBuffer[acmd.dataOffset+int(_FIELD_HEADER_SIZE):], str) + acmd.writeFieldHeader(id, len) + acmd.dataOffset += len +} + +func (acmd *AdminCommand) writeFieldBytes(id byte, bytes []byte) { + copy(acmd.dataBuffer[acmd.dataOffset+int(_FIELD_HEADER_SIZE):], bytes) + acmd.writeFieldHeader(id, len(bytes)) + acmd.dataOffset += len(bytes) +} + +func (acmd *AdminCommand) writeFieldUint32(id byte, size uint32) { + acmd.writeFieldHeader(id, 4) + binary.BigEndian.PutUint32(acmd.dataBuffer[acmd.dataOffset:], size) + acmd.dataOffset += 4 +} + +func (acmd *AdminCommand) writeFieldHeader(id byte, size int) { + // Buffer.Int32ToBytes(int32(size+1), acmd.dataBuffer, acmd.dataOffset) + binary.BigEndian.PutUint32(acmd.dataBuffer[acmd.dataOffset:], uint32(size+1)) + + acmd.dataOffset += 4 + acmd.dataBuffer[acmd.dataOffset] = id + acmd.dataOffset++ +} + +func (acmd *AdminCommand) executeCommand(conn *Connection, policy *AdminPolicy) Error { + acmd.writeSize() + timeout := 1 * time.Second + if policy != nil && policy.Timeout > 0 { + timeout = policy.Timeout + } + + if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { + return err + } + + if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { + return err + } + + if _, err := conn.Read(acmd.dataBuffer, _HEADER_SIZE); err != nil { + return err + } + + result := acmd.dataBuffer[_RESULT_CODE] + if result != 0 { + if conn.node != nil { + return newCustomNodeError(conn.node, types.ResultCode(result)) + } + return newError(types.ResultCode(result)) + } + + return nil +} + +func (acmd *AdminCommand) readUsers(conn *Connection, policy *AdminPolicy) ([]*UserRoles, Error) { + acmd.writeSize() + timeout := 1 * time.Second + if policy != nil && policy.Timeout > 0 { + timeout = policy.Timeout + } + + if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { + return nil, err + } + + if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { + return nil, err + } + + status, list, err := acmd.readUserBlocks(conn) + if err != nil { + return nil, err + } + + if status > 0 { + if conn.node != nil { + return nil, newCustomNodeError(conn.node, types.ResultCode(status)) + } + return nil, newError(types.ResultCode(status)) + } + return list, nil +} + +func (acmd *AdminCommand) readUserBlocks(conn *Connection) (status int, rlist []*UserRoles, err Error) { + + var list []*UserRoles + + for status == 0 { + if _, err = conn.Read(acmd.dataBuffer, 8); err != nil { + return -1, nil, err + } + + size := Buffer.BytesToInt64(acmd.dataBuffer, 0) + receiveSize := (size & 0xFFFFFFFFFFFF) + + if receiveSize > 0 { + if receiveSize > int64(len(acmd.dataBuffer)) { + acmd.dataBuffer = make([]byte, receiveSize) + } + if _, err = conn.Read(acmd.dataBuffer, int(receiveSize)); err != nil { + return -1, nil, err + } + status, list, err = acmd.parseUsers(int(receiveSize)) + if err != nil { + return -1, nil, err + } + rlist = append(rlist, list...) + } else { + break + } + } + return status, rlist, nil +} + +func (acmd *AdminCommand) parseUsers(receiveSize int) (int, []*UserRoles, Error) { + acmd.dataOffset = 0 + list := make([]*UserRoles, 0, 100) + + for acmd.dataOffset < receiveSize { + resultCode := int(acmd.dataBuffer[acmd.dataOffset+1]) + + if resultCode != 0 { + if resultCode == _QUERY_END { + return -1, nil, nil + } + return resultCode, nil, nil + } + + userRoles := &UserRoles{} + fieldCount := int(acmd.dataBuffer[acmd.dataOffset+3]) + acmd.dataOffset += _HEADER_REMAINING + + for i := 0; i < fieldCount; i++ { + flen := int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) + acmd.dataOffset += 4 + id := acmd.dataBuffer[acmd.dataOffset] + acmd.dataOffset++ + flen-- + + switch id { + case _USER: + userRoles.User = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+flen]) + acmd.dataOffset += flen + case _ROLES: + acmd.parseRoles(userRoles) + case _READ_INFO: + userRoles.ReadInfo = acmd.parseInfo() + case _WRITE_INFO: + userRoles.WriteInfo = acmd.parseInfo() + case _CONNECTIONS: + userRoles.ConnsInUse = int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) + acmd.dataOffset += flen + default: + acmd.dataOffset += flen + } + } + + if userRoles.User == "" && userRoles.Roles == nil { + continue + } + + if userRoles.Roles == nil { + userRoles.Roles = make([]string, 0) + } + list = append(list, userRoles) + } + + return 0, list, nil +} + +func (acmd *AdminCommand) parseRoles(userRoles *UserRoles) { + size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + userRoles.Roles = make([]string, 0, size) + + for i := 0; i < size; i++ { + len := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + role := string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) + acmd.dataOffset += len + userRoles.Roles = append(userRoles.Roles, role) + } +} + +func (acmd *AdminCommand) parseInfo() []int { + size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + list := make([]int, 0, size) + + for i := 0; i < size; i++ { + val := int(Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset)) + acmd.dataOffset += 4 + list = append(list, val) + } + return list +} + +func hashPassword(password string) ([]byte, Error) { + // Hashing the password with the cost of 10, with a static salt + const salt = "$2a$10$7EqJtq98hPqEX7fNZaFWoO" + hashedPassword, err := bcrypt.Hash(password, salt) + if err != nil { + return nil, newCommonError(err) + } + return []byte(hashedPassword), nil +} + +func (acmd *AdminCommand) readRoles(conn *Connection, policy *AdminPolicy) ([]*Role, Error) { + acmd.writeSize() + timeout := 1 * time.Second + if policy != nil && policy.Timeout > 0 { + timeout = policy.Timeout + } + + if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { + return nil, err + } + + if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { + return nil, err + } + + status, list, err := acmd.readRoleBlocks(conn) + if err != nil { + return nil, err + } + + if status > 0 { + if conn.node != nil { + return nil, newCustomNodeError(conn.node, types.ResultCode(status)) + } + return nil, newError(types.ResultCode(status)) + } + return list, nil +} + +func (acmd *AdminCommand) readRoleBlocks(conn *Connection) (status int, rlist []*Role, err Error) { + + var list []*Role + + for status == 0 { + if _, err = conn.Read(acmd.dataBuffer, 8); err != nil { + return -1, nil, err + } + + size := Buffer.BytesToInt64(acmd.dataBuffer, 0) + receiveSize := int(size & 0xFFFFFFFFFFFF) + + if receiveSize > 0 { + if receiveSize > len(acmd.dataBuffer) { + acmd.dataBuffer = make([]byte, receiveSize) + } + if _, err = conn.Read(acmd.dataBuffer, receiveSize); err != nil { + return -1, nil, err + } + status, list, err = acmd.parseRolesFull(receiveSize) + if err != nil { + return -1, nil, err + } + rlist = append(rlist, list...) + } else { + break + } + } + return status, rlist, nil +} + +func (acmd *AdminCommand) parseRolesFull(receiveSize int) (int, []*Role, Error) { + acmd.dataOffset = 0 + + var list []*Role + for acmd.dataOffset < receiveSize { + resultCode := int(acmd.dataBuffer[acmd.dataOffset+1]) + + if resultCode != 0 { + if resultCode == _QUERY_END { + return -1, nil, nil + } + return resultCode, nil, nil + } + + role := &Role{} + fieldCount := int(acmd.dataBuffer[acmd.dataOffset+3]) + acmd.dataOffset += _HEADER_REMAINING + + for i := 0; i < fieldCount; i++ { + len := int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) + acmd.dataOffset += 4 + id := acmd.dataBuffer[acmd.dataOffset] + acmd.dataOffset++ + len-- + + switch id { + case _ROLE: + role.Name = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) + acmd.dataOffset += len + case _PRIVILEGES: + acmd.parsePrivileges(role) + case _WHITELIST: + role.Whitelist = acmd.parseWhitelist(len) + case _READ_QUOTA: + role.ReadQuota = Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset) + acmd.dataOffset += len + case _WRITE_QUOTA: + role.WriteQuota = Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset) + acmd.dataOffset += len + default: + acmd.dataOffset += len + } + } + + if len(role.Name) == 0 && len(role.Privileges) == 0 { + continue + } + + if role.Privileges == nil { + role.Privileges = []Privilege{} + } + list = append(list, role) + } + return 0, list, nil +} + +func (acmd *AdminCommand) parsePrivileges(role *Role) { + size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + role.Privileges = make([]Privilege, 0, size) + + for i := 0; i < size; i++ { + priv := Privilege{} + priv.Code = privilegeFrom(acmd.dataBuffer[acmd.dataOffset]) + acmd.dataOffset++ + + if priv.canScope() { + len := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + priv.Namespace = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) + acmd.dataOffset += len + + len = int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) + acmd.dataOffset++ + priv.SetName = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) + acmd.dataOffset += len + } + role.Privileges = append(role.Privileges, priv) + } +} + +func (acmd *AdminCommand) parseWhitelist(length int) []string { + list := []string{} + begin := acmd.dataOffset + max := begin + length + + for acmd.dataOffset < max { + if acmd.dataBuffer[acmd.dataOffset] == ',' { + l := acmd.dataOffset - begin + if l > 0 { + s := string(acmd.dataBuffer[begin : begin+l]) + list = append(list, s) + } + acmd.dataOffset++ + begin = acmd.dataOffset + } else { + acmd.dataOffset++ + } + } + + l := acmd.dataOffset - begin + if l > 0 { + s := string(acmd.dataBuffer[begin : begin+l]) + list = append(list, s) + } + + return list +} diff --git a/aerospike-tls/vendor-aerospike-client-go/admin_policy.go b/aerospike-tls/vendor-aerospike-client-go/admin_policy.go new file mode 100644 index 00000000..31a8bc6d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/admin_policy.go @@ -0,0 +1,48 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "time" + +// AdminPolicy contains attributes used for user administration commands. +type AdminPolicy struct { + + // User administration command socket timeout. + // Default is 2 seconds. + Timeout time.Duration +} + +// NewAdminPolicy generates a new AdminPolicy with default values. +func NewAdminPolicy() *AdminPolicy { + return &AdminPolicy{ + Timeout: _DEFAULT_TIMEOUT, + } +} + +func (ap *AdminPolicy) deadline() (deadline time.Time) { + if ap != nil && ap.Timeout > 0 { + deadline = time.Now().Add(ap.Timeout) + } + + return deadline +} + +func (ap *AdminPolicy) timeout() time.Duration { + if ap != nil && ap.Timeout > 0 { + return ap.Timeout + } + + return _DEFAULT_TIMEOUT +} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike.go b/aerospike-tls/vendor-aerospike-client-go/aerospike.go new file mode 100644 index 00000000..819b7766 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/aerospike.go @@ -0,0 +1,3 @@ +// Package aerospike provides a client to connect and interact with an Aerospike cluster. +// This is the official Go implementation of the Aerospike Client. +package aerospike diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go new file mode 100644 index 00000000..7e96d6a6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go @@ -0,0 +1,75 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "runtime" + + as "github.com/aerospike/aerospike-client-go/v7" + + "testing" +) + +func benchGetObj(times int, client *as.Client, key *as.Key, obj interface{}) { + for i := 0; i < times; i++ { + if err = client.GetObject(nil, key, obj); err != nil { + panic(err) + } + } +} + +func benchPutObj(times int, client *as.Client, key *as.Key, wp *as.WritePolicy, obj interface{}) { + for i := 0; i < times; i++ { + if err = client.PutObject(wp, key, obj); err != nil { + panic(err) + } + } +} + +func Benchmark_GetObject(b *testing.B) { + client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) + if err != nil { + b.Fail() + } + + key, _ := as.NewKey(*namespace, "databases", "Aerospike") + + obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1, 2, 3, 4, 5, 6}} + client.PutObject(nil, key, obj) + + b.N = 1 + runtime.GC() + b.ResetTimer() + benchGetObj(b.N, client, key, obj) +} + +func Benchmark_PutObject(b *testing.B) { + client, err := as.NewClient(*host, *port) + if err != nil { + b.Fail() + } + + // obj := &OBJECT{198, "Jack Shaftoe and Company", []byte(bytes.Repeat([]byte{32}, 1000))} + obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1, 2, 3, 4, 5, 6}} + key, _ := as.NewKey(*namespace, "databases", "Aerospike") + writepolicy := as.NewWritePolicy(0, 0) + + b.N = 100 + runtime.GC() + b.ResetTimer() + benchPutObj(b.N, client, key, writepolicy, obj) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go new file mode 100644 index 00000000..0374bf9d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go @@ -0,0 +1,116 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "runtime" + + as "github.com/aerospike/aerospike-client-go/v7" + + "testing" +) + +var r *as.Record +var rs []*as.Record +var err error + +type OBJECT struct { + Price int + DBName string + // Blob []byte + Blob []int64 +} + +func benchGet(times int, client *as.Client, key *as.Key) { + for i := 0; i < times; i++ { + if r, err = client.Get(nil, key); err != nil { + panic(err) + } + } +} + +func benchBatchGet(times int, client *as.Client, keys []*as.Key) { + for i := 0; i < times; i++ { + if rs, err = client.BatchGet(nil, keys); err != nil { + panic(err) + } + } +} + +func benchPut(times int, client *as.Client, key *as.Key, wp *as.WritePolicy) { + dbName := as.NewBin("dbname", "CouchDB") + price := as.NewBin("price", 0) + keywords := as.NewBin("keywords", []string{"concurrent", "fast"}) + for i := 0; i < times; i++ { + if err = client.PutBins(wp, key, dbName, price, keywords); err != nil { + panic(err) + } + } +} + +func Benchmark_Get(b *testing.B) { + client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) + if err != nil { + b.Fail() + } + + key, _ := as.NewKey(*namespace, "test", "Aerospike") + // obj := &OBJECT{198, "Jack Shaftoe and Company", []byte(bytes.Repeat([]byte{32}, 1000))} + // obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1}} + client.Delete(nil, key) + client.PutBins(nil, key, as.NewBin("b", []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, "a", "b"})) + // client.PutBins(nil, key, as.NewBin("b", 1)) + // client.PutObject(nil, key, &obj) + + b.N = 100 + runtime.GC() + b.ResetTimer() + benchGet(b.N, client, key) +} + +func Benchmark_Put(b *testing.B) { + client, err := as.NewClient(*host, *port) + if err != nil { + b.Fail() + } + + key, _ := as.NewKey(*namespace, "test", "Aerospike") + writepolicy := as.NewWritePolicy(0, 0) + + b.N = 100 + runtime.GC() + b.ResetTimer() + benchPut(b.N, client, key, writepolicy) +} + +func Benchmark_BatchGet(b *testing.B) { + client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) + if err != nil { + b.Fail() + } + + var keys []*as.Key + for i := 0; i < 10; i++ { + key, _ := as.NewKey(*namespace, "test", i) + if err := client.PutBins(nil, key, as.NewBin("b", 1)); err == nil { + keys = append(keys, key) + } + } + + b.N = 1e4 + runtime.GC() + b.ResetTimer() + benchBatchGet(b.N, client, keys) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go new file mode 100644 index 00000000..478c46d4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go @@ -0,0 +1,525 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "bytes" + "crypto/tls" + "crypto/x509" + "encoding/pem" + "flag" + "fmt" + "log" + "math/rand" + "os" + "regexp" + "strconv" + "strings" + "testing" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + asl "github.com/aerospike/aerospike-client-go/v7/logger" + ast "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var ( + hosts = flag.String("hosts", "", "Comma separated Aerospike server seed hostnames or IP addresses and ports. eg: s1:3000,s2:3000,s3:3000") + host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") + nativeHosts = flag.String("nh", "127.0.0.1:3000", "Native Aerospike server seed hostnames or IP addresses, used in tests for GRPC to support unsupported API") + port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") + user = flag.String("U", "", "Username.") + password = flag.String("P", "", "Password.") + authMode = flag.String("A", "internal", "Authentication mode: internal | external") + useReplicas = flag.Bool("use-replicas", false, "Aerospike will use replicas as well as master partitions.") + debug = flag.Bool("debug", false, "Will set the logging level to DEBUG.") + proxy = flag.Bool("proxy", false, "Will use Proxy Client.") + dbaas = flag.Bool("dbaas", false, "Will run the tests for a dbaas environment.") + namespace = flag.String("n", "test", "Namespace") + + certFile = flag.String("cert_file", "", "Certificate file name.") + keyFile = flag.String("key_file", "", "Key file name.") + keyFilePassphrase = flag.String("key_file_passphrase", "", "Key file's pass phrase.") + nodeTLSName = flag.String("node_tls_name", "", "Node's TLS name.") + rootCA = flag.String("root_ca", "", "Root certificate.") + + tlsConfig *tls.Config + clientPolicy *as.ClientPolicy + client as.ClientIfc + nativeClient *as.Client +) + +func initTestVars() { + var buf bytes.Buffer + var err error + + log.SetFlags(log.LstdFlags | log.Lshortfile) + logger := log.New(&buf, "", log.LstdFlags|log.Lshortfile) + logger.SetOutput(os.Stdout) + asl.Logger.SetLogger(logger) + + // dbaas implies a proxy client, albeit with no access to a native client for test setup. + if *dbaas { + *proxy = true + } + + if *debug { + asl.Logger.SetLevel(asl.DEBUG) + } + + clientPolicy = as.NewClientPolicy() + if *user != "" { + clientPolicy.User = *user + clientPolicy.Password = *password + } + + *authMode = strings.ToLower(strings.TrimSpace(*authMode)) + if *authMode != "internal" && *authMode != "external" { + log.Fatalln("Invalid auth mode: only `internal` and `external` values are accepted.") + } + + if *authMode == "external" { + clientPolicy.AuthMode = as.AuthModeExternal + } + + // setup TLS + tlsConfig = initTLS() + clientPolicy.TlsConfig = tlsConfig + + var dbHosts []*as.Host + + if len(strings.TrimSpace(*hosts)) > 0 { + dbHosts, err = as.NewHosts(strings.Split(*hosts, ",")...) + if err != nil { + log.Fatal(err.Error()) + } + } else { + dbHost := as.NewHost(*host, *port) + dbHost.TLSName = *nodeTLSName + + dbHosts = append(dbHosts, dbHost) + } + + log.Println("Connecting to seeds:", dbHosts) + if *proxy { + client, err = as.CreateClientWithPolicyAndHost(as.CTProxy, clientPolicy, dbHosts[0]) + if err != nil { + log.Fatal(err.Error()) + } + } else { + nclient, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHosts...) + if err != nil { + log.Fatal(err.Error()) + } + client = nclient + nativeClient = nclient + } + + if *proxy && !*dbaas { + hosts, err := as.NewHosts(*nativeHosts) + if err != nil { + log.Fatalln(err) + } + nativeClient, err = as.NewClientWithPolicyAndHost(clientPolicy, hosts...) + if err != nil { + log.Fatal("Error connecting the native client to the cluster", err.Error()) + } + } + + defaultBatchPolicy := as.NewBatchPolicy() + defaultBatchPolicy.TotalTimeout = 15 * time.Second + defaultBatchPolicy.SocketTimeout = 5 * time.Second + defaultWritePolicy := as.NewWritePolicy(0, 0) + defaultWritePolicy.TotalTimeout = 15 * time.Second + defaultWritePolicy.SocketTimeout = 5 * time.Second + defaultScanPolicy := as.NewScanPolicy() + defaultScanPolicy.TotalTimeout = 15 * time.Second + defaultScanPolicy.SocketTimeout = 5 * time.Second + defaultQueryPolicy := as.NewQueryPolicy() + defaultQueryPolicy.TotalTimeout = 15 * time.Second + defaultQueryPolicy.SocketTimeout = 5 * time.Second + defaultAdminPolicy := as.NewAdminPolicy() + defaultAdminPolicy.Timeout = 15 * time.Second + defaultInfoPolicy := as.NewInfoPolicy() + defaultInfoPolicy.Timeout = 15 * time.Second + + if nativeClient != nil { + nativeClient.SetDefaultBatchPolicy(defaultBatchPolicy) + nativeClient.SetDefaultBatchPolicy(defaultBatchPolicy) + nativeClient.SetDefaultWritePolicy(defaultWritePolicy) + nativeClient.SetDefaultWritePolicy(defaultWritePolicy) + nativeClient.SetDefaultScanPolicy(defaultScanPolicy) + nativeClient.SetDefaultScanPolicy(defaultScanPolicy) + nativeClient.SetDefaultQueryPolicy(defaultQueryPolicy) + nativeClient.SetDefaultQueryPolicy(defaultQueryPolicy) + nativeClient.SetDefaultAdminPolicy(defaultAdminPolicy) + nativeClient.SetDefaultInfoPolicy(defaultInfoPolicy) + } + + client.SetDefaultBatchPolicy(defaultBatchPolicy) + client.SetDefaultBatchPolicy(defaultBatchPolicy) + client.SetDefaultWritePolicy(defaultWritePolicy) + client.SetDefaultWritePolicy(defaultWritePolicy) + client.SetDefaultScanPolicy(defaultScanPolicy) + client.SetDefaultScanPolicy(defaultScanPolicy) + client.SetDefaultQueryPolicy(defaultQueryPolicy) + client.SetDefaultQueryPolicy(defaultQueryPolicy) + client.SetDefaultAdminPolicy(defaultAdminPolicy) + client.SetDefaultInfoPolicy(defaultInfoPolicy) + + // set default policies + if *useReplicas { + p := client.GetDefaultPolicy() + p.ReplicaPolicy = as.MASTER_PROLES + client.SetDefaultPolicy(p) + } +} + +func TestMain(m *testing.M) { + rand.Seed(time.Now().UnixNano()) + flag.Parse() + + // setup the client object + initTestVars() + os.Exit(m.Run()) +} + +func TestAerospike(t *testing.T) { + // TestMain will be called here, no need to do more + + gm.RegisterFailHandler(gg.Fail) + gg.RunSpecs(t, "Aerospike Client Library Suite") +} + +func featureEnabled(feature string) bool { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + node := nativeClient.GetNodes()[0] + infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "features") + if err != nil { + log.Fatal("Failed to connect to aerospike: err:", err) + } + + return strings.Contains(infoMap["features"], feature) +} + +func isEnterpriseEdition() bool { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + node := nativeClient.GetNodes()[0] + infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "edition") + if err != nil { + log.Fatal("Failed to connect to aerospike: err:", err) + } + + return strings.Contains(infoMap["edition"], "Enterprise") +} + +func securityEnabled() bool { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if !isEnterpriseEdition() { + return false + } + + _, err := nativeClient.QueryRoles(nil) + return err == nil +} + +func xdrEnabled() bool { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + res := info(nativeClient, "get-config:context=xdr") + return len(res) > 0 && !strings.HasPrefix(res, "ERROR") +} + +func nsInfo(ns string, feature string) string { + node := nativeClient.GetNodes()[0] + infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "namespace/"+ns) + if err != nil { + log.Fatal("Failed to connect to aerospike: err:", err) + } + + infoStr := infoMap["namespace/"+ns] + infoPairs := strings.Split(infoStr, ";") + for _, pairs := range infoPairs { + pair := strings.Split(pairs, "=") + if pair[0] == feature { + return pair[1] + } + } + + return "" +} + +func info(client *as.Client, feature string) string { + node := client.GetNodes()[0] + infoMap, err := node.RequestInfo(as.NewInfoPolicy(), feature) + if err != nil { + if !err.Matches(ast.TIMEOUT, ast.NETWORK_ERROR) { + return err.Error() + } else { + log.Fatal("Failed to connect to aerospike: err:", err) + } + } + + return infoMap[feature] +} + +func initTLS() *tls.Config { + if len(*rootCA) == 0 && len(*certFile) == 0 && len(*keyFile) == 0 { + if *dbaas { + // if testing in dbaas environment, still enable the default TLS config + return &tls.Config{} + } + return nil + } + + // Try to load system CA certs, otherwise just make an empty pool + serverPool, err := x509.SystemCertPool() + if serverPool == nil || err != nil { + log.Printf("Adding system certificates to the cert pool failed: %s", err) + serverPool = x509.NewCertPool() + } + + if len(*rootCA) > 0 { + // Try to load system CA certs and add them to the system cert pool + caCert, err := readFromFile(*rootCA) + if err != nil { + log.Fatal(err) + } + + log.Printf("Adding CA certificate to the pool...") + serverPool.AppendCertsFromPEM(caCert) + } + + var clientPool []tls.Certificate + if len(*certFile) > 0 || len(*keyFile) > 0 { + + // Read cert file + certFileBytes, err := readFromFile(*certFile) + if err != nil { + log.Fatal(err) + } + + // Read key file + keyFileBytes, err := readFromFile(*keyFile) + if err != nil { + log.Fatal(err) + } + + // Decode PEM data + keyBlock, _ := pem.Decode(keyFileBytes) + certBlock, _ := pem.Decode(certFileBytes) + + if keyBlock == nil || certBlock == nil { + log.Fatalf("Failed to decode PEM data for key or certificate") + } + + // Check and Decrypt the the Key Block using passphrase + if x509.IsEncryptedPEMBlock(keyBlock) { + decryptedDERBytes, err := x509.DecryptPEMBlock(keyBlock, []byte(*keyFilePassphrase)) + if err != nil { + log.Fatalf("Failed to decrypt PEM Block: `%s`", err) + } + + keyBlock.Bytes = decryptedDERBytes + keyBlock.Headers = nil + } + + // Encode PEM data + keyPEM := pem.EncodeToMemory(keyBlock) + certPEM := pem.EncodeToMemory(certBlock) + + if keyPEM == nil || certPEM == nil { + log.Fatalf("Failed to encode PEM data for key or certificate") + } + + cert, cerr := tls.X509KeyPair(certPEM, keyPEM) + if cerr != nil { + log.Fatalf("Failed to add client certificate and key to the pool: `%s`", cerr) + } + + log.Printf("Adding client certificate and key to the pool...") + clientPool = append(clientPool, cert) + } + + tlsConfig := &tls.Config{ + Certificates: clientPool, + RootCAs: serverPool, + InsecureSkipVerify: false, + PreferServerCipherSuites: true, + } + tlsConfig.BuildNameToCertificate() + + return tlsConfig +} + +// Read content from file +func readFromFile(filePath string) ([]byte, error) { + dataBytes, err := os.ReadFile(filePath) + if err != nil { + return nil, fmt.Errorf("Failed to read from file `%s`: `%v`", filePath, err) + } + + data := bytes.TrimSuffix(dataBytes, []byte("\n")) + + return data, nil +} + +/* + + Version Comparison Code + +*/ + +type versionStatus string + +const ( + vsNewer versionStatus = "newer" + vsOlder versionStatus = "older" + vsEqual versionStatus = "equal" +) + +func nsupPeriod(ns string) int { + if *proxy || *dbaas { + return 0 + } + + var pattern = `nsup-period=(?P\d+)` + var vmeta = regexp.MustCompile(pattern) + + vs := info(nativeClient, "namespace/"+ns) + server := findNamedMatches(vmeta, vs) + + if len(server) > 0 { + return server[0] + } + return 0 +} + +func cmpServerVersion(v string) versionStatus { + var pattern = `(?P\d+)(\.(?P\d+)(\.(?P\d+)(\.(?P\d+))?)?)?.*` + var vmeta = regexp.MustCompile(pattern) + + vs := info(nativeClient, "build") + + server := findNamedMatches(vmeta, vs) + req := findNamedMatches(vmeta, v) + + for i := 0; i < 4; i++ { + if req[i] < server[i] { + return vsNewer + } else if req[i] > server[i] { + return vsOlder + } + } + + return vsEqual +} + +func serverIsOlderThan(v string) bool { + return cmpServerVersion(v) == vsOlder +} + +func serverIsNewerThan(v string) bool { + return cmpServerVersion(v) != vsOlder +} + +func findNamedMatches(regex *regexp.Regexp, str string) []int { + match := regex.FindStringSubmatch(str) + names := regex.SubexpNames() + results := make([]int, len(names)) + + j := 0 + for i, vstr := range match { + if len(names[i]) > 0 { + vr, _ := strconv.Atoi(vstr) + results[j] = vr + j++ + } + } + return results[:j] +} + +func dropUser( + policy *as.AdminPolicy, + user string, +) { + err := nativeClient.DropUser(policy, user) + gm.Expect(err).ToNot(gm.HaveOccurred()) +} + +func dropIndex( + policy *as.WritePolicy, + namespace string, + setName string, + indexName string, +) { + gm.Expect(nativeClient.DropIndex(policy, namespace, setName, indexName)).ToNot(gm.HaveOccurred()) + + // time.Sleep(time.Second) +} + +func createIndex( + policy *as.WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType as.IndexType, +) { + idxTask, err := nativeClient.CreateIndex(policy, namespace, setName, indexName, binName, indexType) + if err != nil { + if !err.Matches(ast.INDEX_FOUND) { + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + return // index already exists + } + + // time.Sleep(time.Second) + + // wait until index is created + gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) +} + +func createComplexIndex( + policy *as.WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType as.IndexType, + indexCollectionType as.IndexCollectionType, + ctx ...*as.CDTContext, +) { + // queries only work on indices + idxTask1, err := nativeClient.CreateComplexIndex(policy, namespace, setName, indexName, binName, indexType, indexCollectionType, ctx...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until index is created + gm.Expect(<-idxTask1.OnComplete()).ToNot(gm.HaveOccurred()) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go b/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go new file mode 100644 index 00000000..4b889bb4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go @@ -0,0 +1,129 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Aerospike", func() { + + gg.Describe("PutObject and GetObject with anonymous fields", func() { + // connection data + var err error + var ns = *namespace + var set = randString(50) + + type anonymousStructA struct { + A int `as:"a"` + TTL uint32 `asm:"ttl"` + GEN uint32 `asm:"gen"` + } + + type anonymousStructB struct { + B string `as:"b"` + TTL uint32 `asm:"ttl"` + GEN uint32 `asm:"gen"` + } + + type anonymousStructABC struct { + anonymousStructA + anonymousStructB + A bool `as:"ace"` + B int `as:"bce"` + C float64 `as:"c"` + TTL1, TTL2 uint32 `asm:"ttl"` + GEN1, GEN2 uint32 `asm:"gen"` + } + + type anonymousStructABCD struct { + ABC *anonymousStructABC + D bool `as:"d"` + } + + type testStruct struct { + anonymousStructABC + anonymousStructABCD + } + + makeTestObject := func() *testStruct { + obj := &testStruct{} + obj.A = true + obj.B = 20 + obj.anonymousStructA.A = 10 + obj.anonymousStructB.B = "Hello" + obj.C = 3.14159 + obj.ABC = &anonymousStructABC{} + obj.ABC.A = false + obj.ABC.B = 42 + obj.ABC.anonymousStructA.A = 28 + obj.ABC.anonymousStructB.B = "World!" + obj.ABC.C = 2.17828 + obj.D = true + return obj + } + + gg.Context("PutObject & GetObject operations", func() { + gg.It("must save an object with anonymous fields", func() { + as.UseNativeBoolTypeInReflection = false + + key, _ := as.NewKey(ns, set, randString(50)) + expected := makeTestObject() + err = client.PutObject(nil, key, expected) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + actual := &testStruct{} + err = client.GetObject(nil, key, actual) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + // make sure the returned BinMap here reflects what you + // expect the final marshalled object should be. + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{ + "ABC": map[interface{}]interface{}{ + "b": "World!", + "ace": 0, + "bce": 42, + "c": 2.17828, + "a": 28, + }, + "d": 1, + "a": 10, + "b": "Hello", + "ace": 1, + "bce": 20, + "c": 3.14159, + })) + + gm.Expect(actual.TTL1).NotTo(gm.Equal(uint32(0))) + gm.Expect(actual.TTL1).To(gm.Equal(actual.TTL2)) + gm.Expect(actual.TTL1).To(gm.Equal(actual.anonymousStructA.TTL)) + gm.Expect(actual.TTL1).To(gm.Equal(actual.anonymousStructB.TTL)) + + gm.Expect(actual.GEN1).To(gm.Equal(uint32(1))) + gm.Expect(actual.GEN2).To(gm.Equal(uint32(1))) + gm.Expect(actual.anonymousStructA.GEN).To(gm.Equal(uint32(1))) + gm.Expect(actual.anonymousStructB.GEN).To(gm.Equal(uint32(1))) + + }) + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/auth_mode.go b/aerospike-tls/vendor-aerospike-client-go/auth_mode.go new file mode 100644 index 00000000..fcf28c09 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/auth_mode.go @@ -0,0 +1,34 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// AuthMode determines authentication mode. +type AuthMode int + +const ( + // AuthModeInternal uses internal authentication only when user/password defined. Hashed password is stored + // on the server. Do not send clear password. This is the default. + AuthModeInternal AuthMode = iota + + // AuthModeExternal uses external authentication (like LDAP) when user/password defined. Specific external authentication is + // configured on server. If TLSConfig is defined, sends clear password on node login via TLS. + // Will return an error if TLSConfig is not defined. + AuthModeExternal + + // AuthModePKI allows authentication and authorization based on a certificate. No user name or + // password needs to be configured. Requires TLS and a client certificate. + // Requires server version 5.7.0+ + AuthModePKI +) diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_attr.go b/aerospike-tls/vendor-aerospike-client-go/batch_attr.go new file mode 100644 index 00000000..b5bc8503 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_attr.go @@ -0,0 +1,293 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type batchAttr struct { + filterExp *Expression + readAttr int + writeAttr int + infoAttr int + expiration uint32 + generation uint32 + hasWrite bool + sendKey bool +} + +func newBatchAttr(policy *BatchPolicy, rattr int) *batchAttr { + res := &batchAttr{} + res.setRead(policy) + res.readAttr |= rattr + + return res +} + +func newBatchAttrOps(rp *BatchPolicy, wp *BatchWritePolicy, ops []*Operation) { + res := &batchAttr{} + readAllBins := false + readHeader := false + hasRead := false + hasWriteOp := false + + for _, op := range ops { + switch op.opType { + case _READ_HEADER: + readHeader = true + hasRead = true + case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: + // _Read all bins if no bin is specified. + if op.binName == "" { + readAllBins = true + } + hasRead = true + + default: + hasWriteOp = true + } + } + + if hasWriteOp { + res.setBatchWrite(wp) + + if hasRead { + res.readAttr |= _INFO1_READ + + if readAllBins { + res.readAttr |= _INFO1_GET_ALL + } else if readHeader { + res.readAttr |= _INFO1_NOBINDATA + } + } + } else { + res.setRead(rp) + + if readAllBins { + res.readAttr |= _INFO1_GET_ALL + } else if readHeader { + res.readAttr |= _INFO1_NOBINDATA + } + } +} + +func (ba *batchAttr) setRead(rp *BatchPolicy) { + ba.filterExp = nil + ba.readAttr = _INFO1_READ + + if rp.ReadModeAP == ReadModeAPAll { + ba.readAttr |= _INFO1_READ_MODE_AP_ALL + } + + ba.writeAttr = 0 + + switch rp.ReadModeSC { + default: + case ReadModeSCSession: + ba.infoAttr = 0 + case ReadModeSCLinearize: + ba.infoAttr = _INFO3_SC_READ_TYPE + case ReadModeSCAllowReplica: + ba.infoAttr = _INFO3_SC_READ_RELAX + case ReadModeSCAllowUnavailable: + ba.infoAttr = _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX + } + ba.expiration = uint32(rp.ReadTouchTTLPercent) + ba.generation = 0 + ba.hasWrite = false + ba.sendKey = false +} + +func (ba *batchAttr) setBatchRead(rp *BatchReadPolicy) { + ba.filterExp = rp.FilterExpression + ba.readAttr = _INFO1_READ + + if rp.ReadModeAP == ReadModeAPAll { + ba.readAttr |= _INFO1_READ_MODE_AP_ALL + } + + ba.writeAttr = 0 + + switch rp.ReadModeSC { + default: + case ReadModeSCSession: + ba.infoAttr = 0 + case ReadModeSCLinearize: + ba.infoAttr = _INFO3_SC_READ_TYPE + case ReadModeSCAllowReplica: + ba.infoAttr = _INFO3_SC_READ_RELAX + case ReadModeSCAllowUnavailable: + ba.infoAttr = _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX + } + ba.expiration = uint32(rp.ReadTouchTTLPercent) + ba.generation = 0 + ba.hasWrite = false + ba.sendKey = false +} + +func (ba *batchAttr) adjustRead(ops []*Operation) { + readAllBins := false + readHeader := false + + for _, op := range ops { + switch op.opType { + case _READ_HEADER: + readHeader = true + case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: + // Read all bins if no bin is specified. + if op.binName == "" { + readAllBins = true + } + default: + } + } + + if readAllBins { + ba.readAttr |= _INFO1_GET_ALL + } else if readHeader { + ba.readAttr |= _INFO1_NOBINDATA + } +} + +func (ba *batchAttr) adjustReadForAllBins(readAllBins bool) { + if readAllBins { + ba.readAttr |= _INFO1_GET_ALL + } else { + ba.readAttr |= _INFO1_NOBINDATA + } +} + +func (ba *batchAttr) setBatchWrite(wp *BatchWritePolicy) { + ba.filterExp = wp.FilterExpression + ba.readAttr = 0 + ba.writeAttr = _INFO2_WRITE | _INFO2_RESPOND_ALL_OPS + ba.infoAttr = 0 + ba.expiration = wp.Expiration + ba.hasWrite = true + ba.sendKey = wp.SendKey + + switch wp.GenerationPolicy { + default: + fallthrough + case NONE: + ba.generation = 0 + + case EXPECT_GEN_EQUAL: + ba.generation = wp.Generation + ba.writeAttr |= _INFO2_GENERATION + + case EXPECT_GEN_GT: + ba.generation = wp.Generation + ba.writeAttr |= _INFO2_GENERATION_GT + } + + switch wp.RecordExistsAction { + case UPDATE: + case UPDATE_ONLY: + ba.infoAttr |= _INFO3_UPDATE_ONLY + case REPLACE: + ba.infoAttr |= _INFO3_CREATE_OR_REPLACE + case REPLACE_ONLY: + ba.infoAttr |= _INFO3_REPLACE_ONLY + case CREATE_ONLY: + ba.writeAttr |= _INFO2_CREATE_ONLY + } + + if wp.DurableDelete { + ba.writeAttr |= _INFO2_DURABLE_DELETE + } + + if wp.CommitLevel == COMMIT_MASTER { + ba.infoAttr |= _INFO3_COMMIT_MASTER + } +} + +func (ba *batchAttr) adjustWrite(ops []*Operation) { + readAllBins := false + readHeader := false + hasRead := false + + for _, op := range ops { + switch op.opType { + case _READ_HEADER: + readHeader = true + hasRead = true + case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: + // _Read all bins if no bin is specified. + if op.binName == "" { + readAllBins = true + } + hasRead = true + + default: + } + } + + if hasRead { + ba.readAttr |= _INFO1_READ + + if readAllBins { + ba.readAttr |= _INFO1_GET_ALL + } else if readHeader { + ba.readAttr |= _INFO1_NOBINDATA + } + } +} + +func (ba *batchAttr) setBatchUDF(up *BatchUDFPolicy) { + ba.filterExp = up.FilterExpression + ba.readAttr = 0 + ba.writeAttr = _INFO2_WRITE + ba.infoAttr = 0 + ba.expiration = up.Expiration + ba.generation = 0 + ba.hasWrite = true + ba.sendKey = up.SendKey + + if up.DurableDelete { + ba.writeAttr |= _INFO2_DURABLE_DELETE + } + + if up.CommitLevel == COMMIT_MASTER { + ba.infoAttr |= _INFO3_COMMIT_MASTER + } +} + +func (ba *batchAttr) setBatchDelete(dp *BatchDeletePolicy) { + ba.filterExp = dp.FilterExpression + ba.readAttr = 0 + ba.writeAttr = _INFO2_WRITE | _INFO2_RESPOND_ALL_OPS | _INFO2_DELETE + ba.infoAttr = 0 + ba.expiration = 0 + ba.hasWrite = true + ba.sendKey = dp.SendKey + + switch dp.GenerationPolicy { + default: + case NONE: + ba.generation = 0 + case EXPECT_GEN_EQUAL: + ba.generation = dp.Generation + ba.writeAttr |= _INFO2_GENERATION + case EXPECT_GEN_GT: + ba.generation = dp.Generation + ba.writeAttr |= _INFO2_GENERATION_GT + } + + if dp.DurableDelete { + ba.writeAttr |= _INFO2_DURABLE_DELETE + } + + if dp.CommitLevel == COMMIT_MASTER { + ba.infoAttr |= _INFO3_COMMIT_MASTER + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command.go b/aerospike-tls/vendor-aerospike-client-go/batch_command.go new file mode 100644 index 00000000..1d2c55f2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command.go @@ -0,0 +1,128 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +type batcher interface { + command + + cloneBatchCommand(batch *batchNode) batcher + filteredOut() int + + retryBatch(ifc batcher, cluster *Cluster, deadline time.Time, iteration int) (bool, Error) + generateBatchNodes(*Cluster) ([]*batchNode, Error) + setSequence(int, int) + + executeSingle(clientIfc) Error +} + +type clientIfc interface { + ClientIfc + + operate(*WritePolicy, *Key, bool, ...*Operation) (*Record, Error) + execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) +} + +type batchCommand struct { + baseMultiCommand + + client clientIfc + batch *batchNode + policy *BatchPolicy + sequenceAP int + sequenceSC int + + splitRetry bool + + filteredOutCnt int +} + +func (cmd *batchCommand) prepareRetry(ifc command, isTimeout bool) bool { + if !(cmd.policy.ReplicaPolicy == SEQUENCE || cmd.policy.ReplicaPolicy == PREFER_RACK) { + // Perform regular retry to same node. + return true + } + + cmd.sequenceAP++ + + if !isTimeout || cmd.policy.ReadModeSC != ReadModeSCLinearize { + cmd.sequenceSC++ + } + return false +} + +func (cmd *batchCommand) retryBatch(ifc batcher, cluster *Cluster, deadline time.Time, iteration int) (bool, Error) { + // Retry requires keys for this node to be split among other nodes. + // This is both recursive and exponential. + batchNodes, err := ifc.generateBatchNodes(cluster) + if err != nil { + return false, err + } + + if len(batchNodes) == 1 && batchNodes[0].Node == cmd.batch.Node { + // Batch node is the same. Go through normal retry. + return false, nil + } + + // Run batch requests sequentially in same thread. + var ferr Error + for _, batchNode := range batchNodes { + command := ifc.cloneBatchCommand(batchNode) + command.setSequence(cmd.sequenceAP, cmd.sequenceSC) + if err := command.executeAt(command, cmd.policy.GetBasePolicy(), deadline, iteration); err != nil { + ferr = chainErrors(err, ferr) + if !cmd.policy.AllowPartialResults { + return false, ferr + } + } + } + + return true, ferr +} + +func (cmd *batchCommand) setSequence(ap, sc int) { + cmd.sequenceAP, cmd.sequenceSC = ap, sc +} + +func (cmd *batchCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *batchCommand) transactionType() transactionType { + return ttNone +} + +func (cmd *batchCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *batchCommand) filteredOut() int { + return cmd.filteredOutCnt +} + +func (cmd *batchCommand) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + panic(unreachable) +} + +func (cmd *batchCommand) cloneBatchCommand(batch *batchNode) batcher { + panic(unreachable) +} + +func (cmd *batchCommand) writeBuffer(ifc command) Error { + panic(unreachable) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go new file mode 100644 index 00000000..28bb0e87 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go @@ -0,0 +1,213 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type batchCommandDelete struct { + batchCommand + + batchDeletePolicy *BatchDeletePolicy + keys []*Key + records []*BatchRecord + attr *batchAttr +} + +func newBatchCommandDelete( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + batchDeletePolicy *BatchDeletePolicy, + keys []*Key, + records []*BatchRecord, + attr *batchAttr, +) *batchCommandDelete { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchCommandDelete{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, false), + policy: policy, + batch: batch, + }, + batchDeletePolicy: batchDeletePolicy, + keys: keys, + records: records, + attr: attr, + } + return res +} + +func (cmd *batchCommandDelete) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.node = batch.Node + res.batch = batch + + return &res +} + +func (cmd *batchCommandDelete) writeBuffer(ifc command) Error { + return cmd.setBatchOperate(cmd.policy, cmd.keys, cmd.batch, nil, nil, cmd.attr) +} + +// Parse all results in the batch. Add records to shared list. +// If the record was not found, the bins will be nil. +func (cmd *batchCommandDelete) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + //Parse each message response and add it to the result array + cmd.dataOffset = 0 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + // The only valid server return codes are "ok" and "not found" and "filtered out". + // If other return codes are received, then abort the batch. + if resultCode != 0 { + if resultCode != types.KEY_NOT_FOUND_ERROR { + if resultCode == types.FILTERED_OUT { + cmd.filteredOutCnt++ + } + } + + if resultCode != types.KEY_NOT_FOUND_ERROR && resultCode != types.FILTERED_OUT { + return false, newCustomNodeError(cmd.node, resultCode) + } + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + err := cmd.skipKey(fieldCount) + if err != nil { + return false, err + } + + if resultCode == 0 { + if err = cmd.parseRecord(cmd.records[batchIndex], cmd.keys[batchIndex], opCount, generation, expiration); err != nil { + return false, err + } + } else { + cmd.records[batchIndex].Err = chainErrors(newCustomNodeError(cmd.node, resultCode), cmd.records[batchIndex].Err) + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + } + } + return true, nil +} + +// Parses the given byte buffer and populate the result object. +// Returns the number of bytes that were parsed from the given buffer. +func (cmd *batchCommandDelete) parseRecord(rec *BatchRecord, key *Key, opCount int, generation, expiration uint32) Error { + bins := make(BinMap, opCount) + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return err + } + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return err + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return err + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + return err + } + + if cmd.isOperation { + if prev, ok := bins[name]; ok { + if prev2, ok := prev.(OpResults); ok { + bins[name] = append(prev2, value) + } else { + bins[name] = OpResults{prev, value} + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + rec.setRecord(newRecord(cmd.node, key, bins, generation, expiration)) + return nil +} + +func (cmd *batchCommandDelete) transactionType() transactionType { + return ttBatchWrite +} + +func (cmd *batchCommandDelete) executeSingle(client clientIfc) Error { + policy := cmd.batchDeletePolicy.toWritePolicy(cmd.policy) + for i, key := range cmd.keys { + res, err := client.Operate(policy, key, DeleteOp()) + cmd.records[i].setRecord(res) + if err != nil { + cmd.records[i].setRawError(err) + + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + return err + } + } + return nil +} + +func (cmd *batchCommandDelete) Execute() Error { + if len(cmd.keys) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchCommandDelete) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go new file mode 100644 index 00000000..faa7d957 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go @@ -0,0 +1,152 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type batchCommandExists struct { + batchCommand + + keys []*Key + existsArray []bool +} + +func newBatchCommandExists( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + keys []*Key, + existsArray []bool, +) *batchCommandExists { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchCommandExists{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, false), + policy: policy, + batch: batch, + }, + keys: keys, + existsArray: existsArray, + } + return res +} + +func (cmd *batchCommandExists) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.node = batch.Node + res.batch = batch + + return &res +} + +func (cmd *batchCommandExists) writeBuffer(ifc command) Error { + return cmd.setBatchRead(cmd.policy, cmd.keys, cmd.batch, nil, nil, _INFO1_READ|_INFO1_NOBINDATA) +} + +// Parse all results in the batch. Add records to shared list. +// If the record was not found, the bins will be nil. +func (cmd *batchCommandExists) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + //Parse each message response and add it to the result array + cmd.dataOffset = 0 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + // The only valid server return codes are "ok" and "not found". + // If other return codes are received, then abort the batch. + if resultCode != 0 && resultCode != types.KEY_NOT_FOUND_ERROR { + if resultCode == types.FILTERED_OUT { + cmd.filteredOutCnt++ + } else { + return false, newCustomNodeError(cmd.node, resultCode) + } + } + + info3 := cmd.dataBuffer[3] + + // If cmd is the end marker of the response, do not proceed further + if (int(info3) & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + + if opCount > 0 { + return false, newCustomNodeError(cmd.node, types.PARSE_ERROR, "Received bins that were not requested!") + } + + err := cmd.skipKey(fieldCount) + if err != nil { + return false, err + } + + // only set the results to true; as a result, no synchronization is needed + cmd.existsArray[batchIndex] = resultCode == 0 + } + return true, nil +} + +func (cmd *batchCommandExists) transactionType() transactionType { + return ttBatchRead +} + +func (cmd *batchCommandExists) executeSingle(client clientIfc) Error { + var err Error + for _, offset := range cmd.batch.offsets { + cmd.existsArray[offset], err = client.Exists(&cmd.policy.BasePolicy, cmd.keys[offset]) + if err != nil { + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + return err + } + } + return nil +} + +func (cmd *batchCommandExists) Execute() Error { + if len(cmd.batch.offsets) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchCommandExists) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go new file mode 100644 index 00000000..1acd449c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go @@ -0,0 +1,269 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type batchCommandGet struct { + batchCommand + + keys []*Key + binNames []string // binNames are mutually exclusive with ops + ops []*Operation // ops are mutually exclusive with binNames + records []*Record + indexRecords []*BatchRead + readAttr int + key Key + + // pointer to the object that's going to be unmarshalled + objects []*reflect.Value + objectsFound []bool +} + +type batchObjectParsetIfc interface { + buf() []byte + readBytes(int) Error + object(int) *reflect.Value +} + +// this method uses reflection. +// Will not be set if performance flag is passed for the build. +var batchObjectParser func( + cmd batchObjectParsetIfc, + offset int, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error + +func newBatchCommandGet( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + keys []*Key, + binNames []string, + ops []*Operation, + records []*Record, + readAttr int, + isOperation bool, +) *batchCommandGet { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchCommandGet{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, isOperation), + policy: policy, + batch: batch, + }, + keys: keys, + ops: ops, + binNames: binNames, + records: records, + readAttr: readAttr, + } + return res +} + +func (cmd *batchCommandGet) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.node = batch.Node + res.batch = batch + + return &res +} + +func (cmd *batchCommandGet) buf() []byte { + return cmd.dataBuffer +} + +func (cmd *batchCommandGet) object(index int) *reflect.Value { + return cmd.objects[index] +} + +func (cmd *batchCommandGet) writeBuffer(ifc command) Error { + return cmd.setBatchRead(cmd.policy, cmd.keys, cmd.batch, cmd.binNames, cmd.ops, cmd.readAttr) +} + +// Parse all results in the batch. Add records to shared list. +// If the record was not found, the bins will be nil. +func (cmd *batchCommandGet) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + //Parse each message response and add it to the result array + cmd.dataOffset = 0 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + // The only valid server return codes are "ok" and "not found" and "filtered out". + // If other return codes are received, then abort the batch. + if resultCode != 0 && resultCode != types.KEY_NOT_FOUND_ERROR { + if resultCode == types.FILTERED_OUT { + cmd.filteredOutCnt++ + } else { + return false, newCustomNodeError(cmd.node, resultCode) + } + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + err := cmd.skipKey(fieldCount) + if err != nil { + return false, err + } + + if cmd.indexRecords != nil { + if len(cmd.indexRecords) > 0 { + if resultCode == 0 { + if cmd.indexRecords[batchIndex].Record, err = cmd.parseRecord(cmd.indexRecords[batchIndex].Key, opCount, generation, expiration); err != nil { + return false, err + } + } + } + } else { + if resultCode == 0 { + if cmd.objects == nil { + if cmd.records[batchIndex], err = cmd.parseRecord(cmd.keys[batchIndex], opCount, generation, expiration); err != nil { + return false, err + } + } else if batchObjectParser != nil { + // mark it as found + cmd.objectsFound[batchIndex] = true + if err := batchObjectParser(cmd, batchIndex, opCount, fieldCount, generation, expiration); err != nil { + return false, err + } + } + } + } + } + return true, nil +} + +// Parses the given byte buffer and populate the result object. +// Returns the number of bytes that were parsed from the given buffer. +func (cmd *batchCommandGet) parseRecord(key *Key, opCount int, generation, expiration uint32) (*Record, Error) { + bins := make(BinMap, opCount) + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return nil, err + } + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return nil, err + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return nil, err + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + return nil, err + } + + if cmd.isOperation { + if prev, ok := bins[name]; ok { + if prev2, ok := prev.(OpResults); ok { + bins[name] = append(prev2, value) + } else { + bins[name] = OpResults{prev, value} + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + return newRecord(cmd.node, key, bins, generation, expiration), nil +} + +func (cmd *batchCommandGet) transactionType() transactionType { + return ttBatchRead +} + +func (cmd *batchCommandGet) executeSingle(client clientIfc) Error { + for _, offset := range cmd.batch.offsets { + var err Error + if len(cmd.ops) > 0 { + // Validate that all operations are read + for i := range cmd.ops { + if cmd.ops[i].opType.isWrite { + return newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read").setNode(cmd.node) + } + } + cmd.records[offset], err = client.operate(cmd.policy.toWritePolicy(), cmd.keys[offset], true, cmd.ops...) + } else if (cmd.readAttr & _INFO1_NOBINDATA) == _INFO1_NOBINDATA { + cmd.records[offset], err = client.GetHeader(&cmd.policy.BasePolicy, cmd.keys[offset]) + } else { + cmd.records[offset], err = client.Get(&cmd.policy.BasePolicy, cmd.keys[offset], cmd.binNames...) + } + if err != nil { + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + return err + } + } + return nil +} + +func (cmd *batchCommandGet) Execute() Error { + if cmd.objects == nil && len(cmd.batch.offsets) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchCommandGet) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go new file mode 100644 index 00000000..cee4a09c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go @@ -0,0 +1,90 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// if this file is included in the build, it will include this method +func init() { + batchObjectParser = parseBatchObject +} + +func parseBatchObject( + cmd batchObjectParsetIfc, + offset int, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error { + if opCount > 0 { + rv := *cmd.object(offset) + + if rv.Kind() != reflect.Ptr { + return ErrInvalidObjectType.err() + } + rv = rv.Elem() + + if !rv.CanAddr() { + return ErrInvalidObjectType.err() + } + + if rv.Kind() != reflect.Struct { + return ErrInvalidObjectType.err() + } + + // find the name based on tag mapping + iobj := indirect(rv) + mappings := objectMappings.getMapping(iobj.Type()) + + if err := setObjectMetaFields(iobj, expiration, generation); err != nil { + return err + } + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return err + } + opSize := int(Buffer.BytesToUint32(cmd.buf(), 0)) + particleType := int(cmd.buf()[5]) + nameSize := int(cmd.buf()[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return err + } + name := string(cmd.buf()[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return err + } + value, err := bytesToParticle(particleType, cmd.buf(), 0, particleBytesSize) + if err != nil { + return err + } + if err := setObjectField(mappings, iobj, name, value); err != nil { + return err + } + } + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go new file mode 100644 index 00000000..b0502787 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go @@ -0,0 +1,303 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type batchCommandOperate struct { + batchCommand + + attr *batchAttr + records []BatchRecordIfc + + // pointer to the object that's going to be unmarshalled + objects []*reflect.Value + objectsFound []bool +} + +func newBatchCommandOperate( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + records []BatchRecordIfc, +) *batchCommandOperate { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchCommandOperate{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, true), + policy: policy, + batch: batch, + }, + records: records, + } + return res +} + +func (cmd *batchCommandOperate) buf() []byte { + return cmd.dataBuffer +} + +func (cmd *batchCommandOperate) object(index int) *reflect.Value { + return cmd.objects[index] +} + +func (cmd *batchCommandOperate) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.node = batch.Node + res.batch = batch + + return &res +} + +func (cmd *batchCommandOperate) writeBuffer(ifc command) Error { + attr, err := cmd.setBatchOperateIfc(cmd.client, cmd.policy, cmd.records, cmd.batch) + cmd.attr = attr + return err +} + +func (cmd *batchCommandOperate) isRead() bool { + return cmd.attr != nil && !cmd.attr.hasWrite +} + +// Parse all results in the batch. Add records to shared list. +// If the record was not found, the bins will be nil. +func (cmd *batchCommandOperate) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + //Parse each message response and add it to the result array + cmd.dataOffset = 0 + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if resultCode == 0 && (info3&_INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + + err := cmd.skipKey(fieldCount) + if err != nil { + return false, err + } + + if resultCode != 0 { + if resultCode == types.FILTERED_OUT { + cmd.filteredOutCnt++ + } + + // If it looks like the error is on the first record and the message is marked as last part, + // the error is for the whole command and not just for the first batchIndex + lastMessage := (info3&_INFO3_LAST) == _INFO3_LAST || cmd.grpcEOS + if resultCode != 0 && lastMessage && receiveSize == int(_MSG_REMAINING_HEADER_SIZE) { + return false, newError(resultCode).setNode(cmd.node) + } + + if resultCode == types.UDF_BAD_RESPONSE { + rec, err := cmd.parseRecord(cmd.records[batchIndex].key(), opCount, generation, expiration) + if err != nil { + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + return false, err + } + + // for UDF failures + var msg interface{} + if rec != nil { + msg = rec.Bins["FAILURE"] + } + + // Need to store record because failure bin contains an error message. + cmd.records[batchIndex].setRecord(rec) + if msg, ok := msg.(string); ok && len(msg) > 0 { + cmd.records[batchIndex].setErrorWithMsg(cmd.node, resultCode, msg, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + } else { + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + } + + // If cmd is the end marker of the response, do not proceed further + // if (info3 & _INFO3_LAST) == _INFO3_LAST { + if lastMessage { + return false, nil + } + continue + } + + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + continue + } + + // Do not process records after grpc stream has ended. + // This is a special case due to proxy server shortcomings. + if resultCode == 0 && !cmd.grpcEOS { + if cmd.objects == nil { + rec, err := cmd.parseRecord(cmd.records[batchIndex].key(), opCount, generation, expiration) + if err != nil { + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + return false, err + } + cmd.records[batchIndex].setRecord(rec) + } else if batchObjectParser != nil { + // mark it as found + cmd.objectsFound[batchIndex] = true + if err := batchObjectParser(cmd, batchIndex, opCount, fieldCount, generation, expiration); err != nil { + return false, err + + } + } + } + } + + return true, nil +} + +// Parses the given byte buffer and populate the result object. +// Returns the number of bytes that were parsed from the given buffer. +func (cmd *batchCommandOperate) parseRecord(key *Key, opCount int, generation, expiration uint32) (*Record, Error) { + bins := make(BinMap, opCount) + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return nil, err + } + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return nil, err + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return nil, err + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + return nil, err + } + + if cmd.isOperation { + if prev, ok := bins[name]; ok { + if prev2, ok := prev.(OpResults); ok { + bins[name] = append(prev2, value) + } else { + bins[name] = OpResults{prev, value} + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + return newRecord(cmd.node, key, bins, generation, expiration), nil +} + +func (cmd *batchCommandOperate) executeSingle(client clientIfc) Error { + var res *Record + var err Error + for _, br := range cmd.records { + + switch br := br.(type) { + case *BatchRead: + ops := br.Ops + if br.headerOnly() { + ops = append(ops, GetHeaderOp()) + } else if len(br.BinNames) > 0 { + for i := range br.BinNames { + ops = append(ops, GetBinOp(br.BinNames[i])) + } + } else if len(ops) == 0 { + ops = append(ops, GetOp()) + } + res, err = client.operate(cmd.client.getUsableBatchReadPolicy(br.Policy).toWritePolicy(cmd.policy), br.Key, true, ops...) + case *BatchWrite: + policy := cmd.client.getUsableBatchWritePolicy(br.Policy).toWritePolicy(cmd.policy) + policy.RespondPerEachOp = true + res, err = client.operate(policy, br.Key, true, br.Ops...) + case *BatchDelete: + policy := cmd.client.getUsableBatchDeletePolicy(br.Policy).toWritePolicy(cmd.policy) + res, err = client.operate(policy, br.Key, true, DeleteOp()) + case *BatchUDF: + policy := cmd.client.getUsableBatchUDFPolicy(br.Policy).toWritePolicy(cmd.policy) + policy.RespondPerEachOp = true + res, err = client.execute(policy, br.Key, br.PackageName, br.FunctionName, br.FunctionArgs...) + } + + br.setRecord(res) + if err != nil { + br.BatchRec().setRawError(err) + + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + + return err + } + } + return nil +} + +func (cmd *batchCommandOperate) Execute() Error { + if cmd.objects == nil && len(cmd.records) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchCommandOperate) transactionType() transactionType { + if cmd.isRead() { + return ttBatchRead + } + return ttBatchWrite +} + +func (cmd *batchCommandOperate) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchOperateNodeListIfcRetry(cluster, cmd.policy, cmd.records, cmd.sequenceAP, cmd.sequenceSC, cmd.batch) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go new file mode 100644 index 00000000..9ce42a79 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go @@ -0,0 +1,91 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// this function will only be set if the performance flag is not passed for build +func init() { + multiObjectParser = batchParseObject + prepareReflectionData = concretePrepareReflectionData +} + +func concretePrepareReflectionData(cmd *baseMultiCommand) { + // if a channel is assigned, assign its value type + if cmd.recordset != nil && !cmd.recordset.objChan.IsNil() { + // this channel must be of type chan *T + cmd.resObjType = cmd.recordset.objChan.Type().Elem().Elem() + cmd.resObjMappings = objectMappings.getMapping(cmd.recordset.objChan.Type().Elem().Elem()) + + cmd.selectCases = []reflect.SelectCase{ + {Dir: reflect.SelectSend, Chan: cmd.recordset.objChan}, + {Dir: reflect.SelectRecv, Chan: reflect.ValueOf(cmd.recordset.cancelled)}, + } + } +} + +func batchParseObject( + cmd *baseMultiCommand, + obj reflect.Value, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error { + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + err = newNodeError(cmd.node, err) + return err + } + + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + err = newNodeError(cmd.node, err) + return err + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + err = newNodeError(cmd.node, err) + return err + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + err = newNodeError(cmd.node, err) + return err + } + + iobj := indirect(obj) + if err := setObjectField(cmd.resObjMappings, iobj, name, value); err != nil { + return err + } + + if err := setObjectMetaFields(obj, expiration, generation); err != nil { + return err + } + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go new file mode 100644 index 00000000..b8b9c445 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go @@ -0,0 +1,223 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type batchCommandUDF struct { + batchCommand + + batchUDFPolicy *BatchUDFPolicy + keys []*Key + packageName string + functionName string + args ValueArray + records []*BatchRecord + attr *batchAttr +} + +func newBatchCommandUDF( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + batchUDFPolicy *BatchUDFPolicy, + keys []*Key, + packageName, + functionName string, + args ValueArray, + records []*BatchRecord, + attr *batchAttr, +) *batchCommandUDF { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchCommandUDF{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, false), + policy: policy, + batch: batch, + }, + batchUDFPolicy: batchUDFPolicy, + keys: keys, + records: records, + packageName: packageName, + functionName: functionName, + args: args, + attr: attr, + } + return res +} + +func (cmd *batchCommandUDF) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.node = batch.Node + res.batch = batch + + return &res +} + +func (cmd *batchCommandUDF) writeBuffer(ifc command) Error { + return cmd.setBatchUDF(cmd.policy, cmd.keys, cmd.batch, cmd.packageName, cmd.functionName, cmd.args, cmd.attr) +} + +// Parse all results in the batch. Add records to shared list. +// If the record was not found, the bins will be nil. +func (cmd *batchCommandUDF) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + //Parse each message response and add it to the result array + cmd.dataOffset = 0 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + // The only valid server return codes are "ok" and "not found" and "filtered out". + // If other return codes are received, then abort the batch. + if resultCode != 0 { + if resultCode != types.KEY_NOT_FOUND_ERROR { + if resultCode == types.FILTERED_OUT { + cmd.filteredOutCnt++ + } + } + + if resultCode != types.KEY_NOT_FOUND_ERROR && resultCode != types.FILTERED_OUT { + return false, newCustomNodeError(cmd.node, resultCode) + } + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + err := cmd.skipKey(fieldCount) + if err != nil { + return false, err + } + + if resultCode == 0 { + if err = cmd.parseRecord(cmd.records[batchIndex], cmd.keys[batchIndex], opCount, generation, expiration); err != nil { + return false, err + } + } else { + cmd.records[batchIndex].Err = chainErrors(newCustomNodeError(cmd.node, resultCode), cmd.records[batchIndex].Err) + cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) + } + } + return true, nil +} + +// Parses the given byte buffer and populate the result object. +// Returns the number of bytes that were parsed from the given buffer. +func (cmd *batchCommandUDF) parseRecord(rec *BatchRecord, key *Key, opCount int, generation, expiration uint32) Error { + bins := make(BinMap, opCount) + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return err + } + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return err + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return err + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + return err + } + + if cmd.isOperation { + if prev, ok := bins[name]; ok { + if prev2, ok := prev.(OpResults); ok { + bins[name] = append(prev2, value) + } else { + bins[name] = OpResults{prev, value} + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + rec.setRecord(newRecord(cmd.node, key, bins, generation, expiration)) + return nil +} + +func (cmd *batchCommandUDF) isRead() bool { + return !cmd.attr.hasWrite +} + +func (cmd *batchCommandUDF) executeSingle(client clientIfc) Error { + for i, key := range cmd.keys { + policy := cmd.batchUDFPolicy.toWritePolicy(cmd.policy) + policy.RespondPerEachOp = true + res, err := client.execute(policy, key, cmd.packageName, cmd.functionName, cmd.args...) + cmd.records[i].setRecord(res) + if err != nil { + cmd.records[i].setRawError(err) + + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + return err + } + } + return nil +} + +func (cmd *batchCommandUDF) Execute() Error { + if len(cmd.keys) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchCommandUDF) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_delete.go b/aerospike-tls/vendor-aerospike-client-go/batch_delete.go new file mode 100644 index 00000000..6886d129 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_delete.go @@ -0,0 +1,97 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +var _ BatchRecordIfc = &BatchDelete{} + +// BatchDelete encapsulates a batch delete operation. +type BatchDelete struct { + BatchRecord + + // Policy os the optional write Policy. + Policy *BatchDeletePolicy +} + +func (bd *BatchDelete) hasWrite() bool { + return bd.BatchRecord.hasWrite +} + +func (bd *BatchDelete) key() *Key { + return bd.Key +} + +// NewBatchDelete creates a batch delete operation. +func NewBatchDelete(policy *BatchDeletePolicy, key *Key) *BatchDelete { + return &BatchDelete{ + BatchRecord: *newSimpleBatchRecord(key, true), + Policy: policy, + } +} + +// newBatchDelete creates a batch delete operation. +func newBatchDelete(policy *BatchDeletePolicy, key *Key) (*BatchDelete, *BatchRecord) { + bd := &BatchDelete{ + BatchRecord: *newSimpleBatchRecord(key, true), + Policy: policy, + } + return bd, &bd.BatchRecord +} + +// Return batch command type. +func (bd *BatchDelete) getType() batchRecordType { + return _BRT_BATCH_DELETE +} + +// Optimized reference equality check to determine batch wire protocol repeat flag. +// For internal use only. +func (bd *BatchDelete) equals(obj BatchRecordIfc) bool { + other, ok := obj.(*BatchDelete) + if !ok { + return false + } + + return bd.Policy == other.Policy +} + +// Return wire protocol size. For internal use only. +func (bd *BatchDelete) size(parentPolicy *BasePolicy) (int, Error) { + size := 2 // gen(2) = 2 + + if bd.Policy != nil { + if bd.Policy.FilterExpression != nil { + if sz, err := bd.Policy.FilterExpression.size(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + } + } + + if bd.Policy.SendKey || parentPolicy.SendKey { + if sz, err := bd.Key.userKey.EstimateSize(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + } + } else if parentPolicy.SendKey { + sz, err := bd.Key.userKey.EstimateSize() + if err != nil { + return -1, err + } + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + + return size, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go new file mode 100644 index 00000000..d73b10de --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go @@ -0,0 +1,75 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BatchDeletePolicy is used in batch delete commands. +type BatchDeletePolicy struct { + // FilterExpression is optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key + // request is not performed and BatchRecord.ResultCode is set to type.FILTERED_OUT. + // Default: nil + FilterExpression *Expression + + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + // Default: CommitLevel.COMMIT_ALL + CommitLevel CommitLevel //= COMMIT_ALL + + // Qualify how to handle record deletes based on record generation. The default (NONE) + // indicates that the generation is not used to restrict deletes. + // Default: GenerationPolicy.NONE + GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; + + // Expected generation. Generation is the number of times a record has been modified + // (including creation) on the server. This field is only relevant when generationPolicy + // is not NONE. + // Default: 0 + Generation uint32 + + // If the transaction results in a record deletion, leave a tombstone for the record. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition only. + // Default: false (do not tombstone deleted records). + DurableDelete bool + + // Send user defined key in addition to hash digest. + // If true, the key will be stored with the tombstone record on the server. + // Default: false (do not send the user defined key) + SendKey bool +} + +// NewBatchDeletePolicy returns a default BatchDeletePolicy. +func NewBatchDeletePolicy() *BatchDeletePolicy { + return &BatchDeletePolicy{ + CommitLevel: COMMIT_ALL, + GenerationPolicy: NONE, + } +} + +func (bdp *BatchDeletePolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { + wp := bp.toWritePolicy() + + if bdp != nil { + if bdp.FilterExpression != nil { + wp.FilterExpression = bdp.FilterExpression + } + wp.CommitLevel = bdp.CommitLevel + wp.GenerationPolicy = bdp.GenerationPolicy + wp.Generation = bdp.Generation + wp.DurableDelete = bdp.DurableDelete + wp.SendKey = bdp.SendKey + } + return wp +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_executer.go b/aerospike-tls/vendor-aerospike-client-go/batch_executer.go new file mode 100644 index 00000000..45d9c5a7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_executer.go @@ -0,0 +1,44 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// batchExecute Uses werrGroup to run commands using multiple goroutines, +// and waits for their return +func (clnt *Client) batchExecute(policy *BatchPolicy, batchNodes []*batchNode, cmd batcher) (int, Error) { + maxConcurrentNodes := policy.ConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(batchNodes) + } + + // we need this list to count the number of filtered out records + list := make([]batcher, 0, len(batchNodes)) + + weg := newWeightedErrGroup(maxConcurrentNodes) + for _, batchNode := range batchNodes { + newCmd := cmd.cloneBatchCommand(batchNode) + list = append(list, newCmd) + weg.execute(newCmd) + } + + errs := weg.wait() + + // count the filtered out records + filteredOut := 0 + for i := range list { + filteredOut += list[i].filteredOut() + } + + return filteredOut, errs +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go b/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go new file mode 100644 index 00000000..f840b04a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go @@ -0,0 +1,109 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type batchIndexCommandGet struct { + batchCommandGet +} + +func newBatchIndexCommandGet( + client clientIfc, + batch *batchNode, + policy *BatchPolicy, + records []*BatchRead, + isOperation bool, +) *batchIndexCommandGet { + var node *Node + if batch != nil { + node = batch.Node + } + + res := &batchIndexCommandGet{ + batchCommandGet{ + batchCommand: batchCommand{ + client: client, + baseMultiCommand: *newMultiCommand(node, nil, isOperation), + policy: policy, + batch: batch, + }, + records: nil, + indexRecords: records, + }, + } + return res +} + +func (cmd *batchIndexCommandGet) cloneBatchCommand(batch *batchNode) batcher { + res := *cmd + res.batch = batch + res.node = batch.Node + + return &res +} + +func (cmd *batchIndexCommandGet) writeBuffer(ifc command) Error { + return cmd.setBatchIndexRead(cmd.policy, cmd.indexRecords, cmd.batch) +} + +func (cmd *batchIndexCommandGet) Execute() Error { + if len(cmd.batch.offsets) == 1 { + return cmd.executeSingle(cmd.client) + } + return cmd.execute(cmd) +} + +func (cmd *batchIndexCommandGet) executeSingle(client clientIfc) Error { + for i, br := range cmd.indexRecords { + var ops []*Operation + if br.headerOnly() { + ops = []*Operation{GetHeaderOp()} + } else if len(br.BinNames) > 0 { + for i := range br.BinNames { + ops = append(ops, GetBinOp(br.BinNames[i])) + } + } else { + ops = br.Ops + } + res, err := client.operate(cmd.policy.toWritePolicy(), br.Key, true, ops...) + cmd.indexRecords[i].setRecord(res) + if err != nil { + cmd.indexRecords[i].setRawError(err) + + // Key not found is NOT an error for batch requests + if err.resultCode() == types.KEY_NOT_FOUND_ERROR { + continue + } + + if err.resultCode() == types.FILTERED_OUT { + cmd.filteredOutCnt++ + continue + } + + if cmd.policy.AllowPartialResults { + continue + } + return err + } + } + return nil +} + +func (cmd *batchIndexCommandGet) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { + return newBatchNodeListRecords(cluster, cmd.policy, cmd.indexRecords, cmd.sequenceAP, cmd.sequenceSC, cmd.batch) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_node.go b/aerospike-tls/vendor-aerospike-client-go/batch_node.go new file mode 100644 index 00000000..fa459979 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_node.go @@ -0,0 +1,41 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "fmt" + +type batchNode struct { + Node *Node + offsets []int +} + +func newBatchNode(node *Node, capacity int, offset int) *batchNode { + res := &batchNode{ + Node: node, + offsets: make([]int, 1, capacity), + } + + res.offsets[0] = offset + return res +} + +func (bn *batchNode) AddKey(offset int) { + bn.offsets = append(bn.offsets, offset) +} + +func (bn *batchNode) String() string { + return fmt.Sprintf("Node: %s, Offsets: %v", bn.Node.String(), bn.offsets) + +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go b/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go new file mode 100644 index 00000000..7ecd66a6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go @@ -0,0 +1,318 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +func newBatchNodeList(cluster *Cluster, policy *BatchPolicy, keys []*Key, records []*BatchRecord, hasWrite bool) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(keys) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + var errs Error + for i := range keys { + var node *Node + var err Error + if hasWrite { + node, err = GetNodeBatchWrite(cluster, keys[i], replicaPolicy, nil, 0) + } else { + node, err = GetNodeBatchRead(cluster, keys[i], replicaPolicy, replicaPolicySC, nil, 0, 0) + } + + if err != nil { + if len(records) > 0 { + records[i].Err = chainErrors(err, records[i].Err) + } else { + errs = chainErrors(err, errs) + } + // return nil, err + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) + } else { + batchNode.AddKey(i) + } + } + + return batchNodes, errs +} + +func newBatchNodeListKeys(cluster *Cluster, policy *BatchPolicy, keys []*Key, records []*BatchRecord, sequenceAP, sequenceSC int, batchSeed *batchNode, hasWrite bool) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(keys) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + var errs Error + for _, offset := range batchSeed.offsets { + var node *Node + var err Error + if hasWrite { + node, err = GetNodeBatchWrite(cluster, keys[offset], replicaPolicy, batchSeed.Node, sequenceAP) + } else { + node, err = GetNodeBatchRead(cluster, keys[offset], replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) + } + + if err != nil { + errs = chainErrors(err, errs) + // return nil, err + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) + } else { + batchNode.AddKey(offset) + } + } + return batchNodes, errs +} + +func newBatchNodeListRecords(cluster *Cluster, policy *BatchPolicy, records []*BatchRead, sequenceAP, sequenceSC int, batchSeed *batchNode) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(batchSeed.offsets) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + for _, offset := range batchSeed.offsets { + node, err := GetNodeBatchRead(cluster, records[offset].Key, replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) + if err != nil { + return nil, err + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) + } else { + batchNode.AddKey(offset) + } + } + return batchNodes, nil +} + +func newBatchIndexNodeList(cluster *Cluster, policy *BatchPolicy, records []*BatchRead) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(records) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + for i := range records { + node, err := GetNodeBatchRead(cluster, records[i].Key, replicaPolicy, replicaPolicySC, nil, 0, 0) + if err != nil { + return nil, err + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) + } else { + batchNode.AddKey(i) + } + } + return batchNodes, nil +} + +func newBatchOperateNodeListIfcRetry(cluster *Cluster, policy *BatchPolicy, records []BatchRecordIfc, sequenceAP, sequenceSC int, batchSeed *batchNode) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(records) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + var errs Error + for _, offset := range batchSeed.offsets { + b := records[offset] + + if b.resultCode() != types.NO_RESPONSE { + // Do not retry keys that already have a response. + continue + } + + var node *Node + var err Error + if b.isWrite() { + node, err = GetNodeBatchWrite(cluster, b.key(), replicaPolicy, batchSeed.Node, sequenceAP) + } else { + node, err = GetNodeBatchRead(cluster, b.key(), replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) + } + + if err != nil { + errs = chainErrors(err, errs) + // return nil, err + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) + } else { + batchNode.AddKey(offset) + } + } + return batchNodes, errs +} + +func newBatchOperateNodeListIfc(cluster *Cluster, policy *BatchPolicy, records []BatchRecordIfc) ([]*batchNode, Error) { + nodes := cluster.GetNodes() + + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // Create initial key capacity for each node as average + 25%. + keysPerNode := len(records) / len(nodes) + keysPerNode += keysPerNode / 2 + + // The minimum key capacity is 10. + if keysPerNode < 10 { + keysPerNode = 10 + } + + replicaPolicy := policy.ReplicaPolicy + replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) + + // Split keys by server node. + batchNodes := make([]*batchNode, 0, len(nodes)) + + var errs Error + for i := range records { + b := records[i] + b.prepare() + + var node *Node + var err Error + if b.isWrite() { + node, err = GetNodeBatchWrite(cluster, b.key(), replicaPolicy, nil, 0) + } else { + node, err = GetNodeBatchRead(cluster, b.key(), replicaPolicy, replicaPolicySC, nil, 0, 0) + } + + if err != nil { + records[i].chainError(err) + records[i].setError(node, err.resultCode(), false) + // Don't interrupt the batch request because of INVALID_NAMESPACE error + // These keys will not be sent to the server + if !err.Matches(types.INVALID_NAMESPACE) { + errs = chainErrors(err, errs) + } + continue + } + + if batchNode := findBatchNode(batchNodes, node); batchNode == nil { + batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) + } else { + batchNode.AddKey(i) + } + } + return batchNodes, errs +} + +func newGrpcBatchOperateListIfc(policy *BatchPolicy, records []BatchRecordIfc) (*batchNode, Error) { + // Split keys by server node. + batchNode := new(batchNode) + for i := range records { + b := records[i] + b.prepare() + batchNode.AddKey(i) + } + + return batchNode, nil +} + +func findBatchNode(nodes []*batchNode, node *Node) *batchNode { + for i := range nodes { + // Note: using pointer equality for performance. + if nodes[i].Node == node { + return nodes[i] + } + } + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_policy.go new file mode 100644 index 00000000..e07d8793 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_policy.go @@ -0,0 +1,122 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BatchPolicy encapsulates parameters for policy attributes used in write operations. +// This object is passed into methods where database writes can occur. +type BatchPolicy struct { + BasePolicy + + // Maximum number of concurrent batch request goroutines to server nodes at any point in time. + // If there are 16 node/namespace combinations requested and ConcurrentNodes is 8, + // then batch requests will be made for 8 node/namespace combinations in concurrent goroutines. + // When a request completes, a new request will be issued until all 16 goroutines are complete. + // + // Values: + // 1: Issue batch requests sequentially. This mode has a performance advantage for small + // to medium sized batch sizes because requests can be issued in the main transaction goroutine. + // This is the default. + // 0: Issue all batch requests in concurrent goroutines. This mode has a performance + // advantage for extremely large batch sizes because each node can process the request + // immediately. The downside is extra goroutines will need to be created (or taken from + // a goroutine pool). + // > 0: Issue up to ConcurrentNodes batch requests in concurrent goroutines. When a request + // completes, a new request will be issued until all goroutines are complete. This mode + // prevents too many concurrent goroutines being created for large cluster implementations. + // The downside is extra goroutines will still need to be created (or taken from a goroutine pool). + ConcurrentNodes int // = 1 + + // Allow batch to be processed immediately in the server's receiving thread when the server + // deems it to be appropriate. If false, the batch will always be processed in separate + // transaction goroutines. This field is only relevant for the new batch index protocol. + // + // For batch exists or batch reads of smaller sized records (<= 1K per record), inline + // processing will be significantly faster on "in memory" namespaces. The server disables + // inline processing on disk based namespaces regardless of this policy field. + // + // Inline processing can introduce the possibility of unfairness because the server + // can process the entire batch before moving onto the next command. + AllowInline bool //= true + + // Allow batch to be processed immediately in the server's receiving thread for SSD + // namespaces. If false, the batch will always be processed in separate service threads. + // Server versions before 6.0 ignore this field. + // + // Inline processing can introduce the possibility of unfairness because the server + // can process the entire batch before moving onto the next command. + // + // Default: false + AllowInlineSSD bool // = false + + // Should all batch keys be attempted regardless of errors. This field is used on both + // the client and server. The client handles node specific errors and the server handles + // key specific errors. + // + // If true, every batch key is attempted regardless of previous key specific errors. + // Node specific errors such as timeouts stop keys to that node, but keys directed at + // other nodes will continue to be processed. + // + // If false, the server will stop the batch to its node on most key specific errors. + // The exceptions are types.KEY_NOT_FOUND_ERROR and types.FILTERED_OUT which never stop the batch. + // The client will stop the entire batch on node specific errors for sync commands + // that are run in sequence (MaxConcurrentThreads == 1). The client will not stop + // the entire batch for async commands or sync commands run in parallel. + // + // Server versions < 6.0 do not support this field and treat this value as false + // for key specific errors. + // + // Default: true + RespondAllKeys bool //= true; + + // AllowPartialResults determines if the results for some nodes should be returned in case + // some nodes encounter an error. The result for the unreceived records will be nil. + // The returned records will be safe to use, since only fully received data will be parsed + // and set. + // + // This flag is only supported for BatchGet and BatchGetHeader methods. BatchGetComplex always returns + // partial results by design. + AllowPartialResults bool //= false +} + +// NewBatchPolicy initializes a new BatchPolicy instance with default parameters. +func NewBatchPolicy() *BatchPolicy { + return &BatchPolicy{ + BasePolicy: *NewPolicy(), + ConcurrentNodes: 1, + AllowInline: true, + AllowPartialResults: false, + RespondAllKeys: true, + } +} + +// NewReadBatchPolicy initializes a new BatchPolicy instance for reads. +func NewReadBatchPolicy() *BatchPolicy { + return NewBatchPolicy() +} + +// NewWriteBatchPolicy initializes a new BatchPolicy instance for writes. +func NewWriteBatchPolicy() *BatchPolicy { + res := NewBatchPolicy() + res.MaxRetries = 0 + return res +} + +func (p *BatchPolicy) toWritePolicy() *WritePolicy { + wp := NewWritePolicy(0, 0) + if p != nil { + wp.BasePolicy = p.BasePolicy + } + return wp +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_read.go b/aerospike-tls/vendor-aerospike-client-go/batch_read.go new file mode 100644 index 00000000..aac921f7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_read.go @@ -0,0 +1,159 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// BatchRead specifies the Key and bin names used in batch read commands +// where variable bins are needed for each key. +type BatchRead struct { + BatchRecord + + // Optional read policy. + Policy *BatchReadPolicy + + // BinNames specifies the Bins to retrieve for this key. + // BinNames are mutually exclusive with Ops. + BinNames []string + + // ReadAllBins defines what data should be read from the record. + // If true, ignore binNames and read all bins. + // If false and binNames are set, read specified binNames. + // If false and binNames are not set, read record header (generation, expiration) only. + ReadAllBins bool //= false + + // Ops specifies the operations to perform for every key. + // Ops are mutually exclusive with BinNames. + // A binName can be emulated with `GetOp(binName)` + // Supported by server v5.6.0+. + Ops []*Operation +} + +// NewBatchRead defines a key and bins to retrieve in a batch operation. +func NewBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) *BatchRead { + return &BatchRead{ + BatchRecord: *newSimpleBatchRecord(key, false), + Policy: policy, + BinNames: binNames, + ReadAllBins: len(binNames) == 0, + } +} + +// newBatchRead defines a key and bins to retrieve in a batch operation. +func newBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) (*BatchRead, *BatchRecord) { + res := &BatchRead{ + BatchRecord: *newSimpleBatchRecord(key, false), + Policy: policy, + BinNames: binNames, + ReadAllBins: len(binNames) == 0, + } + + return res, &res.BatchRecord +} + +// NewBatchReadOps defines a key and bins to retrieve in a batch operation, including expressions. +func NewBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) *BatchRead { + res := &BatchRead{ + BatchRecord: *newSimpleBatchRecord(key, false), + Policy: policy, + Ops: ops, + } + + return res +} + +// NewBatchReadOps defines a key and bins to retrieve in a batch operation, including expressions. +func newBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) (*BatchRead, *BatchRecord) { + // since binNames is mutually exclusive with ops parameter. + res := &BatchRead{ + BatchRecord: *newSimpleBatchRecord(key, false), + Policy: policy, + Ops: ops, + } + + res.ReadAllBins = true + + return res, &res.BatchRecord +} + +// NewBatchReadHeader defines a key to retrieve the record headers only in a batch operation. +func NewBatchReadHeader(policy *BatchReadPolicy, key *Key) *BatchRead { + return &BatchRead{ + BatchRecord: *newSimpleBatchRecord(key, false), + Policy: policy, + ReadAllBins: false, + } +} + +// Return batch command type. +func (br *BatchRead) getType() batchRecordType { + return _BRT_BATCH_READ +} + +// Optimized reference equality check to determine batch wire protocol repeat flag. +// For internal use only. +func (br *BatchRead) equals(obj BatchRecordIfc) bool { + other, ok := obj.(*BatchRead) + if !ok { + return false + } + + return &br.BinNames == &other.BinNames && &br.Ops == &other.Ops && br.Policy == other.Policy && br.ReadAllBins == other.ReadAllBins +} + +// Return wire protocol size. For internal use only. +func (br *BatchRead) size(parentPolicy *BasePolicy) (int, Error) { + size := 0 + + if br.Policy != nil { + if br.Policy.FilterExpression != nil { + if sz, err := br.Policy.FilterExpression.size(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + } + } + } + + for i := range br.BinNames { + size += len(br.BinNames[i]) + int(_OPERATION_HEADER_SIZE) + } + + for i := range br.Ops { + if br.Ops[i].opType.isWrite { + return -1, newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read") + } + sz, err := br.Ops[i].size() + if err != nil { + return -1, err + } + size += sz + } + + return size, nil +} + +// String implements the Stringer interface. +func (br *BatchRead) String() string { + return fmt.Sprintf("%s: %v", br.Key, br.BinNames) +} + +func (br *BatchRead) headerOnly() bool { + return len(br.Ops) == 0 && len(br.BinNames) == 0 && !br.ReadAllBins +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go new file mode 100644 index 00000000..a65b4b9a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go @@ -0,0 +1,70 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BatchReadPolicy attributes used in batch read commands. +type BatchReadPolicy struct { + // FilterExpression is the optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key + // request is not performed and BatchRecord.ResultCode is set to types.FILTERED_OUT. + // + // Default: nil + FilterExpression *Expression + + // ReadModeAP indicates read policy for AP (availability) namespaces. + ReadModeAP ReadModeAP //= ONE + + // ReadModeSC indicates read policy for SC (strong consistency) namespaces. + ReadModeSC ReadModeSC //= SESSION; + + // ReadTouchTTLPercent determines how record TTL (time to live) is affected on reads. When enabled, the server can + // efficiently operate as a read-based LRU cache where the least recently used records are expired. + // The value is expressed as a percentage of the TTL sent on the most recent write such that a read + // within this interval of the record’s end of life will generate a touch. + // + // For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to + // 80, the next read within 8 hours of the record's end of life (equivalent to 2 hours after the most + // recent write) will result in a touch, resetting the TTL to another 10 hours. + // + // Values: + // + // 0 : Use server config default-read-touch-ttl-pct for the record's namespace/set. + // -1 : Do not reset record TTL on reads. + // 1 - 100 : Reset record TTL on reads when within this percentage of the most recent write TTL. + // Default: 0 + ReadTouchTTLPercent int32 +} + +// NewBatchReadPolicy returns a policy instance for BatchRead commands. +func NewBatchReadPolicy() *BatchReadPolicy { + return &BatchReadPolicy{ + ReadModeAP: ReadModeAPOne, + ReadModeSC: ReadModeSCSession, + } +} + +func (brp *BatchReadPolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { + wp := bp.toWritePolicy() + + if brp != nil { + if brp.FilterExpression != nil { + wp.FilterExpression = brp.FilterExpression + } + + wp.ReadModeAP = brp.ReadModeAP + wp.ReadModeSC = brp.ReadModeSC + wp.ReadTouchTTLPercent = brp.ReadTouchTTLPercent + } + return wp +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_record.go b/aerospike-tls/vendor-aerospike-client-go/batch_record.go new file mode 100644 index 00000000..e08a32a4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_record.go @@ -0,0 +1,172 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type batchRecordType byte + +// Batch command type. +const ( + _BRT_INVALID batchRecordType = iota + _BRT_BATCH_READ + _BRT_BATCH_WRITE + _BRT_BATCH_DELETE + _BRT_BATCH_UDF +) + +// BatchRecordIfc is the interface type to encapsulate BatchRead, BatchWrite and BatchUDF commands. +type BatchRecordIfc interface { + // Returns the BatchRecord + BatchRec() *BatchRecord + + key() *Key + resultCode() types.ResultCode + isWrite() bool + + prepare() + setRecord(record *Record) + setError(node *Node, resultCode types.ResultCode, inDoubt bool) + setErrorWithMsg(node *Node, resultCode types.ResultCode, msg string, inDoubt bool) + chainError(err Error) + String() string + getType() batchRecordType + size(parentPolicy *BasePolicy) (int, Error) + equals(BatchRecordIfc) bool +} + +// BatchRecord encasulates the Batch key and record result. +type BatchRecord struct { + // Key. + Key *Key + + // Record result after batch command has completed. Will be nil if record was not found + // or an error occurred. See ResultCode. + Record *Record + + // ResultCode for this returned record. See types.ResultCode. + // If not OK, the record will be nil. + ResultCode types.ResultCode + + // Err encapsulates the possible error chain for this key + Err Error + + // InDoubt signifies the possiblity that the write transaction may have completed even though an error + // occurred for this record. This may be the case when a client error occurs (like timeout) + // after the command was sent to the server. + InDoubt bool + + // Does this command contain a write operation. For internal use only. + hasWrite bool +} + +func newSimpleBatchRecord(key *Key, hasWrite bool) *BatchRecord { + return &BatchRecord{ + Key: key, + ResultCode: types.NO_RESPONSE, + hasWrite: hasWrite, + } +} + +func newBatchRecord(key *Key, record *Record, resultCode types.ResultCode, inDoubt, hasWrite bool) *BatchRecord { + return &BatchRecord{ + Key: key, + Record: record, + ResultCode: resultCode, + InDoubt: inDoubt, + hasWrite: hasWrite, + } +} + +// BatchRec returns the embedded batch record in the interface. +func (br *BatchRecord) BatchRec() *BatchRecord { + return br +} + +func (br *BatchRecord) chainError(e Error) { + br.Err = chainErrors(e, br.Err) +} + +func (br *BatchRecord) isWrite() bool { + return br.hasWrite +} + +func (br *BatchRecord) key() *Key { + return br.Key +} + +func (br *BatchRecord) resultCode() types.ResultCode { + return br.ResultCode +} + +// Prepare for upcoming batch call. Reset result fields because this instance might be +// reused. For internal use only. +func (br *BatchRecord) prepare() { + br.Record = nil + br.ResultCode = types.NO_RESPONSE + br.Err = nil + br.InDoubt = false +} + +// Set record result. For internal use only. +func (br *BatchRecord) setRecord(record *Record) { + br.Record = record + br.ResultCode = types.OK + br.Err = nil +} + +// Set error result directly. +func (br *BatchRecord) setRawError(err Error) { + br.ResultCode = err.resultCode() + br.InDoubt = err.IsInDoubt() + br.Err = err +} + +// Set error result. For internal use only. +func (br *BatchRecord) setError(node *Node, resultCode types.ResultCode, inDoubt bool) { + br.ResultCode = resultCode + br.InDoubt = inDoubt + br.Err = newError(br.ResultCode).setNode(node).markInDoubtIf(inDoubt) +} + +// Set error result. For internal use only. +func (br *BatchRecord) setErrorWithMsg(node *Node, resultCode types.ResultCode, msg string, inDoubt bool) { + br.ResultCode = resultCode + br.InDoubt = inDoubt + br.Err = newError(br.ResultCode, msg).setNode(node).markInDoubtIf(inDoubt) +} + +// String implements the Stringer interface. +func (br *BatchRecord) String() string { + return fmt.Sprintf("Key: %s, Record: %s, ResultCode: %s, InDoubt: %t, Err: %v", br.Key, br.Record, br.ResultCode.String(), br.InDoubt, br.Err) +} + +func (br *BatchRecord) equals(other BatchRecordIfc) bool { + return false +} + +// Return batch command type. For internal use only. +func (br *BatchRecord) getType() batchRecordType { + return _BRT_INVALID +} + +// Return wire protocol size. For internal use only. +func (br *BatchRecord) size(parentPolicy *BasePolicy) (int, Error) { + panic(unreachable) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_test.go b/aerospike-tls/vendor-aerospike-client-go/batch_test.go new file mode 100644 index 00000000..f03b726f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_test.go @@ -0,0 +1,941 @@ +//go:build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "math/rand" + "strings" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + + gg.Describe("BatchGetOperate operations", func() { + var ns = *namespace + var set = randString(50) + + gg.It("must return the result with same ordering", func() { + for _, keyCount := range []int{256, 5, 4, 3, 2, 1} { + var keys []*as.Key + for i := 0; i < keyCount; i++ { + key, _ := as.NewKey(ns, set, i) + client.PutBins(nil, key, as.NewBin("i", i), as.NewBin("j", i)) + + keys = append(keys, key) + } + + ops := []*as.Operation{as.GetBinOp("i"), as.PutOp(as.NewBin("h", 1))} + _, err := client.BatchGetOperate(nil, keys, ops...) + gm.Expect(err).To(gm.HaveOccurred()) + + ops = []*as.Operation{as.GetBinOp("i")} + recs, err := client.BatchGetOperate(nil, keys, ops...) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + for i, rec := range recs { + gm.Expect(len(rec.Bins)).To(gm.Equal(1)) + gm.Expect(rec.Bins["i"]).To(gm.Equal(i)) + } + + } + }) // it + + }) // describe + + gg.Describe("Batch Write operations", func() { + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + var rpolicy = as.NewPolicy() + var bpolicy = as.NewBatchPolicy() + var bdpolicy = as.NewBatchDeletePolicy() + // bpolicy.AllowInline = true + + wpolicy.TotalTimeout = 45 * time.Second + wpolicy.SocketTimeout = 15 * time.Second + rpolicy.TotalTimeout = 45 * time.Second + rpolicy.SocketTimeout = 15 * time.Second + bpolicy.TotalTimeout = 45 * time.Second + bpolicy.SocketTimeout = 15 * time.Second + + if *useReplicas { + rpolicy.ReplicaPolicy = as.MASTER_PROLES + } + + gg.BeforeEach(func() { + bpolicy.FilterExpression = nil + }) + + gg.Context("Batch Delete operations", func() { + const keyCount = 1000 + var exists []bool + var ekeys []*as.Key + var dkeys []*as.Key + + gg.BeforeEach(func() { + bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) + ekeys = []*as.Key{} + dkeys = []*as.Key{} + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + + // if key shouldExist == true, put it in the DB + if i%2 == 0 { + ekeys = append(ekeys, key) + } else { + dkeys = append(dkeys, key) + } + } + }) + + gg.It("must return the result with same ordering", func() { + res, err := client.BatchDelete(bpolicy, bdpolicy, dkeys) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res).NotTo(gm.BeNil()) + gm.Expect(len(res)).To(gm.Equal(len(dkeys))) + for _, br := range res { + gm.Expect(br.ResultCode).To(gm.Equal(types.OK)) + } + + // true case + exists, err = client.BatchExists(bpolicy, ekeys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(exists)).To(gm.Equal(len(ekeys))) + for _, keyExists := range exists { + gm.Expect(keyExists).To(gm.BeTrue()) + } + + // false case + exists, err = client.BatchExists(bpolicy, dkeys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(exists)).To(gm.Equal(len(dkeys))) + for _, keyExists := range exists { + gm.Expect(keyExists).To(gm.BeFalse()) + } + }) + + gg.It("must return the result with same ordering for s single key", func() { + keys := []*as.Key{ekeys[0]} + res, err := client.BatchDelete(bpolicy, bdpolicy, keys) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res).NotTo(gm.BeNil()) + gm.Expect(len(res)).To(gm.Equal(len(keys))) + for _, br := range res { + gm.Expect(br.ResultCode).To(gm.Equal(types.OK)) + gm.Expect(br.Record.Bins).To(gm.Equal(as.BinMap{})) + } + + // true case + exists, err = client.BatchExists(bpolicy, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(exists)).To(gm.Equal(len(keys))) + for _, keyExists := range exists { + gm.Expect(keyExists).To(gm.BeFalse()) + } + }) + + gg.It("must return prioritize BatchDeletePolicy over BatchPolicy", func() { + set := randString(10) + + var keys []*as.Key + for i := 0; i < 5; i++ { + key, _ := as.NewKey(ns, set, i) + if i == 0 { + keys = append(keys, key) + } + bin0 := as.NewBin("count", i) + err := client.PutBins(nil, key, bin0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + bdp := as.NewBatchDeletePolicy() + bdp.FilterExpression = as.ExpEq( + as.ExpIntBin("count"), + as.ExpIntVal(0)) + + bp := as.NewBatchPolicy() + bp.FilterExpression = as.ExpEq( + as.ExpIntBin("count"), + as.ExpIntVal(999)) + records, err := client.BatchDelete(bp, bdp, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(records)).To(gm.BeNumerically(">", 0)) + + for _, br := range records { + bri := br.BatchRec() + gm.Expect(bri.ResultCode).To(gm.Equal(types.ResultCode(0))) + gm.Expect(bri.Record).NotTo(gm.BeNil()) + } + + // scanning + rs, err := client.ScanAll(nil, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + gm.Expect(res.Record.Bins["count"]).ToNot(gm.Equal(0)) + cnt++ + } + gm.Expect(cnt).To(gm.Equal(4)) + }) + }) + + gg.Context("BatchOperate operations", func() { + gg.It("must return the result with same ordering", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + key1, _ := as.NewKey(ns, set, 1) + op1 := as.NewBatchWrite(nil, key1, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b"))) + op3 := as.NewBatchRead(nil, key1, []string{"bin2"}) + + key2, _ := as.NewKey(ns, set, 2) + op5 := as.NewBatchWrite(nil, key2, as.PutOp(as.NewBin("bin1", "a"))) + + brecs := []as.BatchRecordIfc{op1, op3, op5} + err := client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Since the ops will run out of order, there is always a chance that + // the read operation will run first and return a KEY_NOT_FOUND error. + // As a result we run the operate command twice. + err = client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1": nil, "bin2": nil})) + gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) + + // gm.Expect(op2.BatchRec().Err).ToNot(gm.HaveOccurred()) + // gm.Expect(op2.BatchRec().ResultCode).To(gm.Equal(types.OK)) + // gm.Expect(op2.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": nil})) + // gm.Expect(op2.BatchRec().InDoubt).To(gm.BeFalse()) + + gm.Expect(op3.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op3.BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(op3.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": "b"})) + gm.Expect(op3.BatchRec().InDoubt).To(gm.BeFalse()) + + // gm.Expect(op4.BatchRec().Err).ToNot(gm.HaveOccurred()) + // gm.Expect(op4.BatchRec().ResultCode).To(gm.Equal(types.OK)) + // gm.Expect(op4.BatchRec().InDoubt).To(gm.BeFalse()) + + // make sure the delete case actually ran + // exists, err := client.Exists(nil, key1) + // gm.Expect(exists).To(gm.BeFalse()) + + // make sure the delete case actually ran + exists, err := client.Exists(nil, key2) + gm.Expect(exists).To(gm.BeTrue()) + }) + + gg.It("must successfully execute a BatchRead with empty ops", func() { + var batchRecords []as.BatchRecordIfc + for i := 0; i < 5; i++ { + key, _ := as.NewKey(ns, set, i) + client.PutBins(nil, key, as.NewBin("i", i), as.NewBin("j", 5-i)) + + if i == 0 { + batchRead := as.NewBatchRead(nil, key, nil) + batchRead.ReadAllBins = true + batchRecords = append(batchRecords, + batchRead, + ) + } + } + + err := client.BatchOperate(nil, batchRecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + op1 := batchRecords[0].BatchRec() + gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"i": 0, "j": 5})) + gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) + + }) + + gg.It("must successfully execute a BatchOperate for many keys", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + gm.Expect(err).ToNot(gm.HaveOccurred()) + bwPolicy := as.NewBatchWritePolicy() + bdPolicy := as.NewBatchDeletePolicy() + + var keys []*as.Key + for i := 0; i < 64; i++ { + key, _ := as.NewKey(ns, set, i) + if i == 0 { + keys = append(keys, key) + } + bin0 := as.NewBin("count", i) + err := client.PutBins(nil, key, bin0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + for _, sendKey := range []bool{true, false} { + bwPolicy.SendKey = sendKey + bdPolicy.SendKey = sendKey + bpolicy.SendKey = !sendKey + + var brecs []as.BatchRecordIfc + for _, key := range keys { + brecs = append(brecs, as.NewBatchWrite(bwPolicy, key, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b")))) + brecs = append(brecs, as.NewBatchDelete(bdPolicy, key)) + brecs = append(brecs, as.NewBatchRead(nil, key, []string{"bin2"})) + } + + err := client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + gg.It("must successfully execute a delete op", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + gm.Expect(err).ToNot(gm.HaveOccurred()) + bwPolicy := as.NewBatchWritePolicy() + bdPolicy := as.NewBatchDeletePolicy() + + for _, sendKey := range []bool{true, false} { + bwPolicy.SendKey = sendKey + bdPolicy.SendKey = sendKey + bpolicy.SendKey = !sendKey + + key1, _ := as.NewKey(ns, set, 1) + op1 := as.NewBatchWrite(bwPolicy, key1, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b"))) + op2 := as.NewBatchDelete(bdPolicy, key1) + op3 := as.NewBatchRead(nil, key1, []string{"bin2"}) + + brecs := []as.BatchRecordIfc{op1, op3} + err := client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1": nil, "bin2": nil})) + gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) + + brecs = []as.BatchRecordIfc{op1, op3} + err = client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // There is no guarantee for the order of execution for different commands + gm.Expect(op3.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op3.BatchRec().Record).ToNot(gm.BeNil()) + gm.Expect(op3.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": "b"})) + + exists, err := client.Exists(nil, key1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.BeTrue()) + + brecs = []as.BatchRecordIfc{op2} + err = client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(op2.BatchRec().Err).ToNot(gm.HaveOccurred()) + gm.Expect(op2.BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(op2.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{})) + gm.Expect(op2.BatchRec().InDoubt).To(gm.BeFalse()) + + exists, err = client.Exists(nil, key1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.BeFalse()) + } + }) + + gg.It("must successfully execute ops with policies", func() { + key1, _ := as.NewKey(ns, set, randString(50)) + err := client.Put(nil, key1, as.BinMap{"bin1": 1, "bin2": 2}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Create the policy + writePolicy := as.NewBatchWritePolicy() + writePolicy.FilterExpression = as.ExpLess(as.ExpIntBin("bin1"), as.ExpIntVal(1)) + + // Create write operation + record := as.NewBatchWrite(writePolicy, key1, + as.PutOp(as.NewBin("bin3", 3)), + as.PutOp(as.NewBin("bin4", 4)), + ) + + records := []as.BatchRecordIfc{record} + + err = client.BatchOperate(nil, records) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.ResultCode).To(gm.Equal(types.FILTERED_OUT)) + + rec, err := client.Get(nil, key1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(rec.Bins)).To(gm.Equal(2)) + + // remove the filter + + writePolicy.FilterExpression = nil + err = client.BatchOperate(nil, records) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.ResultCode).To(gm.Equal(types.OK)) + + rec, err = client.Get(nil, key1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(rec.Bins)).To(gm.Equal(4)) + }) + }) + + gg.Context("BatchOperate operations", func() { + + gg.It("Should return the error for entire operation", func() { + key, _ := as.NewKey(*namespace, set, 0) + var batchRecords []as.BatchRecordIfc + for i := 0; i < 2000000; i++ { + batchRecords = append(batchRecords, as.NewBatchReadHeader(nil, key)) + } + bp := as.NewBatchPolicy() + bp.RespondAllKeys = true + bp.TotalTimeout = 10 * time.Second + bp.SocketTimeout = 10 * time.Second + err := client.BatchOperate(bp, batchRecords) + gm.Expect(err).To(gm.HaveOccurred()) + // gm.Expect(err.Matches(types.BATCH_MAX_REQUESTS_EXCEEDED)).To(gm.BeTrue()) + }) + + gg.It("Overall command error should be reflected in API call error and not BatchRecord error", func() { + if *dbaas || *proxy { + gg.Skip("Not supported in DBAAS or PROXY environments") + } + + var batchRecords []as.BatchRecordIfc + key, _ := as.NewKey(*namespace, set, 0) + for i := 0; i < len(nativeClient.Cluster().GetNodes())*2000000; i++ { + batchRecords = append(batchRecords, as.NewBatchReadHeader(nil, key)) + } + + err := client.BatchOperate(nil, batchRecords) + gm.Expect(err).To(gm.HaveOccurred()) + // gm.Expect(err.Matches(types.BATCH_MAX_REQUESTS_EXCEEDED)).To(gm.BeTrue()) + + for _, bri := range batchRecords { + gm.Expect(bri.BatchRec().ResultCode).To(gm.Equal(types.NO_RESPONSE)) + } + }) + + gg.It("ListGetByValueRangeOp and ListRemoveByValueRangeOp with nil arguments correctly", func() { + const binName = "int_bin" + + key, err := as.NewKey(ns, set, "list_key1") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + l := []int{7, 6, 5, 8, 9, 10} + err = client.PutBins(wpolicy, key, as.NewBin(binName, l)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Get + op1 := as.ListGetByValueRangeOp(binName, as.NewValue(7), as.NewValue(9), as.ListReturnTypeValue) + op2 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeIndex) + op3 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeValue) + op4 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeRank) + op5 := as.ListGetByValueRangeOp(binName, nil, as.NewValue(9), as.ListReturnTypeValue) + r, err := client.Operate(wpolicy, key, op1, op2, op3, op4, op5) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins[binName]).To(gm.Equal([]interface{}{[]interface{}{7, 8}, []interface{}{0, 3, 4, 5}, []interface{}{7, 8, 9, 10}, []interface{}{2, 3, 4, 5}, []interface{}{7, 6, 5, 8}})) + + // Remove + op6 := as.ListRemoveByValueRangeOp(binName, as.ListReturnTypeIndex, as.NewValue(7), nil) + r2, err2 := client.Operate(wpolicy, key, op6) + gm.Expect(err2).ToNot(gm.HaveOccurred()) + gm.Expect(r2.Bins[binName]).To(gm.Equal([]interface{}{0, 3, 4, 5})) + + r3, err3 := client.Get(nil, key) + gm.Expect(err3).ToNot(gm.HaveOccurred()) + gm.Expect(r3.Bins[binName]).To(gm.Equal([]interface{}{6, 5})) + }) + + gg.It("must return the result with same ordering", func() { + const keyCount = 50 + keys := []*as.Key{} + + for i := 0; i < keyCount; i++ { + bin := as.NewBin("i", i) + + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + + keys = append(keys, key) + } + + for i, key := range keys { + op1 := as.NewBatchWrite(nil, key, as.PutOp(as.NewBin("bin1", "a"))) + op2 := as.NewBatchWrite(nil, key, as.PutOp(as.NewBin("bin2", "b"))) + op3 := as.NewBatchRead(nil, key, []string{"bin2"}) + + bpolicy.FilterExpression = as.ExpLess( + as.ExpIntBin("i"), + as.ExpIntVal(3), + ) + + brecs := []as.BatchRecordIfc{op1, op2, op3} + err := client.BatchOperate(bpolicy, brecs) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for _, rec := range brecs { + if i < 3 { + gm.Expect(rec.BatchRec().ResultCode).To(gm.Equal(types.OK)) + } else { + gm.Expect(rec.BatchRec().ResultCode).To(gm.Equal(types.FILTERED_OUT)) + } + } + } + }) + }) + + gg.Context("BatchRead operations with TTL", func() { + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if serverIsOlderThan("7") { + gg.Skip("Not supported in server before v7.1") + } + }) + + gg.It("Reset Read TTL", func() { + if nsupPeriod(ns) == 0 { + gg.Skip("Not supported with nsup-period == 0") + } + + key, _ := as.NewKey(ns, set, "expirekey3") + bin := as.NewBin("expireBinName", "expirevalue") + + // Specify that record expires 2 seconds after it's written. + writePolicy := as.NewWritePolicy(0, 2) + err := client.PutBins(writePolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Read the record before it expires and reset read ttl. + time.Sleep(1 * time.Second) + readPolicy := as.NewPolicy() + readPolicy.ReadTouchTTLPercent = 80 + record, err := client.Get(readPolicy, key, bin.Name) + gm.Expect(record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + + // Read the record again, but don't reset read ttl. + time.Sleep(1 * time.Second) + readPolicy.ReadTouchTTLPercent = -1 + record, err = client.Get(readPolicy, key, bin.Name) + gm.Expect(record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + + // Read the record after it expires, showing it's gone. + time.Sleep(2 * time.Second) + record, err = client.Get(nil, key, bin.Name) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(types.KEY_NOT_FOUND_ERROR)).To(gm.BeTrue()) + }) + + gg.It("BatchRead TTL", func() { + // WARNING: This test takes a long time to run due to sleeps. + // Define keys + key1, _ := as.NewKey(ns, set, 88888) + key2, _ := as.NewKey(ns, set, 88889) + + // Write keys with ttl. + bwp := as.NewBatchWritePolicy() + bwp.Expiration = 10 + bw1 := as.NewBatchWrite(bwp, key1, as.PutOp(as.NewBin("a", 1))) + bw2 := as.NewBatchWrite(bwp, key2, as.PutOp(as.NewBin("a", 1))) + + list := []as.BatchRecordIfc{bw1, bw2} + err := client.BatchOperate(nil, list) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Read records before they expire and reset read ttl on one record. + time.Sleep(8 * time.Second) + brp1 := as.NewBatchReadPolicy() + brp1.ReadTouchTTLPercent = 80 + + brp2 := as.NewBatchReadPolicy() + brp2.ReadTouchTTLPercent = -1 + + br1 := as.NewBatchRead(brp1, key1, []string{"a"}) + br2 := as.NewBatchRead(brp2, key2, []string{"a"}) + + list = []as.BatchRecordIfc{br1, br2} + + err = client.BatchOperate(nil, list) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(types.OK, br1.ResultCode) + gm.Expect(types.OK, br2.ResultCode) + + // Read records again, but don't reset read ttl. + time.Sleep(3 * time.Second) + brp1.ReadTouchTTLPercent = -1 + brp2.ReadTouchTTLPercent = -1 + + br1 = as.NewBatchRead(brp1, key1, []string{"a"}) + br2 = as.NewBatchRead(brp2, key2, []string{"a"}) + + list = []as.BatchRecordIfc{br1, br2} + + err = client.BatchOperate(nil, list) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Key 2 should have expired. + gm.Expect(types.OK, br1.ResultCode) + gm.Expect(types.KEY_NOT_FOUND_ERROR, br2.ResultCode) + + // Read record after it expires, showing it's gone. + time.Sleep(8 * time.Second) + err = client.BatchOperate(nil, list) + gm.Expect(types.KEY_NOT_FOUND_ERROR, br1.ResultCode) + gm.Expect(types.KEY_NOT_FOUND_ERROR, br2.ResultCode) + }) + }) + + gg.Context("BatchUDF operations", func() { + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + gg.It("must return the results for single BatchUDF vs multiple", func() { + luaCode := `-- Create a record + function rec_create(rec, bins) + return bins + end` + + removeUDF("test_ops.lua") + registerUDF(luaCode, "test_ops.lua") + + for _, keyCount := range []int{10, 1} { + nativeClient.Truncate(nil, ns, set, nil) + batchRecords := []as.BatchRecordIfc{} + + for k := 0; k < keyCount; k++ { + key, _ := as.NewKey(ns, set, k) + args := make(map[interface{}]interface{}) + args["bin1_str"] = "a" + batchRecords = append(batchRecords, as.NewBatchUDF( + nil, + key, + "test_ops", + "rec_create", + as.NewMapValue(args), + )) + } + bp := as.NewBatchPolicy() + err := client.BatchOperate(bp, batchRecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for i := 0; i < keyCount; i++ { + gm.Expect(batchRecords[i].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[i].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[i].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"SUCCESS": map[interface{}]interface{}{"bin1_str": "a"}})) + } + } + }) + + gg.It("must return the results when one operation is against an invalid namespace", func() { + luaCode := `-- Create a record + function rec_create(rec, bins) + if bins ~= nil then + for b, bv in map.pairs(bins) do + rec[b] = bv + end + end + status = aerospike:create(rec) + return status + end` + + removeUDF("test_ops.lua") + registerUDF(luaCode, "test_ops.lua") + + batchRecords := []as.BatchRecordIfc{} + + key1, _ := as.NewKey(randString(10), set, 1) + args := make(map[interface{}]interface{}) + args["bin1_str"] = "a" + batchRecords = append(batchRecords, as.NewBatchUDF( + nil, + key1, + "test_ops", + "rec_create", + as.NewMapValue(args), + )) + + key2, _ := as.NewKey(ns, set, 2) + batchRecords = append(batchRecords, as.NewBatchWrite( + nil, + key2, + as.PutOp(as.NewBin("bin1_str", "aa")), + )) + + key3, _ := as.NewKey(ns, set, 3) + batchRecords = append(batchRecords, as.NewBatchWrite( + nil, + key3, + as.PutOp(as.NewBin("bin1_str", "aaa")), + )) + + batchRecords = append(batchRecords, as.NewBatchRead( + nil, + key1, + []string{"bin1_str"}, + )) + + batchRecords = append(batchRecords, as.NewBatchRead( + nil, + key2, + []string{"bin1_str"}, + )) + + batchRecords = append(batchRecords, as.NewBatchRead( + nil, + key3, + []string{"bin1_str"}, + )) + + bp := as.NewBatchPolicy() + bp.RespondAllKeys = false + err := client.BatchOperate(bp, batchRecords) + err = client.BatchOperate(bp, batchRecords) + // gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(batchRecords[0].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) + gm.Expect(batchRecords[0].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) + + gm.Expect(batchRecords[1].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[1].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[1].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) + + gm.Expect(batchRecords[2].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[2].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[2].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) + + gm.Expect(batchRecords[3].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) + gm.Expect(batchRecords[3].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) + + gm.Expect(batchRecords[4].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[4].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[4].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aa"})) + + gm.Expect(batchRecords[5].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[5].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[5].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aaa"})) + + bp.RespondAllKeys = true + err = client.BatchOperate(bp, batchRecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(batchRecords[0].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) + gm.Expect(batchRecords[0].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) + + gm.Expect(batchRecords[1].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[1].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[1].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) + + gm.Expect(batchRecords[2].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[2].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[2].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) + + gm.Expect(batchRecords[3].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) + gm.Expect(batchRecords[3].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) + + gm.Expect(batchRecords[4].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[4].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[4].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aa"})) + + gm.Expect(batchRecords[5].BatchRec().Err).To(gm.BeNil()) + gm.Expect(batchRecords[5].BatchRec().ResultCode).To(gm.Equal(types.OK)) + gm.Expect(batchRecords[5].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aaa"})) + }) + + gg.It("must return correct errors", func() { + + nativeClient.Truncate(nil, ns, set, nil) + + udf := `function wait_and_update(rec, bins, n) + info("WAIT_AND_WRITE BEGIN") + sleep(n) + info("WAIT FINISHED") + if bins ~= nil then + for b, bv in map.pairs(bins) do + rec[b] = bv + end + end + status = aerospike:update(rec) + return status + end + + function rec_create(rec, bins) + if bins ~= nil then + for b, bv in map.pairs(bins) do + rec[b] = bv + end + end + status = aerospike:create(rec) + return status + end` + + registerUDF(udf, "test_ops.lua") + + var batchRecords []as.BatchRecordIfc + for i := 0; i < 100; i++ { + key, _ := as.NewKey(ns, set+"1", i) + client.PutBins(nil, key, as.NewBin("i", 1)) + + bin := make(map[string]int, 0) + bin["bin"] = i + batchRecords = append(batchRecords, + as.NewBatchUDF(nil, key, "test_ops", "wait_and_update", as.NewValue(bin), as.NewValue(2)), + ) + } + + bp := as.NewBatchPolicy() + bp.TotalTimeout = 10000 * time.Millisecond + bp.SocketTimeout = 1000 * time.Millisecond + bp.MaxRetries = 5 + err = client.BatchOperate(bp, batchRecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for _, bri := range batchRecords { + br := bri.BatchRec() + gm.Expect(br.InDoubt).To(gm.BeFalse()) + gm.Expect(br.ResultCode).To(gm.Equal(types.UDF_BAD_RESPONSE)) + gm.Expect(br.Err.Matches(types.UDF_BAD_RESPONSE)).To(gm.Equal(true)) + gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) + } + + if nsInfo(ns, "storage-engine") == "device" { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + writeBlockSize := 1048576 + bigBin := make(map[string]string, 0) + bigBin["big_bin"] = strings.Repeat("a", writeBlockSize) + smallBin := make(map[string]string, 0) + smallBin["small_bin"] = strings.Repeat("a", 1000) + key1, _ := as.NewKey(ns, set, 0) + key2, _ := as.NewKey(ns, set, 1) + key3, _ := as.NewKey(ns+"1", set, 2) + batchRecords = []as.BatchRecordIfc{ + as.NewBatchUDF(nil, key1, "test_ops", "rec_create", as.NewValue(bigBin)), + as.NewBatchUDF(nil, key2, "test_ops", "rec_create", as.NewValue(bigBin)), + as.NewBatchUDF(nil, key3, "test_ops", "rec_create", as.NewValue(smallBin)), + } + + err = client.BatchOperate(nil, batchRecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + br := batchRecords[0].BatchRec() + gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) + gm.Expect(br.ResultCode).To(gm.Equal(types.RECORD_TOO_BIG)) + gm.Expect(br.Err.Matches(types.RECORD_TOO_BIG)).To(gm.Equal(true)) + gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) + + br = batchRecords[1].BatchRec() + gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) + gm.Expect(br.ResultCode).To(gm.Equal(types.RECORD_TOO_BIG)) + gm.Expect(br.Err.Matches(types.RECORD_TOO_BIG)).To(gm.Equal(true)) + gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) + + br = batchRecords[2].BatchRec() + gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) + gm.Expect(br.ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) + gm.Expect(br.Err.Matches(types.INVALID_NAMESPACE)).To(gm.Equal(true)) + gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) + } + }) + + gg.It("must return the result with same ordering", func() { + registerUDF(udfBody, "udf1.lua") + for _, keyCount := range []int{50, 1} { + keys := []*as.Key{} + for i := 0; i < keyCount; i++ { + bin := as.NewBin("bin1", i*6) + + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + + keys = append(keys, key) + } + + brecs, err := client.BatchExecute(bpolicy, nil, keys, "udf1", "testFunc1", as.NewValue(2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for _, rec := range brecs { + gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.ResultCode).To(gm.Equal(types.OK)) + gm.Expect(rec.InDoubt).To(gm.BeFalse()) + gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[interface{}]interface{}{"status": "OK"})) + } + + recs, err := client.BatchGet(nil, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(recs)).To(gm.Equal(len(keys))) + for i, rec := range recs { + gm.Expect(rec.Bins["bin2"].(int)).To(gm.Equal(i * 3)) + } + } + }) + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_udf.go b/aerospike-tls/vendor-aerospike-client-go/batch_udf.go new file mode 100644 index 00000000..6eced59e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_udf.go @@ -0,0 +1,127 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +var _ BatchRecordIfc = &BatchUDF{} + +// BatchUDF encapsulates a batch user defined function operation. +type BatchUDF struct { + BatchRecord + + // Policy is the optional UDF Policy. + Policy *BatchUDFPolicy + + // PackageName specify the lua module name. + PackageName string + + // FunctionName specify Lua function name. + FunctionName string + + // FunctionArgs specify optional arguments to lua function. + FunctionArgs []Value + + // Wire protocol bytes for function args. For internal use only. + argBytes []byte +} + +// NewBatchUDF creates a batch UDF operation. +func NewBatchUDF(policy *BatchUDFPolicy, key *Key, packageName, functionName string, functionArgs ...Value) *BatchUDF { + return &BatchUDF{ + BatchRecord: *newSimpleBatchRecord(key, true), + Policy: policy, + PackageName: packageName, + FunctionName: functionName, + FunctionArgs: functionArgs, + } +} + +// newBatchUDF creates a batch UDF operation. +func newBatchUDF(policy *BatchUDFPolicy, key *Key, packageName, functionName string, functionArgs ...Value) (*BatchUDF, *BatchRecord) { + res := &BatchUDF{ + BatchRecord: *newSimpleBatchRecord(key, true), + Policy: policy, + PackageName: packageName, + FunctionName: functionName, + FunctionArgs: functionArgs, + } + return res, &res.BatchRecord +} + +func (bu *BatchUDF) isWrite() bool { + return bu.hasWrite +} + +func (bu *BatchUDF) key() *Key { + return bu.Key +} + +// Return batch command type. +func (bu *BatchUDF) getType() batchRecordType { + return _BRT_BATCH_UDF +} + +// Optimized reference equality check to determine batch wire protocol repeat flag. +// For internal use only. +func (bu *BatchUDF) equals(obj BatchRecordIfc) bool { + if other, ok := obj.(*BatchUDF); !ok { + return false + } else { + return bu.FunctionName == other.FunctionName && &bu.FunctionArgs == &other.FunctionArgs && + bu.PackageName == other.PackageName && bu.Policy == other.Policy + } +} + +// Return wire protocol size. For internal use only. +func (bu *BatchUDF) size(parentPolicy *BasePolicy) (int, Error) { + size := 2 // gen(2) = 2 + + if bu.Policy != nil { + if bu.Policy.FilterExpression != nil { + sz, err := bu.Policy.FilterExpression.size() + if err != nil { + return -1, err + } + size += sz + int(_FIELD_HEADER_SIZE) + } + + if bu.Policy.SendKey || parentPolicy.SendKey { + if sz, err := bu.Key.userKey.EstimateSize(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + } + } else if parentPolicy.SendKey { + sz, err := bu.Key.userKey.EstimateSize() + if err != nil { + return -1, err + } + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + + size += len(bu.PackageName) + int(_FIELD_HEADER_SIZE) + size += len(bu.FunctionName) + int(_FIELD_HEADER_SIZE) + + packer := newPacker() + sz, err := packValueArray(packer, bu.FunctionArgs) + if err != nil { + return -1, err + } + + bu.argBytes = packer.Bytes() + + size += sz + int(_FIELD_HEADER_SIZE) + return size, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go new file mode 100644 index 00000000..f6c7ec8e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go @@ -0,0 +1,72 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BatchUDFPolicy attributes used in batch UDF execute commands. +type BatchUDFPolicy struct { + // Optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key + // request is not performed and BatchRecord.ResultCode is set to types.FILTERED_OUT. + // + // Default: nil + FilterExpression *Expression + + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + // + // Default: CommitLevel.COMMIT_ALL + CommitLevel CommitLevel //= COMMIT_ALL + + // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). + // Seconds record will live before being removed by the server. + // Expiration values: + // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. + // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server + // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 + // > 0: Actual expiration in seconds. + Expiration uint32 + + // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition 3.10+ only. + DurableDelete bool + + // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. + // If true and the UDF writes a record, the key will be stored with the record on the server. + // The default is to not send the user defined key. + SendKey bool // = false +} + +// NewBatchUDFPolicy returns a policy instance for Batch UDF commands. +func NewBatchUDFPolicy() *BatchUDFPolicy { + return &BatchUDFPolicy{ + CommitLevel: COMMIT_ALL, + } +} + +func (bup *BatchUDFPolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { + wp := bp.toWritePolicy() + + if bup != nil { + if bup.FilterExpression != nil { + wp.FilterExpression = bup.FilterExpression + } + wp.CommitLevel = bup.CommitLevel + wp.Expiration = bup.Expiration + wp.DurableDelete = bup.DurableDelete + wp.SendKey = bup.SendKey + } + return wp +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_write.go b/aerospike-tls/vendor-aerospike-client-go/batch_write.go new file mode 100644 index 00000000..cac051f9 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_write.go @@ -0,0 +1,113 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +var _ BatchRecordIfc = &BatchWrite{} + +// BatchWrite encapsulates a batch key and read/write operations with write policy. +type BatchWrite struct { + BatchRecord + + // Policy is an optional write Policy. + Policy *BatchWritePolicy + + // Ops specify required operations for this key. + Ops []*Operation +} + +// NewBatchWrite initializesa policy, batch key and read/write operations. +// ANy GetOp() is not allowed because it returns a variable number of bins and +// makes it difficult (sometimes impossible) to lineup operations with results. Instead, +// use GetBinOp(string) for each bin name. +func NewBatchWrite(policy *BatchWritePolicy, key *Key, ops ...*Operation) *BatchWrite { + return &BatchWrite{ + BatchRecord: *newSimpleBatchRecord(key, true), + Ops: ops, + Policy: policy, + } +} + +func (bw *BatchWrite) isWrite() bool { + return bw.hasWrite +} + +func (bw *BatchWrite) key() *Key { + return bw.Key +} + +// Return batch command type. +func (bw *BatchWrite) getType() batchRecordType { + return _BRT_BATCH_WRITE +} + +// Optimized reference equality check to determine batch wire protocol repeat flag. +// For internal use only. +func (bw *BatchWrite) equals(obj BatchRecordIfc) bool { + other, ok := obj.(*BatchWrite) + if !ok { + return false + } + + return &bw.Ops == &other.Ops && bw.Policy == other.Policy && (bw.Policy == nil || !bw.Policy.SendKey) +} + +// Return wire protocol size. For internal use only. +func (bw *BatchWrite) size(parentPolicy *BasePolicy) (int, Error) { + size := 2 // gen(2) = 2 + + if bw.Policy != nil { + if bw.Policy.FilterExpression != nil { + if sz, err := bw.Policy.FilterExpression.size(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + } + } + + if bw.Policy.SendKey || parentPolicy.SendKey { + if sz, err := bw.Key.userKey.EstimateSize(); err != nil { + return -1, err + } else { + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + } + } else if parentPolicy.SendKey { + sz, err := bw.Key.userKey.EstimateSize() + if err != nil { + return -1, err + } + size += sz + int(_FIELD_HEADER_SIZE) + 1 + } + + hasWrite := false + + for _, op := range bw.Ops { + if op.opType.isWrite { + hasWrite = true + } + sz, err := op.size() + if err != nil { + return -1, err + } + size += sz + } + + if !hasWrite { + return -1, newError(types.PARAMETER_ERROR, "Batch write operations do not contain a write") + } + return size, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go new file mode 100644 index 00000000..606f2d2c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go @@ -0,0 +1,103 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BatchWritePolicy attributes used in batch write commands. +type BatchWritePolicy struct { + // FilterExpression is optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key + // request is not performed and BatchRecord#resultCode is set to types.FILTERED_OUT. + // + // Default: nil + FilterExpression *Expression + + // RecordExistsAction qualifies how to handle writes where the record already exists. + RecordExistsAction RecordExistsAction //= RecordExistsAction.UPDATE; + + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + // + // Default: CommitLevel.COMMIT_ALL + CommitLevel CommitLevel //= COMMIT_ALL + + // GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) + // indicates that the generation is not used to restrict writes. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: GenerationPolicy.NONE + // indicates that the generation is not used to restrict writes. + GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; + + // Expected generation. Generation is the number of times a record has been modified + // (including creation) on the server. If a write operation is creating a record, + // the expected generation would be 0. This field is only relevant when + // generationPolicy is not NONE. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: 0 + Generation uint32 + + // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). + // Seconds record will live before being removed by the server. + // Expiration values: + // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. + // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server + // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 + // > 0: Actual expiration in seconds. + Expiration uint32 + + // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition 3.10+ only. + DurableDelete bool + + // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + // The default is to not send the user defined key. + SendKey bool // = false +} + +// NewBatchWritePolicy returns a policy instance for BatchWrite commands. +func NewBatchWritePolicy() *BatchWritePolicy { + return &BatchWritePolicy{ + RecordExistsAction: UPDATE, + GenerationPolicy: NONE, + CommitLevel: COMMIT_ALL, + } +} + +func (bwp *BatchWritePolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { + wp := bp.toWritePolicy() + + if bwp != nil { + if bwp.FilterExpression != nil { + wp.FilterExpression = bwp.FilterExpression + } + wp.RecordExistsAction = bwp.RecordExistsAction + wp.CommitLevel = bwp.CommitLevel + wp.GenerationPolicy = bwp.GenerationPolicy + wp.Generation = bwp.Generation + wp.Expiration = bwp.Expiration + wp.DurableDelete = bwp.DurableDelete + wp.SendKey = bwp.SendKey + } + + return wp +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go new file mode 100644 index 00000000..83fbe865 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go @@ -0,0 +1,172 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math/rand" + "runtime" + "strings" + "testing" + + _ "net/http/pprof" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func makeDataForBatchGetBench(set string, bins []*as.Bin) { + for i := 0; i < 1000; i++ { + key, _ := as.NewKey(*namespace, set, i) + client.PutBins(nil, key, bins...) + } +} + +func doBatchGet(policy *as.BatchPolicy, set string, b *testing.B) { + var err error + var keys []*as.Key + for i := 0; i < 1000; i++ { + key, _ := as.NewKey(*namespace, set, i) + keys = append(keys, key) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err = client.BatchGet(policy, keys) + if err != nil { + panic(err) + } + } +} + +func Benchmark_BatchGet_________Int64(b *testing.B) { + set := "batch_get_bench_integer" + bins := []*as.Bin{as.NewBin("b", rand.Int63())} + makeDataForBatchGetBench(set, bins) + b.N = 1000 + runtime.GC() + b.ResetTimer() + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_________Int32(b *testing.B) { + set := "batch_get_bench_integer" + bins := []*as.Bin{as.NewBin("b", rand.Int31())} + makeDataForBatchGetBench(set, bins) + b.N = 1000 + runtime.GC() + b.ResetTimer() + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String______1(b *testing.B) { + set := "batch_get_bench_str_1" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String_____10(b *testing.B) { + set := "batch_get_bench_str_10" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String____100(b *testing.B) { + set := "batch_get_bench_str_100" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 100))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String___1000(b *testing.B) { + set := "batch_get_bench_str_1000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1000))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String__10000(b *testing.B) { + set := "batch_get_bench_str_10000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_String_100000(b *testing.B) { + set := "batch_get_bench_str_10000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_Complex_Array(b *testing.B) { + set := "batch_get_bench_str_10000" + // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} + bins := []*as.Bin{as.NewBin("b", []interface{}{rand.Int63()})} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} + +func Benchmark_BatchGet_Complex_Map(b *testing.B) { + set := "batch_get_bench_str_10000" + // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} + bins := []*as.Bin{as.NewBin("b", map[interface{}]interface{}{rand.Int63(): rand.Int63()})} + b.N = 1000 + runtime.GC() + b.ResetTimer() + makeDataForBatchGetBench(set, bins) + + policy := as.NewBatchPolicy() + doBatchGet(policy, set, b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go new file mode 100644 index 00000000..d231256c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go @@ -0,0 +1,108 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "runtime" + "testing" + + // "time" + _ "net/http/pprof" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var list []as.Value + +// func doOperate(set string, ops []*as.Operation, b *testing.B) { +// var err error +// policy := NewWritePolicy(0, 0) +// buffer := make([]byte, 1*1024*1024) + +// runtime.GC() +// b.ResetTimer() +// b.SetBytes(0) + +// key, _ := NewKey(*namespace, set, 1000) + +// for i := 0; i < b.N; i++ { +// command := newOperateCommand(nil, policy, key, ops) +// command.baseCommand.dataBuffer = buffer +// err = command.writeBuffer(&command) +// if err != nil { +// b.Fatal(err) +// } +// } +// } + +func doOperate(set string, ops []*as.Operation, b *testing.B) { + var err error + + runtime.GC() + b.ResetTimer() + b.SetBytes(0) + + key, _ := as.NewKey(*namespace, set, 1000) + + for i := 0; i < b.N; i++ { + _, err = client.Operate(nil, key, ops...) + if err != nil { + b.Fatal(err) + } + } +} + +func Benchmark_CDT_List_Append_10_10x10(b *testing.B) { + set := "Benchmark_CDT_List_Append_10_10x10" + ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:10])} + + doOperate(set, ops, b) +} + +func Benchmark_CDT_List_Append_100_10x10(b *testing.B) { + set := "Benchmark_CDT_List_Append_10_10x10" + ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:100])} + + doOperate(set, ops, b) +} + +func Benchmark_CDT_List_Append_1000_10x10(b *testing.B) { + set := "Benchmark_CDT_List_Append_10_10x10" + ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:1000])} + + doOperate(set, ops, b) +} + +func Benchmark_CDT_List_Append_10000_10x10(b *testing.B) { + set := "Benchmark_CDT_List_Append_10000_10x10" + ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list)} + + doOperate(set, ops, b) +} + +func init() { + const cnt = 10000 + values := make([]as.Value, 0, cnt) + for i := 0; i < cnt/5; i++ { + values = append(values, + as.IntegerValue(i), + as.FloatValue(1.0), + as.StringValue("String Value"), + as.ListValue([]interface{}{1, "s", 1.0, true}), + as.MapValue(map[interface{}]interface{}{1: "s", 2.0: true}), + ) + } + list = values +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go new file mode 100644 index 00000000..66f2ca08 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go @@ -0,0 +1,169 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math/rand" + "runtime" + "strings" + "testing" + + _ "net/http/pprof" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func makeDataForGetBench(set string, bins []*as.Bin) { + key, _ := as.NewKey(*namespace, set, 0) + client.PutBins(nil, key, bins...) +} + +func doGet(set string, b *testing.B) { + var err error + key, _ := as.NewKey(*namespace, set, 0) + for i := 0; i < b.N; i++ { + _, err = client.Get(nil, key) + if err != nil { + panic(err) + } + } +} + +func Benchmark_Get_________Int64(b *testing.B) { + set := "get_bench_integer" + bins := []*as.Bin{as.NewBin("b", rand.Int63())} + makeDataForGetBench(set, bins) + runtime.GC() + b.ResetTimer() + doGet(set, b) +} + +func Benchmark_Get_________Int32(b *testing.B) { + set := "get_bench_integer" + bins := []*as.Bin{as.NewBin("b", rand.Int31())} + makeDataForGetBench(set, bins) + runtime.GC() + b.ResetTimer() + doGet(set, b) +} + +func Benchmark_Get_String______1(b *testing.B) { + set := "get_bench_str_1" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_String_____10(b *testing.B) { + set := "get_bench_str_10" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_String____100(b *testing.B) { + set := "get_bench_str_100" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 100))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_String___1000(b *testing.B) { + set := "get_bench_str_1000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1000))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_String__10000(b *testing.B) { + set := "get_bench_str_10000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_String_100000(b *testing.B) { + set := "get_bench_str_10000" + bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_Complex_Array(b *testing.B) { + set := "get_bench_str_10000" + // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} + bins := []*as.Bin{as.NewBin("b", []interface{}{rand.Int63()})} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func Benchmark_Get_Complex_Map(b *testing.B) { + set := "get_bench_str_10000" + // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} + bins := []*as.Bin{as.NewBin("b", map[interface{}]interface{}{rand.Int63(): rand.Int63()})} + runtime.GC() + b.ResetTimer() + makeDataForGetBench(set, bins) + doGet(set, b) +} + +func doPut(set string, value interface{}, b *testing.B) { + var err error + // key, _ := as.NewKey(*namespace, set, 0) + for i := 0; i < b.N; i++ { + bin := as.NewBin("b", value) + // err = client.PutBins(nil, key, bin) + if err != nil || bin == nil { + panic(err) + } + } +} + +func Benchmark_Put_Complex_ArrayFloat64(b *testing.B) { + set := "Benchmark_Put_Complex_ArrayInt2Int" + a := make([]float64, 1000) + for i := range a { + a[i] = float64(i) + } + + runtime.GC() + b.ResetTimer() + doPut(set, a, b) +} + +func Benchmark_Put_Complex_MapFloat642Float64(b *testing.B) { + set := "Benchmark_Put_Complex_MapFloat642Float64" + a := make(map[float64]float64, 1000) + for i := 0; i < 1000; i++ { + a[float64(i)] = float64(i) + } + runtime.GC() + b.ResetTimer() + doPut(set, a, b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go new file mode 100644 index 00000000..209a2eb9 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go @@ -0,0 +1,106 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "runtime" + "strings" + "testing" +) + +type T interface { + size() int +} + +// //////////////////////////////// +type S string + +func (s *S) size() int { + return len(*s) +} + +// //////////////////////////////// +type I int + +func (i I) size() int { + return 8 +} + +// /////////////////////////////////////////////// + +func estimateSize(v T) int { + return v.size() +} + +func estimateSizeStr(v S) int { + return v.size() +} + +func estimateSizeInt(v I) int { + return v.size() +} + +func estimateSizePtr(v *string) int { + return len(*v) +} + +// /////////////////////////////////////////////// + +var n int + +func Benchmark_EstimateSizeStringGeneric(b *testing.B) { + value := S(strings.Repeat("s", 16)) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + n += estimateSize(&value) + } +} + +func Benchmark_EstimateSizeStringSpecialized(b *testing.B) { + value := S(strings.Repeat("s", 16)) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + n += estimateSizeStr(value) + } +} + +func Benchmark_EstimateSizeStringPtr(b *testing.B) { + value := strings.Repeat("s", 16) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + n += estimateSizePtr(&value) + } +} + +func Benchmark_EstimateSizeIntGeneric(b *testing.B) { + value := I(16) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + n += estimateSize(value) + } +} + +func Benchmark_EstimateSizeIntSpecialized(b *testing.B) { + value := I(16) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + n += estimateSizeInt(value) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go new file mode 100644 index 00000000..f845ed07 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go @@ -0,0 +1,73 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "strings" + "testing" + + as "github.com/aerospike/aerospike-client-go/v7" + "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" +) + +var str = strings.Repeat("abcd", 128) +var strVal = as.NewValue(str) +var buffer = []byte(str) +var key *as.Key + +var res []byte + +// func hash_key_baseline(str string) { +// hash := ripemd160.New() +// for i := 0; i < b.N; i++ { +// hash.Reset() +// hash.Write(buffer) +// res = hash.Sum(nil) +// } +// } + +func Benchmark_Key_Hash_BaseLine(b *testing.B) { + hash := ripemd160.New() + for i := 0; i < b.N; i++ { + hash.Reset() + hash.Write(buffer) + res = hash.Sum(nil) + } +} + +func Benchmark_Key_NewKey(b *testing.B) { + for i := 0; i < b.N; i++ { + key, _ = as.NewKey(str, str, str) + res = key.Digest() + } +} + +func Benchmark_K_ComputeDigest_Raw(b *testing.B) { + h := ripemd160.New() + setName := []byte(str) + keyType := []byte{byte(ParticleType.STRING)} + keyVal := []byte(str) + for i := 0; i < b.N; i++ { + h.Reset() + + // write will not fail; no error checking necessary + h.Write(setName) + h.Write(keyType) + h.Write(keyVal) + + res = h.Sum(nil) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go new file mode 100644 index 00000000..c57d3c53 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go @@ -0,0 +1,244 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "encoding/binary" + "math" + "math/rand" + "runtime" + "strings" + "testing" + + // "time" + + _ "net/http/pprof" +) + +var buf *benchBuffer + +func init() { + buf = &benchBuffer{dataBuffer: make([]byte, 1024*1024), dataOffset: 0} +} + +func Benchmark_Pack_binary_Write(b *testing.B) { + buf := new(bytes.Buffer) + for i := 0; i < b.N; i++ { + buf.Reset() + binary.Write(buf, binary.BigEndian, int64(0)) + } +} + +func Benchmark_Pack_binary_PutUint64(b *testing.B) { + buf := make([]byte, 8) + for i := 0; i < b.N; i++ { + binary.BigEndian.PutUint64(buf, 0) + } +} + +func doPack(val interface{}, b *testing.B) { + var err error + v := NewValue(val) + runtime.GC() + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.dataOffset = 0 + _, err = v.pack(buf) + if err != nil { + panic(err) + } + } +} + +func Benchmark_Pack_________Int64(b *testing.B) { + val := rand.Int63() + doPack(val, b) +} + +func Benchmark_Pack_________Int32(b *testing.B) { + val := rand.Int31() + doPack(val, b) +} + +func Benchmark_Pack_String______1(b *testing.B) { + val := strings.Repeat("s", 1) + doPack(val, b) +} + +func Benchmark_Pack_String_____10(b *testing.B) { + val := strings.Repeat("s", 10) + doPack(val, b) +} + +func Benchmark_Pack_String____100(b *testing.B) { + val := strings.Repeat("s", 100) + doPack(val, b) +} + +func Benchmark_Pack_String___1000(b *testing.B) { + val := strings.Repeat("s", 1000) + doPack(val, b) +} + +func Benchmark_Pack_String__10000(b *testing.B) { + val := strings.Repeat("s", 10000) + doPack(val, b) +} + +func Benchmark_Pack_String_100000(b *testing.B) { + val := strings.Repeat("s", 100000) + doPack(val, b) +} + +func Benchmark_Pack_Complex_IfcArray_Direct(b *testing.B) { + val := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} + doPack(val, b) +} + +var _ ListIter = myList([]string{}) + +// supports old generic slices +type myList []string + +func (m myList) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range m { + n, err := packString(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +func (m myList) Len() int { + return len(m) +} + +func Benchmark_Pack_Complex_Array_ListIter(b *testing.B) { + val := myList([]string{strings.Repeat("s", 1), strings.Repeat("s", 2), strings.Repeat("s", 3), strings.Repeat("s", 4), strings.Repeat("s", 5), strings.Repeat("s", 6), strings.Repeat("s", 7), strings.Repeat("s", 8), strings.Repeat("s", 9), strings.Repeat("s", 10)}) + doPack(val, b) +} + +func Benchmark_Pack_Complex_ValueArray(b *testing.B) { + val := []Value{NewValue(1), NewValue(strings.Repeat("s", 100000)), NewValue(1.75), NewValue(nil)} + doPack(val, b) +} + +func Benchmark_Pack_Complex_Map(b *testing.B) { + val := map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + } + doPack(val, b) +} + +func Benchmark_Pack_Complex_JsonMap(b *testing.B) { + val := map[string]interface{}{ + "rand.Int63()": rand.Int63(), + "nil": 1, + "s": 491871, + "15892987": strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + } + doPack(val, b) +} + +// ////////////////////////////////////////////////////////////////////////////////////// +type benchBuffer struct { + dataBuffer []byte + dataOffset int +} + +// Int64ToBytes converts an int64 into slice of Bytes. +func (bb *benchBuffer) WriteInt64(num int64) int { + return bb.WriteUint64(uint64(num)) +} + +// Uint64ToBytes converts an uint64 into slice of Bytes. +func (bb *benchBuffer) WriteUint64(num uint64) int { + binary.BigEndian.PutUint64(bb.dataBuffer[bb.dataOffset:bb.dataOffset+8], num) + bb.dataOffset += 8 + return 8 +} + +// Int32ToBytes converts an int32 to a byte slice of size 4 +func (bb *benchBuffer) WriteInt32(num int32) int { + return bb.WriteUint32(uint32(num)) +} + +// Uint32ToBytes converts an uint32 to a byte slice of size 4 +func (bb *benchBuffer) WriteUint32(num uint32) int { + binary.BigEndian.PutUint32(bb.dataBuffer[bb.dataOffset:bb.dataOffset+4], num) + bb.dataOffset += 4 + return 4 +} + +// Int16ToBytes converts an int16 to slice of bytes +func (bb *benchBuffer) WriteInt16(num int16) int { + return bb.WriteUint16(uint16(num)) +} + +// Int16ToBytes converts an int16 to slice of bytes +func (bb *benchBuffer) WriteUint16(num uint16) int { + binary.BigEndian.PutUint16(bb.dataBuffer[bb.dataOffset:bb.dataOffset+2], num) + bb.dataOffset += 2 + return 2 +} + +func (bb *benchBuffer) WriteFloat32(float float32) int { + bits := math.Float32bits(float) + binary.BigEndian.PutUint32(bb.dataBuffer[bb.dataOffset:bb.dataOffset+4], bits) + bb.dataOffset += 4 + return 4 +} + +func (bb *benchBuffer) WriteFloat64(float float64) int { + bits := math.Float64bits(float) + binary.BigEndian.PutUint64(bb.dataBuffer[bb.dataOffset:bb.dataOffset+8], bits) + bb.dataOffset += 8 + return 8 +} + +func (bb *benchBuffer) WriteBool(b bool) int { + if b { + bb.WriteByte(1) + } else { + bb.WriteByte(0) + } + return 1 +} + +func (bb *benchBuffer) WriteByte(b byte) { + bb.dataBuffer[bb.dataOffset] = b + bb.dataOffset++ +} + +func (bb *benchBuffer) WriteString(s string) (int, Error) { + copy(bb.dataBuffer[bb.dataOffset:bb.dataOffset+len(s)], s) + bb.dataOffset += len(s) + return len(s), nil +} + +func (bb *benchBuffer) Write(b []byte) (int, Error) { + copy(bb.dataBuffer[bb.dataOffset:bb.dataOffset+len(b)], b) + bb.dataOffset += len(b) + return len(b), nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go new file mode 100644 index 00000000..85493b12 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go @@ -0,0 +1,64 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + "testing" + "time" + + xor "github.com/aerospike/aerospike-client-go/v7/types/rand" +) + +func Benchmark_math_rand(b *testing.B) { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + for i := 0; i < b.N; i++ { + r.Int63() + } +} + +func Benchmark_xor_rand(b *testing.B) { + r := xor.NewXorRand() + for i := 0; i < b.N; i++ { + r.Int64() + } +} + +func Benchmark_math_rand_with_new(b *testing.B) { + for i := 0; i < b.N; i++ { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + r.Int63() + } +} + +func Benchmark_xor_rand_with_new(b *testing.B) { + for i := 0; i < b.N; i++ { + r := xor.NewXorRand() + r.Int64() + } +} + +func Benchmark_math_rand_synched(b *testing.B) { + for i := 0; i < b.N; i++ { + rand.Int63() + } +} + +func Benchmark_xor_rand_fast_pool(b *testing.B) { + r := xor.NewXorRand() + for i := 0; i < b.N; i++ { + r.Int64() + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go new file mode 100644 index 00000000..d6ea9ce5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go @@ -0,0 +1,161 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + "runtime" + "strings" + "testing" + + _ "net/http/pprof" +) + +func doReadCommandWriteBuffer(set string, value interface{}, b *testing.B) { + policy := NewPolicy() + + dataBuffer := make([]byte, 1024*1024) + + binNames := []string{} + key, _ := NewKey("test", set, 1000) + + for i := 0; i < b.N; i++ { + command, err := newReadCommand(nil, policy, key, binNames, nil) + if err != nil { + panic(err) + } + command.baseCommand.dataBuffer = dataBuffer + err = command.writeBuffer(&command) + if err != nil { + panic(err) + } + } +} + +func Benchmark_ReadCommand_________Int64(b *testing.B) { + set := "put_bench_integer" + value := rand.Int63() + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_________Int32(b *testing.B) { + set := "put_bench_integer" + value := rand.Int31() + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String______1(b *testing.B) { + set := "put_bench_str_1" + value := strings.Repeat("s", 1) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String_____10(b *testing.B) { + set := "put_bench_str_10" + value := strings.Repeat("s", 10) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String____100(b *testing.B) { + set := "put_bench_str_100" + value := strings.Repeat("s", 100) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String___1000(b *testing.B) { + set := "put_bench_str_1000" + value := strings.Repeat("s", 1000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String__10000(b *testing.B) { + set := "put_bench_str_10000" + value := strings.Repeat("s", 10000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_String_100000(b *testing.B) { + set := "put_bench_str_10000" + value := strings.Repeat("s", 100000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_Complex_Array(b *testing.B) { + set := "put_bench_str_10000" + value := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_Complex_Map(b *testing.B) { + set := "put_bench_str_10000" + value := map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + } + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} + +func Benchmark_ReadCommand_JSON_Map(b *testing.B) { + set := "put_bench_str_10000" + value := map[string]interface{}{ + strings.Repeat("a", 16): rand.Int63(), + strings.Repeat("b", 16): strings.Repeat("s", 100), + strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + strings.Repeat("d", 16): map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + }, + } + b.N = 1000 + runtime.GC() + b.ResetTimer() + doReadCommandWriteBuffer(set, value, b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go new file mode 100644 index 00000000..153a9b3b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go @@ -0,0 +1,83 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "runtime" + "testing" + + // "time" + _ "net/http/pprof" + + as "github.com/aerospike/aerospike-client-go/v7" + // _ "github.com/influxdata/influxdb/client" +) + +func doScan(b *testing.B) { + runtime.GC() + b.ResetTimer() + b.SetBytes(0) + + policy := as.NewScanPolicy() + + n := 0 + for i := 0; i < 10; i++ { + results, err := client.ScanAll(policy, *namespace, "test") + if err != nil { + b.Errorf("Scan error: %s", err) + } + + for range results.Results() { + n++ + } + } + b.N = n +} + +func doQuery(b *testing.B) { + var err error + + runtime.GC() + b.ResetTimer() + b.SetBytes(0) + + n := 0 + //queries to aerospike + policy := as.NewQueryPolicy() + stmt := as.NewStatement(*namespace, "test") + + b.ResetTimer() + b.SetBytes(0) + results, err := client.Query(policy, stmt) + if err != nil { + b.Errorf("Query error: %s", err) + } + + for range results.Results() { + n++ + } + + b.N = n +} + +func Benchmark_Scan(b *testing.B) { + initTestVars() + go doScan(b) +} + +func Benchmark_Query(b *testing.B) { + initTestVars() + doQuery(b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go new file mode 100644 index 00000000..cc9ab143 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go @@ -0,0 +1,118 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "math/rand" + "strings" + "testing" +) + +var sv StringValue +var iv IntegerValue +var lv LongValue +var bav BytesValue + +var __value Value + +func Benchmark_StringValue(b *testing.B) { + b.N = 1e6 + str := strings.Repeat("a", 1000) + for i := 0; i < b.N; i++ { + __value = NewStringValue(str) + } +} + +func Benchmark_IntegerValue(b *testing.B) { + b.N = 1e6 + in := 1091 + for i := 0; i < b.N; i++ { + __value = NewIntegerValue(in) + } +} + +func Benchmark_LongValue(b *testing.B) { + b.N = 1e6 + in := int64(10916927583729485) + for i := 0; i < b.N; i++ { + __value = NewLongValue(in) + } +} + +func Benchmark_BytesValue(b *testing.B) { + b.N = 1e6 + barr := bytes.Repeat([]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, 1000) + for i := 0; i < b.N; i++ { + __value = NewBytesValue(barr) + } +} + +func Benchmark_ListValue(b *testing.B) { + b.N = 1e6 + value := []interface{}{ + rand.Int63(), + strings.Repeat("s", 100), + []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + }, + } + for i := 0; i < b.N; i++ { + __value = NewListValue(value) + } +} + +func Benchmark_JsonMapValue(b *testing.B) { + b.N = 1e6 + value := map[string]interface{}{ + strings.Repeat("a", 16): rand.Int63(), + strings.Repeat("b", 16): strings.Repeat("s", 100), + strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + strings.Repeat("d", 16): map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + }, + } + for i := 0; i < b.N; i++ { + __value = NewValue(value) + } +} + +func Benchmark_IfcMapValue(b *testing.B) { + b.N = 1e6 + value := map[interface{}]interface{}{ + strings.Repeat("a", 16): rand.Int63(), + strings.Repeat("b", 16): strings.Repeat("s", 100), + strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + strings.Repeat("d", 16): map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + }, + } + for i := 0; i < b.N; i++ { + __value = NewValue(value) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go new file mode 100644 index 00000000..9f95f995 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go @@ -0,0 +1,161 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + "runtime" + "strings" + "testing" + + _ "net/http/pprof" +) + +func doPut(set string, value interface{}, b *testing.B) { + policy := NewWritePolicy(0, 0) + + dataBuffer := make([]byte, 1024*1024) + + bins := []*Bin{NewBin("b", value)} + key, _ := NewKey("test", set, 1000) + + for i := 0; i < b.N; i++ { + command, err := newWriteCommand(nil, policy, key, bins, nil, _WRITE) + if err != nil { + panic(err) + } + command.baseCommand.dataBuffer = dataBuffer + err = command.writeBuffer(&command) + if err != nil { + panic(err) + } + } +} + +func Benchmark_WriteCommand_________Int64(b *testing.B) { + set := "put_bench_integer" + value := rand.Int63() + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_________Int32(b *testing.B) { + set := "put_bench_integer" + value := rand.Int31() + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String______1(b *testing.B) { + set := "put_bench_str_1" + value := strings.Repeat("s", 1) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String_____10(b *testing.B) { + set := "put_bench_str_10" + value := strings.Repeat("s", 10) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String____100(b *testing.B) { + set := "put_bench_str_100" + value := strings.Repeat("s", 100) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String___1000(b *testing.B) { + set := "put_bench_str_1000" + value := strings.Repeat("s", 1000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String__10000(b *testing.B) { + set := "put_bench_str_10000" + value := strings.Repeat("s", 10000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_String_100000(b *testing.B) { + set := "put_bench_str_10000" + value := strings.Repeat("s", 100000) + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_Complex_Array(b *testing.B) { + set := "put_bench_str_10000" + value := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_Complex_Map(b *testing.B) { + set := "put_bench_str_10000" + value := map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + } + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} + +func Benchmark_WriteCommand_JSON_Map(b *testing.B) { + set := "put_bench_str_10000" + value := map[string]interface{}{ + strings.Repeat("a", 16): rand.Int63(), + strings.Repeat("b", 16): strings.Repeat("s", 100), + strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + strings.Repeat("d", 16): map[interface{}]interface{}{ + rand.Int63(): rand.Int63(), + nil: 1, + "s": 491871, + 15892987: strings.Repeat("s", 100), + "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, + }, + } + b.N = 1000 + runtime.GC() + b.ResetTimer() + doPut(set, value, b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bin.go b/aerospike-tls/vendor-aerospike-client-go/bin.go new file mode 100644 index 00000000..92a3abc5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bin.go @@ -0,0 +1,41 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BinMap is used to define a map of bin names to values. +type BinMap map[string]interface{} + +// Bin encapsulates a field name/value pair. +type Bin struct { + // Bin name. Current limit is 14 characters. + Name string + + // Bin value. + Value Value +} + +// NewBin generates a new Bin instance, specifying bin name and string value. +// For servers configured as "single-bin", enter an empty name. +func NewBin(name string, value interface{}) *Bin { + return &Bin{ + Name: name, + Value: NewValue(value), + } +} + +// String implements Stringer interface. +func (bn *Bin) String() string { + return bn.Name + ":" + bn.Value.String() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go b/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go new file mode 100644 index 00000000..7e1998ae --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go @@ -0,0 +1,31 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BitOverflowAction specifies the action to take when bitwise add/subtract results in overflow/underflow. +type BitOverflowAction int + +const ( + // BitOverflowActionFail specifies to fail operation with error. + BitOverflowActionFail BitOverflowAction = 0 + + // BitOverflowActionSaturate specifies that in add/subtract overflows/underflows, set to max/min value. + // Example: MAXINT + 1 = MAXINT + BitOverflowActionSaturate BitOverflowAction = 2 + + // BitOverflowActionWrap specifies that in add/subtract overflows/underflows, wrap the value. + // Example: MAXINT + 1 = -1 + BitOverflowActionWrap BitOverflowAction = 4 +) diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_policy.go b/aerospike-tls/vendor-aerospike-client-go/bit_policy.go new file mode 100644 index 00000000..63bd9199 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bit_policy.go @@ -0,0 +1,30 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BitPolicy determines the Bit operation policy. +type BitPolicy struct { + flags int +} + +// DefaultBitPolicy will return the default BitPolicy +func DefaultBitPolicy() *BitPolicy { + return &BitPolicy{BitWriteFlagsDefault} +} + +// NewBitPolicy will return a BitPolicy will provided flags. +func NewBitPolicy(flags int) *BitPolicy { + return &BitPolicy{flags} +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go b/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go new file mode 100644 index 00000000..d9f3f3ce --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go @@ -0,0 +1,32 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BitResizeFlags specifies the bitwise operation flags for resize. +type BitResizeFlags int + +const ( + // BitResizeFlagsDefault specifies the defalt flag. + BitResizeFlagsDefault BitResizeFlags = 0 + + // BitResizeFlagsFromFront Adds/removes bytes from the beginning instead of the end. + BitResizeFlagsFromFront BitResizeFlags = 1 + + // BitResizeFlagsGrowOnly will only allow the []byte size to increase. + BitResizeFlagsGrowOnly BitResizeFlags = 2 + + // BitResizeFlagsShrinkOnly will only allow the []byte size to decrease. + BitResizeFlagsShrinkOnly BitResizeFlags = 4 +) diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go b/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go new file mode 100644 index 00000000..7ad2e165 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go @@ -0,0 +1,39 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// BitWriteFlags specify bitwise operation policy write flags. + +const ( + // BitWriteFlagsDefault allows create or update. + BitWriteFlagsDefault = 0 + + // BitWriteFlagsCreateOnly specifies that: + // If the bin already exists, the operation will be denied. + // If the bin does not exist, a new bin will be created. + BitWriteFlagsCreateOnly = 1 + + // BitWriteFlagsUpdateOnly specifies that: + // If the bin already exists, the bin will be overwritten. + // If the bin does not exist, the operation will be denied. + BitWriteFlagsUpdateOnly = 2 + + // BitWriteFlagsNoFail specifies not to raise error if operation is denied. + BitWriteFlagsNoFail = 4 + + // BitWriteFlagsPartial allows other valid operations to be committed if this operations is + // denied due to flag constraints. + BitWriteFlagsPartial = 8 +) diff --git a/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go b/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go new file mode 100644 index 00000000..ff4dfd85 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go @@ -0,0 +1,148 @@ +// Copyright 2014-2022 Aerospike, Inbc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type bufferedConn struct { + conn *Connection + remaining int + head, tail int +} + +func newBufferedConn(conn *Connection, total int) bufferedConn { + return bufferedConn{ + conn: conn, + remaining: total, + } +} + +// emptyCap returns the empty capacity in the buffer. +func (bc *bufferedConn) emptyCap() int { + return len(bc.buf()) - bc.len() +} + +// len returns the number of unread bytes in the buffer. +func (bc *bufferedConn) len() int { + return bc.tail - bc.head +} + +// buf returns the connection's byte buffer. +func (bc *bufferedConn) buf() []byte { + return bc.conn.dataBuffer +} + +// shiftContentToHead will move the unread bytes to the head of the buffer. +// It will also resize the buffer if there is not enough empty capacity to read +// the minimum number of bytes that are requested. +// If the buffer is empty, head and tail will be reset to the beginning of the buffer. +func (bc *bufferedConn) shiftContentToHead(length int) { + // shift data to the head of the byte slice + if length > bc.emptyCap() { + buf := buffPool.Get(bc.len() + length) + copy(buf, bc.buf()[bc.head:bc.tail]) + bc.conn.dataBuffer = buf + + bc.tail -= bc.head + bc.head = 0 + } else if bc.len() > 0 { + copy(bc.buf(), bc.buf()[bc.head:bc.tail]) + + bc.tail -= bc.head + bc.head = 0 + } else { + bc.tail = 0 + bc.head = 0 + } +} + +// readConn will read the minimum minLength number of bytes from the connection. +// It will read more if it has extra empty capacity in the buffer. +func (bc *bufferedConn) readConn(minLength int) Error { + // Corrupted data streams can result in a huge minLength. + // Do a sanity check here. + if minLength > MaxBufferSize || minLength <= 0 || minLength > bc.remaining { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid readBytes length: %d", minLength)) + } + + bc.shiftContentToHead(minLength) + + toRead := bc.remaining + if ec := bc.emptyCap(); toRead > ec { + toRead = ec + } + + n, err := bc.conn.Read(bc.buf()[bc.tail:], toRead) + bc.tail += n + bc.remaining -= n + + if err != nil { + logger.Logger.Debug("Requested to read %d bytes, but %d was read. (%v)", minLength, n, err) + return err + } + + return nil +} + +func (bc *bufferedConn) read(length int) ([]byte, Error) { + if cl := bc.len(); length > cl { + if err := bc.readConn(length - cl); err != nil { + return nil, err + } + } + + buf := bc.buf()[bc.head : bc.head+length] + bc.head += length + + return buf, nil +} + +func (bc *bufferedConn) drainConn() Error { + if bc.conn.grpcReader != nil { + return nil + } + + if !bc.conn.IsConnected() { + return nil + } + + toRead := 0 + for bc.remaining > 0 { + toRead = bc.remaining + if toRead > len(bc.buf()) { + toRead = len(bc.buf()) + } + + n, err := bc.conn.Read(bc.conn.dataBuffer, toRead) + bc.remaining -= n + if err != nil { + return err + } + } + + return nil +} + +func (bc *bufferedConn) reset(total int) Error { + bc.remaining = total + bc.head = 0 + bc.tail = 0 + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go b/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go new file mode 100644 index 00000000..2ff42d47 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go @@ -0,0 +1,148 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "encoding/binary" + "math" +) + +// BufferEx is a specialized buffer interface for aerospike client. +type BufferEx interface { + WriteInt64(num int64) int + WriteUint64(num uint64) int + WriteInt32(num int32) int + WriteUint32(num uint32) int + WriteInt16(num int16) int + WriteUint16(num uint16) int + WriteFloat32(float float32) int + WriteFloat64(float float64) int + WriteBool(b bool) int + WriteByte(b byte) + WriteString(s string) (int, Error) + Write(b []byte) (int, Error) +} + +var _ BufferEx = &bufferEx{} + +type bufferEx struct { + dataBuffer []byte + dataOffset int +} + +func newBuffer(sz int) *bufferEx { + return &bufferEx{ + dataBuffer: make([]byte, sz), + } +} + +// Bytes returns the content of the buffer +func (buf *bufferEx) Bytes() []byte { + return buf.dataBuffer[:buf.dataOffset] +} + +// Int64ToBytes converts an int64 into slice of Bytes. +func (buf *bufferEx) WriteInt64(num int64) int { + return buf.WriteUint64(uint64(num)) +} + +// Uint64ToBytes converts an uint64 into slice of Bytes. +func (buf *bufferEx) WriteUint64(num uint64) int { + binary.BigEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], num) + buf.dataOffset += 8 + return 8 +} + +// Int32ToBytes converts an int32 to a byte slice of size 4 +func (buf *bufferEx) WriteInt32(num int32) int { + return buf.WriteUint32(uint32(num)) +} + +// Uint32ToBytes converts an uint32 to a byte slice of size 4 +func (buf *bufferEx) WriteUint32(num uint32) int { + binary.BigEndian.PutUint32(buf.dataBuffer[buf.dataOffset:buf.dataOffset+4], num) + buf.dataOffset += 4 + return 4 +} + +// Uint32ToBytes converts an uint32 to a byte slice of size 4 +func (buf *bufferEx) WriteUint32At(num uint32, index int) int { + binary.BigEndian.PutUint32(buf.dataBuffer[index:index+4], num) + return 4 +} + +// Int16ToBytes converts an int16 to slice of bytes +func (buf *bufferEx) WriteInt16(num int16) int { + return buf.WriteUint16(uint16(num)) +} + +func (buf *bufferEx) WriteInt16LittleEndian(num uint16) int { + binary.LittleEndian.PutUint16(buf.dataBuffer[buf.dataOffset:buf.dataOffset+2], num) + buf.dataOffset += 2 + return 2 +} + +func (buf *bufferEx) WriteInt64LittleEndian(num uint64) int { + binary.LittleEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], num) + buf.dataOffset += 8 + return 8 +} + +// Int16ToBytes converts an int16 to slice of bytes +func (buf *bufferEx) WriteUint16(num uint16) int { + binary.BigEndian.PutUint16(buf.dataBuffer[buf.dataOffset:buf.dataOffset+2], num) + buf.dataOffset += 2 + return 2 +} + +func (buf *bufferEx) WriteFloat32(float float32) int { + bits := math.Float32bits(float) + binary.BigEndian.PutUint32(buf.dataBuffer[buf.dataOffset:buf.dataOffset+4], bits) + buf.dataOffset += 4 + return 4 +} + +func (buf *bufferEx) WriteFloat64(float float64) int { + bits := math.Float64bits(float) + binary.BigEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], bits) + buf.dataOffset += 8 + return 8 +} + +func (buf *bufferEx) WriteByte(b byte) { + buf.dataBuffer[buf.dataOffset] = b + buf.dataOffset++ +} + +func (buf *bufferEx) WriteString(s string) (int, Error) { + copy(buf.dataBuffer[buf.dataOffset:buf.dataOffset+len(s)], s) + buf.dataOffset += len(s) + return len(s), nil +} + +func (buf *bufferEx) WriteBool(b bool) int { + if b { + buf.WriteByte(1) + } else { + buf.WriteByte(0) + } + return 1 +} + +func (buf *bufferEx) Write(b []byte) (int, Error) { + copy(buf.dataBuffer[buf.dataOffset:buf.dataOffset+len(b)], b) + buf.dataOffset += len(b) + return len(b), nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt.go b/aerospike-tls/vendor-aerospike-client-go/cdt.go new file mode 100644 index 00000000..48021e51 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt.go @@ -0,0 +1,135 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +func newCDTCreateOperationEncoder(op *Operation, packer BufferEx) (int, Error) { + if op.binValue != nil { + if params := op.binValue.(ListValue); len(params) > 0 { + return packCDTIfcParamsAsArray(packer, int16(*op.opSubType), op.ctx, op.binValue.(ListValue)) + } + } + return packCDTParamsAsArray(packer, int16(*op.opSubType), op.ctx) +} + +func newCDTCreateOperationValues2(command int, attributes mapOrderType, binName string, ctx []*CDTContext, value1 interface{}, value2 interface{}) *Operation { + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{value1, value2, IntegerValue(attributes.attr)}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateOperationValues0(command int, typ OperationType, binName string, ctx []*CDTContext) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + // binValue: NewNullValue(), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateOperationValuesN(command int, typ OperationType, binName string, ctx []*CDTContext, values []interface{}, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), ListValue(values)}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateOperationValue1(command int, typ OperationType, binName string, ctx []*CDTContext, value interface{}, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), value}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateOperationIndex(command int, typ OperationType, binName string, ctx []*CDTContext, index int, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), index}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateOperationIndexCount(command int, typ OperationType, binName string, ctx []*CDTContext, index int, count int, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), index, count}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTMapCreateOperationRelativeIndex(command int, typ OperationType, binName string, ctx []*CDTContext, key Value, index int, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), key, index}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTMapCreateOperationRelativeIndexCount(command int, typ OperationType, binName string, ctx []*CDTContext, key Value, index int, count int, returnType mapReturnType) *Operation { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), key, index, count}), + encoder: newCDTCreateOperationEncoder, + } +} + +func newCDTCreateRangeOperation(command int, typ OperationType, binName string, ctx []*CDTContext, begin interface{}, end interface{}, returnType mapReturnType) *Operation { + if end == nil { + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), begin}), + encoder: newCDTCreateOperationEncoder, + } + } + + return &Operation{ + opType: typ, + opSubType: &command, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{IntegerValue(returnType), begin, end}), + encoder: newCDTCreateOperationEncoder, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go new file mode 100644 index 00000000..17202bae --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go @@ -0,0 +1,516 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +// Bit operations. Create bit operations used by client operate command. +// Offset orientation is left-to-right. Negative offsets are supported. +// If the offset is negative, the offset starts backwards from end of the bitmap. +// If an offset is out of bounds, a parameter error will be returned. +// +// Nested CDT operations are supported by optional CTX context arguments. Example: +// bin = [[0b00000001, 0b01000010],[0b01011010]] +// Resize first bitmap (in a list of bitmaps) to 3 bytes. +// BitOperation.resize("bin", 3, BitResizeFlags.DEFAULT, CTX.listIndex(0)) +// bin result = [[0b00000001, 0b01000010, 0b00000000],[0b01011010]] +const ( + _CDT_BITWISE_RESIZE = 0 + _CDT_BITWISE_INSERT = 1 + _CDT_BITWISE_REMOVE = 2 + _CDT_BITWISE_SET = 3 + _CDT_BITWISE_OR = 4 + _CDT_BITWISE_XOR = 5 + _CDT_BITWISE_AND = 6 + _CDT_BITWISE_NOT = 7 + _CDT_BITWISE_LSHIFT = 8 + _CDT_BITWISE_RSHIFT = 9 + _CDT_BITWISE_ADD = 10 + _CDT_BITWISE_SUBTRACT = 11 + _CDT_BITWISE_SET_INT = 12 + _CDT_BITWISE_GET = 50 + _CDT_BITWISE_COUNT = 51 + _CDT_BITWISE_LSCAN = 52 + _CDT_BITWISE_RSCAN = 53 + _CDT_BITWISE_GET_INT = 54 + + _CDT_BITWISE_INT_FLAGS_SIGNED = 1 +) + +// BitResizeOp creates byte "resize" operation. +// Server resizes []byte to byteSize according to resizeFlags (See BitResizeFlags). +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010] +// byteSize = 4 +// resizeFlags = 0 +// bin result = [0b00000001, 0b01000010, 0b00000000, 0b00000000] +func BitResizeOp(policy *BitPolicy, binName string, byteSize int, resizeFlags BitResizeFlags, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_RESIZE, IntegerValue(byteSize), IntegerValue(policy.flags), IntegerValue(resizeFlags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitInsertOp creates byte "insert" operation. +// Server inserts value bytes into []byte bin at byteOffset. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// byteOffset = 1 +// value = [0b11111111, 0b11000111] +// bin result = [0b00000001, 0b11111111, 0b11000111, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +func BitInsertOp(policy *BitPolicy, binName string, byteOffset int, value []byte, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_INSERT, IntegerValue(byteOffset), BytesValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitRemoveOp creates byte "remove" operation. +// Server removes bytes from []byte bin at byteOffset for byteSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// byteOffset = 2 +// byteSize = 3 +// bin result = [0b00000001, 0b01000010] +func BitRemoveOp(policy *BitPolicy, binName string, byteOffset int, byteSize int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_REMOVE, IntegerValue(byteOffset), IntegerValue(byteSize), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitSetOp creates bit "set" operation. +// Server sets value on []byte bin at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 13 +// bitSize = 3 +// value = [0b11100000] +// bin result = [0b00000001, 0b01000111, 0b00000011, 0b00000100, 0b00000101] +func BitSetOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_SET, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitOrOp creates bit "or" operation. +// Server performs bitwise "or" on value and []byte bin at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 17 +// bitSize = 6 +// value = [0b10101000] +// bin result = [0b00000001, 0b01000010, 0b01010111, 0b00000100, 0b00000101] +func BitOrOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_OR, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitXorOp creates bit "exclusive or" operation. +// Server performs bitwise "xor" on value and []byte bin at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 17 +// bitSize = 6 +// value = [0b10101100] +// bin result = [0b00000001, 0b01000010, 0b01010101, 0b00000100, 0b00000101] +func BitXorOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_XOR, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitAndOp creates bit "and" operation. +// Server performs bitwise "and" on value and []byte bin at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 23 +// bitSize = 9 +// value = [0b00111100, 0b10000000] +// bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101] +func BitAndOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_AND, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitNotOp creates bit "not" operation. +// Server negates []byte bin starting at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 25 +// bitSize = 6 +// bin result = [0b00000001, 0b01000010, 0b00000011, 0b01111010, 0b00000101] +func BitNotOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_NOT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitLShiftOp creates bit "left shift" operation. +// Server shifts left []byte bin starting at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 32 +// bitSize = 8 +// shift = 3 +// bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00101000] +func BitLShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_LSHIFT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(shift), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitRShiftOp creates bit "right shift" operation. +// Server shifts right []byte bin starting at bitOffset for bitSize. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 0 +// bitSize = 9 +// shift = 1 +// bin result = [0b00000000, 0b11000010, 0b00000011, 0b00000100, 0b00000101] +func BitRShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_RSHIFT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(shift), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitAddOp creates bit "add" operation. +// Server adds value to []byte bin starting at bitOffset for bitSize. BitSize must be <= 64. +// Signed indicates if bits should be treated as a signed number. +// If add overflows/underflows, BitOverflowAction is used. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 24 +// bitSize = 16 +// value = 128 +// signed = false +// bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b10000101] +func BitAddOp( + policy *BitPolicy, + binName string, + bitOffset int, + bitSize int, + value int64, + signed bool, + action BitOverflowAction, + ctx ...*CDTContext, +) *Operation { + // return createMathOperation(ADD, policy, binName, ctx, bitOffset, bitSize, value, signed, action) + + actionFlags := action + if signed { + actionFlags |= _CDT_BITWISE_INT_FLAGS_SIGNED + } + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_ADD, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags), IntegerValue(actionFlags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitSubtractOp creates bit "subtract" operation. +// Server subtracts value from []byte bin starting at bitOffset for bitSize. BitSize must be <= 64. +// Signed indicates if bits should be treated as a signed number. +// If add overflows/underflows, BitOverflowAction is used. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 24 +// bitSize = 16 +// value = 128 +// signed = false +// bin result = [0b00000001, 0b01000010, 0b00000011, 0b0000011, 0b10000101] +func BitSubtractOp( + policy *BitPolicy, + binName string, + bitOffset int, + bitSize int, + value int64, + signed bool, + action BitOverflowAction, + ctx ...*CDTContext, +) *Operation { + // return createMathOperation(SUBTRACT, policy, binName, ctx, bitOffset, bitSize, value, signed, action) + + actionFlags := action + if signed { + actionFlags |= _CDT_BITWISE_INT_FLAGS_SIGNED + } + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_SUBTRACT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags), IntegerValue(actionFlags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitSetIntOp creates bit "setInt" operation. +// Server sets value to []byte bin starting at bitOffset for bitSize. Size must be <= 64. +// Server does not return a value. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 1 +// bitSize = 8 +// value = 127 +// bin result = [0b00111111, 0b11000010, 0b00000011, 0b0000100, 0b00000101] +func BitSetIntOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ctx ...*CDTContext) *Operation { + // Packer packer = new Packer(); + // init(packer, ctx, SET_INT, 4) + // packer.packInt(bitOffset) + // packer.packInt(bitSize) + // packer.packLong(value) + // packer.packInt(policy.flags) + // return newOperation(_BIT_MODIFY, binName, Value.get(packer.toByteArray())) + return &Operation{ + opType: _BIT_MODIFY, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_SET_INT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitGetOp creates bit "get" operation. +// Server returns bits from []byte bin starting at bitOffset for bitSize. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 9 +// bitSize = 5 +// returns [0b1000000] +func BitGetOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_READ, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_GET, IntegerValue(bitOffset), IntegerValue(bitSize)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitCountOp creates bit "count" operation. +// Server returns integer count of set bits from []byte bin starting at bitOffset for bitSize. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 20 +// bitSize = 4 +// returns 2 +func BitCountOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_READ, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_COUNT, IntegerValue(bitOffset), IntegerValue(bitSize)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitLScanOp creates bit "left scan" operation. +// Server returns integer bit offset of the first specified value bit in []byte bin +// starting at bitOffset for bitSize. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 24 +// bitSize = 8 +// value = true +// returns 5 +func BitLScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_READ, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_LSCAN, IntegerValue(bitOffset), IntegerValue(bitSize), BoolValue(value)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitRScanOp creates bit "right scan" operation. +// Server returns integer bit offset of the last specified value bit in []byte bin +// starting at bitOffset for bitSize. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 32 +// bitSize = 8 +// value = true +// returns 7 +func BitRScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation { + return &Operation{ + opType: _BIT_READ, + ctx: ctx, + binName: binName, + binValue: ListValue{_CDT_BITWISE_RSCAN, IntegerValue(bitOffset), IntegerValue(bitSize), BoolValue(value)}, + encoder: newCDTBitwiseEncoder, + } +} + +// BitGetIntOp creates bit "get integer" operation. +// Server returns integer from []byte bin starting at bitOffset for bitSize. +// Signed indicates if bits should be treated as a signed number. +// Example: +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 8 +// bitSize = 16 +// signed = false +// returns 16899 +func BitGetIntOp(binName string, bitOffset int, bitSize int, signed bool, ctx ...*CDTContext) *Operation { + binValue := ListValue{_CDT_BITWISE_GET_INT, IntegerValue(bitOffset), IntegerValue(bitSize)} + if signed { + binValue = append(binValue, IntegerValue(_CDT_BITWISE_INT_FLAGS_SIGNED)) + } + return &Operation{ + opType: _BIT_READ, + ctx: ctx, + binName: binName, + binValue: binValue, + encoder: newCDTBitwiseEncoder, + } +} + +func newCDTBitwiseEncoder(op *Operation, packer BufferEx) (int, Error) { + params := op.binValue.(ListValue) + opType := params[0].(int) + if len(op.binValue.(ListValue)) > 1 { + return packCDTBitIfcParamsAsArray(packer, int16(opType), op.ctx, params[1:]) + } + return packCDTBitIfcParamsAsArray(packer, int16(opType), op.ctx, nil) +} + +func packCDTBitIfcParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ListValue) (int, Error) { + return packCDTBitIfcVarParamsAsArray(packer, opType, ctx, []interface{}(params)...) +} + +func packCDTBitIfcVarParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...interface{}) (int, Error) { + size := 0 + n := 0 + var err Error + if len(ctx) > 0 { + if n, err = packArrayBegin(packer, 3); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt64(packer, 0xff); err != nil { + return size + n, err + } + size += n + + if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { + return size + n, err + } + size += n + + for _, c := range ctx { + if n, err = packAInt64(packer, int64(c.Id)); err != nil { + return size + n, err + } + size += n + + if n, err = c.Value.pack(packer); err != nil { + return size + n, err + } + size += n + } + } + + if n, err = packArrayBegin(packer, len(params)+1); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt(packer, int(opType)); err != nil { + return size + n, err + } + size += n + + if len(params) > 0 { + for i := range params { + if n, err = packObject(packer, params[i], false); err != nil { + return size + n, err + } + size += n + } + } + + return size, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go new file mode 100644 index 00000000..9c4ac6c0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go @@ -0,0 +1,966 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +var _ = gg.Describe("CDT Bitwise Test", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var cdtBinName string + + var assertEquals = func(e string, v1, v2 interface{}) { + gm.Expect(v1).To(gm.Equal(v2), e) + } + + var assertBitModifyRegion = func(bin_sz, offset, set_sz int, expected []byte, isInsert bool, ops ...*as.Operation) { + client.Delete(nil, key) + + initial := make([]byte, bin_sz) + + for i := 0; i < bin_sz; i++ { + initial[i] = 0xFF + } + + err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + int_sz := 64 + + if set_sz < int_sz { + int_sz = set_sz + } + + bin_bit_sz := bin_sz * 8 + + if isInsert { + bin_bit_sz += set_sz + } + + full_ops := make([]*as.Operation, len(ops)+7) + copy(full_ops, ops) + full_ops[len(full_ops)-7] = as.BitLScanOp(cdtBinName, offset, set_sz, true) + full_ops[len(full_ops)-6] = as.BitRScanOp(cdtBinName, offset, set_sz, true) + full_ops[len(full_ops)-5] = as.BitGetIntOp(cdtBinName, offset, int_sz, false) + full_ops[len(full_ops)-4] = as.BitCountOp(cdtBinName, offset, set_sz) + full_ops[len(full_ops)-3] = as.BitLScanOp(cdtBinName, 0, bin_bit_sz, false) + full_ops[len(full_ops)-2] = as.BitRScanOp(cdtBinName, 0, bin_bit_sz, false) + full_ops[len(full_ops)-1] = as.BitGetOp(cdtBinName, offset, set_sz) + + record, err := client.Operate(nil, key, full_ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + result_list := record.Bins[cdtBinName].([]interface{}) + lscan1_result := result_list[len(result_list)-7].(int) + rscan1_result := result_list[len(result_list)-6].(int) + getint_result := result_list[len(result_list)-5].(int) + count_result := result_list[len(result_list)-4].(int) + lscan_result := result_list[len(result_list)-3].(int) + rscan_result := result_list[len(result_list)-2].(int) + actual := (result_list[len(result_list)-1]).([]byte) + err_output := fmt.Sprintf("bin_sz %d offset %d set_sz %d", bin_sz, offset, set_sz) + + assertEquals("lscan1 - "+err_output, -1, lscan1_result) + assertEquals("rscan1 - "+err_output, -1, rscan1_result) + assertEquals("getint - "+err_output, 0, getint_result) + assertEquals("count - "+err_output, 0, count_result) + assertEquals("lscan - "+err_output, offset, lscan_result) + assertEquals("rscan - "+err_output, offset+set_sz-1, rscan_result) + assertEquals("op - "+err_output, expected, actual) + } + + var assertBitModifyRegionNotInsert = func(bin_sz, offset, set_sz int, expected []byte, ops ...*as.Operation) { + assertBitModifyRegion(bin_sz, offset, set_sz, expected, false, ops...) + } + + var assertBitModifyInsert = func(bin_sz, offset, set_sz int, expected []byte, ops ...*as.Operation) { + assertBitModifyRegion(bin_sz, offset, set_sz, expected, true, ops...) + } + + var assertBitReadOperation = func(initial []byte, expected []int64, ops ...*as.Operation) { + client.Delete(nil, key) + err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Operate(wpolicy, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[cdtBinName]).To(gm.BeAssignableToTypeOf([]interface{}{})) + binResults := rec.Bins[cdtBinName].([]interface{}) + results := make([]int64, len(binResults)) + for i := range binResults { + results[i] = int64(binResults[i].(int)) + } + + gm.Expect(results).To(gm.Equal(expected)) + } + + var assertBitModifyOperations = func(initial, expected []byte, ops ...*as.Operation) { + client.Delete(nil, key) + + if initial != nil { + err := client.PutBins(wpolicy, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + _, err := client.Operate(nil, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(expected)) + } + + var assertThrows = func(code ast.ResultCode, ops ...*as.Operation) { + _, err := client.Operate(nil, key, ops...) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err).To(gm.BeAssignableToTypeOf(&as.AerospikeError{})) + gm.Expect(err.Matches(code)).To(gm.BeTrue()) + } + + gg.BeforeEach(func() { + if !featureEnabled("blob-bits") { + gg.Skip("CDT Bitwise Tests will not run since feature is not supported by the server.") + return + } + + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtBinName = randString(10) + }) + + gg.Describe("CDT BitWise Operations", func() { + + // const listSize = 10 + + // // make a fresh list before each operation + // gg.BeforeEach(func() { + // list = []interface{}{} + + // for i := 1; i <= listSize; i++ { + // list = append(list, i) + + // sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) + // gm.Expect(err).ToNot(gm.HaveOccurred()) + // gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + // } + // }) + + gg.It("should Set a Bin", func() { + + bit0 := []byte{0x80} + putMode := as.DefaultBitPolicy() + updateMode := as.NewBitPolicy(as.BitWriteFlagsUpdateOnly) + + assertBitModifyOperations( + []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}, + []byte{0x51, 0x02, 0x03, 0x04, 0x05, 0x06}, + as.BitSetOp(putMode, cdtBinName, 1, 1, bit0), + as.BitSetOp(updateMode, cdtBinName, 3, 1, bit0), + as.BitRemoveOp(updateMode, cdtBinName, 6, 2), + ) + + addMode := as.NewBitPolicy(as.BitWriteFlagsCreateOnly) + bytes1 := []byte{0x0A} + + assertBitModifyOperations( + nil, []byte{0x00, 0x0A}, + as.BitInsertOp(addMode, cdtBinName, 1, bytes1), + ) + + assertThrows(17, + as.BitSetOp(putMode, "b", 1, 1, bit0)) + + assertThrows(4, + as.BitSetOp(addMode, cdtBinName, 1, 1, bit0)) + }) + + gg.It("should Set a Bin's bits", func() { + + putMode := as.DefaultBitPolicy() + bit0 := []byte{0x80} + bits1 := []byte{0x11, 0x22, 0x33} + + assertBitModifyOperations( + []byte{0x01, 0x12, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, + 0x0E, 0x0F, 0x10, 0x11, 0x41}, + []byte{0x41, + 0x13, + 0x11, 0x22, 0x33, + 0x11, 0x22, 0x33, + 0x08, + 0x08, 0x91, 0x1B, + 0x01, 0x12, 0x23, + 0x11, 0x22, 0x11, + 0xc1}, + as.BitSetOp(putMode, cdtBinName, 1, 1, bit0), + as.BitSetOp(putMode, cdtBinName, 15, 1, bit0), + // SUM Offest Size + as.BitSetOp(putMode, cdtBinName, 16, 24, bits1), // Y Y Y + as.BitSetOp(putMode, cdtBinName, 40, 22, bits1), // N Y N + as.BitSetOp(putMode, cdtBinName, 73, 21, bits1), // N N N + as.BitSetOp(putMode, cdtBinName, 100, 20, bits1), // Y N N + as.BitSetOp(putMode, cdtBinName, 120, 17, bits1), // N Y N + + as.BitSetOp(putMode, cdtBinName, 144, 1, bit0), + ) + }) + + gg.It("should LSHIFT bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x01, 0x01, 0x00, 0x80, + 0xFF, 0x01, 0x01, + 0x18, 0x01}, + []byte{0x02, 0x40, 0x01, 0x00, + 0xF8, 0x08, 0x01, + 0x28, 0x01}, + as.BitLShiftOp(putMode, cdtBinName, 0, 8, 1), + as.BitLShiftOp(putMode, cdtBinName, 9, 7, 6), + as.BitLShiftOp(putMode, cdtBinName, 23, 2, 1), + + as.BitLShiftOp(putMode, cdtBinName, 37, 18, 3), + + as.BitLShiftOp(putMode, cdtBinName, 58, 2, 1), + as.BitLShiftOp(putMode, cdtBinName, 64, 4, 7), + ) + + assertBitModifyOperations( + []byte{0xFF, 0xFF, 0xFF}, + []byte{0xF8, 0x00, 0x0F}, + as.BitLShiftOp(putMode, cdtBinName, 0, 20, 15), + ) + }) + + gg.It("should RSHIFT bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x80, 0x40, 0x01, 0x00, + 0xFF, 0x01, 0x01, + 0x18, 0x80}, + []byte{0x40, 0x01, 0x00, 0x80, + 0xF8, 0xE0, 0x21, + 0x14, 0x80}, + as.BitRShiftOp(putMode, cdtBinName, 0, 8, 1), + as.BitRShiftOp(putMode, cdtBinName, 9, 7, 6), + as.BitRShiftOp(putMode, cdtBinName, 23, 2, 1), + + as.BitRShiftOp(putMode, cdtBinName, 37, 18, 3), + + as.BitRShiftOp(putMode, cdtBinName, 60, 2, 1), + as.BitRShiftOp(putMode, cdtBinName, 68, 4, 7), + ) + }) + + gg.It("should OR bits", func() { + + bits1 := []byte{0x11, 0x22, 0x33} + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x80, 0x40, 0x01, 0x00, 0x00, + 0x01, 0x02, 0x03}, + []byte{0x90, 0x48, 0x01, 0x20, 0x11, + 0x11, 0x22, 0x33}, + as.BitOrOp(putMode, cdtBinName, 0, 5, bits1), + as.BitOrOp(putMode, cdtBinName, 9, 7, bits1), + as.BitOrOp(putMode, cdtBinName, 23, 6, bits1), + as.BitOrOp(putMode, cdtBinName, 32, 8, bits1), + + as.BitOrOp(putMode, cdtBinName, 40, 24, bits1), + ) + }) + + gg.It("should XOR bits", func() { + + bits1 := []byte{0x11, 0x22, 0x33} + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x80, 0x40, 0x01, 0x00, 0x00, + 0x01, 0x02, 0x03}, + []byte{0x90, 0x48, 0x01, 0x20, 0x11, 0x10, 0x20, + 0x30}, + as.BitXorOp(putMode, cdtBinName, 0, 5, bits1), + as.BitXorOp(putMode, cdtBinName, 9, 7, bits1), + as.BitXorOp(putMode, cdtBinName, 23, 6, bits1), + as.BitXorOp(putMode, cdtBinName, 32, 8, bits1), + + as.BitXorOp(putMode, cdtBinName, 40, 24, bits1), + ) + }) + + gg.It("should AND bits", func() { + + bits1 := []byte{0x11, 0x22, 0x33} + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x80, 0x40, 0x01, 0x00, 0x00, + 0x01, 0x02, 0x03}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03}, + as.BitAndOp(putMode, cdtBinName, 0, 5, bits1), + as.BitAndOp(putMode, cdtBinName, 9, 7, bits1), + as.BitAndOp(putMode, cdtBinName, 23, 6, bits1), + as.BitAndOp(putMode, cdtBinName, 32, 8, bits1), + + as.BitAndOp(putMode, cdtBinName, 40, 24, bits1), + ) + }) + + gg.It("should NOT bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x80, 0x40, 0x01, 0x00, 0x00, 0x01, 0x02, 0x03}, + []byte{0x78, 0x3F, 0x00, 0xF8, 0xFF, 0xFE, 0xFD, 0xFC}, + as.BitNotOp(putMode, cdtBinName, 0, 5), + as.BitNotOp(putMode, cdtBinName, 9, 7), + as.BitNotOp(putMode, cdtBinName, 23, 6), + as.BitNotOp(putMode, cdtBinName, 32, 8), + + as.BitNotOp(putMode, cdtBinName, 40, 24), + ) + }) + + gg.It("should ADD bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, + 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03}, + []byte{0x40, 0x20, 0x01, 0xF0, 0x80, + 0x7F, 0x7F, 0x7F, + 0x02, 0x02, 0x01, + 0x02, 0x02, 0x02, + 0x03, 0x03, 0x06, + 0x07, 0x07, 0x07}, + as.BitAddOp(putMode, cdtBinName, 0, 5, 1, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 9, 7, 1, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 23, 6, 0x21, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 32, 8, 1, false, as.BitOverflowActionFail), + + as.BitAddOp(putMode, cdtBinName, 40, 24, 0x7F7F7F, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 64, 20, 0x01010, false, as.BitOverflowActionFail), + + as.BitAddOp(putMode, cdtBinName, 92, 20, 0x10101, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 113, 22, 0x8082, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 136, 23, 0x20202, false, as.BitOverflowActionFail), + ) + + initial := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + i := 0 + + assertBitModifyOperations( + initial, + []byte{0xFE, 0xFE, 0x7F, 0xFF, 0x7F, 0x80}, + as.BitAddOp(putMode, cdtBinName, 8*i, 8, 0xFF, false, as.BitOverflowActionWrap), + as.BitAddOp(putMode, cdtBinName, 8*i, 8, 0xFF, false, as.BitOverflowActionWrap), + + as.BitAddOp(putMode, cdtBinName, 8*(i+1), 8, 0x7F, true, as.BitOverflowActionWrap), + as.BitAddOp(putMode, cdtBinName, 8*(i+1), 8, 0x7F, true, as.BitOverflowActionWrap), + + as.BitAddOp(putMode, cdtBinName, 8*(i+2), 8, 0x80, true, as.BitOverflowActionWrap), + as.BitAddOp(putMode, cdtBinName, 8*(i+2), 8, 0xFF, true, as.BitOverflowActionWrap), + + as.BitAddOp(putMode, cdtBinName, 8*(i+3), 8, 0x80, false, as.BitOverflowActionSaturate), + as.BitAddOp(putMode, cdtBinName, 8*(i+3), 8, 0x80, false, as.BitOverflowActionSaturate), + + as.BitAddOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), + as.BitAddOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), + + as.BitAddOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), + as.BitAddOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), + ) + + err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + assertThrows(26, + as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFF, false, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFF, false, as.BitOverflowActionFail), + ) + + assertThrows(26, + as.BitAddOp(putMode, cdtBinName, 0, 8, 0x7F, true, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 0, 8, 0x02, true, as.BitOverflowActionFail), + ) + + assertThrows(26, + as.BitAddOp(putMode, cdtBinName, 0, 8, 0x81, true, as.BitOverflowActionFail), + as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFE, true, as.BitOverflowActionFail), + ) + }) + + gg.It("should SUB bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, + + 0x80, 0x80, 0x80, + 0x01, 0x01, 0x01, + + 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03}, + []byte{0x30, 0x1E, 0x00, 0xD0, 0x7E, + + 0x7F, 0x7F, 0x7F, + 0x00, 0xF0, 0xF1, + + 0x00, 0x00, 0x00, + 0x01, 0xFD, 0xFE, + 0x00, 0xE0, 0xE1}, + as.BitSubtractOp(putMode, cdtBinName, 0, 5, 0x01, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 9, 7, 0x01, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 23, 6, 0x03, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 32, 8, 0x01, false, as.BitOverflowActionFail), + + as.BitSubtractOp(putMode, cdtBinName, 40, 24, 0x10101, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 64, 20, 0x101, false, as.BitOverflowActionFail), + + as.BitSubtractOp(putMode, cdtBinName, 92, 20, 0x10101, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 113, 21, 0x101, false, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 136, 23, 0x11111, false, as.BitOverflowActionFail), + ) + + initial := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + i := 0 + + assertBitModifyOperations( + initial, + []byte{0xFF, 0xF6, 0x7F, 0x00, 0x80, 0x7F}, + as.BitSubtractOp(putMode, cdtBinName, 8*i, 8, 0x01, false, as.BitOverflowActionWrap), + + as.BitSubtractOp(putMode, cdtBinName, 8*(i+1), 8, 0x80, true, as.BitOverflowActionWrap), + as.BitSubtractOp(putMode, cdtBinName, 8*(i+1), 8, 0x8A, true, as.BitOverflowActionWrap), + + as.BitSubtractOp(putMode, cdtBinName, 8*(i+2), 8, 0x7F, true, as.BitOverflowActionWrap), + as.BitSubtractOp(putMode, cdtBinName, 8*(i+2), 8, 0x02, true, as.BitOverflowActionWrap), + + as.BitSubtractOp(putMode, cdtBinName, 8*(i+3), 8, 0xAA, false, as.BitOverflowActionSaturate), + + as.BitSubtractOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), + as.BitSubtractOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), + + as.BitSubtractOp(putMode, cdtBinName, 8*(i+5), 8, 0x81, true, as.BitOverflowActionSaturate), + as.BitSubtractOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), + ) + + err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + assertThrows(26, + as.BitSubtractOp(putMode, cdtBinName, 0, 8, 1, false, as.BitOverflowActionFail), + ) + + assertThrows(26, + as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x7F, true, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x02, true, as.BitOverflowActionFail), + ) + + assertThrows(26, + as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x81, true, as.BitOverflowActionFail), + as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0xFE, true, as.BitOverflowActionFail), + ) + }) + + gg.It("should SetInt bits", func() { + + putMode := as.DefaultBitPolicy() + + assertBitModifyOperations( + []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, + + 0x80, 0x80, 0x80, + 0x01, 0x01, 0x01, + + 0x01, 0x01, 0x01, + 0x02, 0x02, 0x02, + 0x03, 0x03, 0x03}, + []byte{0x08, 0x01, 0x00, 0x18, 0x01, + + 0x01, 0x01, 0x01, + 0x00, 0x10, 0x11, + + 0x01, 0x01, 0x01, + 0x00, 0x04, 0x06, + 0x02, 0x22, 0x23}, + as.BitSetIntOp(putMode, cdtBinName, 0, 5, 0x01), + as.BitSetIntOp(putMode, cdtBinName, 9, 7, 0x01), + as.BitSetIntOp(putMode, cdtBinName, 23, 6, 0x03), + as.BitSetIntOp(putMode, cdtBinName, 32, 8, 0x01), + + as.BitSetIntOp(putMode, cdtBinName, 40, 24, 0x10101), + as.BitSetIntOp(putMode, cdtBinName, 64, 20, 0x101), + + as.BitSetIntOp(putMode, cdtBinName, 92, 20, 0x10101), + as.BitSetIntOp(putMode, cdtBinName, 113, 21, 0x101), + as.BitSetIntOp(putMode, cdtBinName, 136, 23, 0x11111), + ) + }) + + gg.It("should Get bits", func() { + + client.Delete(nil, key) + + bytes := []byte{0xC1, 0xAA, 0xAA} + err := client.PutBins(nil, key, as.NewBin(cdtBinName, bytes)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + record, err := client.Operate(nil, key, + as.BitGetOp(cdtBinName, 0, 1), + as.BitGetOp(cdtBinName, 1, 1), + as.BitGetOp(cdtBinName, 7, 1), + as.BitGetOp(cdtBinName, 0, 8), + + as.BitGetOp(cdtBinName, 8, 16), + as.BitGetOp(cdtBinName, 9, 15), + as.BitGetOp(cdtBinName, 9, 14), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record).NotTo(gm.BeNil()) + + expected := [][]byte{ + {0x80}, + {0x80}, + {0x80}, + {0xC1}, + + {0xAA, 0xAA}, + {0x55, 0x54}, + {0x55, 0x54}, + } + + // assertRecordFound(key, record) + + result_list := record.Bins[cdtBinName].([]interface{}) + results := make([][]byte, len(expected)) + + for i := 0; i < len(expected); i++ { + results[i] = result_list[i].([]byte) + } + + gm.Expect(expected).To(gm.Equal(results)) + }) + + gg.It("should Count bits", func() { + + assertBitReadOperation( + []byte{0xC1, 0xAA, 0xAB}, + []int64{1, 1, 1, 3, 9, 8, 7}, + as.BitCountOp(cdtBinName, 0, 1), + as.BitCountOp(cdtBinName, 1, 1), + as.BitCountOp(cdtBinName, 7, 1), + as.BitCountOp(cdtBinName, 0, 8), + + as.BitCountOp(cdtBinName, 8, 16), + as.BitCountOp(cdtBinName, 9, 15), + as.BitCountOp(cdtBinName, 9, 14), + ) + }) + + gg.It("should LSCAN bits", func() { + + assertBitReadOperation( + []byte{0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01}, + []int64{0, 0, 0, + 0, -1, -1, + 39, -1, 0, 0, + 0, 32, + 0, -1}, + as.BitLScanOp(cdtBinName, 0, 1, true), + as.BitLScanOp(cdtBinName, 0, 8, true), + as.BitLScanOp(cdtBinName, 0, 9, true), + + as.BitLScanOp(cdtBinName, 0, 32, true), + as.BitLScanOp(cdtBinName, 0, 32, false), + as.BitLScanOp(cdtBinName, 1, 30, false), + + as.BitLScanOp(cdtBinName, 32, 40, true), + as.BitLScanOp(cdtBinName, 33, 38, true), + as.BitLScanOp(cdtBinName, 32, 40, false), + as.BitLScanOp(cdtBinName, 33, 38, false), + + as.BitLScanOp(cdtBinName, 0, 72, true), + as.BitLScanOp(cdtBinName, 0, 72, false), + + as.BitLScanOp(cdtBinName, -1, 1, true), + as.BitLScanOp(cdtBinName, -1, 1, false), + ) + }) + + gg.It("should RSCAN bits", func() { + + assertBitReadOperation( + []byte{0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x01}, + []int64{0, 7, 8, + 31, -1, -1, + 39, -1, 38, 37, + 71, 70, + 0, -1}, + as.BitRScanOp(cdtBinName, 0, 1, true), + as.BitRScanOp(cdtBinName, 0, 8, true), + as.BitRScanOp(cdtBinName, 0, 9, true), + + as.BitRScanOp(cdtBinName, 0, 32, true), + as.BitRScanOp(cdtBinName, 0, 32, false), + as.BitRScanOp(cdtBinName, 1, 30, false), + + as.BitRScanOp(cdtBinName, 32, 40, true), + as.BitRScanOp(cdtBinName, 33, 38, true), + as.BitRScanOp(cdtBinName, 32, 40, false), + as.BitRScanOp(cdtBinName, 33, 38, false), + + as.BitRScanOp(cdtBinName, 0, 72, true), + as.BitRScanOp(cdtBinName, 0, 72, false), + + as.BitRScanOp(cdtBinName, -1, 1, true), + as.BitRScanOp(cdtBinName, -1, 1, false), + ) + }) + + gg.It("should GetInt bits", func() { + + assertBitReadOperation( + []byte{0x0F, 0x0F, 0x00}, + []int64{15, -1, + 15, 15, + 8, -8, + 3840, 3840, + 3840, 3840, + 1920, 1920, + 115648, -15424, + 15, -1}, + as.BitGetIntOp(cdtBinName, 4, 4, false), + as.BitGetIntOp(cdtBinName, 4, 4, true), + + as.BitGetIntOp(cdtBinName, 0, 8, false), + as.BitGetIntOp(cdtBinName, 0, 8, true), + + as.BitGetIntOp(cdtBinName, 7, 4, false), + as.BitGetIntOp(cdtBinName, 7, 4, true), + + as.BitGetIntOp(cdtBinName, 8, 16, false), + as.BitGetIntOp(cdtBinName, 8, 16, true), + + as.BitGetIntOp(cdtBinName, 9, 15, false), + as.BitGetIntOp(cdtBinName, 9, 15, true), + + as.BitGetIntOp(cdtBinName, 9, 14, false), + as.BitGetIntOp(cdtBinName, 9, 14, true), + + as.BitGetIntOp(cdtBinName, 5, 17, false), + as.BitGetIntOp(cdtBinName, 5, 17, true), + + as.BitGetIntOp(cdtBinName, -12, 4, false), + as.BitGetIntOp(cdtBinName, -12, 4, true), + ) + }) + + gg.It("should BitSetEx bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 80; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, as.BitSetOp(policy, cdtBinName, offset, set_sz, set_data)) + } + } + }) + + gg.It("should LSHIFTEX bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 4; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + limit := 16 + if set_sz < 16 { + limit = set_sz + 1 + } + + for n_bits := 0; n_bits <= limit; n_bits++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitSetOp(policy, cdtBinName, offset, set_sz, + set_data), + as.BitLShiftOp(policy, cdtBinName, offset, set_sz, + n_bits)) + } + + for n_bits := 63; n_bits <= set_sz; n_bits++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitSetOp(policy, cdtBinName, offset, set_sz, + set_data), + as.BitLShiftOp(policy, cdtBinName, offset, set_sz, + n_bits)) + } + } + } + }) + + gg.It("should RSHIFTEX bits", func() { + + policy := as.DefaultBitPolicy() + partial_policy := as.NewBitPolicy(as.BitWriteFlagsPartial) + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 4; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + limit := 16 + if set_sz < 16 { + limit = set_sz + 1 + } + + for n_bits := 0; n_bits <= limit; n_bits++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitSetOp(policy, cdtBinName, offset, set_sz, + set_data), + as.BitRShiftOp(policy, cdtBinName, offset, set_sz, + n_bits)) + } + + for n_bits := 63; n_bits <= set_sz; n_bits++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitSetOp(policy, cdtBinName, offset, set_sz, + set_data), + as.BitRShiftOp(policy, cdtBinName, offset, set_sz, + n_bits)) + } + } + + // Test Partial + n_bits := 1 + + for offset := bin_bit_sz - set_sz + 1; offset < bin_bit_sz; offset++ { + actual_set_sz := bin_bit_sz - offset + actual_set_data := make([]byte, (actual_set_sz+7)/8) + + assertBitModifyRegionNotInsert(bin_sz, offset, actual_set_sz, + actual_set_data, + as.BitSetOp(partial_policy, cdtBinName, offset, set_sz, + set_data), + as.BitRShiftOp(partial_policy, cdtBinName, offset, set_sz, + n_bits)) + } + } + }) + + gg.It("should AND Ex bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 80; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitAndOp(policy, cdtBinName, offset, set_sz, + set_data)) + } + } + }) + + gg.It("should NOT Ex bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 80; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitNotOp(policy, cdtBinName, offset, set_sz)) + } + } + }) + + gg.It("should INSERT Ex bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + + for set_sz := 1; set_sz <= 10; set_sz++ { + set_data := make([]byte, set_sz) + + for offset := 0; offset <= bin_sz; offset++ { + assertBitModifyInsert(bin_sz, offset*8, set_sz*8, set_data, + as.BitInsertOp(policy, cdtBinName, offset, set_data)) + } + } + }) + + gg.It("should ADD Ex bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 64; set_sz++ { + set_data := make([]byte, (set_sz+7)/8) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, + as.BitAddOp(policy, cdtBinName, offset, set_sz, 1, + false, as.BitOverflowActionWrap)) + } + } + }) + + gg.It("should SUB Ex bits", func() { + + policy := as.DefaultBitPolicy() + bin_sz := 15 + bin_bit_sz := bin_sz * 8 + + for set_sz := 1; set_sz <= 64; set_sz++ { + expected := make([]byte, (set_sz+7)/8) + value := int64(uint64(0xFFFFffffFFFFffff >> uint(64-set_sz))) + + for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { + assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, expected, + as.BitSubtractOp(policy, cdtBinName, offset, set_sz, + value, false, as.BitOverflowActionWrap)) + } + } + }) + + gg.It("should LSHIFT bits", func() { + + policy := as.DefaultBitPolicy() + initial := []byte{} + buf := []byte{0x80} + + client.Delete(nil, key) + err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + assertThrows(26, + as.BitSetOp(policy, cdtBinName, 0, 1, buf)) + assertThrows(26, + as.BitOrOp(policy, cdtBinName, 0, 1, buf)) + assertThrows(26, + as.BitXorOp(policy, cdtBinName, 0, 1, buf)) + assertThrows(26, + as.BitAndOp(policy, cdtBinName, 0, 1, buf)) + assertThrows(26, + as.BitNotOp(policy, cdtBinName, 0, 1)) + assertThrows(26, + as.BitLShiftOp(policy, cdtBinName, 0, 1, 1)) + assertThrows(26, + as.BitRShiftOp(policy, cdtBinName, 0, 1, 1)) + // OK for insert. + assertThrows(4, + as.BitRemoveOp(policy, cdtBinName, 0, 1)) + assertThrows(26, + as.BitAddOp(policy, cdtBinName, 0, 1, 1, false, as.BitOverflowActionFail)) + assertThrows(26, + as.BitSubtractOp(policy, cdtBinName, 0, 1, 1, false, as.BitOverflowActionFail)) + assertThrows(26, + as.BitSetIntOp(policy, cdtBinName, 0, 1, 1)) + + assertThrows(26, + as.BitGetOp(cdtBinName, 0, 1)) + assertThrows(26, + as.BitCountOp(cdtBinName, 0, 1)) + assertThrows(26, + as.BitLScanOp(cdtBinName, 0, 1, true)) + assertThrows(26, + as.BitRScanOp(cdtBinName, 0, 1, true)) + assertThrows(26, + as.BitGetIntOp(cdtBinName, 0, 1, false)) + }) + + gg.It("should Resize bits", func() { + + client.Delete(nil, key) + + policy := as.DefaultBitPolicy() + noFail := as.NewBitPolicy(as.BitWriteFlagsNoFail) + record, err := client.Operate(nil, key, + as.BitResizeOp(policy, cdtBinName, 20, as.BitResizeFlagsDefault), + as.BitGetOp(cdtBinName, 19*8, 8), + as.BitResizeOp(noFail, cdtBinName, 10, as.BitResizeFlagsGrowOnly), + as.BitGetOp(cdtBinName, 19*8, 8), + as.BitResizeOp(policy, cdtBinName, 10, as.BitResizeFlagsShrinkOnly), + as.BitGetOp(cdtBinName, 9*8, 8), + as.BitResizeOp(noFail, cdtBinName, 30, as.BitResizeFlagsShrinkOnly), + as.BitGetOp(cdtBinName, 9*8, 8), + as.BitResizeOp(policy, cdtBinName, 19, as.BitResizeFlagsGrowOnly), + as.BitGetOp(cdtBinName, 18*8, 8), + as.BitResizeOp(noFail, cdtBinName, 0, as.BitResizeFlagsGrowOnly), + as.BitResizeOp(policy, cdtBinName, 0, as.BitResizeFlagsShrinkOnly), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + result_list := record.Bins[cdtBinName].([]interface{}) + get0 := result_list[1].([]byte) + get1 := result_list[3].([]byte) + get2 := result_list[5].([]byte) + get3 := result_list[7].([]byte) + get4 := result_list[9].([]byte) + + gm.Expect([]byte{0x00}).To(gm.Equal(get0)) + gm.Expect([]byte{0x00}).To(gm.Equal(get1)) + gm.Expect([]byte{0x00}).To(gm.Equal(get2)) + gm.Expect([]byte{0x00}).To(gm.Equal(get3)) + gm.Expect([]byte{0x00}).To(gm.Equal(get4)) + }) + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_context.go b/aerospike-tls/vendor-aerospike-client-go/cdt_context.go new file mode 100644 index 00000000..5f5e1265 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_context.go @@ -0,0 +1,203 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import ( + "encoding/base64" + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const ( + ctxTypeListIndex = 0x10 + ctxTypeListRank = 0x11 + ctxTypeListValue = 0x13 + ctxTypeMapIndex = 0x20 + ctxTypeMapRank = 0x21 + ctxTypeMapKey = 0x22 + ctxTypeMapValue = 0x23 +) + +// CDTContext defines Nested CDT context. Identifies the location of nested list/map to apply the operation. +// for the current level. +// An array of CTX identifies location of the list/map on multiple +// levels on nesting. +type CDTContext struct { + Id int + Value Value +} + +// CDTContextToBase64 converts a []*CDTContext into a base64 encoded string. +func CDTContextToBase64(ctxl []*CDTContext) (string, Error) { + ctx := cdtContextList(ctxl) + sz, err := ctx.packArray(nil) + if err != nil { + return "", err + } + + buf := newBuffer(sz) + _, err = ctx.packArray(buf) + if err != nil { + return "", err + } + + b64 := base64.StdEncoding.EncodeToString(buf.dataBuffer) + return b64, nil +} + +// Base64ToCDTContext converts a b64 encoded string back into a []*CDTContext. +func Base64ToCDTContext(b64 string) ([]*CDTContext, Error) { + msg, err1 := base64.StdEncoding.DecodeString(b64) + if err1 != nil { + return nil, newError(types.PARSE_ERROR, err1.Error()) + } + + unpacker := newUnpacker(msg, 0, len(msg)) + list, err := unpacker.UnpackList() + if err != nil { + return nil, err + } + + if len(list)%2 != 0 { + return nil, newError(types.PARSE_ERROR, "List count must be even") + } + + res := make([]*CDTContext, 0, len(list)/2) + for i := 0; i < len(list); i += 2 { + res = append(res, &CDTContext{Id: list[i].(int), Value: NewValue(list[i+1])}) + } + + return res, nil +} + +// String implements the Stringer interface for CDTContext +func (ctx *CDTContext) String() string { + return fmt.Sprintf("CDTContext{id: %d, value: %s}", ctx.Id, ctx.Value.String()) +} + +func (ctx *CDTContext) pack(cmd BufferEx) (int, Error) { + size := 0 + sz, err := packAInt64(cmd, int64(ctx.Id)) + size += sz + if err != nil { + return size, err + } + + sz, err = ctx.Value.pack(cmd) + size += sz + + return size, err +} + +// cdtContextList is used in FilterExpression API +type cdtContextList []*CDTContext + +func (ctxl cdtContextList) pack(cmd BufferEx) (int, Error) { + size := 0 + for i := range ctxl { + sz, err := ctxl[i].pack(cmd) + size += sz + if err != nil { + return size, err + } + } + + return size, nil +} + +// used in CreateComplexIndex +func (ctxl cdtContextList) packArray(cmd BufferEx) (int, Error) { + size, err := packArrayBegin(cmd, len(ctxl)*2) + if err != nil { + return size, err + } + + for i := range ctxl { + sz, err := ctxl[i].pack(cmd) + size += sz + if err != nil { + return size, err + } + } + + return size, nil +} + +// CtxListIndex defines Lookup list by index offset. +// If the index is negative, the resolved index starts backwards from end of list. +// If an index is out of bounds, a parameter error will be returned. +// Examples: +// 0: First item. +// 4: Fifth item. +// -1: Last item. +// -3: Third to last item. +func CtxListIndex(index int) *CDTContext { + return &CDTContext{ctxTypeListIndex, IntegerValue(index)} +} + +// CtxListIndexCreate list with given type at index offset, given an order and pad. +func CtxListIndexCreate(index int, order ListOrderType, pad bool) *CDTContext { + return &CDTContext{ctxTypeListIndex | cdtListOrderFlag(order, pad), IntegerValue(index)} +} + +// CtxListRank defines Lookup list by rank. +// 0 = smallest value +// N = Nth smallest value +// -1 = largest value +func CtxListRank(rank int) *CDTContext { + return &CDTContext{ctxTypeListRank, IntegerValue(rank)} +} + +// CtxListValue defines Lookup list by value. +func CtxListValue(key Value) *CDTContext { + return &CDTContext{ctxTypeListValue, key} +} + +// CtxMapIndex defines Lookup map by index offset. +// If the index is negative, the resolved index starts backwards from end of list. +// If an index is out of bounds, a parameter error will be returned. +// Examples: +// 0: First item. +// 4: Fifth item. +// -1: Last item. +// -3: Third to last item. +func CtxMapIndex(index int) *CDTContext { + return &CDTContext{ctxTypeMapIndex, IntegerValue(index)} +} + +// CtxMapRank defines Lookup map by rank. +// 0 = smallest value +// N = Nth smallest value +// -1 = largest value +func CtxMapRank(rank int) *CDTContext { + return &CDTContext{ctxTypeMapRank, IntegerValue(rank)} +} + +// CtxMapKey defines Lookup map by key. +func CtxMapKey(key Value) *CDTContext { + return &CDTContext{ctxTypeMapKey, key} +} + +// CtxMapKeyCreate creates map with given type at map key. +func CtxMapKeyCreate(key Value, order mapOrderType) *CDTContext { + return &CDTContext{ctxTypeMapKey | order.flag, key} +} + +// CtxMapValue defines Lookup map by value. +func CtxMapValue(key Value) *CDTContext { + return &CDTContext{ctxTypeMapValue, key} +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go new file mode 100644 index 00000000..f3f70092 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go @@ -0,0 +1,42 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var _ = gg.Describe("CDTContext Test", func() { + + gg.It("should convert to/from base64", func() { + ctxl := []*as.CDTContext{ + as.CtxMapKey(as.StringValue("key2")), + as.CtxListRank(0), + } + + b, err := as.CDTContextToBase64(ctxl) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(b).ToNot(gm.BeNil()) + + ctxl2, err := as.Base64ToCDTContext(b) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + arraysEqual(ctxl2, ctxl) + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_list.go b/aerospike-tls/vendor-aerospike-client-go/cdt_list.go new file mode 100644 index 00000000..e41e2fb4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_list.go @@ -0,0 +1,882 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// List operations support negative indexing. If the index is negative, the +// resolved index starts backwards from end of list. If an index is out of bounds, +// a parameter error will be returned. If a range is partially out of bounds, the +// valid part of the range will be returned. Index/Range examples: +// +// Index/Range examples: +// +// Index 0: First item in list. +// Index 4: Fifth item in list. +// Index -1: Last item in list. +// Index -3: Third to last item in list. +// Index 1 Count 2: Second and third items in list. +// Index -3 Count 3: Last three items in list. +// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. +// +// Nested CDT operations are supported by optional Ctx context arguments. Examples: +// +// bin = [[7,9,5],[1,2,3],[6,5,4,1]] +// Append 11 to last list. +// ListAppendWithPolicyContextOp(DefaultMapPolicy(), "bin", IntegerValue(11), CtxListIndex(-1)) +// bin result = [[7,9,5],[1,2,3],[6,5,4,1,11]] +// +// bin = {key1:[[7,9,5],[13]], key2:[[9],[2,4],[6,1,9]], key3:[[6,5]]} +// Append 11 to lowest ranked list in map identified by "key2". +// ListAppendWithPolicyContextOp(DefaultMapPolicy(), "bin", IntegerValue(11), CtxMapKey(StringValue("key2")), CtxListRank(0)) +// bin result = {key1:[[7,9,5],[13]], key2:[[9],[2,4,11],[6,1,9]], key3:[[6,5]]} + +const ( + _CDT_LIST_SET_TYPE = 0 + _CDT_LIST_APPEND = 1 + _CDT_LIST_APPEND_ITEMS = 2 + _CDT_LIST_INSERT = 3 + _CDT_LIST_INSERT_ITEMS = 4 + _CDT_LIST_POP = 5 + _CDT_LIST_POP_RANGE = 6 + _CDT_LIST_REMOVE = 7 + _CDT_LIST_REMOVE_RANGE = 8 + _CDT_LIST_SET = 9 + _CDT_LIST_TRIM = 10 + _CDT_LIST_CLEAR = 11 + _CDT_LIST_INCREMENT = 12 + _CDT_LIST_SORT = 13 + _CDT_LIST_SIZE = 16 + _CDT_LIST_GET = 17 + _CDT_LIST_GET_RANGE = 18 + _CDT_LIST_GET_BY_INDEX = 19 + _CDT_LIST_GET_BY_RANK = 21 + _CDT_LIST_GET_BY_VALUE = 22 + _CDT_LIST_GET_BY_VALUE_LIST = 23 + _CDT_LIST_GET_BY_INDEX_RANGE = 24 + _CDT_LIST_GET_BY_VALUE_INTERVAL = 25 + _CDT_LIST_GET_BY_RANK_RANGE = 26 + _CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE = 27 + _CDT_LIST_REMOVE_BY_INDEX = 32 + _CDT_LIST_REMOVE_BY_RANK = 34 + _CDT_LIST_REMOVE_BY_VALUE = 35 + _CDT_LIST_REMOVE_BY_VALUE_LIST = 36 + _CDT_LIST_REMOVE_BY_INDEX_RANGE = 37 + _CDT_LIST_REMOVE_BY_VALUE_INTERVAL = 38 + _CDT_LIST_REMOVE_BY_RANK_RANGE = 39 + _CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE = 40 +) + +// ListOrderType determines the order of returned values in CDT list operations. +type ListOrderType int + +// Map storage order. +const ( + // ListOrderUnordered signifies that list is not ordered. This is the default. + ListOrderUnordered ListOrderType = 0 + + // ListOrderOrdered signifies that list is Ordered. + ListOrderOrdered ListOrderType = 1 +) + +// ListPolicy directives when creating a list and writing list items. +type ListPolicy struct { + attributes ListOrderType + flags int +} + +// NewListPolicy creates a policy with directives when creating a list and writing list items. +// Flags are ListWriteFlags. You can specify multiple by `or`ing them together. +func NewListPolicy(order ListOrderType, flags int) *ListPolicy { + return &ListPolicy{ + attributes: order, + flags: flags, + } +} + +// DefaultListPolicy is the default list policy and can be customized. +var defaultListPolicy = NewListPolicy(ListOrderUnordered, ListWriteFlagsDefault) + +// DefaultListPolicy returns the default policy for CDT list operations. +func DefaultListPolicy() *ListPolicy { + return defaultListPolicy +} + +// ListReturnType determines the returned values in CDT List operations. +type ListReturnType int + +const ( + // ListReturnTypeNone will not return a result. + ListReturnTypeNone ListReturnType = 0 + + // ListReturnTypeIndex will return index offset order. + // 0 = first key + // N = Nth key + // -1 = last key + ListReturnTypeIndex ListReturnType = 1 + + // ListReturnTypeReverseIndex will return reverse index offset order. + // 0 = last key + // -1 = first key + ListReturnTypeReverseIndex ListReturnType = 2 + + // ListReturnTypeRank will return value order. + // 0 = smallest value + // N = Nth smallest value + // -1 = largest value + ListReturnTypeRank ListReturnType = 3 + + // ListReturnTypeReverseRank will return reverse value order. + // 0 = largest value + // N = Nth largest value + // -1 = smallest value + ListReturnTypeReverseRank ListReturnType = 4 + + // ListReturnTypeCount will return count of items selected. + ListReturnTypeCount ListReturnType = 5 + + // ListReturnTypeValue will return value for single key read and value list for range read. + ListReturnTypeValue ListReturnType = 7 + + // ListReturnTypeExists returns true if count > 0. + ListReturnTypeExists ListReturnType = 13 + + // ListReturnTypeInverted will invert meaning of list command and return values. For example: + // ListOperation.getByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED) + // With the INVERTED flag enabled, the items outside of the specified index range will be returned. + // The meaning of the list command can also be inverted. For example: + // ListOperation.removeByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED); + // With the INVERTED flag enabled, the items outside of the specified index range will be removed and returned. + ListReturnTypeInverted ListReturnType = 0x10000 +) + +// ListSortFlags detemines sort flags for CDT lists +type ListSortFlags int + +const ( + // ListSortFlagsDefault is the default sort flag for CDT lists, and sort in Ascending order. + ListSortFlagsDefault ListSortFlags = 0 + // ListSortFlagsDescending will sort the contents of the list in descending order. + ListSortFlagsDescending ListSortFlags = 1 + // ListSortFlagsDropDuplicates will drop duplicate values in the results of the CDT list operation. + ListSortFlagsDropDuplicates ListSortFlags = 2 +) + +// ListWriteFlags detemines write flags for CDT lists +// type ListWriteFlags int + +const ( + // ListWriteFlagsDefault is the default behavior. It means: Allow duplicate values and insertions at any index. + ListWriteFlagsDefault = 0 + // ListWriteFlagsAddUnique means: Only add unique values. + ListWriteFlagsAddUnique = 1 + // ListWriteFlagsInsertBounded means: Enforce list boundaries when inserting. Do not allow values to be inserted + // at index outside current list boundaries. + ListWriteFlagsInsertBounded = 2 + // ListWriteFlagsNoFail means: do not raise error if a list item fails due to write flag constraints. + ListWriteFlagsNoFail = 4 + // ListWriteFlagsPartial means: allow other valid list items to be committed if a list item fails due to + // write flag constraints. + ListWriteFlagsPartial = 8 +) + +func listGenericOpEncoder(op *Operation, packer BufferEx) (int, Error) { + args := op.binValue.(ListValue) + if len(args) > 1 { + return packCDTIfcVarParamsAsArray(packer, int16(args[0].(int)), op.ctx, args[1:]...) + } + return packCDTIfcVarParamsAsArray(packer, int16(args[0].(int)), op.ctx) +} + +func packCDTParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...Value) (int, Error) { + size := 0 + n := 0 + var err Error + if len(ctx) > 0 { + if n, err = packArrayBegin(packer, 3); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt64(packer, 0xff); err != nil { + return size + n, err + } + size += n + + if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { + return size + n, err + } + size += n + + for _, c := range ctx { + if n, err = packAInt64(packer, int64(c.Id)); err != nil { + return size + n, err + } + size += n + + if n, err = c.Value.pack(packer); err != nil { + return size + n, err + } + size += n + } + + if n, err = packArrayBegin(packer, len(params)+1); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt(packer, int(opType)); err != nil { + return size + n, err + } + size += n + } else { + if n, err = packShortRaw(packer, opType); err != nil { + return n, err + } + size += n + + if len(params) > 0 { + if n, err = packArrayBegin(packer, len(params)); err != nil { + return size + n, err + } + size += n + } + } + + if len(params) > 0 { + for i := range params { + if n, err = params[i].pack(packer); err != nil { + return size + n, err + } + size += n + } + } + return size, nil +} + +func packCDTIfcParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ListValue) (int, Error) { + return packCDTIfcVarParamsAsArray(packer, opType, ctx, []interface{}(params)...) +} + +func packCDTIfcVarParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...interface{}) (int, Error) { + size := 0 + n := 0 + var err Error + if len(ctx) > 0 { + if n, err = packArrayBegin(packer, 3); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt64(packer, 0xff); err != nil { + return size + n, err + } + size += n + + if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { + return size + n, err + } + size += n + + for _, c := range ctx { + if n, err = packAInt64(packer, int64(c.Id)); err != nil { + return size + n, err + } + size += n + + if n, err = c.Value.pack(packer); err != nil { + return size + n, err + } + size += n + } + + if n, err = packArrayBegin(packer, len(params)+1); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt(packer, int(opType)); err != nil { + return size + n, err + } + size += n + } else { + n, err = packShortRaw(packer, opType) + if err != nil { + return n, err + } + size += n + + if len(params) > 0 { + if n, err = packArrayBegin(packer, len(params)); err != nil { + return size + n, err + } + size += n + } + } + + if len(params) > 0 { + for i := range params { + if n, err = packObject(packer, params[i], false); err != nil { + return size + n, err + } + size += n + } + } + + return size, nil +} + +func cdtCreateOpEncoder(op *Operation, packer BufferEx) (int, Error) { + args := op.binValue.(ListValue) + if len(args) > 2 { + return packCDTCreate(packer, int16(args[0].(int)), op.ctx, args[1].(int), args[2:]...) + } + return packCDTCreate(packer, int16(args[0].(int)), op.ctx, args[1].(int)) +} + +func packCDTCreate(packer BufferEx, opType int16, ctx []*CDTContext, flag int, params ...interface{}) (int, Error) { + size := 0 + n := 0 + var err Error + if n, err = packArrayBegin(packer, 3); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt64(packer, 0xff); err != nil { + return size + n, err + } + size += n + + if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { + return size + n, err + } + size += n + + var c *CDTContext + last := len(ctx) - 1 + + for i := 0; i < last; i++ { + c = ctx[i] + if n, err = packAInt64(packer, int64(c.Id)); err != nil { + return size + n, err + } + size += n + + if n, err = c.Value.pack(packer); err != nil { + return size + n, err + } + size += n + } + + c = ctx[last] + if n, err = packAInt64(packer, int64(c.Id|flag)); err != nil { + return size + n, err + } + size += n + + if n, err = c.Value.pack(packer); err != nil { + return size + n, err + } + size += n + + if n, err = packArrayBegin(packer, len(params)+1); err != nil { + return size + n, err + } + size += n + + if n, err = packAInt(packer, int(opType)); err != nil { + return size + n, err + } + size += n + + if len(params) > 0 { + for i := range params { + if n, err = packObject(packer, params[i], false); err != nil { + return size + n, err + } + size += n + } + } + + return size, nil +} + +func cdtListOrderFlag(order ListOrderType, pad bool) int { + if order == 1 { + return 0xc0 + } + + if pad { + return 0x80 + } + return 0x40 +} + +// ListCreateOp creates list create operation. +// Server creates list at given context level. The context is allowed to be beyond list +// boundaries only if pad is set to true. In that case, nil list entries will be inserted to +// satisfy the context position. +func ListCreateOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation { + // If context not defined, the set order for top-level bin list. + if len(ctx) == 0 { + return ListSetOrderOp(binName, listOrder) + } + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, cdtListOrderFlag(listOrder, pad), IntegerValue(listOrder)}, encoder: cdtCreateOpEncoder} +} + +// ListCreateOp creates list create operation with a persisted index. +// A list index improves lookup performance, but requires more storage. +// A list index can be created for a top-level ordered list only. +// Nested and unordered list indexes are not supported. +// +// Server creates list at given context level. The context is allowed to be beyond list +// boundaries only if pad is set to true. In that case, nil list entries will be inserted to +// satisfy the context position. +func ListCreateWithIndexOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation { + // If context not defined, the set order for top-level bin list. + if len(ctx) == 0 { + return ListSetOrderWithIndexOp(binName, listOrder) + } + + // Create nested list. persistIndex does not apply here, so ignore it. + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, cdtListOrderFlag(listOrder, pad), IntegerValue(listOrder)}, encoder: cdtCreateOpEncoder} +} + +// ListSetOrderOp creates a set list order operation. +// Server sets list order. Server returns nil. +func ListSetOrderOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, IntegerValue(listOrder)}, encoder: listGenericOpEncoder} +} + +// ListSetOrderWithIndexOp creates a set list order operation with a persisted index. +// A list index improves lookup performance, but requires more storage. +// A list index can be created for a top-level ordered list only. +// Nested and unordered list indexes are not supported. +// +// Server sets list order. Server returns nil. +func ListSetOrderWithIndexOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation { + listOrder |= 0x10 + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, IntegerValue(listOrder)}, encoder: listGenericOpEncoder} +} + +// ListAppendOp creates a list append operation. +// Server appends values to end of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListAppendOp(binName string, values ...interface{}) *Operation { + if len(values) == 1 { + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0])}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values)}, encoder: listGenericOpEncoder} +} + +// ListAppendWithPolicyOp creates a list append operation. +// Server appends values to end of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListAppendWithPolicyOp(policy *ListPolicy, binName string, values ...interface{}) *Operation { + switch len(values) { + case 1: + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0]), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + default: + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + } +} + +// ListAppendWithPolicyContextOp creates a list append operation. +// Server appends values to end of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListAppendWithPolicyContextOp(policy *ListPolicy, binName string, ctx []*CDTContext, values ...interface{}) *Operation { + switch len(values) { + case 1: + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0]), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + default: + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + } +} + +// ListInsertOp creates a list insert operation. +// Server inserts value to specified index of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListInsertOp(binName string, index int, values ...interface{}) *Operation { + if len(values) == 1 { + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0])}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values)}, encoder: listGenericOpEncoder} +} + +// ListInsertWithPolicyOp creates a list insert operation. +// Server inserts value to specified index of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListInsertWithPolicyOp(policy *ListPolicy, binName string, index int, values ...interface{}) *Operation { + if len(values) == 1 { + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0]), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} +} + +// ListInsertWithPolicyContextOp creates a list insert operation. +// Server inserts value to specified index of list bin. +// Server returns list size on bin name. +// It will panic is no values have been passed. +func ListInsertWithPolicyContextOp(policy *ListPolicy, binName string, index int, ctx []*CDTContext, values ...interface{}) *Operation { + if len(values) == 1 { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0]), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} +} + +// ListPopOp creates list pop operation. +// Server returns item at specified index and removes item from list bin. +func ListPopOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListPopRangeOp creates a list pop range operation. +// Server returns items starting at specified index and removes items from list bin. +func ListPopRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { + if count == 1 { + return ListPopOp(binName, index) + } + + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListPopRangeFromOp creates a list pop range operation. +// Server returns items starting at specified index to the end of list and removes items from list bin. +func ListPopRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListRemoveOp creates a list remove operation. +// Server removes item at specified index from list bin. +// Server returns number of items removed. +func ListRemoveOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByValueOp creates list remove by value operation. +// Server removes the item identified by value and returns removed data specified by returnType. +func ListRemoveByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE, IntegerValue(returnType), NewValue(value)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByValueListOp creates list remove by value operation. +// Server removes list items identified by value and returns removed data specified by returnType. +func ListRemoveByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_LIST, IntegerValue(returnType), ListValue(values)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByValueRangeOp creates a list remove operation. +// Server removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// Server returns removed data specified by returnType +func ListRemoveByValueRangeOp(binName string, returnType ListReturnType, valueBegin, valueEnd interface{}, ctx ...*CDTContext) *Operation { + // TODO: Inconsistent parameter order + if valueEnd == nil { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(valueBegin)}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(valueBegin), NewValue(valueEnd)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByValueRelativeRankRangeOp creates a list remove by value relative to rank range operation. +// Server removes list items nearest to value and greater by relative rank. +// Server returns removed data specified by returnType. +// +// Examples for ordered list [0,4,5,9,11,15]: +// +// (value,rank) = [removed items] +// (5,0) = [5,9,11,15] +// (5,1) = [9,11,15] +// (5,-1) = [4,5,9,11,15] +// (3,0) = [4,5,9,11,15] +// (3,3) = [11,15] +// (3,-3) = [0,4,5,9,11,15] +func ListRemoveByValueRelativeRankRangeOp(binName string, returnType ListReturnType, value interface{}, rank int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByValueRelativeRankRangeCountOp creates a list remove by value relative to rank range operation. +// Server removes list items nearest to value and greater by relative rank with a count limit. +// Server returns removed data specified by returnType. +// Examples for ordered list [0,4,5,9,11,15]: +// +// (value,rank,count) = [removed items] +// (5,0,2) = [5,9] +// (5,1,1) = [9] +// (5,-1,2) = [4,5] +// (3,0,1) = [4] +// (3,3,7) = [11,15] +// (3,-3,2) = [] +func ListRemoveByValueRelativeRankRangeCountOp(binName string, returnType ListReturnType, value interface{}, rank, count int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListRemoveRangeOp creates a list remove range operation. +// Server removes "count" items starting at specified index from list bin. +// Server returns number of items removed. +func ListRemoveRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { + if count == 1 { + return ListRemoveOp(binName, index) + } + + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListRemoveRangeFromOp creates a list remove range operation. +// Server removes all items starting at specified index to the end of list. +// Server returns number of items removed. +func ListRemoveRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListSetOp creates a list set operation. +// Server sets item value at specified index in list bin. +// Server does not return a result by default. +func ListSetOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET, IntegerValue(index), NewValue(value)}, encoder: listGenericOpEncoder} +} + +// ListSetWithPolicyOp creates a list set operation using a ListPolicy. +// Server sets item value at specified index in list bin. +// Server does not return a result by default. +func ListSetWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET, IntegerValue(index), NewValue(value), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} +} + +// ListTrimOp creates a list trim operation. +// Server removes items in list bin that do not fall into range specified by index +// and count range. If the range is out of bounds, then all items will be removed. +// Server returns number of elements that were removed. +func ListTrimOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_TRIM, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListClearOp creates a list clear operation. +// Server removes all items in list bin. +// Server does not return a result by default. +func ListClearOp(binName string, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_CLEAR}, encoder: listGenericOpEncoder} +} + +// ListIncrementOp creates a list increment operation. +// Server increments list[index] by value. +// Value should be integer(IntegerValue, LongValue) or float(FloatValue). +// Server returns list[index] after incrementing. +func ListIncrementOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { + val := NewValue(value) + switch val.(type) { + case LongValue, IntegerValue, FloatValue: + default: + panic("Increment operation only accepts Integer or Float values") + } + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), NewValue(value)}, encoder: listGenericOpEncoder} +} + +// ListIncrementByOneOp creates list increment operation with policy. +// Server increments list[index] by 1. +// Server returns list[index] after incrementing. +func ListIncrementByOneOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListIncrementByOneWithPolicyOp creates list increment operation with policy. +// Server increments list[index] by 1. +// Server returns list[index] after incrementing. +func ListIncrementByOneWithPolicyOp(policy *ListPolicy, binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), IntegerValue(1), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} +} + +// ListIncrementWithPolicyOp creates a list increment operation. +// Server increments list[index] by value. +// Server returns list[index] after incrementing. +func ListIncrementWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { + val := NewValue(value) + switch val.(type) { + case LongValue, IntegerValue, FloatValue: + default: + panic("Increment operation only accepts Integer or Float values") + } + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), NewValue(value), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} +} + +// ListSizeOp creates a list size operation. +// Server returns size of list on bin name. +func ListSizeOp(binName string, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SIZE}, encoder: listGenericOpEncoder} +} + +// ListGetOp creates a list get operation. +// Server returns item at specified index in list bin. +func ListGetOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListGetRangeOp creates a list get range operation. +// Server returns "count" items starting at specified index in list bin. +func ListGetRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListGetRangeFromOp creates a list get range operation. +// Server returns items starting at specified index to the end of list. +func ListGetRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListSortOp creates list sort operation. +// Server sorts list according to sortFlags. +// Server does not return a result by default. +func ListSortOp(binName string, sortFlags ListSortFlags, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SORT, IntegerValue(sortFlags)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByIndexOp creates a list remove operation. +// Server removes list item identified by index and returns removed data specified by returnType. +func ListRemoveByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByIndexRangeOp creates a list remove operation. +// Server removes list items starting at specified index to the end of list and returns removed +// data specified by returnType. +func ListRemoveByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByIndexRangeCountOp creates a list remove operation. +// Server removes "count" list items starting at specified index and returns removed data specified by returnType. +func ListRemoveByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByRankOp creates a list remove operation. +// Server removes list item identified by rank and returns removed data specified by returnType. +func ListRemoveByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByRankRangeOp creates a list remove operation. +// Server removes list items starting at specified rank to the last ranked item and returns removed +// data specified by returnType. +func ListRemoveByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListRemoveByRankRangeCountOp creates a list remove operation. +// Server removes "count" list items starting at specified rank and returns removed data specified by returnType. +func ListRemoveByRankRangeCountOp(binName string, rank int, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListGetByValueOp creates a list get by value operation. +// Server selects list items identified by value and returns selected data specified by returnType. +func ListGetByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE, IntegerValue(returnType), NewValue(value)}, encoder: listGenericOpEncoder} +} + +// ListGetByValueListOp creates list get by value list operation. +// Server selects list items identified by values and returns selected data specified by returnType. +func ListGetByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_LIST, IntegerValue(returnType), ListValue(values)}, encoder: listGenericOpEncoder} +} + +// ListGetByValueRangeOp creates a list get by value range operation. +// Server selects list items identified by value range (valueBegin inclusive, valueEnd exclusive) +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// Server returns selected data specified by returnType. +func ListGetByValueRangeOp(binName string, beginValue, endValue interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { + if endValue == nil { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(beginValue)}, encoder: listGenericOpEncoder} + } + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(beginValue), NewValue(endValue)}, encoder: listGenericOpEncoder} +} + +// ListGetByIndexOp creates list get by index operation. +// Server selects list item identified by index and returns selected data specified by returnType +func ListGetByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListGetByIndexRangeOp creates list get by index range operation. +// Server selects list items starting at specified index to the end of list and returns selected +// data specified by returnType. +func ListGetByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} +} + +// ListGetByIndexRangeCountOp creates list get by index range operation. +// Server selects "count" list items starting at specified index and returns selected data specified +// by returnType. +func ListGetByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index), count}, encoder: listGenericOpEncoder} +} + +// ListGetByRankOp creates a list get by rank operation. +// Server selects list item identified by rank and returns selected data specified by returnType. +func ListGetByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListGetByRankRangeOp creates a list get by rank range operation. +// Server selects list items starting at specified rank to the last ranked item and returns selected +// data specified by returnType. +func ListGetByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListGetByRankRangeCountOp creates a list get by rank range operation. +// Server selects "count" list items starting at specified rank and returns selected data specified by returnType. +func ListGetByRankRangeCountOp(binName string, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} +} + +// ListGetByValueRelativeRankRangeOp creates a list get by value relative to rank range operation. +// Server selects list items nearest to value and greater by relative rank. +// Server returns selected data specified by returnType. +// +// Examples for ordered list [0,4,5,9,11,15]: +// +// (value,rank) = [selected items] +// (5,0) = [5,9,11,15] +// (5,1) = [9,11,15] +// (5,-1) = [4,5,9,11,15] +// (3,0) = [4,5,9,11,15] +// (3,3) = [11,15] +// (3,-3) = [0,4,5,9,11,15] +func ListGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank)}, encoder: listGenericOpEncoder} +} + +// ListGetByValueRelativeRankRangeCountOp creates a list get by value relative to rank range operation. +// Server selects list items nearest to value and greater by relative rank with a count limit. +// Server returns selected data specified by returnType. +// +// Examples for ordered list [0,4,5,9,11,15]: +// +// (value,rank,count) = [selected items] +// (5,0,2) = [5,9] +// (5,1,1) = [9] +// (5,-1,2) = [4,5] +// (3,0,1) = [4] +// (3,3,7) = [11,15] +// (3,-3,2) = [] +func ListGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { + return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go new file mode 100644 index 00000000..8a9a1611 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go @@ -0,0 +1,816 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "errors" + "math" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var _ = gg.Describe("CDT List Test", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var cdtBinName string + var list []interface{} + + gg.BeforeEach(func() { + + if !featureEnabled("cdt-list") { + gg.Skip("CDT List Tests will not run since feature is not supported by the server.") + return + } + + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtBinName = randString(10) + }) + + gg.It("should create a valid CDT List", func() { + cdtList, err := client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) + gm.Expect(cdtList).To(gm.BeNil()) + + list := []interface{}{} + for i := 1; i <= 100; i++ { + list = append(list, i) + + sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + + sz, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + } + + sz, err := client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 100)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(list)) + + sz, err = client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, list...)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(100 * 2)) + }) + + gg.It("should create a valid CDT List with persisted index", func() { + cdtBinName := "indexedList" + cdtList, err := client.Operate(wpolicy, key, + as.ListCreateWithIndexOp(cdtBinName, as.ListOrderOrdered, false), + as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 1, 2, 3, 4), + as.GetBinOp(cdtBinName), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtList).ToNot(gm.BeNil()) + gm.Expect(cdtList.Bins).ToNot(gm.BeNil()) + gm.Expect(cdtList.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, []interface{}{1, 2, 3, 4}})) + }) + + gg.Describe("CDT List Operations", func() { + + const listSize = 10 + + // make a fresh list before each operation + gg.BeforeEach(func() { + _, err = client.Delete(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + list = []interface{}{} + + for i := 1; i <= listSize; i++ { + list = append(list, i) + + sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + } + }) + + gg.It("should Get the last element", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) + }) + + gg.It("should Get the last element again", func() { + ops := []*as.Operation{as.ListGetOp(cdtBinName, -1)} + cdtListRes, err := client.Operate(wpolicy, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) + + cdtListRes, err = client.Operate(wpolicy, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) + }) + + gg.It("should Get the last 3 element", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, -3, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) + }) + + gg.It("should Get the from element #7 till the end of list", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) + }) + + gg.It("should Get by value", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByValueOp(cdtBinName, 7, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueListOp(cdtBinName, []interface{}{7, 9}, as.ListReturnTypeIndex)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 8})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeIndex)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, 5, 6, 7})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeExists)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(true)) + }) + + gg.It("should Get by index", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByIndexOp(cdtBinName, 7, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(8)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) + }) + + gg.It("should Get by rank", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByRankOp(cdtBinName, 7, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(8)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) + }) + + gg.It("should append an element to the tail", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, math.MaxInt64)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) + }) + + gg.It("should append the same cached element to the tail", func() { + ops := []*as.Operation{as.ListAppendOp(cdtBinName, math.MaxInt64)} + cdtListRes, err := client.Operate(wpolicy, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) + + cdtListRes, err = client.Operate(wpolicy, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 2)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) + }) + + gg.It("should append a few elements to the tail", func() { + elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, elems...)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, listSize, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) + }) + + gg.It("should append a few elements to the tail with policy", func() { + elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, elems...)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 4)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, listSize, 4)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + elems = append(elems, 0) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) + }) + + gg.It("should prepend an element to the head via ListInsertOp", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertOp(cdtBinName, 0, math.MaxInt64)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) + }) + + gg.It("should prepend an element to the head via ListInsertWithPolicyOp", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, math.MaxInt64)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListInsertWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, math.MaxInt64-1, math.MaxInt64-2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{math.MaxInt64 - 1, math.MaxInt64 - 2, math.MaxInt64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) + }) + + gg.It("should prepend a few elements to the tail via ListInsertOp", func() { + elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} + cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertOp(cdtBinName, 0, elems...)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) + }) + + gg.It("should pop elements from the head", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListPopRangeOp(cdtBinName, 0, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:3])) + + cdtListRes, err = client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[3:])) + }) + + gg.It("should pop element range from the index", func() { + for i := listSize; i > 0; i-- { + cdtListRes, err := client.Operate(wpolicy, key, as.ListPopOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[0])) + + list = list[1:] + + // TODO: Remove the IF later when server has changed + if i > 1 { + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + } + } + }) + + gg.It("should pop elements from element #7 to the end of list", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + + cdtPopRes, err := client.Operate(wpolicy, key, as.ListPopRangeFromOp(cdtBinName, 7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtPopRes.Bins[cdtBinName]).To(gm.Equal(list[7:])) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:7])) + + }) + + gg.It("should remove elements from the head", func() { + for i := listSize; i > 0; i-- { + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + list = list[1:] + + // TODO: Remove the IF later when server has changed + if i > 1 { + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + } + } + }) + + gg.It("should remove elements from element #7 to the end of list", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + + cdtRemoveRes, err := client.Operate(wpolicy, key, as.ListRemoveRangeFromOp(cdtBinName, 7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtRemoveRes.Bins[cdtBinName]).To(gm.Equal(3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:7])) + + }) + + gg.It("should remove elements from the head in increasing numbers", func() { + elemCount := listSize + for i := 1; i <= 4; i++ { + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveRangeOp(cdtBinName, 0, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(i)) + + list = list[i:] + elemCount -= i + + // TODO: Remove the IF later when server has changed + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, elemCount)) + if elemCount > 0 { + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + } + } + }) + + gg.It("should remove elements by value", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueListOp(cdtBinName, []interface{}{1, 2, 3, 4, 5, 6, 7}, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4, 5, 6, 7})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueOp(cdtBinName, 9, as.ListReturnTypeCount)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 10})) + }) + + gg.It("should remove elements by value range", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeValue, 1, 5)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeCount, 6, 9)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 9, 10})) + }) + + gg.It("should remove elements by index", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByIndexOp(cdtBinName, 0, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(4)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) + }) + + gg.It("should remove elements by rank", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListSortOp(cdtBinName, as.ListSortFlagsDefault)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankOp(cdtBinName, 0, as.ListReturnTypeValue)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(4)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) + }) + + gg.It("should increment elements", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + + elemRes, err := client.Operate(wpolicy, key, as.ListIncrementOp(cdtBinName, 0, 10)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) + + elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) + + elemRes, err = client.Operate(wpolicy, key, as.ListIncrementByOneOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) + + elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) + }) + + gg.It("should increment elements with policy", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) + + elemRes, err := client.Operate(wpolicy, key, as.ListIncrementWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, 10)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) + + elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) + + elemRes, err = client.Operate(wpolicy, key, as.ListIncrementByOneWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) + + elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) + }) + + gg.It("should sort elements with policy", func() { + elemRes, err := client.Operate(wpolicy, key, as.ListIncrementWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, 100)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(101)) + + cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{101, 2, 3, 4, 5, 6, 7, 8, 9, 10})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListSortOp(cdtBinName, as.ListSortFlagsDefault)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10, 101})) + }) + + gg.It("should set elements", func() { + elems := []interface{}{} + for i := 0; i < listSize; i++ { + cdtListRes, err := client.Operate(wpolicy, key, as.ListSetOp(cdtBinName, i, math.MaxInt64)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins).To(gm.Equal(as.BinMap{})) + + elems = append(elems, math.MaxInt64) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i+1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) + } + }) + + gg.It("should set the last element", func() { + cdtListRes, err := client.Operate(wpolicy, key, as.ListSetOp(cdtBinName, -1, math.MaxInt64)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins).To(gm.Equal(as.BinMap{})) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, -1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) + }) + + gg.It("should trim list elements", func() { + elems := []interface{}{3, 4, 5} + cdtListRes, err := client.Operate(wpolicy, key, as.ListTrimOp(cdtBinName, 2, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(7)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 3)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) + }) + + gg.It("should clear list elements", func() { + for i := 0; i < listSize; i++ { + _, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + cdtListRes, err := client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).NotTo(gm.Equal(0)) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListClearOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.BeNil()) + + cdtListRes, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(0)) + }) + + gg.It("should support ListWriteFlagsPartial & ListWriteFlagsNoFail", func() { + client.Delete(nil, key) + + cdtBinName2 := cdtBinName + "2" + + list := []interface{}{0, 4, 5, 9, 9, 11, 15, 0} + + cdtListPolicy1 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsPartial|as.ListWriteFlagsNoFail) + cdtListPolicy2 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsNoFail) + record, err := client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy1, cdtBinName, list...), + as.ListAppendWithPolicyOp(cdtListPolicy2, cdtBinName2, list...), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(6)) + gm.Expect(record.Bins[cdtBinName2]).To(gm.Equal(0)) + + list = []interface{}{11, 3} + + record, err = client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy1, cdtBinName, list...), + as.ListAppendWithPolicyOp(cdtListPolicy2, cdtBinName2, list...), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(7)) + gm.Expect(record.Bins[cdtBinName2]).To(gm.Equal(2)) + + }) + + gg.It("should support Relative GetList Ops", func() { + client.Delete(nil, key) + + list := []interface{}{0, 4, 5, 9, 11, 15} + + cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) + record, err := client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, 0, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, 1, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, -1, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, 0, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, 3, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, -3, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, 0, 2, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, 1, 1, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, -1, 2, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, 0, 1, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, 3, 7, as.ListReturnTypeValue), + as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, -3, 2, as.ListReturnTypeValue), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{11, 15}, []interface{}{0, 4, 5, 9, 11, 15}, []interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5}, []interface{}{4}, []interface{}{11, 15}, []interface{}{}})) + }) + + gg.It("should support Relative RemoveList Ops", func() { + client.Delete(nil, key) + + list := []interface{}{0, 4, 5, 9, 11, 15} + + cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) + record, err := client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), + as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, 0), + as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, 1), + as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, -1), + as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 1), + as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 2), + as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 3), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{}, []interface{}{4}, []interface{}{}, []interface{}{}, []interface{}{0}})) + }) + + gg.It("should support List Infinity Ops", func() { + client.Delete(nil, key) + + list := []interface{}{0, 4, 5, 9, 11, 15} + + cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) + record, err := client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), + as.ListGetByValueRangeOp(cdtBinName, 10, as.NewInfinityValue(), as.ListReturnTypeValue), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{11, 15}})) + }) + + gg.It("should support List WildCard Ops", func() { + client.Delete(nil, key) + + list := []interface{}{ + []interface{}{"John", 55}, + []interface{}{"Jim", 95}, + []interface{}{"Joe", 80}, + } + + cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) + record, err := client.Operate(wpolicy, key, + as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), + as.ListGetByValueOp(cdtBinName, []interface{}{"Jim", as.NewWildCardValue()}, as.ListReturnTypeValue), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, []interface{}{[]interface{}{"Jim", 95}}})) + }) + + gg.It("should support Nested List Ops", func() { + client.Delete(nil, key) + + list := []interface{}{ + []interface{}{7, 9, 5}, + []interface{}{1, 2, 3}, + []interface{}{6, 5, 4, 1}, + } + + err := client.Put(wpolicy, key, as.BinMap{cdtBinName: list}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(list)) + + record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxListIndex(-1)}, 11), as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + 5, + []interface{}{ + []interface{}{7, 9, 5}, + []interface{}{1, 2, 3}, + []interface{}{6, 5, 4, 1, 11}, + }, + })) + }) + + gg.It("should support Nested List Map Ops", func() { + client.Delete(nil, key) + + m := map[interface{}]interface{}{ + "key1": []interface{}{ + []interface{}{7, 9, 5}, + []interface{}{13}, + }, + "key2": []interface{}{ + []interface{}{9}, + []interface{}{2, 4}, + []interface{}{6, 1, 9}, + }, + } + + err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) + + record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxMapKey(as.StringValue("key2")), as.CtxListRank(0)}, 11), as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + 3, + map[interface{}]interface{}{ + "key1": []interface{}{ + []interface{}{7, 9, 5}, + []interface{}{13}, + }, + "key2": []interface{}{ + []interface{}{9}, + []interface{}{2, 4, 11}, + []interface{}{6, 1, 9}, + }, + }})) + }) + + gg.It("should support Create List Ops", func() { + client.Delete(nil, key) + + l1 := []as.Value{as.IntegerValue(7), as.IntegerValue(9), as.IntegerValue(5)} + l2 := []as.Value{as.IntegerValue(1), as.IntegerValue(2), as.IntegerValue(3)} + l3 := []as.Value{as.IntegerValue(6), as.IntegerValue(5), as.IntegerValue(4), as.IntegerValue(1)} + inputList := []interface{}{as.ValueArray(l1), as.ValueArray(l2), as.ValueArray(l3)} + + // Create list. + record, err := client.Operate(nil, key, + as.ListAppendWithPolicyOp(as.NewListPolicy(as.ListOrderOrdered, 0), cdtBinName, inputList...), + as.GetBinOp(cdtBinName), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Append value to new list created after the original 3 lists. + record, err = client.Operate(nil, key, + as.ListAppendWithPolicyContextOp(as.NewListPolicy(as.ListOrderOrdered, 0), cdtBinName, []*as.CDTContext{as.CtxListIndexCreate(3, as.ListOrderOrdered, false)}, as.IntegerValue(2)), + as.GetBinOp(cdtBinName), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + results := record.Bins[cdtBinName].([]interface{}) + + count := results[0] + gm.Expect(count).To(gm.Equal(1)) + + list := results[1].([]interface{}) + gm.Expect(len(list)).To(gm.Equal(4)) + + // Test last nested list. + list = list[1].([]interface{}) + gm.Expect(len(list)).To(gm.Equal(1)) + gm.Expect(list[0]).To(gm.Equal(2)) + }) + + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_map.go b/aerospike-tls/vendor-aerospike-client-go/cdt_map.go new file mode 100644 index 00000000..5e3c84c4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_map.go @@ -0,0 +1,753 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +// Unique key map bin operations. Create map operations used by the client operate command. +// The default unique key map is unordered. +// +// The default unique key map is unordered. Valid map key types are: +// String +// Integer +// []byte +// +// The server will validate map key types in an upcoming release. +// +// All maps maintain an index and a rank. The index is the item offset from the start of the map, +// for both unordered and ordered maps. The rank is the sorted index of the value component. +// Map supports negative indexing for index and rank. +// +// Index examples: +// +// Index 0: First item in map. +// Index 4: Fifth item in map. +// Index -1: Last item in map. +// Index -3: Third to last item in map. +// Index 1 Count 2: Second and third items in map. +// Index -3 Count 3: Last three items in map. +// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. +// +// +// Rank examples: +// +// Rank 0: Item with lowest value rank in map. +// Rank 4: Fifth lowest ranked item in map. +// Rank -1: Item with highest ranked value in map. +// Rank -3: Item with third highest ranked value in map. +// Rank 1 Count 2: Second and third lowest ranked items in map. +// Rank -3 Count 3: Top three ranked items in map. +// +// +// Nested CDT operations are supported by optional CTX context arguments. Examples: +// +// bin = {key1:{key11:9,key12:4}, key2:{key21:3,key22:5}} +// Set map value to 11 for map key "key21" inside of map key "key2". +// MapOperation.put(MapPolicy.Default, "bin", StringValue("key21"), IntegerValue(11), CtxMapKey(StringValue("key2"))) +// bin result = {key1:{key11:9,key12:4},key2:{key21:11,key22:5}} +// +// bin : {key1:{key11:{key111:1},key12:{key121:5}}, key2:{key21:{"key211":7}}} +// Set map value to 11 in map key "key121" for highest ranked map ("key12") inside of map key "key1". +// MapPutOp(DefaultMapPolicy(), "bin", StringValue("key121"), IntegerValue(11), CtxMapKey(StringValue("key1")), CtxMapRank(-1)) +// bin result = {key1:{key11:{key111:1},key12:{key121:11}}, key2:{key21:{"key211":7}}} + +const ( + cdtMapOpTypeSetType = 64 + cdtMapOpTypeAdd = 65 + cdtMapOpTypeAddItems = 66 + cdtMapOpTypePut = 67 + cdtMapOpTypePutItems = 68 + cdtMapOpTypeReplace = 69 + cdtMapOpTypeReplaceItems = 70 + cdtMapOpTypeIncrement = 73 + cdtMapOpTypeDecrement = 74 + cdtMapOpTypeClear = 75 + cdtMapOpTypeRemoveByKey = 76 + cdtMapOpTypeRemoveByIndex = 77 + cdtMapOpTypeRemoveByRank = 79 + cdtMapOpTypeRemoveKeyList = 81 + cdtMapOpTypeRemoveByValue = 82 + cdtMapOpTypeRemoveValueList = 83 + cdtMapOpTypeRemoveByKeyInterval = 84 + cdtMapOpTypeRemoveByIndexRange = 85 + cdtMapOpTypeRemoveByValueInterval = 86 + cdtMapOpTypeRemoveByRankRange = 87 + cdtMapOpTypeRemoveByKeyRelIndexRange = 88 + cdtMapOpTypeRemoveByValueRelRankRange = 89 + cdtMapOpTypeSize = 96 + cdtMapOpTypeGetByKey = 97 + cdtMapOpTypeGetByIndex = 98 + cdtMapOpTypeGetByRank = 100 + cdtMapOpTypeGetByValue = 102 + cdtMapOpTypeGetByKeyInterval = 103 + cdtMapOpTypeGetByIndexRange = 104 + cdtMapOpTypeGetByValueInterval = 105 + cdtMapOpTypeGetByRankRange = 106 + cdtMapOpTypeGetByKeyList = 107 + cdtMapOpTypeGetByValueList = 108 + cdtMapOpTypeGetByKeyRelIndexRange = 109 + cdtMapOpTypeGetByValueRelRankRange = 110 +) + +type mapOrderType struct { + attr int + flag int +} + +// MapOrder defines map storage order. +var MapOrder = struct { + // Map is not ordered. This is the default. + UNORDERED mapOrderType // 0 + + // Order map by key. + KEY_ORDERED mapOrderType // 1 + + // Order map by key, then value. + KEY_VALUE_ORDERED mapOrderType // 3 +}{mapOrderType{0, 0x40}, mapOrderType{1, 0x80}, mapOrderType{3, 0xc0}} + +type mapReturnType int + +// MapReturnTypes exports the type of individual MapReturnType values +type MapReturnTypes = mapReturnType + +// MapOrderTypes exports the type of individual MapOrderType values +type MapOrderTypes = mapOrderType + +// MapWriteModes exports the type of individual MapWriteMode values +type MapWriteModes = mapWriteMode + +// MapReturnType defines the map return type. +// Type of data to return when selecting or removing items from the map. +var MapReturnType = struct { + // NONE will will not return a result. + NONE mapReturnType + + // INDEX will return key index order. + // + // 0 = first key + // N = Nth key + // -1 = last key + INDEX mapReturnType + + // REVERSE_INDEX will return reverse key order. + // + // 0 = last key + // -1 = first key + REVERSE_INDEX mapReturnType + + // RANK will return value order. + // + // 0 = smallest value + // N = Nth smallest value + // -1 = largest value + RANK mapReturnType + + // REVERSE_RANK will return reverse value order. + // + // 0 = largest value + // N = Nth largest value + // -1 = smallest value + REVERSE_RANK mapReturnType + + // COUNT will return count of items selected. + COUNT mapReturnType + + // KEY will return key for single key read and key list for range read. + KEY mapReturnType + + // VALUE will return value for single key read and value list for range read. + VALUE mapReturnType + + // KEY_VALUE will return key/value items. The possible return types are: + // + // map[interface{}]interface{} : Returned for unordered maps + // []MapPair : Returned for range results where range order needs to be preserved. + KEY_VALUE mapReturnType + + // EXISTS returns true if count > 0. + EXISTS mapReturnType + + // UNORDERED_MAP returns an unordered map. + UNORDERED_MAP mapReturnType + + // ORDERED_MAP returns an ordered map. + ORDERED_MAP mapReturnType + + // INVERTED will invert meaning of map command and return values. For example: + // MapRemoveByKeyRange(binName, keyBegin, keyEnd, MapReturnType.KEY | MapReturnType.INVERTED) + // With the INVERTED flag enabled, the keys outside of the specified key range will be removed and returned. + INVERTED mapReturnType +}{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 16, 17, 0x10000, +} + +// Unique key map write type. +type mapWriteMode struct { + itemCommand int + itemsCommand int +} + +// MapWriteMode should only be used for server versions < 4.3. +// MapWriteFlags are recommended for server versions >= 4.3. +var MapWriteMode = struct { + // If the key already exists, the item will be overwritten. + // If the key does not exist, a new item will be created. + UPDATE *mapWriteMode + + // If the key already exists, the item will be overwritten. + // If the key does not exist, the write will fail. + UPDATE_ONLY *mapWriteMode + + // If the key already exists, the write will fail. + // If the key does not exist, a new item will be created. + CREATE_ONLY *mapWriteMode +}{ + &mapWriteMode{cdtMapOpTypePut, cdtMapOpTypePutItems}, + &mapWriteMode{cdtMapOpTypeReplace, cdtMapOpTypeReplaceItems}, + &mapWriteMode{cdtMapOpTypeAdd, cdtMapOpTypeAddItems}, +} + +/** + * Map write bit flags. + * Requires server versions >= 4.3. + */ +const ( + // MapWriteFlagsDefault is the Default. Allow create or update. + MapWriteFlagsDefault = 0 + + // MapWriteFlagsCreateOnly means: If the key already exists, the item will be denied. + // If the key does not exist, a new item will be created. + MapWriteFlagsCreateOnly = 1 + + // MapWriteFlagsUpdateOnly means: If the key already exists, the item will be overwritten. + // If the key does not exist, the item will be denied. + MapWriteFlagsUpdateOnly = 2 + + // MapWriteFlagsNoFail means: Do not raise error if a map item is denied due to write flag constraints. + MapWriteFlagsNoFail = 4 + + // MapWriteFlagsPartial means: Allow other valid map items to be committed if a map item is denied due to + // write flag constraints. + MapWriteFlagsPartial = 8 +) + +// MapPolicy directives when creating a map and writing map items. +type MapPolicy struct { + attributes mapOrderType + flags int + itemCommand int + itemsCommand int +} + +// NewMapPolicy creates a MapPolicy with WriteMode. Use with servers before v4.3. +func NewMapPolicy(order mapOrderType, writeMode *mapWriteMode) *MapPolicy { + return &MapPolicy{ + attributes: order, + flags: MapWriteFlagsDefault, + itemCommand: writeMode.itemCommand, + itemsCommand: writeMode.itemsCommand, + } +} + +// NewMapPolicyWithFlags creates a MapPolicy with WriteFlags. Use with servers v4.3+. +// Flags are MapWriteFlags. You can specify multiple flags by 'or'ing them together. +func NewMapPolicyWithFlags(order mapOrderType, flags int) *MapPolicy { + return &MapPolicy{ + attributes: order, + flags: flags, + itemCommand: MapWriteMode.UPDATE.itemCommand, + itemsCommand: MapWriteMode.UPDATE.itemsCommand, + } +} + +// NewMapPolicyWithFlagsAndPersistedIndex creates a MapPolicy with WriteFlags that persists +// the map index. A map index improves lookup performance, but requires more storage. A map +// index can be created for a top-level ordered map only. Nested and unordered map indexes +// are not supported. +// Use with servers v7+. +// Flags are MapWriteFlags. You can specify multiple flags by 'or'ing them together. +func NewMapPolicyWithFlagsAndPersistedIndex(order mapOrderType, flags int) *MapPolicy { + // set the persistIndex flag + order.attr |= 0x10 + return &MapPolicy{ + attributes: order, + flags: flags, + itemCommand: MapWriteMode.UPDATE.itemCommand, + itemsCommand: MapWriteMode.UPDATE.itemsCommand, + } +} + +// DefaultMapPolicy returns the default map policy +func DefaultMapPolicy() *MapPolicy { + return NewMapPolicy(MapOrder.UNORDERED, MapWriteMode.UPDATE) +} + +func newMapSetPolicyEncoder(op *Operation, packer BufferEx) (int, Error) { + return packCDTParamsAsArray(packer, cdtMapOpTypeSetType, op.ctx, op.binValue.(IntegerValue)) +} + +func newMapSetPolicy(binName string, attributes mapOrderType, ctx []*CDTContext) *Operation { + // Remove persistIndex flag for nested maps. + if len(ctx) > 0 && (attributes.attr&0x10) != 0 { + attributes.attr &= ^0x10 + } + + return &Operation{ + opType: _MAP_MODIFY, + binName: binName, + binValue: IntegerValue(attributes.attr), + ctx: ctx, + encoder: newMapSetPolicyEncoder, + } +} + +func newMapCreatePutEncoder(op *Operation, packer BufferEx) (int, Error) { + return packCDTIfcParamsAsArray(packer, int16(*op.opSubType), op.ctx, op.binValue.(ListValue)) +} + +///////////////////////// + +// MapCreateOp creates a map create operation. +// Server creates map at given context level. +func MapCreateOp(binName string, order mapOrderType, ctx []*CDTContext) *Operation { + // If context not defined, the set order for top-level bin map. + if len(ctx) == 0 { + return MapSetPolicyOp(NewMapPolicyWithFlags(order, 0), binName) + } + + return &Operation{ + opType: _MAP_MODIFY, + binName: binName, + binValue: ListValue([]interface{}{cdtMapOpTypeSetType, order.flag, IntegerValue(order.attr)}), + ctx: ctx, + encoder: cdtCreateOpEncoder, + } +} + +// MapCreateWithIndexOp creates a map create operation that persists its index. +// Server creates map at given context level. +// A map index improves lookup performance but requires more storage. +// A map index can be created for a top-level ordered map only. +// Nested and unordered map indexes are not supported. +func MapCreateWithIndexOp(binName string, order mapOrderType) *Operation { + // If context not defined, the set order for top-level bin map. + // set index persistence flag + order.attr |= 0x10 + return MapSetPolicyOp(NewMapPolicyWithFlags(order, 0), binName) +} + +// MapSetPolicyOp creates set map policy operation. +// Server sets map policy attributes. Server returns nil. +// +// The required map policy attributes can be changed after the map is created. +func MapSetPolicyOp(policy *MapPolicy, binName string, ctx ...*CDTContext) *Operation { + return newMapSetPolicy(binName, policy.attributes, ctx) +} + +// MapPutOp creates map put operation. +// Server writes key/value item to map bin and returns map size. +// +// The required map policy dictates the type of map to create when it does not exist. +// The map policy also specifies the mode used when writing items to the map. +func MapPutOp(policy *MapPolicy, binName string, key interface{}, value interface{}, ctx ...*CDTContext) *Operation { + if policy.flags != 0 { + ops := cdtMapOpTypePut + + // Replace doesn't allow map attributes because it does not create on non-existing key. + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &ops, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{key, value, IntegerValue(policy.attributes.attr), IntegerValue(policy.flags)}), + encoder: newMapCreatePutEncoder, + } + } + + if policy.itemCommand == cdtMapOpTypeReplace { + // Replace doesn't allow map attributes because it does not create on non-existing key. + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &policy.itemCommand, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{key, value}), + encoder: newMapCreatePutEncoder, + } + } + + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &policy.itemCommand, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{key, value, IntegerValue(policy.attributes.attr)}), + encoder: newMapCreatePutEncoder, + } +} + +// MapPutItemsOp creates map put items operation +// Server writes each map item to map bin and returns map size. +// +// The required map policy dictates the type of map to create when it does not exist. +// The map policy also specifies the mode used when writing items to the map. +func MapPutItemsOp(policy *MapPolicy, binName string, amap map[interface{}]interface{}, ctx ...*CDTContext) *Operation { + if policy.flags != 0 { + ops := cdtMapOpTypePutItems + + // Replace doesn't allow map attributes because it does not create on non-existing key. + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &ops, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{amap, IntegerValue(policy.attributes.attr), IntegerValue(policy.flags)}), + encoder: newCDTCreateOperationEncoder, + } + } + + if policy.itemsCommand == int(cdtMapOpTypeReplaceItems) { + // Replace doesn't allow map attributes because it does not create on non-existing key. + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &policy.itemsCommand, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{MapValue(amap)}), + encoder: newCDTCreateOperationEncoder, + } + } + + return &Operation{ + opType: _MAP_MODIFY, + opSubType: &policy.itemsCommand, + ctx: ctx, + binName: binName, + binValue: ListValue([]interface{}{MapValue(amap), IntegerValue(policy.attributes.attr)}), + encoder: newCDTCreateOperationEncoder, + } +} + +// MapIncrementOp creates map increment operation. +// Server increments values by incr for all items identified by key and returns final result. +// Valid only for numbers. +// +// The required map policy dictates the type of map to create when it does not exist. +// The map policy also specifies the mode used when writing items to the map. +func MapIncrementOp(policy *MapPolicy, binName string, key interface{}, incr interface{}, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValues2(cdtMapOpTypeIncrement, policy.attributes, binName, ctx, key, incr) +} + +// MapDecrementOp creates map decrement operation. +// Server decrements values by decr for all items identified by key and returns final result. +// Valid only for numbers. +// +// The required map policy dictates the type of map to create when it does not exist. +// The map policy also specifies the mode used when writing items to the map. +func MapDecrementOp(policy *MapPolicy, binName string, key interface{}, decr interface{}, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValues2(cdtMapOpTypeDecrement, policy.attributes, binName, ctx, key, decr) +} + +// MapClearOp creates map clear operation. +// Server removes all items in map. Server returns nil. +func MapClearOp(binName string, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValues0(cdtMapOpTypeClear, _MAP_MODIFY, binName, ctx) +} + +// MapRemoveByKeyOp creates map remove operation. +// Server removes map item identified by key and returns removed data specified by returnType. +func MapRemoveByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByKey, _MAP_MODIFY, binName, ctx, key, returnType) +} + +// MapRemoveByKeyListOp creates map remove operation. +// Server removes map items identified by keys and returns removed data specified by returnType. +func MapRemoveByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveKeyList, _MAP_MODIFY, binName, ctx, keys, returnType) +} + +// MapRemoveByKeyRangeOp creates map remove operation. +// Server removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). +// If keyBegin is nil, the range is less than keyEnd. +// If keyEnd is nil, the range is greater than equal to keyBegin. +// +// Server returns removed data specified by returnType. +func MapRemoveByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByKeyInterval, _MAP_MODIFY, binName, ctx, keyBegin, keyEnd, returnType) +} + +// MapRemoveByValueOp creates map remove operation. +// Server removes map items identified by value and returns removed data specified by returnType. +func MapRemoveByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByValue, _MAP_MODIFY, binName, ctx, value, returnType) +} + +// MapRemoveByValueListOp creates map remove operation. +// Server removes map items identified by values and returns removed data specified by returnType. +func MapRemoveByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValuesN(cdtMapOpTypeRemoveValueList, _MAP_MODIFY, binName, ctx, values, returnType) +} + +// MapRemoveByValueRangeOp creates map remove operation. +// Server removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// +// Server returns removed data specified by returnType. +func MapRemoveByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByValueInterval, _MAP_MODIFY, binName, ctx, valueBegin, valueEnd, returnType) +} + +// MapRemoveByValueRelativeRankRangeOp creates a map remove by value relative to rank range operation. +// Server removes map items nearest to value and greater by relative rank. +// Server returns removed data specified by returnType. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// (value,rank) = [removed items] +// (11,1) = [{0=17}] +// (11,-1) = [{9=10},{5=15},{0=17}] +func MapRemoveByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByValueRelRankRange, _MAP_MODIFY, binName, ctx, value, rank, returnType) +} + +// MapRemoveByValueRelativeRankRangeCountOp creates a map remove by value relative to rank range operation. +// Server removes map items nearest to value and greater by relative rank with a count limit. +// Server returns removed data specified by returnType (See MapReturnType). +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// (value,rank,count) = [removed items] +// (11,1,1) = [{0=17}] +// (11,-1,1) = [{9=10}] +func MapRemoveByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeRemoveByValueRelRankRange, _MAP_MODIFY, binName, ctx, NewValue(value), rank, count, returnType) +} + +// MapRemoveByIndexOp creates map remove operation. +// Server removes map item identified by index and returns removed data specified by returnType. +func MapRemoveByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByIndex, _MAP_MODIFY, binName, ctx, index, returnType) +} + +// MapRemoveByIndexRangeOp creates map remove operation. +// Server removes map items starting at specified index to the end of map and returns removed +// data specified by returnType. +func MapRemoveByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByIndexRange, _MAP_MODIFY, binName, ctx, index, returnType) +} + +// MapRemoveByIndexRangeCountOp creates map remove operation. +// Server removes "count" map items starting at specified index and returns removed data specified by returnType. +func MapRemoveByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationIndexCount(cdtMapOpTypeRemoveByIndexRange, _MAP_MODIFY, binName, ctx, index, count, returnType) +} + +// MapRemoveByRankOp creates map remove operation. +// Server removes map item identified by rank and returns removed data specified by returnType. +func MapRemoveByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByRank, _MAP_MODIFY, binName, ctx, rank, returnType) +} + +// MapRemoveByRankRangeOp creates map remove operation. +// Server removes map items starting at specified rank to the last ranked item and returns removed +// data specified by returnType. +func MapRemoveByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationIndex(cdtMapOpTypeRemoveByRankRange, _MAP_MODIFY, binName, ctx, rank, returnType) +} + +// MapRemoveByRankRangeCountOp creates map remove operation. +// Server removes "count" map items starting at specified rank and returns removed data specified by returnType. +func MapRemoveByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationIndexCount(cdtMapOpTypeRemoveByRankRange, _MAP_MODIFY, binName, ctx, rank, count, returnType) +} + +// MapRemoveByKeyRelativeIndexRangeOp creates a map remove by key relative to index range operation. +// Server removes map items nearest to key and greater by index. +// Server returns removed data specified by returnType. +// +// Examples for map [{0=17},{4=2},{5=15},{9=10}]: +// +// (value,index) = [removed items] +// (5,0) = [{5=15},{9=10}] +// (5,1) = [{9=10}] +// (5,-1) = [{4=2},{5=15},{9=10}] +// (3,2) = [{9=10}] +// (3,-2) = [{0=17},{4=2},{5=15},{9=10}] +func MapRemoveByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeRemoveByKeyRelIndexRange, _MAP_MODIFY, binName, ctx, NewValue(key), index, returnType) +} + +// MapRemoveByKeyRelativeIndexRangeCountOp creates map remove by key relative to index range operation. +// Server removes map items nearest to key and greater by index with a count limit. +// Server returns removed data specified by returnType. +// +// Examples for map [{0=17},{4=2},{5=15},{9=10}]: +// +// (value,index,count) = [removed items] +// (5,0,1) = [{5=15}] +// (5,1,2) = [{9=10}] +// (5,-1,1) = [{4=2}] +// (3,2,1) = [{9=10}] +// (3,-2,2) = [{0=17}] +func MapRemoveByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeRemoveByKeyRelIndexRange, _MAP_MODIFY, binName, ctx, NewValue(key), index, count, returnType) +} + +// MapSizeOp creates map size operation. +// Server returns size of map. +func MapSizeOp(binName string, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValues0(cdtMapOpTypeSize, _MAP_READ, binName, ctx) +} + +// MapGetByKeyOp creates map get by key operation. +// Server selects map item identified by key and returns selected data specified by returnType. +func MapGetByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByKey, _MAP_READ, binName, ctx, key, returnType) +} + +// MapGetByKeyRangeOp creates map get by key range operation. +// Server selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). +// If keyBegin is nil, the range is less than keyEnd. +// If keyEnd is nil, the range is greater than equal to keyBegin. +// +// Server returns selected data specified by returnType. +func MapGetByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateRangeOperation(cdtMapOpTypeGetByKeyInterval, _MAP_READ, binName, ctx, keyBegin, keyEnd, returnType) +} + +// MapGetByKeyRelativeIndexRangeOp creates a map get by key relative to index range operation. +// Server selects map items nearest to key and greater by index. +// Server returns selected data specified by returnType. +// +// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: +// +// (value,index) = [selected items] +// (5,0) = [{5=15},{9=10}] +// (5,1) = [{9=10}] +// (5,-1) = [{4=2},{5=15},{9=10}] +// (3,2) = [{9=10}] +// (3,-2) = [{0=17},{4=2},{5=15},{9=10}] +func MapGetByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeGetByKeyRelIndexRange, _MAP_READ, binName, ctx, NewValue(key), index, returnType) +} + +// MapGetByKeyRelativeIndexRangeCountOp creates a map get by key relative to index range operation. +// Server selects map items nearest to key and greater by index with a count limit. +// Server returns selected data specified by returnType (See MapReturnType). +// +// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: +// +// (value,index,count) = [selected items] +// (5,0,1) = [{5=15}] +// (5,1,2) = [{9=10}] +// (5,-1,1) = [{4=2}] +// (3,2,1) = [{9=10}] +// (3,-2,2) = [{0=17}] +func MapGetByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeGetByKeyRelIndexRange, _MAP_READ, binName, ctx, NewValue(key), index, count, returnType) +} + +// MapGetByKeyListOp creates a map get by key list operation. +// Server selects map items identified by keys and returns selected data specified by returnType. +func MapGetByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByKeyList, _MAP_READ, binName, ctx, keys, returnType) +} + +// MapGetByValueOp creates map get by value operation. +// Server selects map items identified by value and returns selected data specified by returnType. +func MapGetByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByValue, _MAP_READ, binName, ctx, value, returnType) +} + +// MapGetByValueRangeOp creates map get by value range operation. +// Server selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// +// Server returns selected data specified by returnType. +func MapGetByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateRangeOperation(cdtMapOpTypeGetByValueInterval, _MAP_READ, binName, ctx, valueBegin, valueEnd, returnType) +} + +// MapGetByValueRelativeRankRangeOp creates a map get by value relative to rank range operation. +// Server selects map items nearest to value and greater by relative rank. +// Server returns selected data specified by returnType. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// (value,rank) = [selected items] +// (11,1) = [{0=17}] +// (11,-1) = [{9=10},{5=15},{0=17}] +func MapGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeGetByValueRelRankRange, _MAP_READ, binName, ctx, NewValue(value), rank, returnType) +} + +// MapGetByValueRelativeRankRangeCountOp creates a map get by value relative to rank range operation. +// Server selects map items nearest to value and greater by relative rank with a count limit. +// Server returns selected data specified by returnType. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// (value,rank,count) = [selected items] +// (11,1,1) = [{0=17}] +// (11,-1,1) = [{9=10}] +func MapGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeGetByValueRelRankRange, _MAP_READ, binName, ctx, NewValue(value), rank, count, returnType) +} + +// MapGetByValueListOp creates map get by value list operation. +// Server selects map items identified by values and returns selected data specified by returnType. +func MapGetByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByValueList, _MAP_READ, binName, ctx, values, returnType) +} + +// MapGetByIndexOp creates map get by index operation. +// Server selects map item identified by index and returns selected data specified by returnType. +func MapGetByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByIndex, _MAP_READ, binName, ctx, index, returnType) +} + +// MapGetByIndexRangeOp creates map get by index range operation. +// Server selects map items starting at specified index to the end of map and returns selected +// data specified by returnType. +func MapGetByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByIndexRange, _MAP_READ, binName, ctx, index, returnType) +} + +// MapGetByIndexRangeCountOp creates map get by index range operation. +// Server selects "count" map items starting at specified index and returns selected data specified by returnType. +func MapGetByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationIndexCount(cdtMapOpTypeGetByIndexRange, _MAP_READ, binName, ctx, index, count, returnType) +} + +// MapGetByRankOp creates map get by rank operation. +// Server selects map item identified by rank and returns selected data specified by returnType. +func MapGetByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByRank, _MAP_READ, binName, ctx, rank, returnType) +} + +// MapGetByRankRangeOp creates map get by rank range operation. +// Server selects map items starting at specified rank to the last ranked item and returns selected +// data specified by returnType. +func MapGetByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationValue1(cdtMapOpTypeGetByRankRange, _MAP_READ, binName, ctx, rank, returnType) +} + +// MapGetByRankRangeCountOp creates map get by rank range operation. +// Server selects "count" map items starting at specified rank and returns selected data specified by returnType. +func MapGetByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { + return newCDTCreateOperationIndexCount(cdtMapOpTypeGetByRankRange, _MAP_READ, binName, ctx, rank, count, returnType) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go new file mode 100644 index 00000000..5dd76084 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go @@ -0,0 +1,953 @@ +//go:build !as_performance && !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +const udfCDTTests = ` +function add(rec, bin, key, value) + if not aerospike:exists(rec) then + --create record + local m1 = map() + local m2 = map() + m2[value] = key + + m1[key] = m2 -- set map to map + rec[bin] = m1 -- set map to record + --create record + return aerospike:create(rec) + end + + --record existed, let's see if key exists + local m1 = rec[bin] --get map + local m2 = m1[key] --get second map + + --did list already exist? + if m2 == nil then + m2 = map() --map didn't exist yet, let's create it + end + local doesExist = m2[value] + if doesExist ~= nil then + return 0 --value already existed, no need to update record + end + + m2[value] = key + --done setting values, let's store information back to set + m1[key] = m2 --map back to map + rec[bin] = m1 --map back to record + + return aerospike:update(rec) --..and update aerospike :) +end + +--remove from map[]map[] +function remove(rec, bin, key, value) + if not aerospike:exists(rec) then + return 0 --record does not exist, cannot remove so no error + end + + local m1 = rec[bin] + local m2 = m1[key] + if m2 == nil then + return 0 --key does not exist, cannot remove + end + + --remove key from map + local doesExist = m2[value] + if doesExist == nil then + return 0 --value does not exist + end + + map.remove(m2, value) --remove value from map + --done, let's update record with modified maps + m1[key] = m2 --back to map + rec[bin] = m1 --back to record + + return aerospike:update(rec) --and update! +end +` + +var _ = gg.Describe("CDT Map Test", func() { + + // connection data + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var cdtBinName string + // var list []interface{} + + putMode := as.DefaultMapPolicy() + addMode := as.NewMapPolicy(as.MapOrder.UNORDERED, as.MapWriteMode.CREATE_ONLY) + + gg.BeforeEach(func() { + + if !featureEnabled("cdt-map") { + gg.Skip("CDT Map Tests will not run since feature is not supported by the server.") + return + } + + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtBinName = randString(10) + }) + + gg.Describe("Simple Usecases", func() { + + gg.It("should create a valid CDT Map using MapPutOp", func() { + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutOp(putMode, cdtBinName, 1, 1), + as.MapPutOp(putMode, cdtBinName, 2, 2), + as.MapPutOp(addMode, cdtBinName, 3, 3), + as.MapPutOp(addMode, cdtBinName, 4, 4), + as.MapPutOp(addMode, cdtBinName, 6, 6), + as.MapPutOp(addMode, cdtBinName, 7, 7), + as.MapPutOp(addMode, cdtBinName, 8, 8), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key, cdtBinName) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4, 6: 6, 7: 7, 8: 8})) + }) + + gg.It("should unpack an empty Non-Ordered CDT map correctly", func() { + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutOp(putMode, cdtBinName, 1, 1), + as.MapRemoveByKeyOp(cdtBinName, 1, as.MapReturnType.NONE), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key, cdtBinName) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{})) + }) + + gg.It("should unpack an empty Ordered CDT map correctly", func() { + _, err := client.Operate(wpolicy, key, + as.MapPutOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, 1, 1), + // MapRemoveByKeyOp(cdtBinName, 1, as.MapReturnType.NONE), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rs, err := client.ScanAll(nil, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for rs := range rs.Results() { + gm.Expect(rs.Err).ToNot(gm.HaveOccurred()) + + } + + }) + + gg.It("should return the content of an Ordered CDT map correctly", func() { + items := map[interface{}]interface{}{ + "mk1": []interface{}{"v1.0", "v1.1"}, + "mk2": []interface{}{"v2.0", "v2.1"}, + } + + rec, err := client.Operate(nil, key, + as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE), "bin", items), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Operate(nil, key, + as.MapGetByKeyOp("bin", "mk1", as.MapReturnType.VALUE), + as.MapGetByKeyOp("bin", "mk2", as.MapReturnType.VALUE), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": []interface{}{[]interface{}{"v1.0", "v1.1"}, []interface{}{"v2.0", "v2.1"}}})) + + rec, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": []as.MapPair{{Key: "mk1", Value: []interface{}{"v1.0", "v1.1"}}, {Key: "mk2", Value: []interface{}{"v2.0", "v2.1"}}}})) + }) + + gg.It("should create a valid CDT Map using MapPutOp", func() { + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutOp(putMode, cdtBinName, 1, 1), + as.MapPutOp(putMode, cdtBinName, 2, 2), + as.MapPutOp(addMode, cdtBinName, 3, 3), + as.MapPutOp(addMode, cdtBinName, 4, 4), + + as.GetBinOp(cdtBinName), + ) + // gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap).NotTo(gm.Equal([]interface{}{1, 2, 3, 4, 4, 4, map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4}})) + + cdtMap, err = client.Get(nil, key, cdtBinName) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4})) + }) + + gg.It("should create a valid CDT Map using MapPutItemsOp", func() { + addMap := map[interface{}]interface{}{ + 12: "myValue", + -8734: "str2", + 1: "my default", + } + + putMap := map[interface{}]interface{}{ + 12: "myval12222", + 13: "str13", + } + + updateMap := map[interface{}]interface{}{ + 13: "myval2", + } + + replaceMap := map[interface{}]interface{}{ + 12: 23, + -8734: "changed", + } + + putMode := as.DefaultMapPolicy() + addMode := as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.CREATE_ONLY) + updateMode := as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE_ONLY) + + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(addMode, cdtBinName, addMap), + as.MapPutItemsOp(putMode, cdtBinName, putMap), + as.MapPutItemsOp(updateMode, cdtBinName, updateMap), + as.MapPutItemsOp(updateMode, cdtBinName, replaceMap), + as.MapGetByKeyOp(cdtBinName, 1, as.MapReturnType.VALUE), + as.MapGetByKeyOp(cdtBinName, -8734, as.MapReturnType.VALUE), + as.MapGetByKeyRangeOp(cdtBinName, 12, 15, as.MapReturnType.KEY_VALUE), + // as.GetBinOp(cdtBinName), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, 4, 4, 4, "my default", "changed", []as.MapPair{{Key: 12, Value: 23}, {Key: 13, Value: "myval2"}}})) + + cdtMap, err = client.Get(nil, key, cdtBinName) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]as.MapPair{{Key: -8734, Value: "changed"}, {Key: 1, Value: "my default"}, {Key: 12, Value: 23}, {Key: 13, Value: "myval2"}})) + }) + + gg.It("should create a valid CDT Map using mixed MapPutOp and MapPutItemsOp", func() { + + items := map[interface{}]interface{}{ + 12: "myval", + -8734: "str2", + 1: "my default", + 7: 1, + } + + otherBinName := "other_bin" + + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, items), + as.PutOp(as.NewBin(otherBinName, "head")), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(4)) + gm.Expect(cdtMap.Bins).To(gm.HaveKey(otherBinName)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapGetByKeyOp(cdtBinName, 12, as.MapReturnType.INDEX), + as.AppendOp(as.NewBin(otherBinName, "...tail")), + as.GetBinOp(otherBinName), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: 3, "other_bin": []interface{}{nil, "head...tail"}})) // there were two operations for bin `other_bin`, so the results come back in an array + + // Should set SendKey == true for a solely read operation without getting PARAMETER_ERROR from the server + wpolicy2 := *wpolicy + wpolicy2.SendKey = true + cdtMap, err = client.Operate(&wpolicy2, key, + as.MapGetByKeyOp(cdtBinName, 12, as.MapReturnType.VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: "myval"})) + }) + + gg.It("should create a valid CDT Map and then Switch Policy For Order", func() { + + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 4, 1), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 3, 2), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 2, 3), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 1, 4), + + as.MapGetByIndexOp(cdtBinName, 2, as.MapReturnType.KEY_VALUE), + as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapSetPolicyOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName), + + as.MapGetByKeyRangeOp(cdtBinName, 3, 5, as.MapReturnType.COUNT), + as.MapGetByKeyRangeOp(cdtBinName, -5, 2, as.MapReturnType.KEY_VALUE), + as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) + + }) + + gg.It("should create a valid CDT Map and then Switch Policy For Order with Persisted Index", func() { + + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 4, 1), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 3, 2), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 2, 3), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 1, 4), + + as.MapGetByIndexOp(cdtBinName, 2, as.MapReturnType.KEY_VALUE), + as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapSetPolicyOp(as.NewMapPolicyWithFlagsAndPersistedIndex(as.MapOrder.KEY_ORDERED, as.MapWriteFlagsDefault), cdtBinName), + + as.MapGetByKeyRangeOp(cdtBinName, 3, 5, as.MapReturnType.COUNT), + as.MapGetByKeyRangeOp(cdtBinName, -5, 2, as.MapReturnType.KEY_VALUE), + as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) + + }) + + gg.It("should create a valid CDT Map and then apply Inc/Dec operations and Get Correct Values", func() { + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + } + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapIncrementOp(as.DefaultMapPolicy(), cdtBinName, "John", 5), + as.MapDecrementOp(as.DefaultMapPolicy(), cdtBinName, "Jim", 4), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(nil, key, + as.MapGetByRankRangeCountOp(cdtBinName, -2, 2, as.MapReturnType.KEY), + as.MapGetByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.KEY_VALUE), + as.MapGetByRankOp(cdtBinName, 0, as.MapReturnType.VALUE), + as.MapGetByRankOp(cdtBinName, 2, as.MapReturnType.KEY), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.RANK), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.COUNT), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.KEY_VALUE), + as.MapGetByValueRangeOp(cdtBinName, 81, 82, as.MapReturnType.KEY), + as.MapGetByValueOp(cdtBinName, 77, as.MapReturnType.KEY), + as.MapGetByValueOp(cdtBinName, 81, as.MapReturnType.RANK), + as.MapGetByKeyOp(cdtBinName, "Charlie", as.MapReturnType.RANK), + as.MapGetByKeyOp(cdtBinName, "Charlie", as.MapReturnType.REVERSE_RANK), + as.MapGetByKeyListOp(cdtBinName, []interface{}{"Charlie", "Jim"}, as.MapReturnType.KEY), + as.MapGetByValueListOp(cdtBinName, []interface{}{55, 94}, as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ + []interface{}{"Harry", "Jim"}, + []as.MapPair{{Key: "Charlie", Value: 55}, {Key: "John", Value: 81}}, + 55, + "Harry", + []interface{}{3}, 1, []as.MapPair{{Key: "Jim", Value: 94}}, + []interface{}{"John"}, + []interface{}{}, + []interface{}{1}, + 0, + 3, + []interface{}{"Charlie", "Jim"}, + []interface{}{"Charlie", "Jim"}, + }})) + }) + + gg.It("should create a valid CDT Map and then Get via MapReturnType.INVERTED", func() { + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + } + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(nil, key, + as.MapGetByRankRangeCountOp(cdtBinName, -2, 2, as.MapReturnType.KEY|as.MapReturnType.INVERTED), + as.MapGetByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.KEY_VALUE|as.MapReturnType.INVERTED), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.RANK|as.MapReturnType.INVERTED), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.COUNT|as.MapReturnType.INVERTED), + as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.KEY_VALUE|as.MapReturnType.INVERTED), + as.MapGetByValueRangeOp(cdtBinName, 81, 82, as.MapReturnType.KEY|as.MapReturnType.INVERTED), + as.MapGetByValueOp(cdtBinName, 77, as.MapReturnType.KEY|as.MapReturnType.INVERTED), + as.MapGetByValueOp(cdtBinName, 81, as.MapReturnType.RANK|as.MapReturnType.INVERTED), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ + []interface{}{"Charlie", "John"}, + []as.MapPair{{Key: "Harry", Value: 82}, {Key: "Jim", Value: 98}}, + []interface{}{0, 1, 2, 3}, + 4, + []as.MapPair{{Key: "Charlie", Value: 55}, {Key: "Harry", Value: 82}, {Key: "Jim", Value: 98}, {Key: "John", Value: 76}}, + []interface{}{"Charlie", "Harry", "Jim", "John"}, + []interface{}{"Charlie", "Harry", "Jim", "John"}, + []interface{}{0, 1, 2, 3}, + }})) + }) + + gg.It("should create a valid CDT Map and then execute Remove operations", func() { + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + "Sally": 79, + "Lenny": 84, + "Abe": 88, + } + + itemsToRemove := []interface{}{ + "Sally", + "UNKNOWN", + "Lenny", + } + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), + as.MapRemoveByKeyOp(cdtBinName, "NOTFOUND", as.MapReturnType.VALUE), + as.MapRemoveByKeyOp(cdtBinName, "Jim", as.MapReturnType.VALUE), + as.MapRemoveByKeyListOp(cdtBinName, itemsToRemove, as.MapReturnType.VALUE), + as.MapRemoveByValueOp(cdtBinName, 55, as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, nil, 98, []interface{}{79, 84}, []interface{}{"Charlie"}}})) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(7)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.BeNil()) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(98)) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.ConsistOf([]interface{}{79, 84})) + gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]interface{}{"Charlie"})) + }) + + }) + + gg.It("should create a valid CDT Map and then execute RemoveRange operations", func() { + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + "Sally": 79, + "Lenny": 84, + "Abe": 88, + } + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), + as.MapRemoveByKeyRangeOp(cdtBinName, "J", "K", as.MapReturnType.COUNT), + as.MapRemoveByValueRangeOp(cdtBinName, 80, 85, as.MapReturnType.COUNT), + as.MapRemoveByIndexRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.COUNT), + as.MapRemoveByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.COUNT), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, 2, 2, 2, 1}})) + }) + + gg.It("should create a valid CDT Map and then execute Clear operations", func() { + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + "Sally": 79, + "Lenny": 84, + "Abe": 88, + } + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapClearOp(cdtBinName), + as.MapSizeOp(cdtBinName), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{nil, 0}})) + }) + + gg.It("should create a valid CDT Map and then execute RANK operations", func() { + + items := map[interface{}]interface{}{ + "p1": 0, + "p2": 0, + "p3": 0, + "p4": 0, + } + + mapPolicy := as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE) + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + _, err = client.Operate(wpolicy, key, + as.MapIncrementOp(mapPolicy, cdtBinName, "p1", 10), + as.MapIncrementOp(mapPolicy, cdtBinName, "p2", 20), + as.MapIncrementOp(mapPolicy, cdtBinName, "p3", 1), + as.MapIncrementOp(mapPolicy, cdtBinName, "p4", 20), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapGetByRankRangeCountOp(cdtBinName, -3, 3, as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{"p1", "p2", "p4"}})) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapRemoveByValueOp(cdtBinName, 10, as.MapReturnType.KEY), + as.MapGetByRankRangeCountOp(cdtBinName, -3, 3, as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{[]interface{}{"p1"}, []interface{}{"p3", "p2", "p4"}}})) + }) + + gg.It("should support MapWriteFlagsPartial & MapWriteFlagsNoFail", func() { + client.Delete(nil, key) + + cdtBinName2 := cdtBinName + "2" + items := map[interface{}]interface{}{ + 0: 17, + 4: 2, + 5: 15, + 9: 10, + } + + mapPolicy := as.DefaultMapPolicy() + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + as.MapPutItemsOp(mapPolicy, cdtBinName2, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(2)) + + cdtMapPolicy1 := as.NewMapPolicyWithFlags(as.MapOrder.UNORDERED, as.MapWriteFlagsCreateOnly|as.MapWriteFlagsPartial|as.MapWriteFlagsNoFail) + cdtMapPolicy2 := as.NewMapPolicyWithFlags(as.MapOrder.UNORDERED, as.MapWriteFlagsCreateOnly|as.MapWriteFlagsNoFail) + + items = map[interface{}]interface{}{ + 3: 3, + 5: 15, + } + + cdtMap, err = client.Operate(wpolicy, key, + as.MapPutItemsOp(cdtMapPolicy1, cdtBinName, items), + as.MapPutItemsOp(cdtMapPolicy2, cdtBinName2, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(5)) + gm.Expect(cdtMap.Bins[cdtBinName2]).To(gm.Equal(4)) + + }) + + gg.It("should support Map Infinity ops", func() { + client.Delete(nil, key) + + items := map[interface{}]interface{}{ + 0: 17, + 4: 2, + 5: 15, + 9: 10, + } + + mapPolicy := as.DefaultMapPolicy() + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapGetByKeyRangeOp(cdtBinName, 5, as.NewInfinityValue(), as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 9})) + }) + + gg.It("should support Map WildCard ops", func() { + client.Delete(nil, key) + + items := map[interface{}]interface{}{ + 4: []interface{}{"John", 55}, + 5: []interface{}{"Jim", 95}, + 9: []interface{}{"Joe", 80}, + } + + mapPolicy := as.DefaultMapPolicy() + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapGetByValueOp(cdtBinName, []interface{}{"Joe", as.NewWildCardValue()}, as.MapReturnType.KEY), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{9})) + }) + + gg.It("should support Relative MapGet ops", func() { + client.Delete(nil, key) + + items := map[interface{}]interface{}{ + 0: 17, + 4: 2, + 5: 15, + 9: 10, + } + + mapPolicy := as.DefaultMapPolicy() + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, 0, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, 1, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, -1, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 3, 2, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 3, -2, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, 0, 1, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, 1, 2, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, -1, 1, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 3, 2, 1, as.MapReturnType.KEY), + as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 3, -2, 2, as.MapReturnType.KEY), + as.MapGetByValueRelativeRankRangeOp(cdtBinName, 11, 1, as.MapReturnType.VALUE), + as.MapGetByValueRelativeRankRangeOp(cdtBinName, 11, -1, as.MapReturnType.VALUE), + as.MapGetByValueRelativeRankRangeCountOp(cdtBinName, 11, 1, 1, as.MapReturnType.VALUE), + as.MapGetByValueRelativeRankRangeCountOp(cdtBinName, 11, -1, 1, as.MapReturnType.VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5, 9}, []interface{}{9}, []interface{}{0, 4, 5, 9}, []interface{}{5}, []interface{}{9}, []interface{}{4}, []interface{}{9}, []interface{}{0}, []interface{}{17}, []interface{}{10, 15, 17}, []interface{}{17}, []interface{}{10}})) + }) + + gg.It("should support Relative MapRemove ops", func() { + client.Delete(nil, key) + + items := map[interface{}]interface{}{ + 0: 17, + 4: 2, + 5: 15, + 9: 10, + } + + mapPolicy := as.DefaultMapPolicy() + + // Write values to empty map. + cdtMap, err := client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cdtMap, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapRemoveByKeyRelativeIndexRangeOp(cdtBinName, 5, 0, as.MapReturnType.VALUE), + as.MapRemoveByKeyRelativeIndexRangeOp(cdtBinName, 5, 1, as.MapReturnType.VALUE), + as.MapRemoveByKeyRelativeIndexRangeCountOp(cdtBinName, 5, -1, 1, as.MapReturnType.VALUE), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{15, 10}, []interface{}{}, []interface{}{2}})) + + client.Delete(nil, key) + cdtMap, err = client.Operate(wpolicy, key, + as.MapPutItemsOp(mapPolicy, cdtBinName, items), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) + + cdtMap, err = client.Operate(wpolicy, key, + as.MapRemoveByValueRelativeRankRangeOp(cdtBinName, 11, 1, as.MapReturnType.VALUE), + as.MapRemoveByValueRelativeRankRangeCountOp(cdtBinName, 11, -1, 1, as.MapReturnType.VALUE), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{17}, []interface{}{10}})) + }) + + gg.It("should support Nested Map ops", func() { + client.Delete(nil, key) + + m := map[interface{}]interface{}{ + "key1": map[interface{}]interface{}{ + "key11": 9, "key12": 4, + }, + "key2": map[interface{}]interface{}{ + "key21": 3, "key22": 5, + }, + } + + err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) + + record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key21"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key2"))), as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + 2, + map[interface{}]interface{}{ + "key1": map[interface{}]interface{}{ + "key11": 9, "key12": 4, + }, + "key2": map[interface{}]interface{}{ + "key21": 11, "key22": 5, + }, + }, + })) + }) + + gg.It("should support Double Nested Map ops", func() { + client.Delete(nil, key) + + m := map[interface{}]interface{}{ + "key1": map[interface{}]interface{}{ + "key11": map[interface{}]interface{}{"key111": 1}, "key12": map[interface{}]interface{}{"key121": 5}, + }, + "key2": map[interface{}]interface{}{ + "key21": map[interface{}]interface{}{"key211": 7}, + }, + } + + err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) + + record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key121"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key1")), as.CtxMapRank(-1)), as.GetBinOp(cdtBinName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ + 1, + map[interface{}]interface{}{ + "key1": map[interface{}]interface{}{ + "key11": map[interface{}]interface{}{"key111": 1}, "key12": map[interface{}]interface{}{"key121": 11}, + }, + "key2": map[interface{}]interface{}{ + "key21": map[interface{}]interface{}{"key211": 7}, + }, + }, + })) + }) + + gg.It("should handle CDTs in UDFs", func() { + + registerUDF(udfCDTTests, "cdt_tests.lua") + + _, err = client.Execute(nil, key, "cdt_tests", "add", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + sets, err := client.ScanAll(nil, ns, "skill") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"b": map[interface{}]interface{}{"k": map[interface{}]interface{}{1: "k"}}})) + + for res := range sets.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + _, err = client.Delete(nil, res.Record.Key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + _, err = client.Execute(nil, key, "cdt_tests", "add", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Execute(nil, key, "cdt_tests", "remove", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"b": map[interface{}]interface{}{"k": map[interface{}]interface{}{}}})) + + sets, err = client.ScanAll(nil, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for res := range sets.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + _, err = client.Delete(nil, res.Record.Key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + gg.It("should handle Map Create gg.Context", func() { + // Key key = new Key(args.namespace, args.set, "opmkey22"); + client.Delete(nil, key) + + m1 := map[string]int{"key11": 9, "key12": 4} + m2 := map[string]int{"key21": 3, "key22": 5} + inputMap := map[string]interface{}{"key1": m1, "key2": m2} + + // Create maps. + err := client.Put(nil, key, as.BinMap{cdtBinName: inputMap}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Set map value to 11 for map key "key21" inside of map key "key2" + // and retrieve all maps. + record, err := client.Operate(nil, key, + as.MapCreateOp(cdtBinName, as.MapOrder.KEY_ORDERED, []*as.CDTContext{as.CtxMapKey(as.StringValue("key3"))}), + as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, "key31", 99, as.CtxMapKey(as.StringValue("key3"))), + as.GetBinOp(cdtBinName), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + results := record.Bins[cdtBinName].([]interface{}) + + count := results[1] + gm.Expect(count).To(gm.Equal(1)) + + m := results[2].(map[interface{}]interface{}) + gm.Expect(len(m)).To(gm.Equal(3)) + + mp := m["key3"].([]as.MapPair) + + gm.Expect(len(mp)).To(gm.Equal(1)) + gm.Expect(mp[0].Key).To(gm.Equal("key31")) + gm.Expect(mp[0].Value).To(gm.Equal(99)) + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/client.go b/aerospike-tls/vendor-aerospike-client-go/client.go new file mode 100644 index 00000000..60062cbb --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client.go @@ -0,0 +1,1925 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "fmt" + "os" + "regexp" + "runtime" + "strconv" + "strings" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const unreachable = "UNREACHABLE" + +// Client encapsulates an Aerospike cluster. +// All database operations are available against this object. +type Client struct { + cluster *Cluster + + // DefaultPolicy is used for all read commands without a specific policy. + DefaultPolicy *BasePolicy + // DefaultBatchPolicy is the default parent policy used in batch read commands. Base policy fields + // include socketTimeout, totalTimeout, maxRetries, etc... + DefaultBatchPolicy *BatchPolicy + // DefaultBatchReadPolicy is the default read policy used in batch operate commands. + DefaultBatchReadPolicy *BatchReadPolicy + // DefaultBatchWritePolicy is the default write policy used in batch operate commands. + // Write policy fields include generation, expiration, durableDelete, etc... + DefaultBatchWritePolicy *BatchWritePolicy + // DefaultBatchDeletePolicy is the default delete policy used in batch delete commands. + DefaultBatchDeletePolicy *BatchDeletePolicy + // DefaultBatchUDFPolicy is the default user defined function policy used in batch UDF execute commands. + DefaultBatchUDFPolicy *BatchUDFPolicy + // DefaultWritePolicy is used for all write commands without a specific policy. + DefaultWritePolicy *WritePolicy + // DefaultScanPolicy is used for all scan commands without a specific policy. + DefaultScanPolicy *ScanPolicy + // DefaultQueryPolicy is used for all query commands without a specific policy. + DefaultQueryPolicy *QueryPolicy + // DefaultAdminPolicy is used for all security commands without a specific policy. + DefaultAdminPolicy *AdminPolicy + // DefaultInfoPolicy is used for all info commands without a specific policy. + DefaultInfoPolicy *InfoPolicy +} + +func clientFinalizer(f *Client) { + f.Close() +} + +//------------------------------------------------------- +// Constructors +//------------------------------------------------------- + +// NewClient generates a new Client instance. +// The connection pool after connecting to the database is initially empty, +// and connections are established on a per need basis, which can be slow and +// time out some initial commands. +// It is recommended to call the client.WarmUp() method right after connecting to the database +// to fill up the connection pool to the required service level. +func NewClient(hostname string, port int) (*Client, Error) { + return NewClientWithPolicyAndHost(NewClientPolicy(), NewHost(hostname, port)) +} + +// NewClientWithPolicy generates a new Client using the specified ClientPolicy. +// If the policy is nil, the default relevant policy will be used. +// The connection pool after connecting to the database is initially empty, +// and connections are established on a per need basis, which can be slow and +// time out some initial commands. +// It is recommended to call the client.WarmUp() method right after connecting to the database +// to fill up the connection pool to the required service level. +func NewClientWithPolicy(policy *ClientPolicy, hostname string, port int) (*Client, Error) { + return NewClientWithPolicyAndHost(policy, NewHost(hostname, port)) +} + +// NewClientWithPolicyAndHost generates a new Client with the specified ClientPolicy and +// sets up the cluster using the provided hosts. +// If the policy is nil, the default relevant policy will be used. +// The connection pool after connecting to the database is initially empty, +// and connections are established on a per need basis, which can be slow and +// time out some initial commands. +// It is recommended to call the client.WarmUp() method right after connecting to the database +// to fill up the connection pool to the required service level. +func NewClientWithPolicyAndHost(policy *ClientPolicy, hosts ...*Host) (*Client, Error) { + if policy == nil { + policy = NewClientPolicy() + } + + cluster, err := NewCluster(policy, hosts) + if err != nil && policy.FailIfNotConnected { + logger.Logger.Debug("Failed to connect to host(s): %v; error: %s", hosts, err) + return nil, err + } + + client := &Client{ + cluster: cluster, + DefaultPolicy: NewPolicy(), + DefaultBatchPolicy: NewBatchPolicy(), + DefaultBatchReadPolicy: NewBatchReadPolicy(), + DefaultBatchWritePolicy: NewBatchWritePolicy(), + DefaultBatchDeletePolicy: NewBatchDeletePolicy(), + DefaultBatchUDFPolicy: NewBatchUDFPolicy(), + DefaultWritePolicy: NewWritePolicy(0, 0), + DefaultScanPolicy: NewScanPolicy(), + DefaultQueryPolicy: NewQueryPolicy(), + DefaultAdminPolicy: NewAdminPolicy(), + DefaultInfoPolicy: NewInfoPolicy(), + } + + runtime.SetFinalizer(client, clientFinalizer) + return client, err +} + +//------------------------------------------------------- +// Policy methods +//------------------------------------------------------- + +// DefaultPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultPolicy() *BasePolicy { + return clnt.DefaultPolicy +} + +// DefaultBatchPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultBatchPolicy() *BatchPolicy { + return clnt.DefaultBatchPolicy +} + +// DefaultBatchWritePolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultBatchWritePolicy() *BatchWritePolicy { + return clnt.DefaultBatchWritePolicy +} + +// DefaultBatchReadPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultBatchReadPolicy() *BatchReadPolicy { + return clnt.DefaultBatchReadPolicy +} + +// DefaultBatchDeletePolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultBatchDeletePolicy() *BatchDeletePolicy { + return clnt.DefaultBatchDeletePolicy +} + +// DefaultBatchUDFPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultBatchUDFPolicy() *BatchUDFPolicy { + return clnt.DefaultBatchUDFPolicy +} + +// DefaultWritePolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultWritePolicy() *WritePolicy { + return clnt.DefaultWritePolicy +} + +// DefaultScanPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultScanPolicy() *ScanPolicy { + return clnt.DefaultScanPolicy +} + +// DefaultQueryPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultQueryPolicy() *QueryPolicy { + return clnt.DefaultQueryPolicy +} + +// DefaultAdminPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultAdminPolicy() *AdminPolicy { + return clnt.DefaultAdminPolicy +} + +// DefaultInfoPolicy returns corresponding default policy from the client +func (clnt *Client) GetDefaultInfoPolicy() *InfoPolicy { + return clnt.DefaultInfoPolicy +} + +// DefaultPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultPolicy(policy *BasePolicy) { + clnt.DefaultPolicy = policy +} + +// DefaultBatchPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultBatchPolicy(policy *BatchPolicy) { + clnt.DefaultBatchPolicy = policy +} + +// DefaultBatchWritePolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultBatchWritePolicy(policy *BatchWritePolicy) { + clnt.DefaultBatchWritePolicy = policy +} + +// DefaultBatchReadPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultBatchReadPolicy(policy *BatchReadPolicy) { + clnt.DefaultBatchReadPolicy = policy +} + +// DefaultBatchDeletePolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultBatchDeletePolicy(policy *BatchDeletePolicy) { + clnt.DefaultBatchDeletePolicy = policy +} + +// DefaultBatchUDFPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultBatchUDFPolicy(policy *BatchUDFPolicy) { + clnt.DefaultBatchUDFPolicy = policy +} + +// DefaultWritePolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultWritePolicy(policy *WritePolicy) { + clnt.DefaultWritePolicy = policy +} + +// DefaultScanPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultScanPolicy(policy *ScanPolicy) { + clnt.DefaultScanPolicy = policy +} + +// DefaultQueryPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultQueryPolicy(policy *QueryPolicy) { + clnt.DefaultQueryPolicy = policy +} + +// DefaultAdminPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultAdminPolicy(policy *AdminPolicy) { + clnt.DefaultAdminPolicy = policy +} + +// DefaultInfoPolicy returns corresponding default policy from the client +func (clnt *Client) SetDefaultInfoPolicy(policy *InfoPolicy) { + clnt.DefaultInfoPolicy = policy +} + +//------------------------------------------------------- +// Cluster Connection Management +//------------------------------------------------------- + +// Close closes all client connections to database server nodes. +func (clnt *Client) Close() { + clnt.cluster.Close() +} + +// IsConnected determines if the client is ready to talk to the database server cluster. +func (clnt *Client) IsConnected() bool { + return clnt.cluster.IsConnected() +} + +// GetNodes returns an array of active server nodes in the cluster. +func (clnt *Client) GetNodes() []*Node { + return clnt.cluster.GetNodes() +} + +// GetNodeNames returns a list of active server node names in the cluster. +func (clnt *Client) GetNodeNames() []string { + nodes := clnt.cluster.GetNodes() + names := make([]string, 0, len(nodes)) + + for _, node := range nodes { + names = append(names, node.GetName()) + } + return names +} + +//------------------------------------------------------- +// Write Record Operations +//------------------------------------------------------- + +// Put writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Put(policy *WritePolicy, key *Key, binMap BinMap) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _WRITE) + if err != nil { + return err + } + + return command.Execute() +} + +// PutBins writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This method avoids using the BinMap allocation and iteration and is lighter on GC. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _WRITE) + if err != nil { + return err + } + + return command.Execute() +} + +//------------------------------------------------------- +// Operations string +//------------------------------------------------------- + +// Append appends bin value's string to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call only works for string and []byte values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Append(policy *WritePolicy, key *Key, binMap BinMap) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _APPEND) + if err != nil { + return err + } + + return command.Execute() +} + +// AppendBins works the same as Append, but avoids BinMap allocation and iteration. +func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _APPEND) + if err != nil { + return err + } + + return command.Execute() +} + +// Prepend prepends bin value's string to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call works only for string and []byte values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _PREPEND) + if err != nil { + return err + } + + return command.Execute() +} + +// PrependBins works the same as Prepend, but avoids BinMap allocation and iteration. +func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _PREPEND) + if err != nil { + return err + } + + return command.Execute() +} + +//------------------------------------------------------- +// Arithmetic Operations +//------------------------------------------------------- + +// Add adds integer bin values to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call only works for integer values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Add(policy *WritePolicy, key *Key, binMap BinMap) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _ADD) + if err != nil { + return err + } + + return command.Execute() +} + +// AddBins works the same as Add, but avoids BinMap allocation and iteration. +func (clnt *Client) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _ADD) + if err != nil { + return err + } + + return command.Execute() +} + +//------------------------------------------------------- +// Delete Operations +//------------------------------------------------------- + +// Delete deletes a record for specified key. +// The policy specifies the transaction timeout. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Delete(policy *WritePolicy, key *Key) (bool, Error) { + policy = clnt.getUsableWritePolicy(policy) + command, err := newDeleteCommand(clnt.cluster, policy, key) + if err != nil { + return false, err + } + + err = command.Execute() + return command.Existed(), err +} + +//------------------------------------------------------- +// Touch Operations +//------------------------------------------------------- + +// Touch updates a record's metadata. +// If the record exists, the record's TTL will be reset to the +// policy's expiration. +// If the record doesn't exist, it will return an error. +func (clnt *Client) Touch(policy *WritePolicy, key *Key) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newTouchCommand(clnt.cluster, policy, key) + if err != nil { + return err + } + + return command.Execute() +} + +//------------------------------------------------------- +// Existence-Check Operations +//------------------------------------------------------- + +// Exists determine if a record key exists. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Exists(policy *BasePolicy, key *Key) (bool, Error) { + policy = clnt.getUsablePolicy(policy) + command, err := newExistsCommand(clnt.cluster, policy, key) + if err != nil { + return false, err + } + + err = command.Execute() + return command.Exists(), err +} + +// BatchExists determines if multiple record keys exist in one batch request. +// The returned boolean array is in positional order with the original key array order. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be marked true + existsArray := make([]bool, len(keys)) + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) + if err != nil { + return nil, err + } + + // pass nil to make sure it will be cloned and prepared + cmd := newBatchCommandExists(clnt, nil, policy, keys, existsArray) + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + if err != nil { + return nil, err + } + + return existsArray, err +} + +//------------------------------------------------------- +// Read Record Operations +//------------------------------------------------------- + +// Get reads a record header and bins for specified key. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) { + policy = clnt.getUsablePolicy(policy) + + command, err := newReadCommand(clnt.cluster, policy, key, binNames, nil) + if err != nil { + return nil, err + } + + if err := command.Execute(); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +// GetHeader reads a record generation and expiration only for specified key. +// Bins are not read. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) GetHeader(policy *BasePolicy, key *Key) (*Record, Error) { + policy = clnt.getUsablePolicy(policy) + + command, err := newReadHeaderCommand(clnt.cluster, policy, key) + if err != nil { + return nil, err + } + + if err := command.Execute(); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +//------------------------------------------------------- +// Batch Read Operations +//------------------------------------------------------- + +// BatchGet reads multiple record headers and bins for specified keys in one batch request. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be set to record + records := make([]*Record, len(keys)) + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) + if err != nil { + return nil, err + } + + cmd := newBatchCommandGet(clnt, nil, policy, keys, binNames, nil, records, _INFO1_READ, false) + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if err != nil && !policy.AllowPartialResults { + return nil, err + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return records, err +} + +// BatchGetOperate reads multiple records for specified keys using read operations in one batch call. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// +// If a batch request to a node fails, the entire batch is cancelled. +func (clnt *Client) BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be set to record + records := make([]*Record, len(keys)) + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) + if err != nil { + return nil, err + } + + cmd := newBatchCommandGet(clnt, nil, policy, keys, nil, ops, records, _INFO1_READ, true) + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if err != nil && !policy.AllowPartialResults { + return nil, err + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return records, err +} + +// BatchGetComplex reads multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins to be requested for each key in the batch. +// The returned records are located in the same list. +// If the BatchRead key field is not found, the corresponding record field will be nil. +// The policy can be used to specify timeouts and maximum concurrent goroutines. +// This method requires Aerospike Server version >= 3.6.0. +func (clnt *Client) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error { + policy = clnt.getUsableBatchPolicy(policy) + + cmd := newBatchIndexCommandGet(clnt, nil, policy, records, true) + + batchNodes, err := newBatchIndexNodeList(clnt.cluster, policy, records) + if err != nil { + return err + } + + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if err != nil && !policy.AllowPartialResults { + return err + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return err +} + +// BatchGetHeader reads multiple record header data for specified keys in one batch request. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be set to record + records := make([]*Record, len(keys)) + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) + if err != nil { + return nil, err + } + + cmd := newBatchCommandGet(clnt, nil, policy, keys, nil, nil, records, _INFO1_READ|_INFO1_NOBINDATA, false) + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if err != nil && !policy.AllowPartialResults { + return nil, err + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return records, err +} + +// BatchDelete deletes records for specified keys. If a key is not found, the corresponding result +// BatchRecord.ResultCode will be types.KEY_NOT_FOUND_ERROR. +// +// Requires server version 6.0+ +func (clnt *Client) BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) { + policy = clnt.getUsableBatchPolicy(policy) + deletePolicy = clnt.getUsableBatchDeletePolicy(deletePolicy) + + attr := &batchAttr{} + attr.setBatchDelete(deletePolicy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be set to record + records := make([]*BatchRecord, len(keys)) + for i := range records { + records[i] = newSimpleBatchRecord(keys[i], true) + } + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, records, true) + if err != nil { + return nil, err + } + + cmd := newBatchCommandDelete(clnt, nil, policy, deletePolicy, keys, records, attr) + _, err = clnt.batchExecute(policy, batchNodes, cmd) + return records, err +} + +// BatchOperate will read/write multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins for each key in the batch. +// The returned records are located in the same list. +// +// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. +// +// Requires server version 6.0+ +func (clnt *Client) BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error { + policy = clnt.getUsableBatchPolicy(policy) + + batchNodes, err := newBatchOperateNodeListIfc(clnt.cluster, policy, records) + if err != nil && policy.RespondAllKeys { + return err + } + + cmd := newBatchCommandOperate(clnt, nil, policy, records) + _, err = clnt.batchExecute(policy, batchNodes, cmd) + return err +} + +// BatchExecute will read/write multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins for each key in the batch. +// The returned records are located in the same list. +// +// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. +// +// Requires server version 6.0+ +func (clnt *Client) BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) { + policy = clnt.getUsableBatchPolicy(policy) + udfPolicy = clnt.getUsableBatchUDFPolicy(udfPolicy) + + attr := &batchAttr{} + attr.setBatchUDF(udfPolicy) + + // same array can be used without synchronization; + // when a key exists, the corresponding index will be set to record + records := make([]*BatchRecord, len(keys)) + for i := range records { + records[i] = newSimpleBatchRecord(keys[i], attr.hasWrite) + } + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, records, attr.hasWrite) + if err != nil { + return nil, err + } + + cmd := newBatchCommandUDF(clnt, nil, policy, udfPolicy, keys, packageName, functionName, args, records, attr) + _, err = clnt.batchExecute(policy, batchNodes, cmd) + return records, err +} + +//------------------------------------------------------- +// Generic Database Operations +//------------------------------------------------------- + +// Operate performs multiple read/write operations on a single key in one batch request. +// An example would be to add an integer value to an existing record and then +// read the result, all in one database call. +// +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) { + return clnt.operate(policy, key, false, operations...) +} + +// useOpResults is used in batch single nodes commands and should be true to return the right type for BatchOperate results +func (clnt *Client) operate(policy *WritePolicy, key *Key, useOpResults bool, operations ...*Operation) (*Record, Error) { + // TODO: Remove this method in the next major release. + policy = clnt.getUsableWritePolicy(policy) + args, err := newOperateArgs(clnt.cluster, policy, key, operations) + if err != nil { + return nil, err + } + command, err := newOperateCommand(clnt.cluster, policy, key, args, useOpResults) + if err != nil { + return nil, err + } + + if err := command.Execute(); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +//------------------------------------------------------- +// Scan Operations +//------------------------------------------------------- + +// ScanPartitions Read records in specified namespace, set and partition filter. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If partitionFilter is nil, all partitions will be scanned. +// If the policy is nil, the default relevant policy will be used. +// This method is only supported by Aerospike 4.9+ servers. +func (clnt *Client) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + var tracker *partitionTracker + if partitionFilter == nil { + tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) + } else { + tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) + } + + // result recordset + res := newRecordset(policy.RecordQueueSize, 1) + go clnt.scanPartitions(&policy, tracker, namespace, setName, res, binNames...) + + return res, nil +} + +// ScanAll reads all records in specified namespace and set from all nodes. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.ScanPartitions(apolicy, nil, namespace, setName, binNames...) +} + +// scanNodePartitions reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) scanNodePartitions(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) + + // result recordset + res := newRecordset(policy.RecordQueueSize, 1) + go clnt.scanPartitions(&policy, tracker, namespace, setName, res, binNames...) + + return res, nil +} + +// ScanNode reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.scanNodePartitions(apolicy, node, namespace, setName, binNames...) +} + +//--------------------------------------------------------------- +// User defined functions (Supported by Aerospike 3+ servers only) +//--------------------------------------------------------------- + +// RegisterUDFFromFile reads a file from file system and registers +// the containing a package user defined functions with the server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RegisterTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) { + policy = clnt.getUsableWritePolicy(policy) + udfBody, err := os.ReadFile(clientPath) + if err != nil { + return nil, newCommonError(err) + } + + return clnt.RegisterUDF(policy, udfBody, serverPath, language) +} + +// RegisterUDF registers a package containing user defined functions with server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RegisterTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) { + policy = clnt.getUsableWritePolicy(policy) + content := base64.StdEncoding.EncodeToString(udfBody) + + var strCmd bytes.Buffer + // errors are to remove errcheck warnings + // they will always be nil as stated in golang docs + strCmd.WriteString("udf-put:filename=") + strCmd.WriteString(serverPath) + strCmd.WriteString(";content=") + strCmd.WriteString(content) + strCmd.WriteString(";content-len=") + strCmd.WriteString(strconv.Itoa(len(content))) + strCmd.WriteString(";udf-type=") + strCmd.WriteString(string(language)) + strCmd.WriteString(";") + + // Send UDF to one node. That node will distribute the UDF to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) + if err != nil { + return nil, err + } + + response := responseMap[strCmd.String()] + if strings.EqualFold(response, "ok") { + return NewRegisterTask(clnt.cluster, serverPath), nil + } + + err = parseInfoErrorCode(response) + + res := make(map[string]string) + vals := strings.Split("error="+err.Error(), ";") + for _, pair := range vals { + t := strings.SplitN(pair, "=", 2) + if len(t) == 2 { + res[strings.ToLower(t[0])] = t[1] + } else if len(t) == 1 { + res[strings.ToLower(t[0])] = "" + } + } + + if _, exists := res["error"]; exists { + msg, _ := base64.StdEncoding.DecodeString(res["message"]) + return nil, newError(err.resultCode(), fmt.Sprintf("Registration failed: %s\nFile: %s\nLine: %s\nMessage: %s", + res["error"], res["file"], res["line"], msg)) + } + + // if message was not parsable + return nil, parseInfoErrorCode(response) +} + +// RemoveUDF removes a package containing user defined functions in the server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RemoveTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) { + policy = clnt.getUsableWritePolicy(policy) + var strCmd bytes.Buffer + // errors are to remove errcheck warnings + // they will always be nil as stated in golang docs + strCmd.WriteString("udf-remove:filename=") + strCmd.WriteString(udfName) + strCmd.WriteString(";") + + // Send command to one node. That node will distribute it to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) + if err != nil { + return nil, err + } + + response := responseMap[strCmd.String()] + if strings.EqualFold(response, "ok") { + return NewRemoveTask(clnt.cluster, udfName), nil + } + return nil, parseInfoErrorCode(response) +} + +// ListUDF lists all packages containing user defined functions in the server. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, Error) { + policy = clnt.getUsablePolicy(policy) + + var strCmd bytes.Buffer + // errors are to remove errcheck warnings + // they will always be nil as stated in golang docs + strCmd.WriteString("udf-list") + + // Send command to one node. That node will distribute it to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) + if err != nil { + return nil, err + } + + response := responseMap[strCmd.String()] + vals := strings.Split(response, ";") + res := make([]*UDF, 0, len(vals)) + + for _, udfInfo := range vals { + if strings.Trim(udfInfo, " ") == "" { + continue + } + udfParts := strings.Split(udfInfo, ",") + + udf := &UDF{} + for _, values := range udfParts { + valueParts := strings.Split(values, "=") + if len(valueParts) == 2 { + switch valueParts[0] { + case "filename": + udf.Filename = valueParts[1] + case "hash": + udf.Hash = valueParts[1] + case "type": + udf.Language = Language(valueParts[1]) + } + } + } + res = append(res, udf) + } + + return res, nil +} + +// Execute executes a user defined function on server and return results. +// The function operates on a single record. +// The package name is used to locate the udf file location: +// +// udf file = /.lua +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) { + record, err := clnt.execute(policy, key, packageName, functionName, args...) + if err != nil { + return nil, err + } + + if record == nil || len(record.Bins) == 0 { + return nil, nil + } + + for k, v := range record.Bins { + if strings.Contains(k, "SUCCESS") { + return v, nil + } else if strings.Contains(k, "FAILURE") { + return nil, newError(ErrUDFBadResponse.ResultCode, fmt.Sprintf("%v", v)) + } + } + + return nil, ErrUDFBadResponse.err() +} + +func (clnt *Client) execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) { + policy = clnt.getUsableWritePolicy(policy) + command, err := newExecuteCommand(clnt.cluster, policy, key, packageName, functionName, NewValueArray(args)) + if err != nil { + return nil, err + } + + if err := command.Execute(); err != nil { + return nil, err + } + + return command.GetRecord(), nil +} + +//---------------------------------------------------------- +// Query/Execute (Supported by Aerospike 3+ servers only) +//---------------------------------------------------------- + +// QueryExecute applies operations on records that match the statement filter. +// Records are not returned to the client. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryExecute(policy *QueryPolicy, + writePolicy *WritePolicy, + statement *Statement, + ops ...*Operation, +) (*ExecuteTask, Error) { + + if len(statement.BinNames) > 0 { + return nil, ErrNoBinNamesAllowedInQueryExecute.err() + } + + policy = clnt.getUsableQueryPolicy(policy) + writePolicy = clnt.getUsableWritePolicy(writePolicy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + statement.prepare(false) + + var errs Error + for i := range nodes { + command := newServerCommand(nodes[i], policy, writePolicy, statement, statement.TaskId, ops) + if err := command.Execute(); err != nil { + errs = chainErrors(err, errs) + } + } + + return NewExecuteTask(clnt.cluster, statement), errs +} + +// ExecuteUDF applies user defined function on records that match the statement filter. +// Records are not returned to the client. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ExecuteUDF(policy *QueryPolicy, + statement *Statement, + packageName string, + functionName string, + functionArgs ...Value, +) (*ExecuteTask, Error) { + policy = clnt.getUsableQueryPolicy(policy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + statement.SetAggregateFunction(packageName, functionName, functionArgs, false) + + var errs Error + for i := range nodes { + command := newServerCommand(nodes[i], policy, nil, statement, statement.TaskId, nil) + if err := command.Execute(); err != nil { + errs = chainErrors(err, errs) + } + } + + return NewExecuteTask(clnt.cluster, statement), errs +} + +// ExecuteUDFNode applies user defined function on records that match the statement filter on the specified node. +// Records are not returned to the client. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ExecuteUDFNode(policy *QueryPolicy, + node *Node, + statement *Statement, + packageName string, + functionName string, + functionArgs ...Value, +) (*ExecuteTask, Error) { + policy = clnt.getUsableQueryPolicy(policy) + + if node == nil { + return nil, ErrClusterIsEmpty.err() + } + + statement.SetAggregateFunction(packageName, functionName, functionArgs, false) + + command := newServerCommand(node, policy, nil, statement, statement.TaskId, nil) + err := command.Execute() + + return NewExecuteTask(clnt.cluster, statement), err +} + +// SetXDRFilter sets XDR filter for given datacenter name and namespace. The expression filter indicates +// which records XDR should ship to the datacenter. +// Pass nil as filter to remove the current filter on the server. +func (clnt *Client) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error { + policy = clnt.getUsableInfoPolicy(policy) + + var strCmd string + if filter == nil { + strCmd = "xdr-set-filter:dc=" + datacenter + ";namespace=" + namespace + ";exp=null" + } else { + b64, err := filter.Base64() + if err != nil { + return newError(types.SERIALIZE_ERROR, "FilterExpression could not be serialized to Base64") + } + + strCmd = "xdr-set-filter:dc=" + datacenter + ";namespace=" + namespace + ";exp=" + b64 + } + + // Send command to one node. That node will distribute it to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.Timeout, strCmd) + if err != nil { + return err + } + + response := responseMap[strCmd] + if strings.EqualFold(response, "ok") { + return nil + } + + return parseInfoErrorCode(response) +} + +var infoErrRegexp = regexp.MustCompile(`(?i)(fail|error)((:|=)(?P[0-9]+))?((:|=)(?P.+))?`) + +func parseInfoErrorCode(response string) Error { + match := infoErrRegexp.FindStringSubmatch(response) + + var code = types.SERVER_ERROR + var message = response + + if len(match) > 0 { + for i, name := range infoErrRegexp.SubexpNames() { + if i != 0 && name != "" && len(match[i]) > 0 { + switch name { + case "code": + i, err := strconv.ParseInt(match[i], 10, 64) + if err == nil { + code = types.ResultCode(i) + message = types.ResultCodeToString(code) + } + case "msg": + message = match[i] + } + } + } + } + + return newError(code, message) +} + +//-------------------------------------------------------- +// Query functions (Supported by Aerospike 3+ servers only) +//-------------------------------------------------------- + +// QueryPartitions executes a query for specified partitions and returns a recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 4.9+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + var tracker *partitionTracker + if partitionFilter == nil { + tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) + } else { + tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) + } + + // result recordset + res := newRecordset(policy.RecordQueueSize, 1) + go clnt.queryPartitions(policy, tracker, statement, res) + + return res, nil +} + +// Query executes a query and returns a Recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) { + return clnt.QueryPartitions(policy, statement, nil) +} + +// QueryNode executes a query on a specific node and returns a recordset. +// The caller can concurrently pop records off the channel through the +// record channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { + return clnt.queryNodePartitions(policy, node, statement) +} + +func (clnt *Client) queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) + + // result recordset + res := newRecordset(policy.RecordQueueSize, 1) + go clnt.queryPartitions(policy, tracker, statement, res) + + return res, nil +} + +//-------------------------------------------------------- +// Index functions (Supported by Aerospike 3+ servers only) +//-------------------------------------------------------- + +// CreateIndex creates a secondary index. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// IndexTask instance. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) CreateIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType IndexType, +) (*IndexTask, Error) { + policy = clnt.getUsableWritePolicy(policy) + return clnt.CreateComplexIndex(policy, namespace, setName, indexName, binName, indexType, ICT_DEFAULT) +} + +// CreateComplexIndex creates a secondary index, with the ability to put indexes +// on bin containing complex data types, e.g: Maps and Lists. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// IndexTask instance. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) CreateComplexIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType IndexType, + indexCollectionType IndexCollectionType, + ctx ...*CDTContext, +) (*IndexTask, Error) { + policy = clnt.getUsableWritePolicy(policy) + + var strCmd bytes.Buffer + strCmd.WriteString("sindex-create:ns=") + strCmd.WriteString(namespace) + + if len(setName) > 0 { + strCmd.WriteString(";set=") + strCmd.WriteString(setName) + } + + strCmd.WriteString(";indexname=") + strCmd.WriteString(indexName) + + var bufEx *bufferEx + if len(ctx) > 0 { + sz, err := cdtContextList(ctx).packArray(nil) + if err != nil { + return nil, err + } + + bufEx = newBuffer(sz) + + _, err = cdtContextList(ctx).packArray(bufEx) + if err != nil { + return nil, err + } + + strCmd.WriteString(";context=") + s := base64.StdEncoding.EncodeToString(bufEx.Bytes()) + strCmd.WriteString(s) + } + + if indexCollectionType != ICT_DEFAULT { + strCmd.WriteString(";indextype=") + strCmd.WriteString(ictToString(indexCollectionType)) + } + + strCmd.WriteString(";indexdata=") + strCmd.WriteString(binName) + strCmd.WriteString(",") + strCmd.WriteString(string(indexType)) + + // Send index command to one node. That node will distribute the command to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) + if err != nil { + return nil, err + } + + response := responseMap[strCmd.String()] + if strings.EqualFold(response, "OK") { + // Return task that could optionally be polled for completion. + return NewIndexTask(clnt.cluster, namespace, indexName), nil + } + + return nil, parseInfoErrorCode(response) +} + +// DropIndex deletes a secondary index. It will block until index is dropped on all nodes. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) DropIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, +) Error { + policy = clnt.getUsableWritePolicy(policy) + var strCmd bytes.Buffer + strCmd.WriteString("sindex-delete:ns=") + strCmd.WriteString(namespace) + + if len(setName) > 0 { + strCmd.WriteString(";set=") + strCmd.WriteString(setName) + } + strCmd.WriteString(";indexname=") + strCmd.WriteString(indexName) + + // Send index command to one node. That node will distribute the command to other nodes. + responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) + if err != nil { + return err + } + + response := responseMap[strCmd.String()] + + if strings.EqualFold(response, "OK") { + // Return task that could optionally be polled for completion. + task := NewDropIndexTask(clnt.cluster, namespace, indexName) + return <-task.OnComplete() + } + + err = parseInfoErrorCode(response) + if err.Matches(types.INDEX_NOTFOUND) { + // Index did not previously exist. Return without error. + return nil + } + + return err +} + +// Truncate removes records in specified namespace/set efficiently. This method is many orders of magnitude +// faster than deleting records one at a time. Works with Aerospike Server versions >= 3.12. +// This asynchronous server call may return before the truncation is complete. The user can still +// write new records after the server call returns because new records will have last update times +// greater than the truncate cutoff (set at the time of truncate call). +// For more information, See https://www.aerospike.com/docs/reference/info#truncate +func (clnt *Client) Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error { + policy = clnt.getUsableInfoPolicy(policy) + + var strCmd bytes.Buffer + if len(set) > 0 { + strCmd.WriteString("truncate:namespace=") + strCmd.WriteString(namespace) + strCmd.WriteString(";set=") + strCmd.WriteString(set) + } else { + strCmd.WriteString("truncate-namespace:namespace=") + strCmd.WriteString(namespace) + } + if beforeLastUpdate != nil { + strCmd.WriteString(";lut=") + strCmd.WriteString(strconv.FormatInt(beforeLastUpdate.UnixNano(), 10)) + } + + responseMap, err := clnt.sendInfoCommand(policy.Timeout, strCmd.String()) + if err != nil { + return err + } + + response := responseMap[strCmd.String()] + if strings.EqualFold(response, "OK") { + return nil + } + + return parseInfoErrorCode(response) +} + +//------------------------------------------------------- +// User administration +//------------------------------------------------------- + +// CreateUser creates a new user with password and roles. Clear-text password will be hashed using bcrypt +// before sending to server. +func (clnt *Client) CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + hash, err := hashPassword(password) + if err != nil { + return err + } + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.createUser(conn, policy, user, hash, roles) + }) + + return err +} + +// DropUser removes a user from the cluster. +func (clnt *Client) DropUser(policy *AdminPolicy, user string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.dropUser(conn, policy, user) + }) + return err +} + +// ChangePassword changes a user's password. Clear-text password will be hashed using bcrypt before sending to server. +func (clnt *Client) ChangePassword(policy *AdminPolicy, user string, password string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + if clnt.cluster.user == "" { + return ErrInvalidUser.err() + } + + hash, err := hashPassword(password) + if err != nil { + return err + } + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + + if user == clnt.cluster.user { + // Change own password. + err = command.changePassword(conn, policy, user, clnt.cluster.Password(), hash) + } else { + // Change other user's password by user admin. + err = command.setPassword(conn, policy, user, hash) + } + }) + + if err == nil { + clnt.cluster.changePassword(user, password, hash) + } + + return err +} + +// GrantRoles adds roles to user's list of roles. +func (clnt *Client) GrantRoles(policy *AdminPolicy, user string, roles []string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.grantRoles(conn, policy, user, roles) + }) + return err +} + +// RevokeRoles removes roles from user's list of roles. +func (clnt *Client) RevokeRoles(policy *AdminPolicy, user string, roles []string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.revokeRoles(conn, policy, user, roles) + }) + + return err +} + +// QueryUser retrieves roles for a given user. +func (clnt *Client) QueryUser(policy *AdminPolicy, user string) (res *UserRoles, err Error) { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return nil, err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + res, err = command.QueryUser(conn, policy, user) + }) + return res, err +} + +// QueryUsers retrieves all users and their roles. +func (clnt *Client) QueryUsers(policy *AdminPolicy) (res []*UserRoles, err Error) { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return nil, err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + res, err = command.QueryUsers(conn, policy) + }) + return res, err +} + +// QueryRole retrieves privileges for a given role. +func (clnt *Client) QueryRole(policy *AdminPolicy, role string) (res *Role, err Error) { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return nil, err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + res, err = command.QueryRole(conn, policy, role) + }) + return res, err +} + +// QueryRoles retrieves all roles and their privileges. +func (clnt *Client) QueryRoles(policy *AdminPolicy) (res []*Role, err Error) { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return nil, err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + res, err = command.QueryRoles(conn, policy) + }) + return res, err +} + +// CreateRole creates a user-defined role. +// Quotas require server security configuration "enable-quotas" to be set to true. +// Pass 0 for quota values for no limit. +func (clnt *Client) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.createRole(conn, policy, roleName, privileges, whitelist, readQuota, writeQuota) + }) + return err +} + +// DropRole removes a user-defined role. +func (clnt *Client) DropRole(policy *AdminPolicy, roleName string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.dropRole(conn, policy, roleName) + }) + return err +} + +// GrantPrivileges grant privileges to a user-defined role. +func (clnt *Client) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.grantPrivileges(conn, policy, roleName, privileges) + }) + return err +} + +// RevokePrivileges revokes privileges from a user-defined role. +func (clnt *Client) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.revokePrivileges(conn, policy, roleName, privileges) + }) + return err +} + +// SetWhitelist sets IP address whitelist for a role. If whitelist is nil or empty, it removes existing whitelist from role. +func (clnt *Client) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.setWhitelist(conn, policy, roleName, whitelist) + }) + return err +} + +// SetQuotas sets maximum reads/writes per second limits for a role. If a quota is zero, the limit is removed. +// Quotas require server security configuration "enable-quotas" to be set to true. +// Pass 0 for quota values for no limit. +func (clnt *Client) SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { + policy = clnt.getUsableAdminPolicy(policy) + + // prepare the node.tendConn + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return err + } + + node.usingTendConn(policy.Timeout, func(conn *Connection) { + command := NewAdminCommand(nil) + err = command.setQuotas(conn, policy, roleName, readQuota, writeQuota) + }) + return err +} + +//------------------------------------------------------- +// Access Methods +//------------------------------------------------------- + +// Cluster exposes the cluster object to the user +func (clnt *Client) Cluster() *Cluster { + return clnt.cluster +} + +// String implements the Stringer interface for client +func (clnt *Client) String() string { + if clnt.cluster != nil { + return clnt.cluster.String() + } + return "" +} + +// MetricsEnabled returns true if metrics are enabled for the cluster. +func (clnt *Client) MetricsEnabled() bool { + return clnt.cluster.MetricsEnabled() +} + +// EnableMetrics enables the cluster transaction metrics gathering. +// If the parameters for the histogram in the policy are the different from the one already +// on the cluster, the metrics will be reset. +func (clnt *Client) EnableMetrics(policy *MetricsPolicy) { + clnt.cluster.EnableMetrics(policy) +} + +// DisableMetrics disables the cluster transaction metrics gathering. +func (clnt *Client) DisableMetrics() { + clnt.cluster.DisableMetrics() +} + +// Stats returns internal statistics regarding the inner state of the client and the cluster. +func (clnt *Client) Stats() (map[string]interface{}, Error) { + resStats := clnt.cluster.statsCopy() + + clusterStats := *newNodeStats(clnt.cluster.MetricsPolicy()) + for _, stats := range resStats { + clusterStats.aggregate(&stats) + } + + resStats["cluster-aggregated-stats"] = clusterStats + + b, err := json.Marshal(resStats) + if err != nil { + return nil, newCommonError(err) + } + + res := map[string]interface{}{} + err = json.Unmarshal(b, &res) + if err != nil { + return nil, newCommonError(err) + } + + res["open-connections"] = clusterStats.ConnectionsOpen.Get() + res["total-nodes"] = len(clnt.cluster.GetNodes()) + + aggstats := res["cluster-aggregated-stats"].(map[string]interface{}) + aggstats["exceeded-max-retries"] = clnt.cluster.maxRetriesExceededCount.Get() + aggstats["exceeded-total-timeout"] = clnt.cluster.totalTimeoutExceededCount.Get() + + return res, nil +} + +// WarmUp fills the connection pool with connections for all nodes. +// This is necessary on startup for high traffic programs. +// If the count is <= 0, the connection queue will be filled. +// If the count is more than the size of the pool, the pool will be filled. +// Note: One connection per node is reserved for tend operations and is not used for transactions. +func (clnt *Client) WarmUp(count int) (int, Error) { + return clnt.cluster.WarmUp(count) +} + +//------------------------------------------------------- +// Internal Methods +//------------------------------------------------------- + +func (clnt *Client) sendInfoCommand(timeout time.Duration, command string) (map[string]string, Error) { + node, err := clnt.cluster.GetRandomNode() + if err != nil { + return nil, err + } + + policy := InfoPolicy{Timeout: timeout} + return node.RequestInfo(&policy, command) +} + +//------------------------------------------------------- +// Policy Methods +//------------------------------------------------------- + +func (clnt *Client) getUsablePolicy(policy *BasePolicy) *BasePolicy { + if policy == nil { + if clnt.DefaultPolicy != nil { + return clnt.DefaultPolicy + } + return NewPolicy() + } + return policy +} + +func (clnt *Client) getUsableBatchPolicy(policy *BatchPolicy) *BatchPolicy { + if policy == nil { + if clnt.DefaultBatchPolicy != nil { + return clnt.DefaultBatchPolicy + } + return NewBatchPolicy() + } + return policy +} + +func (clnt *Client) getUsableBaseBatchWritePolicy(policy *BatchPolicy) *BatchPolicy { + if policy == nil { + if clnt.DefaultBatchPolicy != nil { + return clnt.DefaultBatchPolicy + } + return NewBatchPolicy() + } + return policy +} + +func (clnt *Client) getUsableBatchReadPolicy(policy *BatchReadPolicy) *BatchReadPolicy { + if policy == nil { + if clnt.DefaultBatchReadPolicy != nil { + return clnt.DefaultBatchReadPolicy + } + return NewBatchReadPolicy() + } + return policy +} + +func (clnt *Client) getUsableBatchWritePolicy(policy *BatchWritePolicy) *BatchWritePolicy { + if policy == nil { + if clnt.DefaultBatchWritePolicy != nil { + return clnt.DefaultBatchWritePolicy + } + return NewBatchWritePolicy() + } + return policy +} + +func (clnt *Client) getUsableBatchDeletePolicy(policy *BatchDeletePolicy) *BatchDeletePolicy { + if policy == nil { + if clnt.DefaultBatchDeletePolicy != nil { + return clnt.DefaultBatchDeletePolicy + } + return NewBatchDeletePolicy() + } + return policy +} + +func (clnt *Client) getUsableBatchUDFPolicy(policy *BatchUDFPolicy) *BatchUDFPolicy { + if policy == nil { + if clnt.DefaultBatchUDFPolicy != nil { + return clnt.DefaultBatchUDFPolicy + } + return NewBatchUDFPolicy() + } + return policy +} + +func (clnt *Client) getUsableWritePolicy(policy *WritePolicy) *WritePolicy { + if policy == nil { + if clnt.DefaultWritePolicy != nil { + return clnt.DefaultWritePolicy + } + return NewWritePolicy(0, 0) + } + return policy +} + +func (clnt *Client) getUsableScanPolicy(policy *ScanPolicy) *ScanPolicy { + if policy == nil { + if clnt.DefaultScanPolicy != nil { + return clnt.DefaultScanPolicy + } + return NewScanPolicy() + } + return policy +} + +func (clnt *Client) getUsableQueryPolicy(policy *QueryPolicy) *QueryPolicy { + if policy == nil { + if clnt.DefaultQueryPolicy != nil { + return clnt.DefaultQueryPolicy + } + return NewQueryPolicy() + } + return policy +} + +func (clnt *Client) getUsableAdminPolicy(policy *AdminPolicy) *AdminPolicy { + if policy == nil { + if clnt.DefaultAdminPolicy != nil { + return clnt.DefaultAdminPolicy + } + return NewAdminPolicy() + } + return policy +} + +func (clnt *Client) getUsableInfoPolicy(policy *InfoPolicy) *InfoPolicy { + if policy == nil { + if clnt.DefaultInfoPolicy != nil { + return clnt.DefaultInfoPolicy + } + return NewInfoPolicy() + } + return policy +} + +//------------------------------------------------------- +// Utility Functions +//------------------------------------------------------- diff --git a/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go b/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go new file mode 100644 index 00000000..180445cf --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go @@ -0,0 +1,154 @@ +//go:build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "sync" + + "golang.org/x/sync/semaphore" + + lualib "github.com/aerospike/aerospike-client-go/v7/internal/lua" + "github.com/aerospike/aerospike-client-go/v7/logger" + lua "github.com/yuin/gopher-lua" +) + +//-------------------------------------------------------- +// Query Aggregate functions (Supported by Aerospike 3+ servers only) +//-------------------------------------------------------- + +// SetLuaPath sets the Lua interpreter path to files +// This path is used to load UDFs for QueryAggregate command +func SetLuaPath(lpath string) { + lualib.SetPath(lpath) +} + +// QueryAggregate executes a Map/Reduce query and returns the results. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) { + statement.SetAggregateFunction(packageName, functionName, functionArgs, true) + + policy = clnt.getUsableQueryPolicy(policy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, ErrClusterIsEmpty.err() + } + + // results channel must be async for performance + recSet := newRecordset(policy.RecordQueueSize, len(nodes)) + + // get a lua instance + luaInstance := lualib.LuaPool.Get().(*lua.LState) + if luaInstance == nil { + return nil, ErrLuaPoolEmpty.err() + } + + // Input Channel + inputChan := make(chan interface{}, 4096) // 4096 = number of partitions + istream := lualib.NewStream(luaInstance, inputChan) + + // Output Channe; + outputChan := make(chan interface{}) + ostream := lualib.NewStream(luaInstance, outputChan) + + // results channel must be async for performance + var wg sync.WaitGroup + wg.Add(len(nodes)) + // results channel must be async for performance + maxConcurrentNodes := policy.MaxConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(nodes) + } + sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) + ctx := context.Background() + for _, node := range nodes { + // copy policies to avoid race conditions + newPolicy := *policy + command := newQueryAggregateCommand(node, &newPolicy, statement, recSet) + command.luaInstance = luaInstance + command.inputChan = inputChan + + if err := sem.Acquire(ctx, 1); err != nil { + logger.Logger.Error("Constraint Semaphore failed for QueryAggregate: %s", err.Error()) + } + go func() { + defer sem.Release(1) + defer wg.Done() + command.Execute() + }() + } + + go func() { + wg.Wait() + close(inputChan) + }() + + go func() { + // we cannot signal end and close the recordset + // while processing is still going on + // We will do it only here, after all processing is over + defer func() { + for i := 0; i < len(nodes); i++ { + recSet.signalEnd() + } + }() + + for val := range outputChan { + recSet.records <- &Result{Record: &Record{Bins: BinMap{"SUCCESS": val}}, Err: nil} + } + }() + + go func() { + defer close(outputChan) + defer luaInstance.Close() + + err := luaInstance.DoFile(lualib.Path() + packageName + ".lua") + if err != nil { + recSet.sendError(newCommonError(err)) + return + } + + fn := luaInstance.GetGlobal(functionName) + + luaArgs := []lua.LValue{fn, lualib.NewValue(luaInstance, 2), istream, ostream} + for _, a := range functionArgs { + luaArgs = append(luaArgs, lualib.NewValue(luaInstance, unwrapValue(a))) + } + + if err := luaInstance.CallByParam(lua.P{ + Fn: luaInstance.GetGlobal("apply_stream"), + NRet: 1, + Protect: true, + }, + luaArgs..., + ); err != nil { + recSet.sendError(newCommonError(err)) + return + } + + luaInstance.Get(-1) // returned value + luaInstance.Pop(1) // remove received value + }() + + return recSet, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder.go b/aerospike-tls/vendor-aerospike-client-go/client_builder.go new file mode 100644 index 00000000..6e34feb1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_builder.go @@ -0,0 +1,26 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// ClientType determines the type of client to build. +type ClientType int + +const ( + // CTNative means: Create a native client. + CTNative ClientType = iota + + // CTProxy means: Create a proxy client. + CTProxy +) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go b/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go new file mode 100644 index 00000000..e3f54d14 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go @@ -0,0 +1,36 @@ +//go:build !as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +// CreateClientWithPolicyAndHost generates a new Client of the specified type +// with the specified ClientPolicy and sets up the cluster using the provided hosts. +// If the policy is nil, the default relevant policy will be used. +func CreateClientWithPolicyAndHost(typ ClientType, policy *ClientPolicy, hosts ...*Host) (ClientIfc, Error) { + if len(hosts) == 0 { + return nil, newError(types.SERVER_NOT_AVAILABLE, "No hosts were provided") + } + + switch typ { + case CTNative: + return NewClientWithPolicyAndHost(policy, hosts...) + case CTProxy: + return nil, newError(types.GRPC_ERROR, "Proxy client mode not enabled. Pass -tags as_proxy during build") + } + return nil, newError(types.SERVER_NOT_AVAILABLE, "Invalid client type") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go b/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go new file mode 100644 index 00000000..de7f58bd --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go @@ -0,0 +1,39 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +// CreateClientWithPolicyAndHost generates a new Client of the specified type +// with the specified ClientPolicy and sets up the cluster using the provided hosts. +// If the policy is nil, the default relevant policy will be used. +func CreateClientWithPolicyAndHost(typ ClientType, policy *ClientPolicy, hosts ...*Host) (ClientIfc, Error) { + if len(hosts) == 0 { + return nil, newError(types.SERVER_NOT_AVAILABLE, "No hosts were provided") + } + + switch typ { + case CTNative: + return NewClientWithPolicyAndHost(policy, hosts...) + case CTProxy: + if len(hosts) > 1 { + return nil, newError(types.GRPC_ERROR, "Only one proxy host is acceptable") + } + return NewProxyClientWithPolicyAndHost(policy, hosts[0]) + } + return nil, newError(types.SERVER_NOT_AVAILABLE, "Invalid client type") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc.go new file mode 100644 index 00000000..7cfe2a1a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_ifc.go @@ -0,0 +1,138 @@ +//go:build !as_performance && !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// ClientIfc abstracts an Aerospike cluster. +type ClientIfc interface { + Add(policy *WritePolicy, key *Key, binMap BinMap) Error + AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Append(policy *WritePolicy, key *Key, binMap BinMap) Error + AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) + BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) + BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) + BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) + BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error + BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) + BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) + BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error + ChangePassword(policy *AdminPolicy, user string, password string) Error + Close() + Cluster() *Cluster + CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) + CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) + CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error + CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error + Delete(policy *WritePolicy, key *Key) (bool, Error) + DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error + DropRole(policy *AdminPolicy, roleName string) Error + DropUser(policy *AdminPolicy, user string) Error + Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) + ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + Exists(policy *BasePolicy, key *Key) (bool, Error) + Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) + GetHeader(policy *BasePolicy, key *Key) (*Record, Error) + GetNodeNames() []string + GetNodes() []*Node + GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + GrantRoles(policy *AdminPolicy, user string, roles []string) Error + IsConnected() bool + ListUDF(policy *BasePolicy) ([]*UDF, Error) + Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) + Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error + PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Put(policy *WritePolicy, key *Key, binMap BinMap) Error + PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) + QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) + QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) + QueryRole(policy *AdminPolicy, role string) (*Role, Error) + QueryRoles(policy *AdminPolicy) ([]*Role, Error) + QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) + QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) + RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) + RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) + RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) + RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + RevokeRoles(policy *AdminPolicy, user string, roles []string) Error + ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error + SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error + SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error + Stats() (map[string]interface{}, Error) + String() string + Touch(policy *WritePolicy, key *Key) Error + Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error + WarmUp(count int) (int, Error) + + BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) + GetObject(policy *BasePolicy, key *Key, obj interface{}) Error + PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) + QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) + QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) + QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) + QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) + ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + + // TODO: Synchronization here for the sake of dynamic config in the future + + getUsablePolicy(*BasePolicy) *BasePolicy + getUsableWritePolicy(*WritePolicy) *WritePolicy + getUsableScanPolicy(*ScanPolicy) *ScanPolicy + getUsableQueryPolicy(*QueryPolicy) *QueryPolicy + getUsableAdminPolicy(*AdminPolicy) *AdminPolicy + getUsableInfoPolicy(*InfoPolicy) *InfoPolicy + + getUsableBatchPolicy(*BatchPolicy) *BatchPolicy + getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy + getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy + getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy + getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy + + GetDefaultPolicy() *BasePolicy + GetDefaultBatchPolicy() *BatchPolicy + GetDefaultBatchWritePolicy() *BatchWritePolicy + GetDefaultBatchDeletePolicy() *BatchDeletePolicy + GetDefaultBatchUDFPolicy() *BatchUDFPolicy + GetDefaultWritePolicy() *WritePolicy + GetDefaultScanPolicy() *ScanPolicy + GetDefaultQueryPolicy() *QueryPolicy + GetDefaultAdminPolicy() *AdminPolicy + GetDefaultInfoPolicy() *InfoPolicy + + SetDefaultPolicy(*BasePolicy) + SetDefaultBatchPolicy(*BatchPolicy) + SetDefaultBatchWritePolicy(*BatchWritePolicy) + SetDefaultBatchDeletePolicy(*BatchDeletePolicy) + SetDefaultBatchUDFPolicy(*BatchUDFPolicy) + SetDefaultWritePolicy(*WritePolicy) + SetDefaultScanPolicy(*ScanPolicy) + SetDefaultQueryPolicy(*QueryPolicy) + SetDefaultAdminPolicy(*AdminPolicy) + SetDefaultInfoPolicy(*InfoPolicy) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go new file mode 100644 index 00000000..310bb050 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go @@ -0,0 +1,141 @@ +//go:build !as_performance && app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// ClientIfc abstracts an Aerospike cluster. +type ClientIfc interface { + Add(policy *WritePolicy, key *Key, binMap BinMap) Error + AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Append(policy *WritePolicy, key *Key, binMap BinMap) Error + AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) + BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) + BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) + BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) + BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error + BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) + BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) + BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error + ChangePassword(policy *AdminPolicy, user string, password string) Error + Close() + Cluster() *Cluster + CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) + CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) + CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error + CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error + Delete(policy *WritePolicy, key *Key) (bool, Error) + DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error + DropRole(policy *AdminPolicy, roleName string) Error + DropUser(policy *AdminPolicy, user string) Error + Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) + ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + Exists(policy *BasePolicy, key *Key) (bool, Error) + Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) + GetHeader(policy *BasePolicy, key *Key) (*Record, Error) + GetNodeNames() []string + GetNodes() []*Node + GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + GrantRoles(policy *AdminPolicy, user string, roles []string) Error + IsConnected() bool + ListUDF(policy *BasePolicy) ([]*UDF, Error) + Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) + Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error + PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Put(policy *WritePolicy, key *Key, binMap BinMap) Error + PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) + QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) + QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) + QueryRole(policy *AdminPolicy, role string) (*Role, Error) + QueryRoles(policy *AdminPolicy) ([]*Role, Error) + QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) + QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) + RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) + RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) + RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) + RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + RevokeRoles(policy *AdminPolicy, user string, roles []string) Error + ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error + SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error + SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error + Stats() (map[string]interface{}, Error) + String() string + Touch(policy *WritePolicy, key *Key) Error + Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error + WarmUp(count int) (int, Error) + + // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) + + BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) + GetObject(policy *BasePolicy, key *Key, obj interface{}) Error + PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) + QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) + QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) + QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) + ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + + // TODO: Synchronization here for the sake of dynamic config in the future + + getUsablePolicy(*BasePolicy) *BasePolicy + getUsableWritePolicy(*WritePolicy) *WritePolicy + getUsableScanPolicy(*ScanPolicy) *ScanPolicy + getUsableQueryPolicy(*QueryPolicy) *QueryPolicy + getUsableAdminPolicy(*AdminPolicy) *AdminPolicy + getUsableInfoPolicy(*InfoPolicy) *InfoPolicy + + getUsableBatchPolicy(*BatchPolicy) *BatchPolicy + getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy + getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy + getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy + getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy + + GetDefaultPolicy() *BasePolicy + GetDefaultBatchPolicy() *BatchPolicy + GetDefaultBatchReadPolicy() *BatchReadPolicy + GetDefaultBatchWritePolicy() *BatchWritePolicy + GetDefaultBatchDeletePolicy() *BatchDeletePolicy + GetDefaultBatchUDFPolicy() *BatchUDFPolicy + GetDefaultWritePolicy() *WritePolicy + GetDefaultScanPolicy() *ScanPolicy + GetDefaultQueryPolicy() *QueryPolicy + GetDefaultAdminPolicy() *AdminPolicy + GetDefaultInfoPolicy() *InfoPolicy + + SetDefaultPolicy(*BasePolicy) + SetDefaultBatchPolicy(*BatchPolicy) + SetDefaultBatchReadPolicy(*BatchReadPolicy) + SetDefaultBatchWritePolicy(*BatchWritePolicy) + SetDefaultBatchDeletePolicy(*BatchDeletePolicy) + SetDefaultBatchUDFPolicy(*BatchUDFPolicy) + SetDefaultWritePolicy(*WritePolicy) + SetDefaultScanPolicy(*ScanPolicy) + SetDefaultQueryPolicy(*QueryPolicy) + SetDefaultAdminPolicy(*AdminPolicy) + SetDefaultInfoPolicy(*InfoPolicy) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go new file mode 100644 index 00000000..e2ccaa8c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go @@ -0,0 +1,139 @@ +//go:build as_performance && app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// ClientIfc abstracts an Aerospike cluster. +type ClientIfc interface { + Add(policy *WritePolicy, key *Key, binMap BinMap) Error + AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Append(policy *WritePolicy, key *Key, binMap BinMap) Error + AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) + BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) + BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) + BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) + BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error + BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) + BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) + BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error + ChangePassword(policy *AdminPolicy, user string, password string) Error + Close() + Cluster() *Cluster + CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) + CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) + CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error + CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error + Delete(policy *WritePolicy, key *Key) (bool, Error) + DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error + DropRole(policy *AdminPolicy, roleName string) Error + DropUser(policy *AdminPolicy, user string) Error + Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) + ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + Exists(policy *BasePolicy, key *Key) (bool, Error) + Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) + GetHeader(policy *BasePolicy, key *Key) (*Record, Error) + GetNodeNames() []string + GetNodes() []*Node + GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + GrantRoles(policy *AdminPolicy, user string, roles []string) Error + IsConnected() bool + ListUDF(policy *BasePolicy) ([]*UDF, Error) + Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) + Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error + PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Put(policy *WritePolicy, key *Key, binMap BinMap) Error + PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) + QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) + QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) + QueryRole(policy *AdminPolicy, role string) (*Role, Error) + QueryRoles(policy *AdminPolicy) ([]*Role, Error) + QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) + QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) + RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) + RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) + RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) + RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + RevokeRoles(policy *AdminPolicy, user string, roles []string) Error + ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error + SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error + SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error + Stats() (map[string]interface{}, Error) + String() string + Touch(policy *WritePolicy, key *Key) Error + Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error + WarmUp(count int) (int, Error) + + // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) + + // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) + // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error + // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) + // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) + // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) + // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) + // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + + // TODO: Synchronization here for the sake of dynamic config in the future + + getUsablePolicy(*BasePolicy) *BasePolicy + getUsableWritePolicy(*WritePolicy) *WritePolicy + getUsableScanPolicy(*ScanPolicy) *ScanPolicy + getUsableQueryPolicy(*QueryPolicy) *QueryPolicy + getUsableAdminPolicy(*AdminPolicy) *AdminPolicy + getUsableInfoPolicy(*InfoPolicy) *InfoPolicy + + getUsableBatchPolicy(*BatchPolicy) *BatchPolicy + getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy + getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy + getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy + getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy + + GetDefaultPolicy() *BasePolicy + GetDefaultBatchPolicy() *BatchPolicy + GetDefaultBatchWritePolicy() *BatchWritePolicy + GetDefaultBatchDeletePolicy() *BatchDeletePolicy + GetDefaultBatchUDFPolicy() *BatchUDFPolicy + GetDefaultWritePolicy() *WritePolicy + GetDefaultScanPolicy() *ScanPolicy + GetDefaultQueryPolicy() *QueryPolicy + GetDefaultAdminPolicy() *AdminPolicy + GetDefaultInfoPolicy() *InfoPolicy + + SetDefaultPolicy(*BasePolicy) + SetDefaultBatchPolicy(*BatchPolicy) + SetDefaultBatchWritePolicy(*BatchWritePolicy) + SetDefaultBatchDeletePolicy(*BatchDeletePolicy) + SetDefaultBatchUDFPolicy(*BatchUDFPolicy) + SetDefaultWritePolicy(*WritePolicy) + SetDefaultScanPolicy(*ScanPolicy) + SetDefaultQueryPolicy(*QueryPolicy) + SetDefaultAdminPolicy(*AdminPolicy) + SetDefaultInfoPolicy(*InfoPolicy) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go new file mode 100644 index 00000000..3e3376b6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go @@ -0,0 +1,141 @@ +//go:build as_performance && !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// ClientIfc abstracts an Aerospike cluster. +type ClientIfc interface { + Add(policy *WritePolicy, key *Key, binMap BinMap) Error + AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Append(policy *WritePolicy, key *Key, binMap BinMap) Error + AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) + BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) + BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) + BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) + BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error + BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) + BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) + BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error + ChangePassword(policy *AdminPolicy, user string, password string) Error + Close() + Cluster() *Cluster + CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) + CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) + CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error + CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error + Delete(policy *WritePolicy, key *Key) (bool, Error) + DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error + DropRole(policy *AdminPolicy, roleName string) Error + DropUser(policy *AdminPolicy, user string) Error + Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) + ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) + Exists(policy *BasePolicy, key *Key) (bool, Error) + Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) + GetHeader(policy *BasePolicy, key *Key) (*Record, Error) + GetNodeNames() []string + GetNodes() []*Node + GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + GrantRoles(policy *AdminPolicy, user string, roles []string) Error + IsConnected() bool + ListUDF(policy *BasePolicy) ([]*UDF, Error) + Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) + Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error + PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Put(policy *WritePolicy, key *Key, binMap BinMap) Error + PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error + Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) + QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) + QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) + QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) + QueryRole(policy *AdminPolicy, role string) (*Role, Error) + QueryRoles(policy *AdminPolicy) ([]*Role, Error) + QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) + QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) + RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) + RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) + RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) + RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error + RevokeRoles(policy *AdminPolicy, user string, roles []string) Error + ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) + ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error + SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error + SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error + Stats() (map[string]interface{}, Error) + String() string + Touch(policy *WritePolicy, key *Key) Error + Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error + WarmUp(count int) (int, Error) + + QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) + + // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) + // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error + // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) + // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) + // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) + // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) + // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) + // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) + + // TODO: Synchronization here for the sake of dynamic config in the future + + getUsablePolicy(*BasePolicy) *BasePolicy + getUsableWritePolicy(*WritePolicy) *WritePolicy + getUsableScanPolicy(*ScanPolicy) *ScanPolicy + getUsableQueryPolicy(*QueryPolicy) *QueryPolicy + getUsableAdminPolicy(*AdminPolicy) *AdminPolicy + getUsableInfoPolicy(*InfoPolicy) *InfoPolicy + + getUsableBatchPolicy(*BatchPolicy) *BatchPolicy + getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy + getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy + getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy + getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy + + GetDefaultPolicy() *BasePolicy + GetDefaultBatchPolicy() *BatchPolicy + GetDefaultBatchReadPolicy() *BatchReadPolicy + GetDefaultBatchWritePolicy() *BatchWritePolicy + GetDefaultBatchDeletePolicy() *BatchDeletePolicy + GetDefaultBatchUDFPolicy() *BatchUDFPolicy + GetDefaultWritePolicy() *WritePolicy + GetDefaultScanPolicy() *ScanPolicy + GetDefaultQueryPolicy() *QueryPolicy + GetDefaultAdminPolicy() *AdminPolicy + GetDefaultInfoPolicy() *InfoPolicy + + SetDefaultPolicy(*BasePolicy) + SetDefaultBatchPolicy(*BatchPolicy) + SetDefaultBatchReadPolicy(*BatchReadPolicy) + SetDefaultBatchWritePolicy(*BatchWritePolicy) + SetDefaultBatchDeletePolicy(*BatchDeletePolicy) + SetDefaultBatchUDFPolicy(*BatchUDFPolicy) + SetDefaultWritePolicy(*WritePolicy) + SetDefaultScanPolicy(*ScanPolicy) + SetDefaultQueryPolicy(*QueryPolicy) + SetDefaultAdminPolicy(*AdminPolicy) + SetDefaultInfoPolicy(*InfoPolicy) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_object_test.go b/aerospike-tls/vendor-aerospike-client-go/client_object_test.go new file mode 100644 index 00000000..3e71cef0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_object_test.go @@ -0,0 +1,1436 @@ +//go:build !as_performance && !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "strconv" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + var nsup int + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + for _, useBoolType := range []bool{false, true} { + + gg.BeforeEach(func() { + as.UseNativeBoolTypeInReflection = useBoolType + }) + + gg.Describe("Data operations on objects", func() { + // connection data + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + + gg.BeforeEach(func() { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + type SomeBool bool + type SomeByte byte + type SomeInt int + type SomeUint uint + type SomeInt8 int8 + type SomeUint8 uint8 + type SomeInt16 int16 + type SomeUint16 uint16 + type SomeInt32 int32 + type SomeUint32 uint32 + type SomeInt64 int64 + type SomeUint64 uint64 + type SomeFloat32 float32 + type SomeFloat64 float64 + type SomeString string + + type SomeStruct struct { + A int + Self *SomeStruct + } + + type testObject struct { + TTL uint32 `asm:"ttl"` + Gen uint32 `asm:"gen"` + + Nil interface{} + NilP *int + + Bool bool + BoolP *bool + + Byte byte + ByteP *byte + + Int int + Intp *int + + Int8 int8 + Int8P *int8 + UInt8 uint8 + UInt8P *uint8 + + Int16 int16 + Int16P *int16 + UInt16 uint16 + UInt16P *uint16 + + Int32 int32 + Int32P *int32 + UInt32 uint32 + UInt32P *uint32 + + Int64 int64 + Int64P *int64 + UInt64 uint64 + UInt64P *uint64 + + F32 float32 + F32P *float32 + + F64 float64 + F64P *float64 + + String string + StringP *string + + Interface interface{} + // InterfaceP interface{} + InterfacePP *interface{} + + ByteArray []byte + ArrByteArray [][]byte + Array [3]interface{} + SliceString []string + SliceFloat64 []float64 + SliceInt []interface{} + Slice []interface{} + ArrayOfMaps [1]map[int]string + SliceOfMaps []map[int]string + ArrayOfSlices [1][]interface{} + SliceOfSlices [][]interface{} + ArrayOfArrays [1][1]interface{} + SliceOfArrays [][1]interface{} + + ArrayOfStructs [1]SomeStruct + SliceOfStructs []SomeStruct + + Map map[interface{}]interface{} + MapOfMaps map[string]map[int64]byte + MapOfSlices map[string][]byte + MapOfArrays map[string][3]byte + MapOfStructs map[string]SomeStruct + MapOfPStructs map[string]*SomeStruct + + CustomBool SomeBool + CustomBoolP *SomeBool + CustomByte SomeByte + CustomByteP *SomeByte + CustomInt SomeInt + CustomIntP *SomeInt + CustomUint SomeUint + CustomUintP *SomeUint + CustomInt8 SomeInt8 + CustomInt8P *SomeInt8 + CustomUint8 SomeUint8 + CustomUint8P *SomeUint8 + CustomInt16 SomeInt16 + CustomInt16P *SomeInt16 + CustomUint16 SomeUint16 + CustomUint16P *SomeUint16 + CustomInt32 SomeInt32 + CustomInt32P *SomeInt32 + CustomUint32 SomeUint32 + CustomUint32P *SomeUint32 + CustomInt64 SomeInt64 + CustomInt64P *SomeInt64 + CustomUint64 SomeUint64 + CustomUint64P *SomeUint64 + + CustomFloat32 SomeFloat32 + CustomFloat32P *SomeFloat32 + CustomFloat64 SomeFloat64 + CustomFloat64P *SomeFloat64 + + CustomString SomeString + CustomStringP *SomeString + + NestedObj SomeStruct + NestedObjP *testObject + EmpNestedObjP *testObject + + // Important: Used in ODMs + NestedObjSlice []SomeStruct + EmpNstdObjSlic []SomeStruct + NstdObjPSlice []*testObject + EmpNstdObjPSlc []*testObject + + // std lib type + Tm time.Time + TmP *time.Time + + Anonym struct { + SomeStruct + } + + AnonymP *struct { + SomeStruct + } + } + + type testObjectTagged struct { + TTL uint32 `asm:"ttl"` + Gen uint32 `asm:"gen"` + + Nil interface{} `as:"nil"` + NilP *int `as:"nilp"` + + Bool bool `as:"bool"` + BoolP *bool `as:"boolp"` + + Byte byte `as:"byte"` + ByteP *byte `as:"bytep"` + + Int int `as:"int"` + Intp *int `as:"intp"` + + Int8 int8 `as:"int8"` + Int8P *int8 `as:"int8p"` + UInt8 uint8 `as:"uint8"` + UInt8P *uint8 `as:"uint8p"` + + Int16 int16 `as:"int16"` + Int16P *int16 `as:"int16p"` + UInt16 uint16 `as:"uint16"` + UInt16P *uint16 `as:"uint16p"` + + Int32 int32 `as:"int32"` + Int32P *int32 `as:"int32p"` + UInt32 uint32 `as:"uint32"` + UInt32P *uint32 `as:"uint32p"` + + Int64 int64 `as:"int64"` + Int64P *int64 `as:"int64p"` + UInt64 uint64 `as:"uint64"` + UInt64P *uint64 `as:"uint64p"` + + F32 float32 `as:"f32"` + F32P *float32 `as:"f32p"` + + F64 float64 `as:"f64"` + F64P *float64 `as:"f64p"` + + String string `as:"string"` + StringP *string `as:"stringp"` + + Interface interface{} `as:"interface"` + // InterfaceP interface{} `as:"// interface"` + InterfacePP *interface{} `as:"interfacepp"` + + ByteArray []byte `as:"bytearray"` + ArrByteArray [][]byte `as:"arrbytearray"` + Array [3]interface{} `as:"array"` + SliceString []string `as:"slicestring"` + SliceFloat64 []float64 `as:"slicefloat64"` + SliceInt []interface{} `as:"sliceint"` + Slice []interface{} `as:"slice"` + + ArrayOfMaps [1]map[int]string `as:"arrayOfMaps"` + SliceOfMaps []map[int]string `as:"sliceOfMaps"` + ArrayOfSlices [1][]interface{} `as:"arrayOfSlices"` + SliceOfSlices [][]interface{} `as:"sliceOfSlices"` + ArrayOfArrays [1][1]interface{} `as:"arrayOfArrays"` + SliceOfArrays [][1]interface{} `as:"sliceOfArrays"` + ArrayOfStructs [1]SomeStruct `as:"ArrayOfStructs"` + SliceOfStructs []SomeStruct `as:"SliceOfStructs"` + + Map map[interface{}]interface{} `as:"map"` + MapOfMaps map[string]map[int64]byte `as:"mapOfMaps"` + MapOfSlices map[string][]byte `as:"mapOfSlices"` + MapOfArrays map[string][3]byte `as:"MapOfArrays"` + MapOfStructs map[string]SomeStruct `as:"mapOfStructs"` + MapOfPStructs map[string]*SomeStruct `as:"mapOfPStructs"` + + CustomBool SomeBool `as:"custombool"` + CustomBoolP *SomeBool `as:"customboolp"` + CustomByte SomeByte `as:"custombyte"` + CustomByteP *SomeByte `as:"custombytep"` + CustomInt SomeInt `as:"customint"` + CustomIntP *SomeInt `as:"customintp"` + CustomUint SomeUint `as:"customuint"` + CustomUintP *SomeUint `as:"customuintp"` + CustomInt8 SomeInt8 `as:"customint8"` + CustomInt8P *SomeInt8 `as:"customint8p"` + CustomUint8 SomeUint8 `as:"customuint8"` + CustomUint8P *SomeUint8 `as:"customuint8p"` + CustomInt16 SomeInt16 `as:"customint16"` + CustomInt16P *SomeInt16 `as:"customint16p"` + CustomUint16 SomeUint16 `as:"customuint16"` + CustomUint16P *SomeUint16 `as:"customuint16p"` + CustomInt32 SomeInt32 `as:"customint32"` + CustomInt32P *SomeInt32 `as:"customint32p"` + CustomUint32 SomeUint32 `as:"customuint32"` + CustomUint32P *SomeUint32 `as:"customuint32p"` + CustomInt64 SomeInt64 `as:"customint64"` + CustomInt64P *SomeInt64 `as:"customint64p"` + CustomUint64 SomeUint64 `as:"customuint64"` + CustomUint64P *SomeUint64 `as:"customuint64p"` + + CustomFloat32 SomeFloat32 `as:"customfloat32"` + CustomFloat32P *SomeFloat32 `as:"customfloat32p"` + CustomFloat64 SomeFloat64 `as:"customfloat64"` + CustomFloat64P *SomeFloat64 `as:"customfloat64p"` + + CustomString SomeString `as:"customstring"` + CustomStringP *SomeString `as:"customstringp"` + + NestedObj SomeStruct `as:"nestedobj"` + NestedObjP *testObject `as:"nestedobjp"` + EmpNestedObjP *testObject `as:"empnestedobj"` + + // Important: Used in ODMs `as:"// important"` + NestedObjSlice []SomeStruct `as:"nestedobjslice"` + EmpNstdObjSlic []SomeStruct `as:"empnstdobj"` + NstdObjPSlice []*testObject `as:"nstdobjpslice"` + EmpNstdObjPSlc []*testObject `as:"empnstdobjp"` + + // std lib type `as:"// std lib"` + Tm time.Time `as:"tm time."` + TmP *time.Time `as:"tmp"` + + Anonym struct { + SomeStruct + } `as:"anonym"` + + AnonymP *struct { + SomeStruct + } `as:"anonymp"` + } + + makeTestObject := func() *testObject { + bl := true + b := byte(0) + ip := 11 + p8 := int8(4) + up8 := uint8(6) + p16 := int16(8) + up16 := uint16(10) + p32 := int32(12) + up32 := uint32(14) + p64 := int64(16) + up64 := uint64(math.MaxUint64) + f32p := float32(math.MaxFloat32) + f64p := math.MaxFloat64 + str := "pointer to a string" + iface := interface{}("a string") + + ctbl := SomeBool(true) + ctb := SomeByte(100) + cti := SomeInt(math.MinInt64) + ctui := SomeUint(math.MaxInt64) + cti8 := SomeInt8(103) + ctui8 := SomeUint8(math.MaxUint8) + cti16 := SomeInt16(math.MinInt16) + ctui16 := SomeUint16(math.MaxUint16) + cti32 := SomeInt32(math.MinInt32) + ctui32 := SomeUint32(math.MaxUint32) + cti64 := SomeInt64(math.MinInt64) + ctui64 := SomeUint64(math.MaxUint64) + cf32 := SomeFloat32(math.SmallestNonzeroFloat32) + cf64 := SomeFloat64(math.SmallestNonzeroFloat64) + ctstr := SomeString("Some string") + + now := time.Now().Round(time.Nanosecond) + + return &testObject{ + Bool: true, + BoolP: &bl, + + Nil: nil, + NilP: nil, + + Byte: byte(0), + ByteP: &b, + + Int: 1, + Intp: &ip, + + Int8: 3, + Int8P: &p8, + UInt8: 5, + UInt8P: &up8, + + Int16: 7, + Int16P: &p16, + UInt16: 9, + UInt16P: &up16, + + Int32: 11, + Int32P: &p32, + UInt32: 13, + UInt32P: &up32, + + Int64: math.MaxInt64, + Int64P: &p64, + UInt64: math.MaxUint64, + UInt64P: &up64, + + F32: 1.87132794, + F32P: &f32p, + F64: 59285092891.502818573, + F64P: &f64p, + + String: "string", + StringP: &str, + + Interface: iface, + // InterfaceP: ifaceP, // NOTICE: NOT SUPPORTED + InterfacePP: &iface, + + ByteArray: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, + ArrByteArray: [][]byte{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, + Array: [3]interface{}{1, "string", nil}, + SliceString: []string{"string1", "string2", "string3"}, + SliceFloat64: []float64{1.1, 2.2, 3.3, 4.4}, + SliceInt: []interface{}{1, 2, 3}, + Slice: []interface{}{1, "string", []byte{1, 11, 111}, nil, true}, + ArrayOfMaps: [1]map[int]string{{1: "str"}}, + SliceOfMaps: []map[int]string{{1: "str"}}, + ArrayOfSlices: [1][]interface{}{{1, 2, 3}}, + SliceOfSlices: [][]interface{}{{1, 2, 3}, {4, 5, 6}}, + ArrayOfArrays: [1][1]interface{}{{1}}, + SliceOfArrays: [][1]interface{}{{1}, {2}, {3}}, + ArrayOfStructs: [1]SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, + SliceOfStructs: []SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, + + Map: map[interface{}]interface{}{1: "string", "string": nil /*nil: map[interface{}]interface{}{"1": ip}, true: false*/}, + MapOfMaps: map[string]map[int64]byte{"1": {1: 1, 2: 2}}, + MapOfSlices: map[string][]byte{"1": {1, 2}, "2": {3, 4}}, + MapOfArrays: map[string][3]byte{"1": {1, 2, 3}, "2": {3, 4, 5}}, + MapOfStructs: map[string]SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, + MapOfPStructs: map[string]*SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, + + CustomBool: true, + CustomBoolP: &ctbl, + CustomByte: 100, + CustomByteP: &ctb, + CustomInt: 100, + CustomIntP: &cti, + CustomUint: 100, + CustomUintP: &ctui, + CustomInt8: 100, + CustomInt8P: &cti8, + CustomUint8: 100, + CustomUint8P: &ctui8, + CustomInt16: 100, + CustomInt16P: &cti16, + CustomUint16: 100, + CustomUint16P: &ctui16, + CustomInt32: 100, + CustomInt32P: &cti32, + CustomUint32: 100, + CustomUint32P: &ctui32, + CustomInt64: 100, + CustomInt64P: &cti64, + CustomUint64: 100, + CustomUint64P: &ctui64, + + CustomFloat32: cf32, + CustomFloat32P: &cf32, + CustomFloat64: cf64, + CustomFloat64P: &cf64, + + CustomString: ctstr, + CustomStringP: &ctstr, + + NestedObj: SomeStruct{A: 1, Self: &SomeStruct{A: 999}}, + NestedObjP: &testObject{Int: 1, Intp: &ip, Tm: now}, + + NestedObjSlice: []SomeStruct{{A: 1, Self: &SomeStruct{A: 999}}, {A: 2, Self: &SomeStruct{A: 998}}}, + NstdObjPSlice: []*testObject{{Int: 1, Intp: &ip, Tm: now}, {Int: 2, Intp: &ip, Tm: now}}, + + Tm: now, + TmP: &now, + + Anonym: struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}, + AnonymP: &(struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}), + } + } + + makeTestObjectTagged := func() *testObjectTagged { + bl := true + b := byte(0) + ip := 11 + p8 := int8(4) + up8 := uint8(6) + p16 := int16(8) + up16 := uint16(10) + p32 := int32(12) + up32 := uint32(14) + p64 := int64(16) + up64 := uint64(math.MaxUint64) + f32p := float32(math.MaxFloat32) + f64p := math.MaxFloat64 + str := "pointer to a string" + iface := interface{}("a string") + + ctbl := SomeBool(true) + ctb := SomeByte(100) + cti := SomeInt(math.MinInt64) + ctui := SomeUint(math.MaxInt64) + cti8 := SomeInt8(103) + ctui8 := SomeUint8(math.MaxUint8) + cti16 := SomeInt16(math.MinInt16) + ctui16 := SomeUint16(math.MaxUint16) + cti32 := SomeInt32(math.MinInt32) + ctui32 := SomeUint32(math.MaxUint32) + cti64 := SomeInt64(math.MinInt64) + ctui64 := SomeUint64(math.MaxUint64) + cf32 := SomeFloat32(math.SmallestNonzeroFloat32) + cf64 := SomeFloat64(math.SmallestNonzeroFloat64) + ctstr := SomeString("Some string") + + now := time.Now().Round(time.Nanosecond) + + return &testObjectTagged{ + Bool: true, + BoolP: &bl, + + Nil: nil, + NilP: nil, + + Byte: byte(0), + ByteP: &b, + + Int: 1, + Intp: &ip, + + Int8: 3, + Int8P: &p8, + UInt8: 5, + UInt8P: &up8, + + Int16: 7, + Int16P: &p16, + UInt16: 9, + UInt16P: &up16, + + Int32: 11, + Int32P: &p32, + UInt32: 13, + UInt32P: &up32, + + Int64: math.MaxInt64, + Int64P: &p64, + UInt64: math.MaxUint64, + UInt64P: &up64, + + F32: 1.87132794, + F32P: &f32p, + F64: 59285092891.502818573, + F64P: &f64p, + + String: "string", + StringP: &str, + + Interface: iface, + // InterfaceP: ifaceP, // NOTICE: NOT SUPPORTED + InterfacePP: &iface, + + ByteArray: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, + ArrByteArray: [][]byte{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, + Array: [3]interface{}{1, "string", nil}, + SliceString: []string{"string1", "string2", "string3"}, + SliceFloat64: []float64{1.1, 2.2, 3.3, 4.4}, + SliceInt: []interface{}{1, 2, 3}, + Slice: []interface{}{1, "string", []byte{1, 11, 111}, nil, true}, + ArrayOfMaps: [1]map[int]string{{1: "str"}}, + SliceOfMaps: []map[int]string{{1: "str"}}, + ArrayOfSlices: [1][]interface{}{{1, 2, 3}}, + SliceOfSlices: [][]interface{}{{1, 2, 3}, {4, 5, 6}}, + ArrayOfArrays: [1][1]interface{}{{1}}, + SliceOfArrays: [][1]interface{}{{1}, {2}, {3}}, + ArrayOfStructs: [1]SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, + SliceOfStructs: []SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, + + Map: map[interface{}]interface{}{1: "string", "string": nil /*nil: map[interface{}]interface{}{"1": ip}, true: false*/}, + MapOfMaps: map[string]map[int64]byte{"1": {1: 1, 2: 2}}, + MapOfSlices: map[string][]byte{"1": {1, 2}, "2": {3, 4}}, + MapOfArrays: map[string][3]byte{"1": {1, 2, 3}, "2": {3, 4, 5}}, + MapOfStructs: map[string]SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, + MapOfPStructs: map[string]*SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, + + CustomBool: true, + CustomBoolP: &ctbl, + CustomByte: 100, + CustomByteP: &ctb, + CustomInt: 100, + CustomIntP: &cti, + CustomUint: 100, + CustomUintP: &ctui, + CustomInt8: 100, + CustomInt8P: &cti8, + CustomUint8: 100, + CustomUint8P: &ctui8, + CustomInt16: 100, + CustomInt16P: &cti16, + CustomUint16: 100, + CustomUint16P: &ctui16, + CustomInt32: 100, + CustomInt32P: &cti32, + CustomUint32: 100, + CustomUint32P: &ctui32, + CustomInt64: 100, + CustomInt64P: &cti64, + CustomUint64: 100, + CustomUint64P: &ctui64, + + CustomFloat32: cf32, + CustomFloat32P: &cf32, + CustomFloat64: cf64, + CustomFloat64P: &cf64, + + CustomString: ctstr, + CustomStringP: &ctstr, + + NestedObj: SomeStruct{A: 1, Self: &SomeStruct{A: 999}}, + NestedObjP: &testObject{Int: 1, Intp: &ip, Tm: now}, + + NestedObjSlice: []SomeStruct{{A: 1, Self: &SomeStruct{A: 999}}, {A: 2, Self: &SomeStruct{A: 998}}}, + NstdObjPSlice: []*testObject{{Int: 1, Intp: &ip, Tm: now}, {Int: 2, Intp: &ip, Tm: now}}, + + Tm: now, + TmP: &now, + + Anonym: struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}, + AnonymP: &(struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}), + } + } + + gg.Context("PutObject operations", func() { + + gg.It("must respect `UseNativeBoolTypeInReflection` option", func() { + type T struct { + T, F bool + } + + t := &T{ + T: true, + F: false, + } + + // Use native bools + as.UseNativeBoolTypeInReflection = true + key, _ := as.NewKey(ns, set, randString(50)) + err = client.PutObject(nil, key, t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"T": t.T, "F": t.F})) + + // Use integers + as.UseNativeBoolTypeInReflection = false + key, _ = as.NewKey(ns, set, randString(50)) + err = client.PutObject(nil, key, t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"T": 1, "F": 0})) + }) + + gg.It("must respect `,omitempty` option", func() { + type Inner struct { + V1 int `as:" v1,ommitempty "` + V2 string `as:" v2,ommitempty "` + } + + type T struct { + Name string `as:" name "` + Description string `as:" desc ,omitempty"` + Age int `as:" ,omitempty"` + + InnerVal Inner `as:"inner,omitempty"` + } + + t := &T{ + Name: "Ada Lovelace", + Description: "Was doing it before it was cool", + Age: 31, + } + + key, _ := as.NewKey(ns, set, randString(50)) + err = client.PutObject(nil, key, t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"name": t.Name, "desc": t.Description, "Age": 31, "inner": map[interface{}]interface{}{"v1": 0, "v2": ""}})) + + key, _ = as.NewKey(ns, set, randString(50)) + + t = &T{ + Name: "", + Description: "", + Age: 0, + } + + err = client.PutObject(nil, key, t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"name": t.Name, "inner": map[interface{}]interface{}{"v1": 0, "v2": ""}})) + }) + + gg.It("must save an object with the most complex structure possible and retrieve it via BatchGetObject", func() { + + testObj := makeTestObject() + err := client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + resObj := &testObject{} + err = client.GetObject(nil, key, resObj) + + // set the Gen and TTL + testObj.TTL = resObj.TTL + testObj.Gen = resObj.Gen + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(resObj).To(gm.Equal(testObj)) + gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) + + // should not panic if read back to an object with none of the bins + T := struct { + NonExisting int `as:"nonexisting"` + }{-1} + err = client.GetObject(nil, key, &T) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(T.NonExisting).To(gm.Equal(-1)) + + // get the same object via BatchGetObject + resObj = &testObject{} + found, err := client.BatchGetObjects(nil, []*as.Key{key}, []interface{}{resObj}) + gm.Expect(len(found)).To(gm.Equal(1)) + gm.Expect(found[0]).To(gm.BeTrue()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // set the Gen and TTL + testObj.TTL = resObj.TTL + testObj.Gen = resObj.Gen + + gm.Expect(resObj).To(gm.Equal(testObj)) + gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) + }) + + gg.It("must save a tagged object with the most complex structure possible", func() { + + testObj := makeTestObjectTagged() + err := client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + resObj := &testObjectTagged{} + err = client.GetObject(nil, key, resObj) + + // set the Gen and TTL + testObj.TTL = resObj.TTL + testObj.Gen = resObj.Gen + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(resObj).To(gm.Equal(testObj)) + gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) + }) + + gg.It("must save an object and read it back respecting the tags", func() { + + type InnerStruct struct { + Strings []string `as:"b"` + PersistNot int `as:"-"` + PersistAsInner1 int `as:"inner1"` + } + + type TaggedStruct struct { + Strings []string `as:"b"` + DontPersist int `as:"-"` + PersistAsFld1 int `as:"fld1"` + Bytes []byte `as:"fldbytes"` + + IStruct InnerStruct `as:"istruct"` + } + + testObj := TaggedStruct{Strings: []string{"a", "b", "c"}, DontPersist: 1, PersistAsFld1: 2, Bytes: []byte{1, 2, 3, 4}, IStruct: InnerStruct{Strings: []string{"d", "e", "f", "g"}, PersistNot: 10, PersistAsInner1: 11}} + err := client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + resObj := &TaggedStruct{} + err = client.GetObject(nil, key, resObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(resObj.DontPersist).To(gm.Equal(0)) + gm.Expect(resObj.PersistAsFld1).To(gm.Equal(2)) + gm.Expect(resObj.IStruct.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.IStruct.PersistAsInner1).To(gm.Equal(11)) + + // get the bins and check for bin names + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins).To(gm.Equal( + as.BinMap{ + "b": []interface{}{"a", "b", "c"}, + "fld1": 2, + "fldbytes": []byte{1, 2, 3, 4}, + "istruct": map[interface{}]interface{}{ + "b": []interface{}{"d", "e", "f", "g"}, + "inner1": 11, + }, + })) + + gm.Expect(len(rec.Bins)).To(gm.Equal(4)) + gm.Expect(rec.Bins["DontPersist"]).To(gm.BeNil()) + gm.Expect(rec.Bins["fld1"]).To(gm.Equal(2)) + innerStruct := rec.Bins["istruct"].(map[interface{}]interface{}) + gm.Expect(len(innerStruct)).To(gm.Equal(2)) + gm.Expect(innerStruct["PersistNot"]).To(gm.BeNil()) + gm.Expect(innerStruct["inner1"]).To(gm.Equal(11)) + + }) + + gg.It("must save an object *pointer* and read it back respecting the tags", func() { + + type InnerStruct struct { + PersistNot int `as:"-"` + PersistAsInner1 int `as:"inner1"` + } + + type TaggedStruct struct { + DontPersist int `as:"-"` + PersistAsFld1 int `as:"fld1"` + + IStruct *InnerStruct + } + + testObj := &TaggedStruct{DontPersist: 1, PersistAsFld1: 2, IStruct: &InnerStruct{PersistNot: 10, PersistAsInner1: 11}} + err := client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + resObj := &TaggedStruct{IStruct: &InnerStruct{}} + err = client.GetObject(nil, key, resObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(resObj.DontPersist).To(gm.Equal(0)) + gm.Expect(resObj.PersistAsFld1).To(gm.Equal(2)) + gm.Expect(resObj.IStruct.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.IStruct.PersistAsInner1).To(gm.Equal(11)) + + // get the bins and check for bin names + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(len(rec.Bins)).To(gm.Equal(2)) + gm.Expect(rec.Bins["DontPersist"]).To(gm.BeNil()) + gm.Expect(rec.Bins["fld1"]).To(gm.Equal(2)) + innerStruct := rec.Bins["IStruct"].(map[interface{}]interface{}) + gm.Expect(len(innerStruct)).To(gm.Equal(1)) + gm.Expect(innerStruct["PersistNot"]).To(gm.BeNil()) + gm.Expect(innerStruct["inner1"]).To(gm.Equal(11)) + + }) + + gg.It("must put and get pre-assigned lists and maps", func() { + + type MyObject struct { + List []string + Map map[int]string + } + + var t, o1, o2 MyObject + o1.List = nil // the default is nil anyways + o1.Map = nil // the default is nil anyways + + o2.List = []string{"Should be overwritten"} + o2.Map = map[int]string{666: "Nope"} + + t = MyObject{ + List: []string{"Apple", "Orange"}, + Map: map[int]string{1: "Apple", 2: "Orange"}, + } + + err := client.PutObject(nil, key, &t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{ + "Map": map[interface{}]interface{}{1: "Apple", 2: "Orange"}, + "List": []interface{}{"Apple", "Orange"}, + })) + + err = client.GetObject(nil, key, &o1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.GetObject(nil, key, &o2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(o1).To(gm.Equal(o2)) + gm.Expect(t).To(gm.Equal(o1)) + gm.Expect(t).To(gm.Equal(o2)) + }) + + }) // PutObject context + + gg.Context("Metadata operations", func() { + + gg.It("must save an object and read its metadata back", func() { + + type objMeta struct { + TTL1, TTL2 uint32 `asm:"ttl"` + GEN1, GEN2 uint32 `asm:"gen"` + Val int `as:"val"` + } + + testObj := objMeta{Val: 1} + err := client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"val": 1})) + + resObj := &objMeta{} + err = client.GetObject(nil, key, resObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(resObj.TTL1).NotTo(gm.Equal(uint32(0))) + gm.Expect(resObj.TTL1).To(gm.Equal(resObj.TTL2)) + + gm.Expect(resObj.GEN1).To(gm.Equal(uint32(1))) + gm.Expect(resObj.GEN2).To(gm.Equal(uint32(1))) + + // put it again to check the generation + err = client.PutObject(nil, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.GetObject(nil, key, resObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(resObj.TTL1).NotTo(gm.Equal(uint32(0))) + gm.Expect(resObj.TTL1).To(gm.Equal(resObj.TTL2)) + + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + defaultTTL, nerr := strconv.Atoi(nsInfo(ns, "default-ttl")) + gm.Expect(nerr).ToNot(gm.HaveOccurred()) + + switch defaultTTL { + case 0: + gm.Expect(resObj.TTL1).To(gm.Equal(uint32(math.MaxUint32))) + default: + gm.Expect(resObj.TTL1).To(gm.Equal(uint32(defaultTTL))) + } + + gm.Expect(resObj.GEN1).To(gm.Equal(uint32(2))) + gm.Expect(resObj.GEN2).To(gm.Equal(uint32(2))) + }) + + }) // PutObject context + + gg.Context("BatchGetObjects operations", func() { + + var keys []*as.Key + var resObjects []interface{} + var objects []*testObjectTagged + + gg.BeforeEach(func() { + set = randString(50) + + keys = nil + resObjects = nil + objects = nil + + nsup = nsupPeriod(ns) + + var wpolicy *as.WritePolicy + if nsup > 0 { + wpolicy = as.NewWritePolicy(0, 500) + } else { + wpolicy = as.NewWritePolicy(0, 0) + } + + for i := 0; i < 100; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + keys = append(keys, key) + resObjects = append(resObjects, new(testObjectTagged)) + + // only put odd objects in the db + if i%2 == 0 { + objects = append(objects, new(testObjectTagged)) + continue + } + + testObj := makeTestObjectTagged() + objects = append(objects, testObj) + err := client.PutObject(wpolicy, key, testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + }) + + gg.It("must return error on invalid input", func() { + _, err := client.BatchGetObjects(nil, nil, resObjects) + gm.Expect(err).To(gm.HaveOccurred()) + + _, err = client.BatchGetObjects(nil, nil, nil) + gm.Expect(err).To(gm.HaveOccurred()) + + _, err = client.BatchGetObjects(nil, []*as.Key{}, []interface{}{}) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + gg.It("should create a valid Sorted CDT Map and then Get Correct Values back in both map and []MapPair fields", func() { + + cdtBinName := "orderedMap" + + items := map[interface{}]interface{}{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + } + + // Write values to empty map. + _, err := client.Operate(nil, key, + as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, items), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + + type testObjectTagged struct { + TTL uint32 `asm:"ttl"` + Gen uint32 `asm:"gen"` + + M map[string]int `as:"orderedMap"` + } + + instance := testObjectTagged{} + err = client.GetObject(nil, key, &instance) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(instance.M).To(gm.Equal(map[string]int{ + "Charlie": 55, + "Jim": 98, + "John": 76, + "Harry": 82, + })) + + type testObjectTaggedSorted struct { + TTL uint32 `asm:"ttl"` + Gen uint32 `asm:"gen"` + + M []as.MapPair `as:"orderedMap"` + } + + instanceSorted := testObjectTaggedSorted{} + err = client.GetObject(nil, key, &instanceSorted) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(instanceSorted.M).To(gm.Equal([]as.MapPair{ + {"Charlie", 55}, + {"Harry", 82}, + {"Jim", 98}, + {"John", 76}, + })) + }) + + gg.It("must get all objects with the most complex structure possible", func() { + found, err := client.BatchGetObjects(nil, keys, resObjects) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for i := range resObjects { + if i%2 == 0 { + gm.Expect(found[i]).To(gm.BeFalse()) + resObj := resObjects[i].(*testObjectTagged) + gm.Expect(*resObj).To(gm.BeZero()) + } else { + gm.Expect(found[i]).To(gm.BeTrue()) + resObj := resObjects[i].(*testObjectTagged) + + if nsup > 0 { + gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) + } + gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) + + objects[i].TTL = resObj.TTL + objects[i].Gen = resObj.Gen + + gm.Expect(resObj).To(gm.Equal(objects[i])) + } + } + }) + + }) // ScanObjects context + + gg.Context("UDF Objects operations", func() { + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + gg.It("must store and get values of types which implement Value interface using udf", func() { + udfFunc := `function setValue(rec, val) + rec['value'] = val + aerospike:update(rec) + + return rec + end` + + registerUDF(udfFunc, "test_set.lua") + + var ( + bytes = []byte("bytes") + str = "string" + i = 10 + f = 3.14 + valArray = []as.Value{as.NewValue(i), as.NewValue(str)} + list = []interface{}{i, str} + m = map[interface{}]interface{}{"int": i, "string": str} + json = map[string]interface{}{"int": i, "string": str} + ) + + cases := []struct { + in as.Value + out interface{} + }{ + {in: as.NewNullValue(), out: nil}, + {in: as.NewInfinityValue(), out: nil}, + {in: as.NewWildCardValue(), out: nil}, + {in: as.NewBytesValue(bytes), out: bytes}, + {in: as.NewStringValue(str), out: str}, + {in: as.NewIntegerValue(i), out: i}, + {in: as.NewFloatValue(f), out: f}, + {in: as.NewValueArray(valArray), out: list}, + {in: as.NewListValue(list), out: list}, + {in: as.NewMapValue(m), out: m}, + {in: as.NewJsonValue(json), out: m}, + } + + for i, data := range cases { + err = client.PutBins(nil, key, as.NewBin("test", i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Execute(nil, key, "test_set", "setValue", data.in) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(nil, key, "value") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + if data.out == nil { + gm.Expect(rec.Bins["value"]).To(gm.BeNil()) + } else { + gm.Expect(rec.Bins["value"]).To(gm.Equal(data.out)) + } + + } + }) // #272 issue + + gg.It("must serialize values to the lua function and deserialize into object, even if it is int", func() { + + type Test struct { + Test float64 `as:"test"` + TestLua float64 `as:"testLua"` + } + + udfFunc := `function addValue(rec, val) + local ret = map() + if not aerospike:exists(rec) then + ret['status'] = false + ret['result'] = 'Record does not exist' + else + rec['testLua'] = (rec['testLua'] or 0.0) + val + aerospike:update(rec) + ret['status'] = true + end + return ret + end` + + registerUDF(udfFunc, "test.lua") + + adOp := as.AddOp(as.NewBin("test", float64(1))) + testLua := float64(0) + for i := 1; i <= 100; i++ { + _, err := client.Operate(nil, key, adOp) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + testLua += float64(i) * float64(0.1) + _, err = client.Execute(nil, key, "test", "addValue", as.NewValue(float64(i)*float64(0.1))) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + t := &Test{} + err = client.GetObject(nil, key, t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(t.Test).To(gm.Equal(float64(i))) + gm.Expect(t.TestLua).To(gm.BeNumerically("~", testLua)) + } + + }) // it + }) + + var scanPolicy = as.NewScanPolicy() + var queryPolicy = as.NewQueryPolicy() + + gg.Context("ScanObjects operations", func() { + type InnerStruct struct { + PersistNot int `as:"-"` + PersistAsInner1 int `as:"inner1"` + Gen uint32 `asm:"gen"` + TTL uint32 `asm:"ttl"` + } + + gg.BeforeEach(func() { + set = randString(50) + + nsup = nsupPeriod(ns) + + var wp *as.WritePolicy + if nsup > 0 { + wp = as.NewWritePolicy(0, 500) + } else { + wp = as.NewWritePolicy(0, 0) + + } + for i := 1; i < 100; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + testObj := InnerStruct{PersistAsInner1: i} + err := client.PutObject(wp, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + }) + + gg.It("must scan all objects with the most complex structure possible", func() { + + testObj := &InnerStruct{} + + retChan := make(chan *InnerStruct, 10) + + rs, err := client.ScanAllObjects(scanPolicy, retChan, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for resObj := range retChan { + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">", 0)) + gm.Expect(resObj.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) + if nsup > 0 { + gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) + } + + testObj.PersistAsInner1 = resObj.PersistAsInner1 + testObj.Gen = resObj.Gen + testObj.TTL = resObj.TTL + gm.Expect(resObj).To(gm.Equal(testObj)) + cnt++ + } + + for e := range rs.Errors() { + gm.Expect(e).ToNot(gm.HaveOccurred()) + } + + gm.Expect(cnt).To(gm.Equal(99)) + }) + + }) // ScanObjects context + + gg.Context("QueryObjects operations", func() { + + type InnerStruct struct { + PersistNot int `as:"-"` + PersistAsInner1 int `as:"inner1"` + Gen uint32 `asm:"gen"` + TTL uint32 `asm:"ttl"` + } + + gg.BeforeEach(func() { + set = randString(50) + + nsup = nsupPeriod(ns) + + var wp *as.WritePolicy + if nsup > 0 { + wp = as.NewWritePolicy(5, 500) + } else { + wp = as.NewWritePolicy(5, 0) + } + for i := 1; i < 100; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + testObj := InnerStruct{PersistAsInner1: i} + err := client.PutObject(wp, key, &testObj) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + }) + + gg.It("must scan all objects with the most complex structure possible", func() { + + testObj := &InnerStruct{} + + retChan := make(chan *InnerStruct, 10) + stmt := as.NewStatement(ns, set) + + rs, err := client.QueryObjects(queryPolicy, stmt, retChan) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for resObj := range retChan { + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">", 0)) + gm.Expect(resObj.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) + if nsup > 0 { + gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) + } + + testObj.PersistAsInner1 = resObj.PersistAsInner1 + testObj.Gen = resObj.Gen + testObj.TTL = resObj.TTL + gm.Expect(resObj).To(gm.Equal(testObj)) + cnt++ + } + + for e := range rs.Errors() { + gm.Expect(e).ToNot(gm.HaveOccurred()) + } + + gm.Expect(cnt).To(gm.Equal(99)) + }) + + gg.It("must query only relevant objects with the most complex structure possible", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + // first create an index + createIndex(nil, ns, set, set+"inner1", "inner1", as.NUMERIC) + defer dropIndex(nil, ns, set, set+"inner1") + + testObj := &InnerStruct{} + + retChan := make(chan *InnerStruct, 10) + stmt := as.NewStatement(ns, set) + stmt.SetFilter(as.NewRangeFilter("inner1", 21, 70)) + + rs, err := client.QueryObjects(queryPolicy, stmt, retChan) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for resObj := range retChan { + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">=", 21)) + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically("<=", 70)) + gm.Expect(resObj.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) + if nsup > 0 { + gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) + } + + testObj.PersistAsInner1 = resObj.PersistAsInner1 + testObj.Gen = resObj.Gen + testObj.TTL = resObj.TTL + gm.Expect(resObj).To(gm.Equal(testObj)) + cnt++ + } + + for e := range rs.Errors() { + gm.Expect(e).ToNot(gm.HaveOccurred()) + } + + gm.Expect(cnt).To(gm.Equal(50)) + }) + + gg.It("must query only relevant objects, and close and return", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + // first create an index + createIndex(nil, ns, set, set+"inner1", "inner1", as.NUMERIC) + defer dropIndex(nil, ns, set, set+"inner1") + + testObj := &InnerStruct{} + + retChan := make(chan *InnerStruct, 1) + stmt := as.NewStatement(ns, set) + stmt.SetFilter(as.NewRangeFilter("inner1", 21, 70)) + + qpolicy := as.NewQueryPolicy() + qpolicy.RecordQueueSize = 1 + + rs, err := client.QueryObjects(queryPolicy, stmt, retChan) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for resObj := range retChan { + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">=", 21)) + gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically("<=", 70)) + gm.Expect(resObj.PersistNot).To(gm.Equal(0)) + gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) + if nsup > 0 { + gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) + } + + testObj.PersistAsInner1 = resObj.PersistAsInner1 + testObj.Gen = resObj.Gen + testObj.TTL = resObj.TTL + gm.Expect(resObj).To(gm.Equal(testObj)) + cnt++ + + if cnt >= 10 { + rs.Close() + gm.Eventually(rs.Errors()).Should(gm.BeClosed()) + } + } + + for e := range rs.Errors() { + gm.Expect(e).ToNot(gm.HaveOccurred()) + } + + gm.Expect(cnt).To(gm.BeNumerically("<=", 11)) + }) + + }) // QueryObject context + }) + } // for useBoolType +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_policy.go b/aerospike-tls/vendor-aerospike-client-go/client_policy.go new file mode 100644 index 00000000..df3b55b0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_policy.go @@ -0,0 +1,216 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "crypto/tls" + "time" +) + +// ClientPolicy encapsulates parameters for client policy command. +type ClientPolicy struct { + // AuthMode specifies authentication mode used when user/password is defined. It is set to AuthModeInternal by default. + AuthMode AuthMode + + // User authentication to cluster. Leave empty for clusters running without restricted access. + User string + + // Password authentication to cluster. The password will be stored by the client and sent to server + // in hashed format. Leave empty for clusters running without restricted access. + Password string + + // ClusterName sets the expected cluster ID. If not nil, server nodes must return this cluster ID in order to + // join the client's view of the cluster. Should only be set when connecting to servers that + // support the "cluster-name" info command. (v3.10+) + ClusterName string //="" + + // Initial host connection timeout duration. The timeout when opening a connection + // to the server host for the first time. + Timeout time.Duration //= 30 seconds + + // Connection idle timeout. Every time a connection is used, its idle + // deadline will be extended by this duration. When this deadline is reached, + // the connection will be closed and discarded from the connection pool. + // The value is limited to 24 hours (86400s). + // + // It's important to set this value to a few seconds less than the server's proto-fd-idle-ms + // (default 60000 milliseconds or 1 minute), so the client does not attempt to use a socket + // that has already been reaped by the server. + // + // Connection pools are now implemented by a LIFO stack. Connections at the tail of the + // stack will always be the least used. These connections are checked for IdleTimeout + // on every tend (usually 1 second). + // + // Default: 0 seconds + IdleTimeout time.Duration //= 0 seconds + + // LoginTimeout specifies the timeout for login operation for external authentication such as LDAP. + LoginTimeout time.Duration //= 10 seconds + + // ConnectionQueueCache specifies the size of the Connection Queue cache PER NODE. + // Note: One connection per node is reserved for tend operations and is not used for transactions. + ConnectionQueueSize int //= 100 + + // MinConnectionsPerNode specifies the minimum number of synchronous connections allowed per server node. + // Preallocate min connections on client node creation. + // The client will periodically allocate new connections if count falls below min connections. + // + // Server proto-fd-idle-ms may also need to be increased substantially if min connections are defined. + // The proto-fd-idle-ms default directs the server to close connections that are idle for 60 seconds + // which can defeat the purpose of keeping connections in reserve for a future burst of activity. + // + // If server proto-fd-idle-ms is changed, client ClientPolicy.IdleTimeout should also be + // changed to be a few seconds less than proto-fd-idle-ms. + // + // Default: 0 + MinConnectionsPerNode int + + // MaxErrorRate defines the maximum number of errors allowed per node per ErrorRateWindow before + // the circuit-breaker algorithm returns MAX_ERROR_RATE on database commands to that node. + // If MaxErrorRate is zero, there is no error limit and + // the exception will never be thrown. + // + // The counted error types are any error that causes the connection to close (socket errors + // and client timeouts) and types.ResultCode.DEVICE_OVERLOAD. + // + // Default: 100 + MaxErrorRate int + + // ErrorRateWindow defined the number of cluster tend iterations that defines the window for MaxErrorRate. + // One tend iteration is defined as TendInterval plus the time to tend all nodes. + // At the end of the window, the error count is reset to zero and backoff state is removed + // on all nodes. + // + // Default: 1 + ErrorRateWindow int //= 1 + + // If set to true, will not create a new connection + // to the node if there are already `ConnectionQueueSize` active connections. + // Note: One connection per node is reserved for tend operations and is not used for transactions. + LimitConnectionsToQueueSize bool //= true + + // Number of connections allowed to established at the same time. + // This value does not limit the number of connections. It just + // puts a threshold on the number of parallel opening connections. + // By default, there are no limits. + OpeningConnectionThreshold int // 0 + + // Throw exception if host connection fails during addHost(). + FailIfNotConnected bool //= true + + // TendInterval determines interval for checking for cluster state changes. + // Minimum possible interval is 10 Milliseconds. + TendInterval time.Duration //= 1 second + + // A IP translation table is used in cases where different clients + // use different server IP addresses. This may be necessary when + // using clients from both inside and outside a local area + // network. Default is no translation. + // The key is the IP address returned from friend info requests to other servers. + // The value is the real IP address used to connect to the server. + IpMap map[string]string + + // UseServicesAlternate determines if the client should use "services-alternate" instead of "services" + // in info request during cluster tending. + //"services-alternate" returns server configured external IP addresses that client + // uses to talk to nodes. "services-alternate" can be used in place of providing a client "ipMap". + // This feature is recommended instead of using the client-side IpMap above. + // + // "services-alternate" is available with Aerospike Server versions >= 3.7.1. + UseServicesAlternate bool // false + + // RackAware directs the client to update rack information on intervals. + // When this feature is enabled, the client will prefer to use nodes which reside + // on the same rack as the client for read transactions. The application should also set the RackId, and + // use the ReplicaPolicy.PREFER_RACK for reads. + // This feature is in particular useful if the cluster is in the cloud and the cloud provider + // is charging for network bandwidth out of the zone. Keep in mind that the node on the same rack + // may not be the Master, and as such the data may be stale. This setting is particularly usable + // for clusters that are read heavy. + RackAware bool // false + + // RackIds defines the list of acceptable racks in order of preference. Nodes in RackIds[0] are chosen first. + // If a node is not found in rackIds[0], then nodes in rackIds[1] are searched, and so on. + // If rackIds is set, ClientPolicy.RackId is ignored. + // + // ClientPolicy.RackAware, ReplicaPolicy.PREFER_RACK and server rack + // configuration must also be set to enable this functionality. + RackIds []int // nil + + // TlsConfig specifies TLS secure connection policy for TLS enabled servers. + // For better performance, we suggest preferring the server-side ciphers by + // setting PreferServerCipherSuites = true. + TlsConfig *tls.Config //= nil + + // IgnoreOtherSubnetAliases helps to ignore aliases that are outside main subnet + IgnoreOtherSubnetAliases bool //= false + + // SeedOnlyCluster enforces the client to use only the seed addresses. + // Peers nodes for the cluster are not discovered and seed nodes are + // retained despite connection failures. + SeedOnlyCluster bool // = false +} + +// NewClientPolicy generates a new ClientPolicy with default values. +func NewClientPolicy() *ClientPolicy { + return &ClientPolicy{ + AuthMode: AuthModeInternal, + Timeout: 30 * time.Second, + IdleTimeout: 0 * time.Second, + LoginTimeout: 10 * time.Second, + ConnectionQueueSize: 100, + OpeningConnectionThreshold: 0, + FailIfNotConnected: true, + TendInterval: time.Second, + LimitConnectionsToQueueSize: true, + IgnoreOtherSubnetAliases: false, + MaxErrorRate: 100, + ErrorRateWindow: 1, + SeedOnlyCluster: false, + } +} + +// RequiresAuthentication returns true if a User or Password is set for ClientPolicy. +func (cp *ClientPolicy) RequiresAuthentication() bool { + return (cp.User != "") || (cp.Password != "") || (cp.AuthMode == AuthModePKI) +} + +func (cp *ClientPolicy) servicesString() string { + if cp.UseServicesAlternate { + return "services-alternate" + } + return "services" +} + +func (cp *ClientPolicy) serviceString() string { + // PATCH (e2e-tls-run): always request the clear-text service info + // command. Upstream Aerospike is CE; service-tls-std is EE-only + // and returns "ERROR:25:enterprise only", which breaks node + // validation. TLS is still used on the wire (stunnel terminates + // in front of CE); only the info command name is overridden. + if cp.UseServicesAlternate { + return "service-clear-alt" + } + return "service-clear-std" +} + +func (cp *ClientPolicy) peersString() string { + // PATCH (e2e-tls-run): same reason — CE doesn't answer + // peers-tls-std. Ask peers-clear-std even on a TLS connection. + if cp.UseServicesAlternate { + return "peers-clear-alt" + } + return "peers-clear-std" +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_reflect.go b/aerospike-tls/vendor-aerospike-client-go/client_reflect.go new file mode 100644 index 00000000..995d27c3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_reflect.go @@ -0,0 +1,277 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// PutObject writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// If the policy is nil, the default relevant policy will be used. +// A struct can be tagged to influence the way the object is put in the database: +// +// type Person struct { +// TTL uint32 `asm:"ttl"` +// RecGen uint32 `asm:"gen"` +// Name string `as:"name"` +// Address string `as:"desc,omitempty"` +// Age uint8 `as:",omitempty"` +// Password string `as:"-"` +// } +// +// Tag `as:` denotes Aerospike fields. The first value will be the alias for the field. +// `,omitempty` (without any spaces between the comma and the word) will act like the +// json package, and will not send the value of the field to the database if the value is zero value. +// Tag `asm:` denotes Aerospike Meta fields, and includes ttl and generation values. +// If a tag is marked with `-`, it will not be sent to the database at all. +// Note: Tag `as` can be replaced with any other user-defined tag via the function `SetAerospikeTag`. +func (clnt *Client) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) { + policy = clnt.getUsableWritePolicy(policy) + + binMap := marshal(obj) + command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _WRITE) + if err != nil { + return err + } + + res := command.Execute() + return res +} + +// GetObject reads a record for specified key and puts the result into the provided object. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) GetObject(policy *BasePolicy, key *Key, obj interface{}) Error { + policy = clnt.getUsablePolicy(policy) + + rval := reflect.ValueOf(obj) + binNames := objectMappings.getFields(rval.Type()) + + partition, err := PartitionForRead(clnt.cluster, policy, key) + if err != nil { + return err + } + + command, err := newReadCommand(clnt.cluster, policy, key, binNames, partition) + if err != nil { + return err + } + + command.object = &rval + return command.Execute() +} + +// getObjectDirect reads a record for specified key and puts the result into the provided object. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) getObjectDirect(policy *BasePolicy, key *Key, rval *reflect.Value) Error { + policy = clnt.getUsablePolicy(policy) + + binNames := objectMappings.getFields(rval.Type()) + command, err := newReadCommand(clnt.cluster, policy, key, binNames, nil) + if err != nil { + return err + } + + command.object = rval + return command.Execute() +} + +// BatchGetObjects reads multiple record headers and bins for specified keys in one batch request. +// The returned objects are in positional order with the original key array order. +// If a key is not found, the positional object will not change, and the positional found boolean will be false. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // check the size of key and objects + if len(keys) != len(objects) { + return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: number of keys and objects do not match") + } + + if len(keys) == 0 { + return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: keys are empty") + } + + binSet := map[string]struct{}{} + objectsVal := make([]*reflect.Value, len(objects)) + for i := range objects { + rval := reflect.ValueOf(objects[i]) + objectsVal[i] = &rval + for _, bn := range objectMappings.getFields(rval.Type()) { + binSet[bn] = struct{}{} + } + } + binNames := make([]string, 0, len(binSet)) + for binName := range binSet { + binNames = append(binNames, binName) + } + + objectsFound := make([]bool, len(keys)) + cmd := newBatchCommandGet(clnt, nil, policy, keys, binNames, nil, nil, _INFO1_READ, false) + cmd.objects = objectsVal + cmd.objectsFound = objectsFound + + batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) + if err != nil { + return nil, err + } + + filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) + if err != nil { + return nil, err + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return objectsFound, err +} + +// ScanPartitionObjects Reads records in specified namespace, set and partition filter. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If partitionFilter is nil, all partitions will be scanned. +// If the policy is nil, the default relevant policy will be used. +// This method is only supported by Aerospike 4.9+ servers. +func (clnt *Client) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, newError(types.SERVER_NOT_AVAILABLE, "Scan failed because cluster is empty.") + } + + var tracker *partitionTracker + if partitionFilter == nil { + tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) + } else { + tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) + } + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + go clnt.scanPartitionObjects(&policy, tracker, namespace, setName, res, binNames...) + + return res, nil +} + +// ScanAllObjects reads all records in specified namespace and set from all nodes. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.ScanPartitionObjects(apolicy, objChan, nil, namespace, setName, binNames...) +} + +// scanNodePartitions reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) scanNodePartitionsObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + + tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + go clnt.scanPartitionObjects(&policy, tracker, namespace, setName, res, binNames...) + + return res, nil +} + +// ScanNodeObjects reads all records in specified namespace and set for one node only, +// and marshalls the results into the objects of the provided channel in Recordset. +// If the policy is nil, the default relevant policy will be used. +// The resulting records will be marshalled into the objChan. +// objChan will be closed after all the records are read. +func (clnt *Client) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.scanNodePartitionsObjects(apolicy, node, objChan, namespace, setName, binNames...) +} + +// QueryPartitionObjects executes a query for specified partitions and returns a recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 4.9+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + + nodes := clnt.cluster.GetNodes() + if len(nodes) == 0 { + return nil, newError(types.SERVER_NOT_AVAILABLE, "Query failed because cluster is empty.") + } + + var tracker *partitionTracker + + if partitionFilter == nil { + tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) + } else { + tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) + } + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + go clnt.queryPartitionObjects(policy, tracker, statement, res) + + return res, nil +} + +// QueryObjects executes a query on all nodes in the cluster and marshals the records into the given channel. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop objects. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) { + return clnt.QueryPartitionObjects(policy, statement, objChan, nil) +} + +func (clnt *Client) queryNodePartitionsObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + + tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + go clnt.queryPartitionObjects(policy, tracker, statement, res) + + return res, nil +} + +// QueryNodeObjects executes a query on a specific node and marshals the records into the given channel. +// The caller can concurrently pop records off the channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { + return clnt.queryNodePartitionsObjects(policy, node, statement, objChan) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go new file mode 100644 index 00000000..6fac8087 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go @@ -0,0 +1,280 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "errors" + "math" + "strings" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + + gg.Describe("Data operations on complex types with reflection", func() { + // connection data + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var rpolicy = as.NewPolicy() + var rec *as.Record + + if *useReplicas { + rpolicy.ReplicaPolicy = as.MASTER_PROLES + } + + gg.BeforeEach(func() { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.Context("Put operations", func() { + + gg.Context("Bins with complex types", func() { + + gg.Context("Bins with LIST type", func() { + + gg.It("must return error for Get for a nonexisting key", func() { + rec, err = client.Get(rpolicy, key) + gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) + }) + + gg.It("must save a key with Array Types", func() { + bin1 := as.NewBin("Aerospike1", []int8{math.MinInt8, 0, 1, 2, 3, math.MaxInt8}) + bin2 := as.NewBin("Aerospike2", []int16{math.MinInt16, 0, 1, 2, 3, math.MaxInt16}) + bin3 := as.NewBin("Aerospike3", []int32{math.MinInt32, 0, 1, 2, 3, math.MaxInt32}) + bin4 := as.NewBin("Aerospike4", []int64{math.MinInt64, 0, 1, 2, 3, math.MaxInt64}) + bin5 := as.NewBin("Aerospike5", []uint8{0, 1, 2, 3, math.MaxUint8}) + bin6 := as.NewBin("Aerospike6", []uint16{0, 1, 2, 3, math.MaxUint16}) + bin7 := as.NewBin("Aerospike7", []uint32{0, 1, 2, 3, math.MaxUint32}) + bin8 := as.NewBin("Aerospike8", []string{"", "\n", "string"}) + bin9 := as.NewBin("Aerospike9", []interface{}{"", 1, nil, true, false, uint64(math.MaxUint64), math.MaxFloat32, math.MaxFloat64, as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), [3]int{1, 2, 3}}) + + // complex type, consisting different arrays + bin10 := as.NewBin("Aerospike10", []interface{}{ + nil, + bin1.Value.GetObject(), + bin2.Value.GetObject(), + bin3.Value.GetObject(), + bin4.Value.GetObject(), + bin5.Value.GetObject(), + bin6.Value.GetObject(), + bin7.Value.GetObject(), + bin8.Value.GetObject(), + bin9.Value.GetObject(), + map[interface{}]interface{}{ + 1: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}: []interface{}{"string", 12, nil}, + // [3]int{0, 1, 2}: []interface{}{"string", 12, nil}, + // [3]string{"0", "1", "2"}: []interface{}{"string", 12, nil}, + 15: nil, + int8(math.MaxInt8): int8(math.MaxInt8), + int64(math.MinInt64): int64(math.MinInt64), + int64(math.MaxInt64): int64(math.MaxInt64), + // uint64(math.MaxUint64): uint64(math.MaxUint64), + // float32(-math.MaxFloat32): float32(-math.MaxFloat32), + // float64(-math.MaxFloat64): float64(-math.MaxFloat64), + // float32(math.MaxFloat32): float32(math.MaxFloat32), + // float64(math.MaxFloat64): float64(math.MaxFloat64), + "true": true, + "false": false, + "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array + // nil: []int{18, 41}, // array to complex map + "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test + }, + }) + + err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7, bin8, bin9, bin10) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + arraysEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) + arraysEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) + arraysEqual(rec.Bins[bin3.Name], bin3.Value.GetObject()) + arraysEqual(rec.Bins[bin4.Name], bin4.Value.GetObject()) + arraysEqual(rec.Bins[bin5.Name], bin5.Value.GetObject()) + arraysEqual(rec.Bins[bin6.Name], bin6.Value.GetObject()) + arraysEqual(rec.Bins[bin7.Name], bin7.Value.GetObject()) + arraysEqual(rec.Bins[bin8.Name], bin8.Value.GetObject()) + arraysEqual(rec.Bins[bin9.Name], bin9.Value.GetObject()) + arraysEqual(rec.Bins[bin10.Name], bin10.Value.GetObject()) + }) + + }) // context list + + gg.Context("Bins with MAP type", func() { + + gg.It("must save a key with Array Types", func() { + // complex type, consisting different maps + bin1 := as.NewBin("Aerospike1", map[int32]string{ + 0: "", + int32(math.MaxInt32): randString(100), + int32(math.MinInt32): randString(100), + }) + + bin2 := as.NewBin("Aerospike2", map[interface{}]interface{}{ + 15: nil, + "true": true, + "false": false, + int8(math.MaxInt8): int8(math.MaxInt8), + int64(math.MinInt64): int64(math.MinInt64), + int64(math.MaxInt64): int64(math.MaxInt64), + // uint64(math.MaxUint64): uint64(math.MaxUint64), + // float32(-math.MaxFloat32): float32(-math.MaxFloat32), + // float64(-math.MaxFloat64): float64(-math.MaxFloat64), + // float32(math.MaxFloat32): float32(math.MaxFloat32), + // float64(math.MaxFloat64): float64(math.MaxFloat64), + "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array + // nil: []int{18, 41}, // array to complex map + // "longString": strings.Repeat("s", 32911), // bit-sign test + "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test + }) + + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + mapsEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) + mapsEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) + }) + + }) // context map + + gg.Context("Bins with LIST type", func() { + + gg.It("must save a key with Array Types", func() { + bin1 := as.NewBin("Aerospike1", []interface{}{math.MinInt8, 0, 1, 2, 3, math.MaxInt8}) + bin2 := as.NewBin("Aerospike2", []interface{}{math.MinInt16, 0, 1, 2, 3, math.MaxInt16}) + bin3 := as.NewBin("Aerospike3", []interface{}{math.MinInt32, 0, 1, 2, 3, math.MaxInt32}) + bin4 := as.NewBin("Aerospike4", []interface{}{math.MinInt64, 0, 1, 2, 3, math.MaxInt64}) + bin5 := as.NewBin("Aerospike5", []interface{}{0, 1, 2, 3, math.MaxUint8}) + bin6 := as.NewBin("Aerospike6", []interface{}{0, 1, 2, 3, math.MaxUint16}) + bin7 := as.NewBin("Aerospike7", []interface{}{0, 1, 2, 3, math.MaxUint32}) + bin8 := as.NewBin("Aerospike8", []interface{}{"", "\n", "string"}) + bin9 := as.NewBin("Aerospike9", []interface{}{"", 1, nil, true, false, uint64(math.MaxUint64), math.MaxFloat32, math.MaxFloat64, as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), [3]int{1, 2, 3}}) + + // complex type, consisting different arrays + bin10 := as.NewBin("Aerospike10", []interface{}{ + nil, + bin1.Value.GetObject(), + bin2.Value.GetObject(), + bin3.Value.GetObject(), + bin4.Value.GetObject(), + bin5.Value.GetObject(), + bin6.Value.GetObject(), + bin7.Value.GetObject(), + bin8.Value.GetObject(), + bin9.Value.GetObject(), + map[interface{}]interface{}{ + 1: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}: []interface{}{"string", 12, nil}, + // [3]int{0, 1, 2}: []interface{}{"string", 12, nil}, + // [3]string{"0", "1", "2"}: []interface{}{"string", 12, nil}, + 15: nil, + int8(math.MaxInt8): int8(math.MaxInt8), + int64(math.MinInt64): int64(math.MinInt64), + int64(math.MaxInt64): int64(math.MaxInt64), + // uint64(math.MaxUint64): uint64(math.MaxUint64), + // float32(-math.MaxFloat32): float32(-math.MaxFloat32), + // float64(-math.MaxFloat64): float64(-math.MaxFloat64), + // float32(math.MaxFloat32): float32(math.MaxFloat32), + // float64(math.MaxFloat64): float64(math.MaxFloat64), + "true": true, + "false": false, + "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array + // nil: []interface{}{18, 41}, // array to complex map + "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test + }, + }) + + err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7, bin8, bin9, bin10) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + arraysEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) + arraysEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) + arraysEqual(rec.Bins[bin3.Name], bin3.Value.GetObject()) + arraysEqual(rec.Bins[bin4.Name], bin4.Value.GetObject()) + arraysEqual(rec.Bins[bin5.Name], bin5.Value.GetObject()) + arraysEqual(rec.Bins[bin6.Name], bin6.Value.GetObject()) + arraysEqual(rec.Bins[bin7.Name], bin7.Value.GetObject()) + arraysEqual(rec.Bins[bin8.Name], bin8.Value.GetObject()) + arraysEqual(rec.Bins[bin9.Name], bin9.Value.GetObject()) + arraysEqual(rec.Bins[bin10.Name], bin10.Value.GetObject()) + }) + + }) // context list + + gg.Context("Bins with MAP type", func() { + + gg.It("must save a key with Array Types", func() { + // complex type, consisting different maps + bin1 := as.NewBin("Aerospike1", map[int32]string{ + 0: "", + int32(math.MaxInt32): randString(100), + int32(math.MinInt32): randString(100), + }) + + bin2 := as.NewBin("Aerospike2", map[interface{}]interface{}{ + 15: nil, + "true": true, + "false": false, + int8(math.MaxInt8): int8(math.MaxInt8), + int64(math.MinInt64): int64(math.MinInt64), + int64(math.MaxInt64): int64(math.MaxInt64), + // uint64(math.MaxUint64): uint64(math.MaxUint64), + // float32(-math.MaxFloat32): float32(-math.MaxFloat32), + // float64(-math.MaxFloat64): float64(-math.MaxFloat64), + // float32(math.MaxFloat32): float32(math.MaxFloat32), + // float64(math.MaxFloat64): float64(math.MaxFloat64), + "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array + // nil: []int{18, 41}, // array to complex map + "longString": strings.Repeat("s", 32911), // bit-sign test + "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test + }) + + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + mapsEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) + mapsEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) + }) + + }) // context map + + }) // context complex types + + }) // put context + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_test.go b/aerospike-tls/vendor-aerospike-client-go/client_test.go new file mode 100644 index 00000000..3b04ba79 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/client_test.go @@ -0,0 +1,1768 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "bytes" + "errors" + "fmt" + "math" + "math/rand" + "strconv" + "strings" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + "github.com/aerospike/aerospike-client-go/v7/types" + ast "github.com/aerospike/aerospike-client-go/v7/types" + asub "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func isJsonObject(ifc interface{}) bool { + switch ifc := ifc.(type) { + case float64, float32, int, int64, uint64: + return true + case []interface{}: + for _, v := range ifc { + switch v.(type) { + case float64, float32, int, int64, uint64: + default: + return false + } + } + return true + case map[string]interface{}: + for _, v := range ifc { + if !isJsonObject(v) { + return false + } + } + return true + default: + return false + } +} + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + + var actualClusterName string + + gg.Describe("Client InfoErrorParser", func() { + + gg.It("must parse InfoError response strings", func() { + type t struct { + r string + code types.ResultCode + err string + } + + responses := []t{ + {"invalid", types.SERVER_ERROR, "invalid"}, + {"FAIL", types.SERVER_ERROR, "FAIL"}, + {"FAiL", types.SERVER_ERROR, "FAiL"}, + {"Error", types.SERVER_ERROR, "Error"}, + {"ERROR", types.SERVER_ERROR, "ERROR"}, + {"ERROR:200", types.INDEX_FOUND, "Index already exists"}, + {"FAIL:201", types.INDEX_NOTFOUND, "Index not found"}, + {"ERROR:200", types.INDEX_FOUND, "Index already exists"}, + {"FAIL:201", types.INDEX_NOTFOUND, "Index not found"}, + {"FAIL:201:some message from the server", types.INDEX_NOTFOUND, "some message from the server"}, + {"FAIL:some message from the server", types.SERVER_ERROR, "some message from the server"}, + {"error:some message from the server", types.SERVER_ERROR, "some message from the server"}, + } + + for _, r := range responses { + err := as.ParseInfoErrorCode(r.r) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.(*as.AerospikeError).Msg()).To(gm.Equal(r.err)) + gm.Expect(err.Matches(r.code)).To(gm.BeTrue()) + } + + }) + + }) + + gg.Describe("Client Management", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + }) + + dbHost := as.NewHost(*host, *port) + dbHost.TLSName = *nodeTLSName + + gg.It("must open and close the client without a problem", func() { + client, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(client.IsConnected()).To(gm.BeTrue()) + + time.Sleep(5 * time.Second) + + // set actual cluster name + node, err := client.Cluster().GetRandomNode() + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(node).NotTo(gm.BeNil()) + res, err := node.RequestInfo(as.NewInfoPolicy(), "cluster-name") + gm.Expect(err).ToNot(gm.HaveOccurred()) + actualClusterName = res["cluster-name"] + + stats, err := client.Stats() + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(stats)).To(gm.BeNumerically(">", 0)) + for _, nodeStatsIfc := range stats { + // make sure it's a strict map of string => float64 | string => float64 + gm.Expect(isJsonObject(nodeStatsIfc)).To(gm.BeTrue()) + + if nodeStats, ok := nodeStatsIfc.(map[string]interface{}); ok { + gm.Expect(nodeStats["connections-attempts"].(float64)).To(gm.BeNumerically(">=", 1)) + gm.Expect(nodeStats["node-added-count"].(float64)).To(gm.BeNumerically(">=", 1)) + gm.Expect(nodeStats["partition-map-updates"].(float64)).To(gm.BeNumerically(">=", 1)) + gm.Expect(nodeStats["tends-successful"].(float64)).To(gm.BeNumerically(">", 1)) + gm.Expect(nodeStats["tends-total"].(float64)).To(gm.BeNumerically(">", 1)) + } + } + + client.Close() + gm.Expect(client.IsConnected()).To(gm.BeFalse()) + }) + + gg.It("must return an error if supplied cluster-name is wrong", func() { + cpolicy := *clientPolicy + cpolicy.ClusterName = "haha" + cpolicy.Timeout = 10 * time.Second + nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.CLUSTER_NAME_MISMATCH_ERROR)).To(gm.BeTrue()) + gm.Expect(nclient).To(gm.BeNil()) + }) + + gg.It("must return a client even if cluster-name is wrong, but failIfConnected is false", func() { + cpolicy := *clientPolicy + cpolicy.ClusterName = "haha" + cpolicy.Timeout = 10 * time.Second + cpolicy.FailIfNotConnected = false + nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.CLUSTER_NAME_MISMATCH_ERROR)).To(gm.BeTrue()) + gm.Expect(nclient).NotTo(gm.BeNil()) + gm.Expect(nclient.IsConnected()).To(gm.BeFalse()) + }) + + gg.It("must connect to the cluster when cluster-name is correct", func() { + nodeCount := len(client.GetNodes()) + + cpolicy := *clientPolicy + cpolicy.ClusterName = actualClusterName + cpolicy.Timeout = 10 * time.Second + nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(len(nclient.GetNodes())).To(gm.Equal(nodeCount)) + }) + + gg.It("must connect to the cluster using external authentication protocol", func() { + if *authMode != "external" { + gg.Skip("Skipping External Authentication connection...") + } + + nodeCount := len(client.GetNodes()) + + cpolicy := *clientPolicy + cpolicy.Timeout = 10 * time.Second + cpolicy.AuthMode = as.AuthModeExternal + cpolicy.User = "badwan" + cpolicy.Password = "blastoff" + nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(len(nclient.GetNodes())).To(gm.Equal(nodeCount)) + }) + + gg.Context("Rackaware", func() { + + gg.It("must connect to the cluster in rackaware mode, and set the RackId = 0, and still get master node for all keys", func() { + cpolicy := *clientPolicy + cpolicy.User = *user + cpolicy.Password = *password + c, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + info := info(c, "racks:") + if strings.HasPrefix(strings.ToUpper(info), "ERROR") { + gg.Skip("Skipping RackAware test since it is not supported on this cluster...") + } + + cpolicy = *clientPolicy + cpolicy.Timeout = 10 * time.Second + cpolicy.RackAware = true + + for rid := 1; rid <= 20; rid++ { + nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + wpolicy := as.NewWritePolicy(0, 0) + wpolicy.ReplicaPolicy = as.PREFER_RACK + for i := 0; i < 12; i++ { + key, _ := as.NewKey(*namespace, "test", 1) + partition, err := as.PartitionForWrite(nclient.Cluster(), wpolicy.GetBasePolicy(), key) + gm.Expect(err).NotTo(gm.HaveOccurred()) + masterNode, err := partition.GetMasterNode(nclient.Cluster()) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + // node, err := nclient.Cluster().GetReadNode(partition, replicaPolicy, &seq) + node, err := partition.GetNodeRead(nclient.Cluster()) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(node).NotTo(gm.BeNil()) + gm.Expect(node).To(gm.Equal(masterNode)) + } + nclient.Close() + } + }) + + // gg.It("must connect to the cluster in rackaware mode", func() { + // cpolicy := *clientPolicy + // cpolicy.Timeout = 10 * time.Second + // cpolicy.RackAware = true + + // rpolicy := as.NewPolicy() + // rpolicy.ReplicaPolicy = as.PREFER_RACK + + // for rid := 1; rid <= 20; rid++ { + // cpolicy.RackId = (rid % 2) + 1 + + // nclient, err := as.NewClientWithPolicyAndHostNewClientWithPolicy(&cpolicy, dbHost) + // gm.Expect(err).NotTo(gm.HaveOccurred()) + + // for i := 0; i < 12; i++ { + // println(i) + // key, _ := as.NewKey(*namespace, "test", 1) + // partition, err := as.PartitionForRead(nclient.Cluster(), rpolicy.GetBasePolicy(), key) + // gm.Expect(err).NotTo(gm.HaveOccurred()) + + // node, err := partition.GetNodeRead(nclient.Cluster()) + // gm.Expect(err).NotTo(gm.HaveOccurred()) + // gm.Expect(node.Rack("test")).To(gm.Equal(cpolicy.RackId)) + // } + // nclient.Close() + // } + // }) + }) + }) + + gg.Describe("Data operations on native types", func() { + // connection data + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var rpolicy = as.NewPolicy() + var bpolicy = as.NewBatchPolicy() + var rec *as.Record + + if *useReplicas { + rpolicy.ReplicaPolicy = as.MASTER_PROLES + } + + gg.BeforeEach(func() { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.Context("Put operations", func() { + + gg.Context("Expiration values", func() { + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + gg.It("must return 30d if set to TTLServerDefault", func() { + wpolicy := as.NewWritePolicy(0, as.TTLServerDefault) + bin := as.NewBin("Aerospike", "value") + rec, err = client.Operate(wpolicy, key, as.PutOp(bin), as.GetOp()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + defaultTTL, err := strconv.Atoi(nsInfo(ns, "default-ttl")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + switch defaultTTL { + case 0: + gm.Expect(rec.Expiration).To(gm.Equal(uint32(math.MaxUint32))) + default: + gm.Expect(rec.Expiration).To(gm.Equal(uint32(defaultTTL))) + } + + }) + + gg.It("must return TTLDontExpire if set to TTLDontExpire", func() { + wpolicy := as.NewWritePolicy(0, as.TTLDontExpire) + bin := as.NewBin("Aerospike", "value") + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Expiration).To(gm.Equal(uint32(as.TTLDontExpire))) + }) + + gg.It("must not change the TTL if set to TTLDontUpdate", func() { + wpolicy := as.NewWritePolicy(0, as.TTLServerDefault) + bin := as.NewBin("Aerospike", "value") + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(3 * time.Second) + + wpolicy = as.NewWritePolicy(0, as.TTLDontUpdate) + bin = as.NewBin("Aerospike", "value") + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + defaultTTL, err := strconv.Atoi(nsInfo(ns, "default-ttl")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + switch defaultTTL { + case 0: + gm.Expect(rec.Expiration).To(gm.Equal(uint32(math.MaxUint32))) + default: + gm.Expect(rec.Expiration).To(gm.BeNumerically("<=", uint32(defaultTTL-3))) // default expiration on server is set to 30d + } + }) + }) + + gg.Context("Bins with `nil` values should be deleted", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", "value") + bin1 := as.NewBin("Aerospike1", "value2") // to avoid deletion of key + err = client.PutBins(wpolicy, key, bin, bin1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + + bin2 := as.NewBin("Aerospike", nil) + err = client.PutBins(wpolicy, key, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Key should not exist + _, exists := rec.Bins[bin.Name] + gm.Expect(exists).To(gm.Equal(false)) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", "nil") + bin2 := as.NewBin("Aerospike2", "value") + bin3 := as.NewBin("Aerospike3", "value") + err = client.PutBins(wpolicy, key, bin1, bin2, bin3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin2nil := as.NewBin("Aerospike2", nil) + bin3nil := as.NewBin("Aerospike3", nil) + err = client.PutBins(wpolicy, key, bin2nil, bin3nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Key should not exist + _, exists := rec.Bins[bin2.Name] + gm.Expect(exists).To(gm.Equal(false)) + _, exists = rec.Bins[bin3.Name] + gm.Expect(exists).To(gm.Equal(false)) + }) + + gg.It("must save a key with MULTIPLE bins using a BinMap", func() { + bin1 := as.NewBin("Aerospike1", "nil") + bin2 := as.NewBin("Aerospike2", "value") + bin3 := as.NewBin("Aerospike3", "value") + err = client.Put(wpolicy, key, as.BinMap{bin1.Name: bin1.Value, bin2.Name: bin2.Value, bin3.Name: bin3.Value}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin2nil := as.NewBin("Aerospike2", nil) + bin3nil := as.NewBin("Aerospike3", nil) + err = client.Put(wpolicy, key, as.BinMap{bin2nil.Name: bin2nil.Value, bin3nil.Name: bin3nil.Value}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Key should not exist + _, exists := rec.Bins[bin2.Name] + gm.Expect(exists).To(gm.Equal(false)) + _, exists = rec.Bins[bin3.Name] + gm.Expect(exists).To(gm.Equal(false)) + }) + }) + + gg.Context("Bins with `string` values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", "Awesome") + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", "Awesome1") + bin2 := as.NewBin("Aerospike2", "") + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + }) + }) + + gg.Context("Bins with `int8` and `uint8` values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", int8(rand.Intn(math.MaxInt8))) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", int8(math.MaxInt8)) + bin2 := as.NewBin("Aerospike2", int8(math.MinInt8)) + bin3 := as.NewBin("Aerospike3", uint8(math.MaxUint8)) + err = client.PutBins(wpolicy, key, bin1, bin2, bin3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) + }) + }) + + gg.Context("Bins with `int16` and `uint16` values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", int16(rand.Intn(math.MaxInt16))) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", int16(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", int16(math.MinInt16)) + bin3 := as.NewBin("Aerospike3", uint16(math.MaxUint16)) + err = client.PutBins(wpolicy, key, bin1, bin2, bin3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) + }) + }) + + gg.Context("Bins with `int` and `uint` values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", rand.Int()) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins; uint of > MaxInt32 will always result in LongValue", func() { + bin1 := as.NewBin("Aerospike1", math.MaxInt32) + bin2, bin3 := func() (*as.Bin, *as.Bin) { + if asub.Arch32Bits { + return as.NewBin("Aerospike2", int(math.MinInt32)), + as.NewBin("Aerospike3", uint(math.MaxInt32)) + } + return as.NewBin("Aerospike2", int(math.MinInt64)), + as.NewBin("Aerospike3", uint(math.MaxInt64)) + + }() + + err = client.PutBins(wpolicy, key, bin1, bin2, bin3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + if asub.Arch64Bits { + gm.Expect(rec.Bins[bin2.Name].(int)).To(gm.Equal(bin2.Value.GetObject())) + gm.Expect(int64(rec.Bins[bin3.Name].(int))).To(gm.Equal(bin3.Value.GetObject())) + } else { + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) + } + }) + }) + + gg.Context("Bins with `int64` only values (uint64 is supported via type cast to int64) ", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", rand.Int63()) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + if asub.Arch64Bits { + gm.Expect(int64(rec.Bins[bin.Name].(int))).To(gm.Equal(bin.Value.GetObject())) + } else { + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + } + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", math.MaxInt64) + bin2 := as.NewBin("Aerospike2", math.MinInt64) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + }) + }) + + gg.Context("Bins with `float32` only values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", rand.Float32()) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(float64(rec.Bins[bin.Name].(float64))).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", math.MaxFloat32) + bin2 := as.NewBin("Aerospike2", -math.MaxFloat32) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + }) + }) + + gg.Context("Bins with `float64` only values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", rand.Float64()) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(float64(rec.Bins[bin.Name].(float64))).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", math.MaxFloat64) + bin2 := as.NewBin("Aerospike2", -math.MaxFloat64) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + }) + }) + + gg.Context("Bins with `bool` only values", func() { + gg.It("must save a key with SINGLE bin", func() { + bin := as.NewBin("Aerospike", as.BoolValue(true)) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(bool(rec.Bins[bin.Name].(bool))).To(gm.Equal(bin.Value.GetObject())) + }) + + gg.It("must save a key with MULTIPLE bins", func() { + bin1 := as.NewBin("Aerospike1", as.BoolValue(true)) + bin2 := as.NewBin("Aerospike2", as.BoolValue(false)) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + }) + }) + + gg.Context("Bins with complex types", func() { + + gg.Context("Bins with BLOB type", func() { + gg.It("must save and retrieve Bins with AerospikeBlobs type", func() { + person := &testBLOB{name: "SomeDude"} + bin := as.NewBin("Aerospike1", person) + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + }) + + gg.Context("Bins with LIST type", func() { + + gg.It("must save a key with Array Types", func() { + // All int types and sizes should be encoded into an int64, + // unless if they are of type uint64, which always encodes to uint64 + // regardless of the values inside + intList := []interface{}{math.MinInt64, math.MinInt64 + 1} + for i := uint(0); i < 64; i++ { + intList = append(intList, -(1 << i)) + intList = append(intList, -(1<", generation)) + + recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure the + for r := range recordset.Results() { + gm.Expect(r.Err).ToNot(gm.HaveOccurred()) + if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { + gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) + gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) + } + } + }) + + }) // Touch context + + gg.Context("Exists operations", func() { + bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) + + gg.BeforeEach(func() { + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("must check Existence of a non-existing key", func() { + var nxkey *as.Key + nxkey, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + var exists bool + exists, err = client.Exists(rpolicy, nxkey) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(false)) + }) + + gg.It("must checks Existence of an existing key", func() { + var exists bool + exists, err = client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + }) + + }) // Exists context + + gg.Context("Batch Exists operations", func() { + bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) + var keyCount = []int{1, 2048} + + gg.BeforeEach(func() { + }) + + for _, keyCount := range keyCount { + for _, useInline := range []bool{true, false} { + gg.It(fmt.Sprintf("must return the result with same ordering. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { + var exists []bool + keys := []*as.Key{} + + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + keys = append(keys, key) + + // if key shouldExist == true, put it in the DB + if i%2 == 0 { + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + } + } + + bpolicy.AllowInline = useInline + exists, err = client.BatchExists(bpolicy, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(exists)).To(gm.Equal(len(keys))) + for idx, keyExists := range exists { + gm.Expect(keyExists).To(gm.Equal(idx%2 == 0)) + } + }) + } + } + + }) // Batch Exists context + + gg.Context("Batch Get operations", func() { + bin := as.NewBin("Aerospike", rand.Int()) + var keyCount = []int{1, 2048} + + gg.BeforeEach(func() { + }) + + for _, keyCount := range keyCount { + for _, useInline := range []bool{true, false} { + gg.It(fmt.Sprintf("must return the records with same ordering as keys. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { + binRedundant := as.NewBin("Redundant", "Redundant") + + var records []*as.Record + type existence struct { + key *as.Key + shouldExist bool // set randomly and checked against later + } + + exList := make([]existence, 0, keyCount) + keys := make([]*as.Key, 0, keyCount) + + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + e := existence{key: key, shouldExist: rand.Intn(100) > 50} + exList = append(exList, e) + keys = append(keys, key) + + // if key shouldExist == true, put it in the DB + if e.shouldExist { + err = client.PutBins(wpolicy, key, bin, binRedundant) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + rec, err := client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Bins[binRedundant.Name]).To(gm.Equal(binRedundant.Value.GetObject())) + } else { + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(false)) + } + } + + brecords := make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: true, + } + } + bpolicy.AllowInline = useInline + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for idx, rec := range brecords { + if exList[idx].shouldExist { + gm.Expect(len(rec.Record.Bins)).To(gm.Equal(2)) + gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec.Record).To(gm.BeNil()) + } + } + + brecords = make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: false, + BinNames: []string{bin.Name}, + } + } + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for idx, rec := range brecords { + if exList[idx].shouldExist { + gm.Expect(len(rec.Record.Bins)).To(gm.Equal(1)) + gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec.Record).To(gm.BeNil()) + } + } + + records, err = client.BatchGet(bpolicy, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(records)).To(gm.Equal(len(keys))) + for idx, rec := range records { + if exList[idx].shouldExist { + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec).To(gm.BeNil()) + } + } + + records, err = client.BatchGet(bpolicy, keys, bin.Name) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(records)).To(gm.Equal(len(keys))) + for idx, rec := range records { + if exList[idx].shouldExist { + // only bin1 has been requested + gm.Expect(rec.Bins[binRedundant.Name]).To(gm.BeNil()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec).To(gm.BeNil()) + } + } + }) + + gg.It(fmt.Sprintf("must return the records with same ordering as keys via Batch Complex Protocol. keyCount: %d, AllowInline: %v", keyCount, useInline), func() { + binRedundant := as.NewBin("Redundant", "Redundant") + + type existence struct { + key *as.Key + shouldExist bool // set randomly and checked against later + } + + exList := make([]existence, 0, keyCount) + keys := make([]*as.Key, 0, keyCount) + + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + e := existence{key: key, shouldExist: rand.Intn(100) > 50} + exList = append(exList, e) + keys = append(keys, key) + + // if key shouldExist == true, put it in the DB + if e.shouldExist { + err = client.PutBins(wpolicy, key, bin, binRedundant) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + rec, err := client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Bins[binRedundant.Name]).To(gm.Equal(binRedundant.Value.GetObject())) + } else { + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(false)) + } + } + + brecords := make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: true, + } + } + bpolicy.AllowInline = useInline + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for idx, rec := range brecords { + if exList[idx].shouldExist { + gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec.Record).To(gm.BeNil()) + } + } + + brecords = make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: false, + BinNames: []string{"Aerospike", "Redundant"}, + } + } + bpolicy.AllowInline = useInline + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for idx, rec := range brecords { + if exList[idx].shouldExist { + gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) + gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec.Record).To(gm.BeNil()) + } + } + + brecords = make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: false, + BinNames: nil, + } + } + bpolicy.AllowInline = useInline + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for idx, rec := range brecords { + if exList[idx].shouldExist { + gm.Expect(len(rec.Record.Bins)).To(gm.Equal(0)) + gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) + } else { + gm.Expect(rec.Record).To(gm.BeNil()) + } + } + + }) + } + } + }) // Batch Get context + + gg.Context("GetHeader operations", func() { + bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) + + gg.BeforeEach(func() { + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("must Get the Header of an existing key after touch", func() { + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + generation := rec.Generation + + err = client.Touch(wpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err = client.GetHeader(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Generation).To(gm.BeNumerically(">", generation)) + gm.Expect(rec.Bins[bin.Name]).To(gm.BeNil()) + }) + + }) // GetHeader context + + gg.Context("BatchOperate", func() { + + gg.It("must execute BatchGetOperate with Operations", func() { + const listSize = 10 + const cdtBinName = "cdtBin" + + for keyCount := 1; keyCount < 10; keyCount++ { + keys := make([]*as.Key, keyCount) + for i := 0; i < keyCount; i++ { + keys[i], err = as.NewKey(ns, set, randString(10)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + // First Part: For CDTs + list := []interface{}{} + for j, key := range keys { + for i := 1; i <= listSize; i++ { + list = append(list, i*100) + + sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, j+i*100)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + } + } + + records, err := client.BatchGetOperate(bpolicy, keys, + as.ListSizeOp(cdtBinName), + as.ListGetByIndexOp(cdtBinName, -1, as.ListReturnTypeValue), + as.ListGetByIndexOp(cdtBinName, 0, as.ListReturnTypeValue), + as.ListGetByIndexOp(cdtBinName, 2, as.ListReturnTypeValue), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for i, key := range keys { + rec := records[i] + gm.Expect(rec.Key.Digest()).To(gm.Equal(key.Digest())) + gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(as.OpResults{listSize, i + listSize*100, i + 100, i + 300})) + } + } + }) + + gg.It("must execute BatchGetComplex with Operations", func() { + const listSize = 10 + const cdtBinName = "cdtBin" + + for keyCount := 1; keyCount < 10; keyCount++ { + keys := make([]*as.Key, keyCount) + for i := 0; i < keyCount; i++ { + keys[i], err = as.NewKey(ns, set, randString(10)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + brecords := make([]*as.BatchRead, len(keys)) + for i := range keys { + brecords[i] = &as.BatchRead{ + BatchRecord: as.BatchRecord{ + Key: keys[i], + }, + ReadAllBins: false, // just to check if the internal flags are set correctly regardless + Ops: []*as.Operation{ + as.ListSizeOp(cdtBinName), + as.ListGetByIndexOp(cdtBinName, -1, as.ListReturnTypeValue), + as.ListGetByIndexOp(cdtBinName, 0, as.ListReturnTypeValue), + as.ListGetByIndexOp(cdtBinName, 2, as.ListReturnTypeValue), + }, + } + } + + // First Part: For CDTs + list := []interface{}{} + for j, key := range keys { + for i := 1; i <= listSize; i++ { + list = append(list, i*100) + + sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, j+i*100)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + } + } + + err = client.BatchGetComplex(bpolicy, brecords) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for i, key := range keys { + rec := brecords[i].Record + gm.Expect(rec.Key.Digest()).To(gm.Equal(key.Digest())) + gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(as.OpResults{listSize, i + listSize*100, i + 100, i + 300})) + } + } + }) + }) + + gg.Context("Batch Get Header operations", func() { + bin := as.NewBin("Aerospike", rand.Int()) + var keyCount = []int{1, 1024} + + gg.BeforeEach(func() { + }) + + for _, keyCount := range keyCount { + for _, useInline := range []bool{true, false} { + gg.It(fmt.Sprintf("must return the record headers with same ordering as keys. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { + var records []*as.Record + type existence struct { + key *as.Key + shouldExist bool // set randomly and checked against later + } + + exList := []existence{} + keys := []*as.Key{} + + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + e := existence{key: key, shouldExist: rand.Intn(100) > 50} + exList = append(exList, e) + keys = append(keys, key) + + // if key shouldExist == true, put it in the DB + if e.shouldExist { + err = client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // update generation + err = client.Touch(wpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure they exists in the DB + exists, err := client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.Equal(true)) + } + } + + bpolicy.AllowInline = useInline + records, err = client.BatchGetHeader(bpolicy, keys) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(records)).To(gm.Equal(len(keys))) + for idx, rec := range records { + if exList[idx].shouldExist { + gm.Expect(rec.Bins[bin.Name]).To(gm.BeNil()) + gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) + } else { + gm.Expect(rec).To(gm.BeNil()) + } + } + }) + } + } + }) // Batch Get Header context + + gg.Context("Operate operations", func() { + bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", randString(100)) + + gg.BeforeEach(func() { + // err = client.PutBins(wpolicy, key, bin) + // gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("must return proper error on write operations, but not reads", func() { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + wpolicy := as.NewWritePolicy(0, 0) + rec, err = client.Operate(wpolicy, key, as.GetOp()) + gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) + + rec, err = client.Operate(wpolicy, key, as.TouchOp()) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + gg.It("must work correctly when no BinOps are passed as argument", func() { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + ops1 := []*as.Operation{} + + wpolicy := as.NewWritePolicy(0, 0) + rec, err = client.Operate(wpolicy, key, ops1...) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Error()).To(gm.ContainSubstring("No operations were passed.")) + }) + + gg.It("must send key on Put operations", func() { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + ops1 := []*as.Operation{ + as.PutOp(bin1), + as.PutOp(bin2), + as.GetOp(), + } + + wpolicy := as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + rec, err = client.Operate(wpolicy, key, ops1...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure the result is what we put in + for r := range recordset.Results() { + gm.Expect(r.Err).ToNot(gm.HaveOccurred()) + if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { + gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) + gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) + } + } + }) + + gg.It("must send key on Touch operations", func() { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + ops1 := []*as.Operation{ + as.GetOp(), + as.PutOp(bin2), + } + + wpolicy := as.NewWritePolicy(0, 0) + wpolicy.SendKey = false + rec, err = client.Operate(wpolicy, key, ops1...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure the key is not saved + for r := range recordset.Results() { + gm.Expect(r.Err).ToNot(gm.HaveOccurred()) + if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { + gm.Expect(r.Record.Key.Value()).To(gm.BeNil()) + } + } + + ops2 := []*as.Operation{ + as.GetOp(), + as.TouchOp(), + } + wpolicy.SendKey = true + rec, err = client.Operate(wpolicy, key, ops2...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recordset, err = client.ScanAll(nil, key.Namespace(), key.SetName()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure the + for r := range recordset.Results() { + gm.Expect(r.Err).ToNot(gm.HaveOccurred()) + if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { + gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) + gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) + } + } + }) + + gg.It("must apply all operations, and result should match expectation", func() { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + ops1 := []*as.Operation{ + as.PutOp(bin1), + as.PutOp(bin2), + as.GetOp(), + } + + rec, err = client.Operate(nil, key, ops1...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int))) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string))) + gm.Expect(rec.Generation).To(gm.Equal(uint32(1))) + + ops2 := []*as.Operation{ + as.AddOp(bin1), // double the value of the bin + as.AppendOp(bin2), // with itself + as.GetOp(), + } + + rec, err = client.Operate(nil, key, ops2...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) * 2)) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat(bin2.Value.GetObject().(string), 2))) + gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) + + ops3 := []*as.Operation{ + as.AddOp(bin1), + as.PrependOp(bin2), + as.TouchOp(), + as.GetOp(), + } + + rec, err = client.Operate(nil, key, ops3...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) * 3)) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat(bin2.Value.GetObject().(string), 3))) + gm.Expect(rec.Generation).To(gm.Equal(uint32(3))) + + ops4 := []*as.Operation{ + as.TouchOp(), + as.GetHeaderOp(), + } + + rec, err = client.Operate(nil, key, ops4...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Generation).To(gm.Equal(uint32(4))) + gm.Expect(len(rec.Bins)).To(gm.Equal(0)) + + // GetOp should override GetHEaderOp + ops5 := []*as.Operation{ + as.GetOp(), + as.GetHeaderOp(), + } + + rec, err = client.Operate(nil, key, ops5...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Generation).To(gm.Equal(uint32(4))) + gm.Expect(len(rec.Bins)).To(gm.Equal(2)) + + // GetOp should override GetHeaderOp + ops6 := []*as.Operation{ + as.GetHeaderOp(), + as.DeleteOp(), + as.PutOp(bin1), + } + + rec, err = client.Operate(nil, key, ops6...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Generation).To(gm.Equal(uint32(5))) + gm.Expect(len(rec.Bins)).To(gm.Equal(0)) + + // GetOp should override GetHeaderOp + ops7 := []*as.Operation{ + as.GetOp(), + as.TouchOp(), + } + + rec, err = client.Operate(nil, key, ops7...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Generation).To(gm.Equal(uint32(6))) + gm.Expect(len(rec.Bins)).To(gm.Equal(1)) + }) + + gg.It("must re-apply the same operations, and result should match expectation", func() { + const listSize = 10 + const cdtBinName = "cdtBin" + + // First Part: For CDTs + list := []interface{}{} + opAppend := as.ListAppendOp(cdtBinName, 1) + for i := 1; i <= listSize; i++ { + list = append(list, i) + + sz, err := client.Operate(wpolicy, key, opAppend) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) + } + + op := as.ListGetOp(cdtBinName, -1) + cdtListRes, err := client.Operate(wpolicy, key, op) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + cdtListRes, err = client.Operate(wpolicy, key, op) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) + + // Second Part: For other normal Ops + bin1 := as.NewBin("Aerospike1", 1) + bin2 := as.NewBin("Aerospike2", "a") + + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + ops1 := []*as.Operation{ + as.PutOp(bin1), + as.PutOp(bin2), + as.GetOp(), + } + + rec, err = client.Operate(nil, key, ops1...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int))) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string))) + gm.Expect(rec.Generation).To(gm.Equal(uint32(1))) + + ops2 := []*as.Operation{ + as.AddOp(bin1), + as.AppendOp(bin2), + as.GetOp(), + } + + rec, err = client.Operate(nil, key, ops2...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) + 1)) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string) + "a")) + gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) + + rec, err = client.Operate(nil, key, ops2...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) + 2)) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string) + "aa")) + gm.Expect(rec.Generation).To(gm.Equal(uint32(3))) + + }) + + }) // GetHeader context + + }) + + gg.Describe("Commands Test", func() { + + gg.Context("XDR Filter", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + + if !xdrEnabled() { + gg.Skip("XDR Filter Tests are not supported in the Community Edition, or when the server is not configured for XDR") + return + } + }) + + gg.It("must successfully send SetXDRFilter command", func() { + xp := as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(85), + ) + + err := client.SetXDRFilter(nil, "test", "test", xp) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("must reject invalid Expression for SetXDRFilter command", func() { + xp := as.ExpEq( + as.ExpIntBin("bin"), + as.ExpStringVal("some string"), + ) + + err := client.SetXDRFilter(nil, "test", "test", xp) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + gg.It("must remove the server XDR filter using SetXDRFilter command", func() { + err := client.SetXDRFilter(nil, "test", "test", nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + }) // gg.Context + + }) // Describe + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/cluster.go b/aerospike-tls/vendor-aerospike-client-go/cluster.go new file mode 100644 index 00000000..c98b8a98 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/cluster.go @@ -0,0 +1,1010 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "net" + "runtime/debug" + "sync" + "sync/atomic" + "time" + + "golang.org/x/sync/errgroup" + + iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + sm "github.com/aerospike/aerospike-client-go/v7/internal/atomic/map" + "github.com/aerospike/aerospike-client-go/v7/internal/seq" + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Cluster encapsulates the aerospike cluster nodes and manages +// them. +type Cluster struct { + // Initial host nodes specified by user. + seeds iatomic.SyncVal[[]*Host] + + // All aliases for all nodes in cluster. + // Only accessed within cluster tend goroutine. + aliases sm.Map[Host, *Node] + + // Map of active nodes in cluster. + // Only accessed within cluster tend goroutine. + nodesMap sm.Map[string, *Node] + + // Active nodes in cluster. + nodes iatomic.SyncVal[[]*Node] + stats map[string]*nodeStats //host => stats + statsLock sync.Mutex + + // enable performance metrics + metricsEnabled atomic.Bool // bool + metricsPolicy iatomic.TypedVal[*MetricsPolicy] + + // Hints for best node for a partition + partitionWriteMap iatomic.TypedVal[partitionMap] //partitionMap + + clientPolicy ClientPolicy + infoPolicy InfoPolicy + connectionThreshold iatomic.Int // number of parallel opening connections + + maxRetriesExceededCount iatomic.Int // number of times the commands on this cluster were exceeded the specifiedmax retries + totalTimeoutExceededCount iatomic.Int // number of times the commands on this cluster were exceeded the specified total timeout + + nodeIndex iatomic.Int // only used via atomic operations + replicaIndex iatomic.Int // only used via atomic operations + + wgTend sync.WaitGroup + tendChannel chan struct{} + closed iatomic.Bool + tendCount int + + supportsPartitionQuery iatomic.Bool // whether all nodes in the cluster support query by partition. + + // User name in UTF-8 encoded bytes. + user string + + // Password in hashed format in bytes. + password iatomic.SyncVal[[]byte] +} + +// NewCluster generates a Cluster instance. +func NewCluster(policy *ClientPolicy, hosts []*Host) (*Cluster, Error) { + // Validate the policy params + if policy.MinConnectionsPerNode > policy.ConnectionQueueSize { + panic("minimum number of connections specified in the ClientPolicy is bigger than total connection pool size") + } + + // Default TLS names when TLS enabled. + newHosts := make([]*Host, 0, len(hosts)) + if policy.TlsConfig != nil && !policy.TlsConfig.InsecureSkipVerify { + useClusterName := len(policy.ClusterName) > 0 + + for _, host := range hosts { + nh := *host + if nh.TLSName == "" { + if useClusterName { + nh.TLSName = policy.ClusterName + } else { + nh.TLSName = host.Name + } + } + newHosts = append(newHosts, &nh) + } + hosts = newHosts + } + + clientPolicy := *policy + + // Set a default Idle Timeout for the connection + if clientPolicy.IdleTimeout <= 0 { + clientPolicy.IdleTimeout = 55 * time.Second + } + + newCluster := &Cluster{ + clientPolicy: clientPolicy, + infoPolicy: InfoPolicy{Timeout: policy.Timeout}, + tendChannel: make(chan struct{}), + + seeds: *iatomic.NewSyncVal(hosts), + aliases: *sm.New[Host, *Node](16), + nodesMap: *sm.New[string, *Node](16), + nodes: *iatomic.NewSyncVal([]*Node{}), + stats: map[string]*nodeStats{}, + + password: *iatomic.NewSyncVal[[]byte](nil), + + supportsPartitionQuery: *iatomic.NewBool(false), + } + + newCluster.partitionWriteMap.Set(make(partitionMap)) + + // setup auth info for cluster + if policy.RequiresAuthentication() { + if policy.AuthMode == AuthModeExternal && policy.TlsConfig == nil { + return nil, newError(types.PARAMETER_ERROR, "External Authentication requires TLS configuration to be set, because it sends clear password on the wire.") + } + + newCluster.user = policy.User + hashedPass, err := hashPassword(policy.Password) + if err != nil { + return nil, err + } + newCluster.password = *iatomic.NewSyncVal(hashedPass) + } + + // try to seed connections for first use + err := newCluster.waitTillStabilized() + + // apply policy rules + if policy.FailIfNotConnected && !newCluster.IsConnected() { + if err != nil { + return nil, err + } + return nil, newError(types.PARAMETER_ERROR, fmt.Sprintf("Failed to connect to host(s): %v. The network connection(s) to cluster nodes may have timed out, or the cluster may be in a state of flux.", hosts)) + } + + // start up cluster maintenance go routine + newCluster.wgTend.Add(1) + go newCluster.clusterBoss(&newCluster.clientPolicy) + + if err == nil { + logger.Logger.Debug("New cluster initialized and ready to be used...") + } else { + logger.Logger.Error("New cluster was not initialized successfully, but the client will keep trying to connect to the database. Error: %s", err.Error()) + } + + return newCluster, err +} + +// String implements the stringer interface +func (clstr *Cluster) String() string { + return fmt.Sprintf("%v", clstr.GetNodes()) +} + +// Maintains the cluster on intervals. +// All clean up code for cluster is here as well. +func (clstr *Cluster) clusterBoss(policy *ClientPolicy) { + logger.Logger.Info("Starting the cluster tend goroutine...") + + defer func() { + if r := recover(); r != nil { + logger.Logger.Error("Cluster tend goroutine crashed: %s", debug.Stack()) + go clstr.clusterBoss(&clstr.clientPolicy) + } + }() + + defer clstr.wgTend.Done() + + tendInterval := policy.TendInterval + if tendInterval <= 10*time.Millisecond { + tendInterval = 10 * time.Millisecond + } + +Loop: + for { + select { + case <-clstr.tendChannel: + // tend channel closed + logger.Logger.Debug("Tend channel closed. Shutting down the cluster...") + break Loop + case <-time.After(tendInterval): + tm := time.Now() + if err := clstr.tend(); err != nil { + logger.Logger.Warn(err.Error()) + } + + // Tending took longer than requested tend interval. + // Tending is too slow for the cluster, and may be falling behind schedule. + if tendDuration := time.Since(tm); tendDuration > clstr.clientPolicy.TendInterval { + logger.Logger.Warn("Tending took %s, while your requested ClientPolicy.TendInterval is %s. Tends are slower than the interval, and may be falling behind the changes in the cluster.", tendDuration, clstr.clientPolicy.TendInterval) + } + } + } + + // cleanup code goes here + // close the nodes + nodeArray := clstr.GetNodes() + for _, node := range nodeArray { + node.Close() + } +} + +// AddSeeds adds new hosts to the cluster. +// They will be added to the cluster on next tend call. +func (clstr *Cluster) AddSeeds(hosts []*Host) { + clstr.seeds.Update(func(seeds []*Host) ([]*Host, error) { + seeds = append(seeds, hosts...) + return seeds, nil + }) +} + +// Healthy returns an error if the cluster is not healthy. +func (clstr *Cluster) Healthy() Error { + p := clstr.getPartitions() + if p == nil { + return ErrInvalidPartitionMap.err() + } + return p.validate() +} + +// Updates cluster state +func (clstr *Cluster) tend() Error { + + nodes := clstr.GetNodes() + nodeCountBeforeTend := len(nodes) + + // All node additions/deletions are performed in tend goroutine. + // If active nodes don't exist, seed cluster. + if len(nodes) == 0 || (clstr.clientPolicy.SeedOnlyCluster && len(nodes) < clstr.GetSeedCount()) { + logger.Logger.Info("No nodes available; seeding...") + if newNodesFound, err := clstr.seedNodes(); !newNodesFound { + return err + } + + // refresh nodes list after seeding + nodes = clstr.GetNodes() + } + + peers := newPeers(len(nodes)+16, 16) + + seq.ParDo(nodes, func(node *Node) { + if err := node.Refresh(peers); err != nil { + logger.Logger.Debug("Error occurred while refreshing node: %s", node.String()) + } + }) + + // Refresh peers when necessary. + if peers.genChanged.Get() || len(peers.peers()) != nodeCountBeforeTend { + // Refresh peers for all nodes that responded the first time even if only one node's peers changed. + peers.refreshCount.Set(0) + + seq.ParDo(nodes, func(node *Node) { + node.refreshPeers(peers) + }) + } + + var partMap iatomic.Guard[partitionMap] + + // find the first host that connects + seq.ParDo(peers.peers(), func(_peer *peer) { + if clstr.peerExists(peers, _peer.nodeName) { + // Node already exists. Do not even try to connect to hosts. + return + } + + seq.Do(_peer.hosts, func(host *Host) error { + // attempt connection to the host + nv := nodeValidator{seedOnlyCluster: clstr.clientPolicy.SeedOnlyCluster} + if err := nv.validateNode(clstr, host); err != nil { + logger.Logger.Warn("Add node `%s` failed: `%s`", host, err) + return nil + } + + // Must look for new node name in the unlikely event that node names do not agree. + if _peer.nodeName != nv.name { + logger.Logger.Warn("Peer node `%s` is different than actual node `%s` for host `%s`", _peer.nodeName, nv.name, host) + } + + if clstr.peerExists(peers, nv.name) { + // Node already exists. Do not even try to connect to hosts. + return seq.Break + } + + // Create new node. + node := clstr.createNode(&nv) + peers.addNode(nv.name, node) + partMap.InitDoVal(clstr.getPartitions().clone, func(partMap partitionMap) { + node.refreshPartitions(peers, partMap, true) + }) + return seq.Break + }) + }) + + // Refresh partition map when necessary. + seq.ParDo(nodes, func(node *Node) { + if node.partitionChanged.Get() { + partMap.InitDoVal(clstr.getPartitions().clone, func(partMap partitionMap) { + node.refreshPartitions(peers, partMap, false) + }) + } + }) + + if peers.genChanged.Get() { + // Handle nodes changes determined from refreshes. + removeList := clstr.findNodesToRemove(peers.refreshCount.Get()) + + // Remove nodes in a batch. + for i := range removeList { + logger.Logger.Debug("The following nodes will be removed: %s", removeList[i]) + } + clstr.removeNodes(removeList) + clstr.aggregateNodeStats(removeList) + } + + // Add nodes in a batch. + clstr.addNodes(peers.nodes()) + + // add to the number of successful tends + clstr.tendCount++ + + // update all partitions in one go + updatePartitionMap := seq.Any(clstr.GetNodes(), func(node *Node) bool { + return node.partitionChanged.Get() + }) + + if updatePartitionMap { + clstr.setPartitions(*partMap.Release()) + } + + if err := clstr.getPartitions().validate(); err != nil { + logger.Logger.Error("Error validating the cluster partition map after tend: %s", err.Error()) + } + + // only log if node count is changed + if nodeCountBeforeTend != len(clstr.GetNodes()) { + logger.Logger.Info("Tend finished. Live node count changes from %d to %d", nodeCountBeforeTend, len(clstr.GetNodes())) + } + + clstr.aggregateNodeStats(clstr.GetNodes()) + + // Reset connection error window for all nodes every connErrorWindow tend iterations. + if clstr.clientPolicy.MaxErrorRate > 0 && clstr.tendCount%clstr.clientPolicy.ErrorRateWindow == 0 { + for _, node := range clstr.GetNodes() { + node.resetErrorCount() + } + } + + return nil +} + +func (clstr *Cluster) aggregateNodeStats(nodeList []*Node) { + // update stats + clstr.statsLock.Lock() + defer clstr.statsLock.Unlock() + + for _, node := range nodeList { + h := node.host.String() + if stats, exists := clstr.stats[h]; exists { + stats.aggregate(node.stats.getAndReset()) + } else { + clstr.stats[h] = node.stats.getAndReset() + } + } +} + +func (clstr *Cluster) statsCopy() map[string]nodeStats { + // update the stats on the cluster object + clstr.aggregateNodeStats(clstr.GetNodes()) + + clstr.statsLock.Lock() + defer clstr.statsLock.Unlock() + + res := make(map[string]nodeStats, len(clstr.stats)) + for _, node := range clstr.GetNodes() { + h := node.host.String() + if stats, exists := clstr.stats[h]; exists { + statsCopy := stats.clone() + statsCopy.ConnectionsOpen.Set(node.connectionCount.Get()) + res[h] = statsCopy + } + } + + // stats for nodes which do not exist anymore + for h, stats := range clstr.stats { + if _, exists := res[h]; !exists { + stats.ConnectionsOpen.Set(0) + res[h] = stats.clone() + } + } + + return res +} + +func (clstr *Cluster) peerExists(peers *peers, nodeName string) bool { + node := clstr.findNodeByName(nodeName) + if node != nil { + node.referenceCount.IncrementAndGet() + return true + } + + node = peers.nodeByName(nodeName) + if node != nil { + node.referenceCount.IncrementAndGet() + return true + } + + return false +} + +// Tend the cluster until it has stabilized and return control. +// This helps avoid initial database request timeout issues when +// a large number of goroutines are initiated at client startup. +// +// If the cluster has not stabilized by the timeout, return +// control as well. Do not return an error since future +// database requests may still succeed. +func (clstr *Cluster) waitTillStabilized() Error { + count := -1 + + doneCh := make(chan Error, 10) + + // will run until the cluster is stabilized + go func() { + var err Error + for { + if err = clstr.tend(); err != nil { + if err.Matches(types.NOT_AUTHENTICATED, types.CLUSTER_NAME_MISMATCH_ERROR) { + select { + case doneCh <- err: + default: + } + } + logger.Logger.Warn(err.Error()) + } + + // Check to see if cluster has changed since the last Tend(). + // If not, assume cluster has stabilized and return. + if count == len(clstr.GetNodes()) { + break + } + + time.Sleep(time.Millisecond) + + count = len(clstr.GetNodes()) + } + doneCh <- err + }() + + select { + case <-time.After(clstr.clientPolicy.Timeout): + if clstr.clientPolicy.FailIfNotConnected { + clstr.Close() + } + return ErrTimeout.err() + case err := <-doneCh: + if err != nil && clstr.clientPolicy.FailIfNotConnected { + clstr.Close() + } + return err + } +} + +func (clstr *Cluster) findAlias(alias *Host) *Node { + return clstr.aliases.Get(*alias) +} + +func (clstr *Cluster) setPartitions(partMap partitionMap) { + if err := partMap.validate(); err != nil { + logger.Logger.Error("Partition map error: %s.", err.Error()) + } + + clstr.partitionWriteMap.Set(partMap) +} + +func (clstr *Cluster) getPartitions() partitionMap { + return clstr.partitionWriteMap.Get() +} + +// discoverSeeds will lookup the seed hosts and convert seed hosts +// to IP addresses. +func discoverSeedIPs(seeds []*Host) (res []*Host) { + for _, seed := range seeds { + addresses, err := net.LookupHost(seed.Name) + if err != nil { + continue + } + + for i := range addresses { + h := *seed + h.Name = addresses[i] + res = append(res, &h) + } + } + + return res +} + +// Adds seeds to the cluster +func (clstr *Cluster) seedNodes() (newSeedsFound bool, errChain Error) { + // Must copy array reference for copy on write semantics to work. + seedArrayCopy, _ := clstr.seeds.GetSyncedVia(func(seeds []*Host) ([]*Host, error) { + seedsCopy := make([]*Host, len(seeds)) + copy(seedsCopy, seeds) + + return seedsCopy, nil + }) + + // discover seed IPs from DNS or Load Balancers + seedArray := discoverSeedIPs(seedArrayCopy) + + successChan := make(chan struct{}, len(seedArray)) + errChan := make(chan Error, len(seedArray)) + + logger.Logger.Info("Seeding the cluster. Seeds count: %d", len(seedArray)) + + // Add all nodes at once to avoid copying entire array multiple times. + for i, seed := range seedArray { + go func(index int, seed *Host) { + nodesToAdd := make(nodesToAddT, 128) + nv := nodeValidator{seedOnlyCluster: clstr.clientPolicy.SeedOnlyCluster} + err := nv.seedNodes(clstr, seed, nodesToAdd) + if err != nil { + logger.Logger.Warn("Seed %s failed: %s", seed.String(), err.Error()) + errChan <- err + return + } + clstr.addNodes(nodesToAdd) + successChan <- struct{}{} + }(i, seed) + } + + seedCount := len(seedArray) +L: + for { + select { + case err := <-errChan: + errChain = chainErrors(err, errChain) + seedCount-- + if seedCount <= 0 { + break L + } + case <-successChan: + seedCount-- + newSeedsFound = true + if seedCount <= 0 { + break L + } + case <-time.After(clstr.clientPolicy.Timeout): + // time is up, no seeds found + break L + } + } + + if errChain != nil { + errChain = chainErrors(newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Failed to connect to hosts: %v", seedArray)), errChain) + } + + return newSeedsFound, errChain +} + +func (clstr *Cluster) createNode(nv *nodeValidator) *Node { + return newNode(clstr, nv) +} + +// Finds a node by name in a list of nodes +func (clstr *Cluster) findNodeName(list []*Node, name string) bool { + for _, node := range list { + if node.GetName() == name { + return true + } + } + return false +} + +func (clstr *Cluster) addAlias(host *Host, node *Node) { + if host != nil && node != nil { + clstr.aliases.Set(*host, node) + } +} + +func (clstr *Cluster) findNodesToRemove(refreshCount int) []*Node { + removeList := []*Node{} + + if clstr.clientPolicy.SeedOnlyCluster { + // Don't remove any node even if its bad or inactive. + return removeList + } + + nodes := clstr.GetNodes() + + for _, node := range nodes { + if !node.IsActive() { + // Inactive nodes must be removed. + removeList = append(removeList, node) + continue + } + + // Single node clusters rely on whether it responded to info requests. + if refreshCount == 0 && node.failures.Get() >= 5 { + // All node info requests failed and this node had 5 consecutive failures. + // Remove node. If no nodes are left, seeds will be tried in next cluster + // tend iteration. + removeList = append(removeList, node) + continue + } + + // Two node clusters require at least one successful refresh before removing. + if len(nodes) > 1 && refreshCount >= 1 && node.referenceCount.Get() == 0 { + // Node is not referenced by other nodes. + // Check if node responded to info request. + if node.failures.Get() == 0 { + // Node is alive, but not referenced by other nodes. Check if mapped. + if !clstr.findNodeInPartitionMap(node) { + // Node doesn't have any partitions mapped to it. + // There is no point in keeping it in the cluster. + removeList = append(removeList, node) + } + } else { + // Node not responding. Remove it. + removeList = append(removeList, node) + } + } + } + + return removeList +} + +func (clstr *Cluster) findNodeInPartitionMap(filter *Node) bool { + partMap := clstr.getPartitions() + + for _, partitions := range partMap { + for _, nodeArray := range partitions.Replicas { + for _, node := range nodeArray { + // Use reference equality for performance. + if node == filter { + return true + } + } + } + } + return false +} + +func (clstr *Cluster) updateClusterFeatures() { + pQuery := true + for _, n := range clstr.GetNodes() { + if !n.SupportsPartitionQuery() { + pQuery = false + break + } + } + clstr.supportsPartitionQuery.Set(pQuery) +} + +func (clstr *Cluster) addNodes(nodesToAdd map[string]*Node) { + if len(nodesToAdd) == 0 { + return + } + + // update features for all nodes + defer clstr.updateClusterFeatures() + + clstr.nodes.Update(func(nodes []*Node) ([]*Node, error) { + if clstr.clientPolicy.SeedOnlyCluster && clstr.GetSeedCount() == len(nodes) { + // Don't add new nodes. + return nodes, nil + } + + for _, node := range nodesToAdd { + if node != nil && !clstr.findNodeName(nodes, node.name) { + logger.Logger.Debug("Adding node %s (%s) to the cluster.", node.name, node.host.String()) + nodes = append(nodes, node) + } + } + + nodesMap := make(map[string]*Node, len(nodes)) + nodesAliases := make(map[Host]*Node, len(nodes)) + for i := range nodes { + nodesMap[nodes[i].name] = nodes[i] + + for _, alias := range nodes[i].GetAliases() { + nodesAliases[*alias] = nodes[i] + } + } + + clstr.nodesMap.Replace(nodesMap) + clstr.aliases.Replace(nodesAliases) + + return nodes, nil + }) +} + +func (clstr *Cluster) removeNodes(nodesToRemove []*Node) { + if len(nodesToRemove) == 0 { + return + } + + // update features for all nodes + defer clstr.updateClusterFeatures() + + // There is no need to delete nodes from partitionWriteMap because the nodes + // have already been set to inactive. + + // Cleanup node resources. + for _, node := range nodesToRemove { + // Remove node's aliases from cluster alias set. + // Aliases are only used in tend goroutine, so synchronization is not necessary. + clstr.aliases.DeleteAllDeref(node.GetAliases()...) + clstr.nodesMap.Delete(node.name) + node.Close() + } + + // Remove all nodes at once to avoid copying entire array multiple times. + clstr.nodes.Update(func(nodes []*Node) ([]*Node, error) { + nlist := make([]*Node, 0, len(nodes)) + nlist = append(nlist, nodes...) + for i, n := range nlist { + for _, ntr := range nodesToRemove { + if ntr.Equals(n) { + nlist[i] = nil + } + } + } + + newNodes := make([]*Node, 0, len(nlist)) + for i := range nlist { + if nlist[i] != nil { + newNodes = append(newNodes, nlist[i]) + } + } + + return newNodes, nil + }) + +} + +// IsConnected returns true if cluster has nodes and is not already closed. +func (clstr *Cluster) IsConnected() bool { + // Must copy array reference for copy on write semantics to work. + nodeArray := clstr.GetNodes() + return (len(nodeArray) > 0) && !clstr.closed.Get() +} + +// GetRandomNode returns a random node on the cluster +func (clstr *Cluster) GetRandomNode() (*Node, Error) { + // Must copy array reference for copy on write semantics to work. + nodeArray := clstr.GetNodes() + length := len(nodeArray) + + // prevent division by zero + if length > 0 { + for i := 0; i < length; i++ { + // Must handle concurrency with other non-tending goroutines, so nodeIndex is consistent. + index := clstr.nodeIndex.IncrementAndGet() % length + node := nodeArray[index] + + if node != nil && node.IsActive() { + //logger.Logger.Debug("Node `%s` is active. index=%d", node, index) + return node, nil + } + } + } + + return nil, ErrClusterIsEmpty.err() +} + +// GetNodes returns a list of all nodes in the cluster +func (clstr *Cluster) GetNodes() []*Node { + // Must copy array reference for copy on write semantics to work. + return clstr.nodes.Get() +} + +// GetSeedCount is the count of seed nodes +func (clstr *Cluster) GetSeedCount() int { + res, _ := iatomic.MapSyncValue(&clstr.seeds, func(seeds []*Host) (int, error) { + return len(seeds), nil + }) + + return res +} + +// GetSeeds returns a list of all seed nodes in the cluster +func (clstr *Cluster) GetSeeds() []Host { + res, _ := iatomic.MapSyncValue(&clstr.seeds, func(seeds []*Host) ([]Host, error) { + res := make([]Host, 0, len(seeds)) + for _, seed := range seeds { + res = append(res, *seed) + } + + return res, nil + }) + + return res +} + +// GetAliases returns a list of all node aliases in the cluster +func (clstr *Cluster) GetAliases() map[Host]*Node { + return clstr.aliases.Clone() +} + +// GetNodeByName finds a node by name and returns an +// error if the node is not found. +func (clstr *Cluster) GetNodeByName(nodeName string) (*Node, Error) { + node := clstr.findNodeByName(nodeName) + + if node == nil { + return nil, newError(types.INVALID_NODE_ERROR, "Invalid node name"+nodeName) + } + return node, nil +} + +func (clstr *Cluster) findNodeByName(nodeName string) *Node { + // Must copy array reference for copy on write semantics to work. + for _, node := range clstr.GetNodes() { + if node.GetName() == nodeName { + return node + } + } + return nil +} + +// Close closes all cached connections to the cluster nodes +// and stops the tend goroutine. +func (clstr *Cluster) Close() { + if clstr.closed.CompareAndToggle(false) { + // send close signal to maintenance channel + close(clstr.tendChannel) + + // wait until tend is over + clstr.wgTend.Wait() + + // remove node references from the partition table + // to allow GC to work its magic. Leaks otherwise. + clstr.getPartitions().cleanup() + } +} + +// MigrationInProgress determines if any node in the cluster +// is participating in a data migration +func (clstr *Cluster) MigrationInProgress(timeout time.Duration) (res bool, err Error) { + if timeout <= 0 { + timeout = _DEFAULT_TIMEOUT + } + + done := make(chan bool, 1) + + go func() { + // this function is guaranteed to return after _DEFAULT_TIMEOUT + nodes := clstr.GetNodes() + for _, node := range nodes { + if node.IsActive() { + if res, err = node.MigrationInProgress(); res || err != nil { + done <- true + return + } + } + } + + res, err = false, nil + done <- false + }() + + dealine := time.After(timeout) + for { + select { + case <-dealine: + return false, ErrTimeout.err() + case <-done: + return res, err + } + } +} + +// WaitUntillMigrationIsFinished will block until all +// migration operations in the cluster all finished. +func (clstr *Cluster) WaitUntillMigrationIsFinished(timeout time.Duration) Error { + if timeout <= 0 { + timeout = _NO_TIMEOUT + } + done := make(chan Error, 1) + + go func() { + // this function is guaranteed to return after timeout + // no go routines will be leaked + for { + if res, err := clstr.MigrationInProgress(timeout); err != nil || !res { + done <- err + return + } + } + }() + + dealine := time.After(timeout) + select { + case <-dealine: + return ErrTimeout.err() + case err := <-done: + return err + } +} + +// Password returns the password that is currently used with the cluster. +func (clstr *Cluster) Password() (res []byte) { + pass := clstr.password.Get() + if pass != nil { + return pass + } + return nil +} + +func (clstr *Cluster) changePassword(user string, password string, hash []byte) { + // change password ONLY if the user is the same + if clstr.user == user { + clstr.clientPolicy.Password = password + clstr.password.Set(hash) + } +} + +// ClientPolicy returns the client policy that is currently used with the cluster. +func (clstr *Cluster) ClientPolicy() (res ClientPolicy) { + return clstr.clientPolicy +} + +// WarmUp fills the connection pool with connections for all nodes. +// This is necessary on startup for high traffic programs. +// If the count is <= 0, the connection queue will be filled. +// If the count is more than the size of the pool, the pool will be filled. +// Note: One connection per node is reserved for tend operations and is not used for transactions. +func (clstr *Cluster) WarmUp(count int) (int, Error) { + var g errgroup.Group + cnt := iatomic.NewInt(0) + nodes := clstr.GetNodes() + for i := range nodes { + node := nodes[i] + g.Go(func() error { + n, err := node.WarmUp(count) + cnt.AddAndGet(n) + + return err + }) + } + + err := g.Wait() + if err != nil { + return cnt.Get(), err.(Error) + } + return cnt.Get(), nil +} + +// MetricsEnabled returns true if metrics are enabled for the cluster. +func (clstr *Cluster) MetricsPolicy() *MetricsPolicy { + return clstr.metricsPolicy.Get() +} + +// MetricsEnabled returns true if metrics are enabled for the cluster. +func (clstr *Cluster) MetricsEnabled() bool { + return clstr.metricsEnabled.Load() +} + +// EnableMetrics enables the cluster transaction metrics gathering. +// If the parameters for the histogram in the policy are the different from the one already +// on the cluster, the metrics will be reset. +func (clstr *Cluster) EnableMetrics(policy *MetricsPolicy) { + if policy == nil { + policy = DefaultMetricsPolicy() + } + + clstr.metricsPolicy.Set(policy) + clstr.metricsEnabled.Store(true) + + clstr.statsLock.Lock() + defer clstr.statsLock.Unlock() + + // reshape the histogram in case it has changed + for _, stat := range clstr.stats { + stat.reshape(policy) + } + + for _, node := range clstr.GetNodes() { + node.stats.reshape(policy) + } +} + +// DisableMetrics disables the cluster transaction metrics gathering. +func (clstr *Cluster) DisableMetrics() { + clstr.metricsEnabled.Store(false) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/command.go b/aerospike-tls/vendor-aerospike-client-go/command.go new file mode 100644 index 00000000..3fa0e7c8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/command.go @@ -0,0 +1,2907 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "compress/zlib" + "encoding/binary" + "errors" + "fmt" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v7/types/pool" + + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +const ( + // Flags commented out are not supported by cmd client. + // Contains a read operation. + _INFO1_READ int = (1 << 0) + // Get all bins. + _INFO1_GET_ALL int = (1 << 1) + // Short query + _INFO1_SHORT_QUERY int = (1 << 2) + // Batch read or exists. + _INFO1_BATCH int = (1 << 3) + + // Do not read the bins + _INFO1_NOBINDATA int = (1 << 5) + + // Involve all replicas in read operation. + _INFO1_READ_MODE_AP_ALL = (1 << 6) + + // Tell server to compress its response. + _INFO1_COMPRESS_RESPONSE = (1 << 7) + + // Create or update record + _INFO2_WRITE int = (1 << 0) + // Fling a record into the belly of Moloch. + _INFO2_DELETE int = (1 << 1) + // Update if expected generation == old. + _INFO2_GENERATION int = (1 << 2) + // Update if new generation >= old, good for restore. + _INFO2_GENERATION_GT int = (1 << 3) + // Transaction resulting in record deletion leaves tombstone (Enterprise only). + _INFO2_DURABLE_DELETE int = (1 << 4) + // Create only. Fail if record already exists. + _INFO2_CREATE_ONLY int = (1 << 5) + // Treat as long query, but relax read consistency. + _INFO2_RELAX_AP_LONG_QUERY = (1 << 6) + // Return a result for every operation. + _INFO2_RESPOND_ALL_OPS int = (1 << 7) + + // This is the last of a multi-part message. + _INFO3_LAST int = (1 << 0) + // Commit to master only before declaring success. + _INFO3_COMMIT_MASTER int = (1 << 1) + // On send: Do not return partition done in scan/query. + // On receive: Specified partition is done in scan/query. + _INFO3_PARTITION_DONE int = (1 << 2) + // Update only. Merge bins. + _INFO3_UPDATE_ONLY int = (1 << 3) + + // Create or completely replace record. + _INFO3_CREATE_OR_REPLACE int = (1 << 4) + // Completely replace existing record only. + _INFO3_REPLACE_ONLY int = (1 << 5) + // See Below + _INFO3_SC_READ_TYPE int = (1 << 6) + // See Below + _INFO3_SC_READ_RELAX int = (1 << 7) + + // Interpret SC_READ bits in info3. + // + // RELAX TYPE + // strict + // ------ + // 0 0 sequential (default) + // 0 1 linearize + // + // relaxed + // ------- + // 1 0 allow replica + // 1 1 allow unavailable + + _STATE_READ_AUTH_HEADER uint8 = 1 + _STATE_READ_HEADER uint8 = 2 + _STATE_READ_DETAIL uint8 = 3 + _STATE_COMPLETE uint8 = 4 + + _BATCH_MSG_READ uint8 = 0x0 + _BATCH_MSG_REPEAT uint8 = 0x1 + _BATCH_MSG_INFO uint8 = 0x2 + _BATCH_MSG_GEN uint8 = 0x4 + _BATCH_MSG_TTL uint8 = 0x8 + + _MSG_TOTAL_HEADER_SIZE uint8 = 30 + _FIELD_HEADER_SIZE uint8 = 5 + _OPERATION_HEADER_SIZE uint8 = 8 + _MSG_REMAINING_HEADER_SIZE uint8 = 22 + _DIGEST_SIZE uint8 = 20 + _COMPRESS_THRESHOLD int = 128 + _CL_MSG_VERSION int64 = 2 + _AS_MSG_TYPE int64 = 3 + _AS_MSG_TYPE_COMPRESSED int64 = 4 +) + +type transactionType int + +const ( + ttNone transactionType = iota + ttGet + ttGetHeader + ttExists + ttPut + ttDelete + ttOperate + ttQuery + ttScan + ttUDF + ttBatchRead + ttBatchWrite +) + +var ( + buffPool = pool.NewTieredBufferPool(MinBufferSize, PoolCutOffBufferSize) +) + +// command interface describes all commands available +type command interface { + getPolicy(ifc command) Policy + + writeBuffer(ifc command) Error + getNode(ifc command) (*Node, Error) + getConnection(policy Policy) (*Connection, Error) + putConnection(conn *Connection) + parseResult(ifc command, conn *Connection) Error + parseRecordResults(ifc command, receiveSize int) (bool, Error) + prepareRetry(ifc command, isTimeout bool) bool + + transactionType() transactionType + + isRead() bool + + execute(ifc command) Error + executeAt(ifc command, policy *BasePolicy, deadline time.Time, iterations int) Error + + canPutConnBack() bool + + // Executes the command + Execute() Error +} + +// Holds data buffer for the command +type baseCommand struct { + bufferEx + + node *Node + conn *Connection + + // dataBufferCompress is not a second buffer; it is just a pointer to + // the beginning of the dataBuffer. + // To avoid allocating multiple buffers before compression, the dataBuffer + // will be referencing to a padded buffer. After the command is written to + // the buffer, this padding will be used to compress the command in-place, + // and then the compressed proto header will be written. + dataBufferCompress []byte + // oneShot determines if streaming commands like query, scan or queryAggregate + // are not retried if they error out mid-parsing + oneShot bool + + // will determine if the buffer will be compressed + // before being sent to the server + compressed bool + + commandSentCounter int + commandWasSent bool +} + +// Writes the command for write operations +func (cmd *baseCommand) setWrite(policy *WritePolicy, operation OperationType, key *Key, bins []*Bin, binMap BinMap) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if binMap == nil { + for i := range bins { + if err := cmd.estimateOperationSizeForBin(bins[i]); err != nil { + return err + } + } + } else { + for name, value := range binMap { + if err := cmd.estimateOperationSizeForBinNameAndValue(name, value); err != nil { + return err + } + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + if binMap == nil { + cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, len(bins)) + } else { + cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, len(binMap)) + } + + if err := cmd.writeKey(key, policy.SendKey); err != nil { + return err + } + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + if binMap == nil { + for i := range bins { + if err := cmd.writeOperationForBin(bins[i], operation); err != nil { + return err + } + } + } else { + for name, value := range binMap { + if err := cmd.writeOperationForBinNameAndValue(name, value, operation); err != nil { + return err + } + } + } + + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +// Writes the command for delete operations +func (cmd *baseCommand) setDelete(policy *WritePolicy, key *Key) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, false) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + cmd.writeHeaderWrite(policy, _INFO2_WRITE|_INFO2_DELETE, fieldCount, 0) + if err := cmd.writeKey(key, false); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.end() + cmd.markCompressed(policy) + + return nil + +} + +// Writes the command for touch operations +func (cmd *baseCommand) setTouch(policy *WritePolicy, key *Key) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + cmd.estimateOperationSize() + if err := cmd.sizeBuffer(false); err != nil { + return err + } + cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, 1) + if err := cmd.writeKey(key, policy.SendKey); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.writeOperationForOperationType(_TOUCH) + cmd.end() + return nil + +} + +// Writes the command for exist operations +func (cmd *baseCommand) setExists(policy *BasePolicy, key *Key) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, false) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if err := cmd.sizeBuffer(false); err != nil { + return err + } + cmd.writeHeaderReadHeader(policy, _INFO1_READ|_INFO1_NOBINDATA, fieldCount, 0) + if err := cmd.writeKey(key, false); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.end() + return nil + +} + +// Writes the command for get operations (all bins) +func (cmd *baseCommand) setReadForKeyOnly(policy *BasePolicy, key *Key) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, false) + if err != nil { + return err + } + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeHeaderRead(policy, _INFO1_READ|_INFO1_GET_ALL, 0, 0, fieldCount, 0) + if err := cmd.writeKey(key, false); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.end() + cmd.markCompressed(policy) + + return nil + +} + +// Writes the command for get operations (specified bins) +func (cmd *baseCommand) setRead(policy *BasePolicy, key *Key, binNames []string) Error { + if len(binNames) > 0 { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, false) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + for i := range binNames { + cmd.estimateOperationSizeForBinName(binNames[i]) + } + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + attr := _INFO1_READ + if len(binNames) == 0 { + attr |= _INFO1_GET_ALL + } + cmd.writeHeaderRead(policy, attr, 0, 0, fieldCount, len(binNames)) + + if err := cmd.writeKey(key, false); err != nil { + return err + } + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + for i := range binNames { + cmd.writeOperationForBinName(binNames[i], _READ) + } + cmd.end() + cmd.markCompressed(policy) + return nil + } + return cmd.setReadForKeyOnly(policy, key) +} + +// Writes the command for getting metadata operations +func (cmd *baseCommand) setReadHeader(policy *BasePolicy, key *Key) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, false) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeHeaderReadHeader(policy, _INFO1_READ|_INFO1_NOBINDATA, fieldCount, 0) + if err := cmd.writeKey(key, false); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.end() + cmd.markCompressed(policy) + + return nil + +} + +// Implements different command operations +func (cmd *baseCommand) setOperate(policy *WritePolicy, key *Key, args *operateArgs) Error { + if len(args.operations) == 0 { + return newError(types.PARAMETER_ERROR, "No operations were passed.") + } + + cmd.begin() + fieldCount := 0 + + for i := range args.operations { + if err := cmd.estimateOperationSizeForOperation(args.operations[i], false); err != nil { + return err + } + } + + ksz, err := cmd.estimateKeySize(key, policy.SendKey && args.hasWrite) + if err != nil { + return err + } + fieldCount += ksz + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeHeaderReadWrite(policy, args, fieldCount) + + if err := cmd.writeKey(key, policy.SendKey && args.hasWrite); err != nil { + return err + } + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + for _, operation := range args.operations { + if err := cmd.writeOperationForOperation(operation); err != nil { + return err + } + } + + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +func (cmd *baseCommand) setUdf(policy *WritePolicy, key *Key, packageName string, functionName string, args *ValueArray) Error { + cmd.begin() + fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) + if err != nil { + return err + } + + predSize := 0 + if policy.FilterExpression != nil { + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + fc, err := cmd.estimateUdfSize(packageName, functionName, args) + if err != nil { + return err + } + fieldCount += fc + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, 0) + if err := cmd.writeKey(key, policy.SendKey); err != nil { + return err + } + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + cmd.writeFieldString(packageName, UDF_PACKAGE_NAME) + cmd.writeFieldString(functionName, UDF_FUNCTION) + if err := cmd.writeUdfArgs(args); err != nil { + return err + } + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +func (cmd *baseCommand) setBatchOperateIfc(client ClientIfc, policy *BatchPolicy, records []BatchRecordIfc, batch *batchNode) (*batchAttr, Error) { + offsets := batch.offsets + max := len(batch.offsets) + + // Estimate buffer size + cmd.begin() + fieldCount := 1 + predSize := 0 + if policy.FilterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return nil, err + } + if predSize > 0 { + fieldCount++ + } + } + cmd.dataOffset += predSize + + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 + + var prev BatchRecordIfc + for i := 0; i < max; i++ { + record := records[offsets[i]] + key := record.key() + cmd.dataOffset += len(key.digest) + 4 + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !policy.SendKey && prev != nil && prev.key().namespace == key.namespace && (prev.key().setName == key.setName) && record.equals(prev) { + // Can set repeat previous namespace/bin names to save space. + cmd.dataOffset++ + } else { + // Must write full header and namespace/set/bin names. + cmd.dataOffset += 12 // header(4) + ttl(4) + fielCount(2) + opCount(2) = 12 + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + + if sz, err := record.size(&policy.BasePolicy); err != nil { + return nil, err + } else { + cmd.dataOffset += sz + } + + prev = record + } + + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return nil, err + } + + cmd.writeBatchHeader(policy, fieldCount) + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return nil, err + } + } + + // Write real field size. + fieldSizeOffset := cmd.dataOffset + cmd.writeFieldHeader(0, BATCH_INDEX) + + cmd.WriteUint32(uint32(max)) + + cmd.WriteByte(cmd.getBatchFlags(policy)) + + attr := &batchAttr{} + prev = nil + for i := 0; i < max; i++ { + index := offsets[i] + cmd.WriteUint32(uint32(index)) + + record := records[index] + key := record.key() + if _, err := cmd.Write(key.digest[:]); err != nil { + return nil, newCommonError(err) + } + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !policy.SendKey && prev != nil && prev.key().namespace == key.namespace && prev.key().setName == key.setName && record.equals(prev) { + // Can set repeat previous namespace/bin names to save space. + cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat + } else { + // Write full message. + switch record.getType() { + case _BRT_BATCH_READ: + br := record.(*BatchRead) + + attr.setBatchRead(client.getUsableBatchReadPolicy(br.Policy)) + if len(br.BinNames) > 0 { + cmd.writeBatchBinNames(key, br.BinNames, attr, attr.filterExp) + } else if br.Ops != nil { + attr.adjustRead(br.Ops) + cmd.writeBatchOperations(key, br.Ops, attr, attr.filterExp) + } else { + attr.adjustReadForAllBins(br.ReadAllBins) + cmd.writeBatchRead(key, attr, attr.filterExp, 0) + } + + case _BRT_BATCH_WRITE: + bw := record.(*BatchWrite) + + attr.setBatchWrite(client.getUsableBatchWritePolicy(bw.Policy)) + attr.adjustWrite(bw.Ops) + cmd.writeBatchOperations(key, bw.Ops, attr, attr.filterExp) + + case _BRT_BATCH_UDF: + bu := record.(*BatchUDF) + + attr.setBatchUDF(client.getUsableBatchUDFPolicy(bu.Policy)) + cmd.writeBatchWrite(key, attr, attr.filterExp, 3, 0) + cmd.writeFieldString(bu.PackageName, UDF_PACKAGE_NAME) + cmd.writeFieldString(bu.FunctionName, UDF_FUNCTION) + cmd.writeFieldBytes(bu.argBytes, UDF_ARGLIST) + + case _BRT_BATCH_DELETE: + bd := record.(*BatchDelete) + + attr.setBatchDelete(client.getUsableBatchDeletePolicy(bd.Policy)) + cmd.writeBatchWrite(key, attr, attr.filterExp, 0, 0) + } + prev = record + } + } + + cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) + cmd.end() + cmd.markCompressed(policy) + + return attr, nil + +} + +func (cmd *baseCommand) setBatchOperate(policy *BatchPolicy, keys []*Key, batch *batchNode, binNames []string, ops []*Operation, attr *batchAttr) Error { + offsets := batch.offsets + max := len(batch.offsets) + // Estimate buffer size + cmd.begin() + fieldCount := 1 + predSize := 0 + + exp := policy.FilterExpression + if attr.filterExp != nil { + exp = attr.filterExp + } + + if exp != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(exp) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + cmd.dataOffset += predSize + + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 + + var prev *Key + for i := 0; i < max; i++ { + key := keys[offsets[i]] + cmd.dataOffset += len(key.digest) + 4 + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !attr.sendKey && prev != nil && prev.namespace == key.namespace && (prev.setName == key.setName) { + // Can set repeat previous namespace/bin names to save space. + cmd.dataOffset++ + } else { + // Must write full header and namespace/set/bin names. + cmd.dataOffset += 12 // header(4) + ttl(4) + fielCount(2) + opCount(2) = 12 + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + + if attr.sendKey { + if sz, err := key.userKey.EstimateSize(); err != nil { + return err + } else { + cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 + } + } + + if len(binNames) > 0 { + for _, binName := range binNames { + cmd.estimateOperationSizeForBinName(binName) + } + } else if len(ops) > 0 { + for _, op := range ops { + if op.opType.isWrite { + if !attr.hasWrite { + return newError(types.PARAMETER_ERROR, "batch operation is write but isWrite flag not set in attrs") + } + cmd.dataOffset += 2 // Extra write specific fields. + } + + if err := cmd.estimateOperationSizeForOperation(op, true); err != nil { + return err + } + } + } else if (attr.writeAttr & _INFO2_DELETE) != 0 { + cmd.dataOffset += 2 // Extra write specific fields. + } + + prev = key + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeBatchHeader(policy, fieldCount) + + if exp != nil { + if err := cmd.writeFilterExpression(exp, predSize); err != nil { + return err + } + } + + // Write real field size. + fieldSizeOffset := cmd.dataOffset + cmd.writeFieldHeader(0, BATCH_INDEX) + + cmd.WriteUint32(uint32(max)) + + cmd.WriteByte(cmd.getBatchFlags(policy)) + + prev = nil + for i := 0; i < max; i++ { + index := offsets[i] + cmd.WriteUint32(uint32(index)) + + key := keys[index] + if _, err := cmd.Write(key.digest[:]); err != nil { + return newCommonError(err) + } + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !attr.sendKey && prev != nil && prev.namespace == key.namespace && prev.setName == key.setName { + // Can set repeat previous namespace/bin names to save space. + cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat + } else { + // Write full header, namespace and bin names. + if len(binNames) > 0 { + cmd.writeBatchBinNames(key, binNames, attr, nil) + } else if len(ops) > 0 { + cmd.writeBatchOperations(key, ops, attr, nil) + } else if (attr.writeAttr & _INFO2_DELETE) != 0 { + cmd.writeBatchWrite(key, attr, nil, 0, 0) + } else { + cmd.writeBatchRead(key, attr, nil, 0) + } + + prev = key + } + } + + cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +func (cmd *baseCommand) setBatchUDF(policy *BatchPolicy, keys []*Key, batch *batchNode, packageName, functionName string, args ValueArray, attr *batchAttr) Error { + offsets := batch.offsets + max := len(batch.offsets) + + // Estimate buffer size + cmd.begin() + fieldCount := 1 + predSize := 0 + if policy.FilterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + cmd.dataOffset += predSize + + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 + + var prev *Key + for i := 0; i < max; i++ { + key := keys[offsets[i]] + cmd.dataOffset += len(key.digest) + 4 + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !attr.sendKey && prev != nil && prev.namespace == key.namespace && (prev.setName == key.setName) { + // Can set repeat previous namespace/bin names to save space. + cmd.dataOffset++ + } else { + // Must write full header and namespace/set/bin names. + cmd.dataOffset += 12 // header(4) + ttl(4) + fieldCount(2) + opCount(2) = 12 + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + + if attr.sendKey { + if sz, err := key.userKey.EstimateSize(); err != nil { + return err + } else { + cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 + } + } + + cmd.dataOffset += 2 // gen(2) = 2 + if sz, err := cmd.estimateUdfSize(packageName, functionName, &args); err != nil { + return err + } else { + cmd.dataOffset += sz + } + + prev = key + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + cmd.writeBatchHeader(policy, fieldCount) + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + // Write real field size. + fieldSizeOffset := cmd.dataOffset + cmd.writeFieldHeader(0, BATCH_INDEX) + + cmd.WriteUint32(uint32(max)) + + cmd.WriteByte(cmd.getBatchFlags(policy)) + + prev = nil + for i := 0; i < max; i++ { + index := offsets[i] + cmd.WriteUint32(uint32(index)) + + key := keys[index] + if _, err := cmd.Write(key.digest[:]); err != nil { + return newCommonError(err) + } + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if !attr.sendKey && prev != nil && prev.namespace == key.namespace && prev.setName == key.setName { + // Can set repeat previous namespace/bin names to save space. + cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat + } else { + cmd.writeBatchWrite(key, attr, nil, 3, 0) + cmd.writeFieldString(packageName, UDF_PACKAGE_NAME) + cmd.writeFieldString(functionName, UDF_FUNCTION) + if err := cmd.writeUdfArgs(&args); err != nil { + return err + } + prev = key + } + } + + cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) + cmd.end() + cmd.markCompressed(policy) + + // fmt.Printf("len: %d\n", len(cmd.dataBuffer[:cmd.dataOffset])) + // fmt.Printf("%s\n", hex.Dump(cmd.dataBuffer[:cmd.dataOffset])) + + return nil +} + +func (cmd *baseCommand) writeBatchHeader(policy *BatchPolicy, fieldCount int) { + readAttr := _INFO1_BATCH + + if policy.UseCompression { + readAttr |= _INFO1_COMPRESS_RESPONSE + } + + cmd.dataOffset = 8 + + // Write all header data except total size which must be written last. + cmd.WriteByte(_MSG_REMAINING_HEADER_SIZE) // Message header length. + cmd.WriteByte(byte(readAttr)) + cmd.WriteByte(0) + cmd.WriteByte(0) + for i := 12; i < 22; i++ { + cmd.WriteByte(0) + } + cmd.WriteUint32(0) // timeout will be rewritten later + cmd.WriteUint16(uint16(fieldCount)) + cmd.WriteUint16(0) + // cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +func (cmd *baseCommand) writeBatchBinNames(key *Key, binNames []string, attr *batchAttr, filter *Expression) { + cmd.writeBatchRead(key, attr, filter, len(binNames)) + + for i := range binNames { + cmd.writeOperationForBinName(binNames[i], _READ) + } +} + +func (cmd *baseCommand) writeBatchOperations(key *Key, ops []*Operation, attr *batchAttr, filter *Expression) { + if attr.hasWrite { + cmd.writeBatchWrite(key, attr, filter, 0, len(ops)) + } else { + cmd.writeBatchRead(key, attr, filter, len(ops)) + } + + for i := range ops { + cmd.writeOperationForOperation(ops[i]) + } +} + +func (cmd *baseCommand) writeBatchRead(key *Key, attr *batchAttr, filter *Expression, opCount int) { + cmd.WriteByte(_BATCH_MSG_INFO | _BATCH_MSG_TTL) + cmd.WriteByte(byte(attr.readAttr)) + cmd.WriteByte(byte(attr.writeAttr)) + cmd.WriteByte(byte(attr.infoAttr)) + cmd.WriteUint32(attr.expiration) + cmd.writeBatchFieldsWithFilter(key, filter, 0, opCount) +} + +func (cmd *baseCommand) writeBatchWrite(key *Key, attr *batchAttr, filter *Expression, fieldCount, opCount int) { + cmd.WriteByte(_BATCH_MSG_INFO | _BATCH_MSG_GEN | _BATCH_MSG_TTL) + cmd.WriteByte(byte(attr.readAttr)) + cmd.WriteByte(byte(attr.writeAttr)) + cmd.WriteByte(byte(attr.infoAttr)) + cmd.WriteUint16(uint16(attr.generation)) + cmd.WriteUint32(attr.expiration) + + if attr.sendKey { + fieldCount++ + cmd.writeBatchFieldsWithFilter(key, filter, fieldCount, opCount) + cmd.writeFieldValue(key.userKey, KEY) + } else { + cmd.writeBatchFieldsWithFilter(key, filter, fieldCount, opCount) + } +} + +func (cmd *baseCommand) getBatchFlags(policy *BatchPolicy) byte { + flags := byte(0) + if policy.AllowInline { + flags = 1 + } + + if policy.AllowInlineSSD { + flags |= 0x2 + } + + if policy.RespondAllKeys { + flags |= 0x4 + } + return flags +} + +func (cmd *baseCommand) setBatchRead(policy *BatchPolicy, keys []*Key, batch *batchNode, binNames []string, ops []*Operation, readAttr int) Error { + offsets := batch.offsets + max := len(batch.offsets) + + // Estimate buffer size + cmd.begin() + fieldCount := 1 + predSize := 0 + if policy.FilterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + cmd.dataOffset += predSize + + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 + + var prev *Key + for i := 0; i < max; i++ { + key := keys[offsets[i]] + cmd.dataOffset += len(key.digest) + 4 + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if prev != nil && prev.namespace == key.namespace && + (prev.setName == key.setName) { + // Can set repeat previous namespace/bin names to save space. + cmd.dataOffset++ + } else { + // Must write full header and namespace/set/bin names. + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + 6 + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + + if len(binNames) > 0 { + for _, binName := range binNames { + cmd.estimateOperationSizeForBinName(binName) + } + } else if len(ops) > 0 { + for _, op := range ops { + if err := cmd.estimateOperationSizeForOperation(op, true); err != nil { + return err + } + } + } + + prev = key + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + if policy.ReadModeAP == ReadModeAPAll { + readAttr |= _INFO1_READ_MODE_AP_ALL + } + + cmd.writeHeaderRead(&policy.BasePolicy, readAttr|_INFO1_BATCH, 0, 0, fieldCount, 0) + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + // Write real field size. + fieldSizeOffset := cmd.dataOffset + cmd.writeFieldHeader(0, BATCH_INDEX_WITH_SET) + + cmd.WriteUint32(uint32(max)) + + if policy.AllowInline { + cmd.WriteByte(1) + } else { + cmd.WriteByte(0) + } + + prev = nil + for i := 0; i < max; i++ { + index := offsets[i] + cmd.WriteUint32(uint32(index)) + + key := keys[index] + if _, err := cmd.Write(key.digest[:]); err != nil { + return newCommonError(err) + } + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if prev != nil && prev.namespace == key.namespace && + (prev.setName == key.setName) { + // Can set repeat previous namespace/bin names to save space. + cmd.WriteByte(1) // repeat + } else { + // Write full header, namespace and bin names. + cmd.WriteByte(0) // do not repeat + if len(binNames) > 0 { + cmd.WriteByte(byte(readAttr)) + cmd.writeBatchFields(key, 0, len(binNames)) + for _, binName := range binNames { + cmd.writeOperationForBinName(binName, _READ) + } + } else if len(ops) > 0 { + offset := cmd.dataOffset + cmd.dataOffset++ + cmd.writeBatchFields(key, 0, len(ops)) + cmd.dataBuffer[offset], _ = cmd.writeBatchReadOperations(ops, readAttr) + } else { + attr := byte(readAttr) + if len(binNames) == 0 { + attr |= byte(_INFO1_GET_ALL) + } else { + attr |= byte(_INFO1_NOBINDATA) + } + cmd.WriteByte(attr) + cmd.writeBatchFields(key, 0, 0) + } + + prev = key + } + } + + cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +func (cmd *baseCommand) setBatchIndexRead(policy *BatchPolicy, records []*BatchRead, batch *batchNode) Error { + offsets := batch.offsets + max := len(batch.offsets) + + // Estimate buffer size + cmd.begin() + fieldCount := 1 + predSize := 0 + if policy.FilterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 + + var prev *BatchRead + for i := 0; i < max; i++ { + record := records[offsets[i]] + key := record.Key + binNames := record.BinNames + ops := record.Ops + + cmd.dataOffset += len(key.digest) + 4 + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if prev != nil && prev.Key.namespace == key.namespace && + (prev.Key.setName == key.setName) && + &prev.BinNames == &binNames && prev.ReadAllBins == record.ReadAllBins && + &prev.Ops == &ops { + // Can set repeat previous namespace/bin names to save space. + cmd.dataOffset++ + } else { + // Must write full header and namespace/set/bin names. + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + 6 + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + + if len(binNames) != 0 { + for _, binName := range binNames { + cmd.estimateOperationSizeForBinName(binName) + } + } else if len(ops) != 0 { + for _, op := range ops { + cmd.estimateOperationSizeForOperation(op, true) + } + } + + prev = record + } + } + + if err := cmd.sizeBuffer(policy.compress()); err != nil { + return err + } + + readAttr := _INFO1_READ + if policy.ReadModeAP == ReadModeAPAll { + readAttr |= _INFO1_READ_MODE_AP_ALL + } + + cmd.writeHeaderRead(&policy.BasePolicy, readAttr|_INFO1_BATCH, 0, 0, fieldCount, 0) + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + // Write real field size. + fieldSizeOffset := cmd.dataOffset + cmd.writeFieldHeader(0, BATCH_INDEX_WITH_SET) + + cmd.WriteUint32(uint32(max)) + + if policy.AllowInline { + cmd.WriteByte(1) + } else { + cmd.WriteByte(0) + } + + prev = nil + for i := 0; i < max; i++ { + index := offsets[i] + cmd.WriteUint32(uint32(index)) + + record := records[index] + key := record.Key + binNames := record.BinNames + ops := record.Ops + if _, err := cmd.Write(key.digest[:]); err != nil { + return newCommonError(err) + } + + // Try reference equality in hope that namespace/set for all keys is set from fixed variables. + if prev != nil && prev.Key.namespace == key.namespace && + (prev.Key.setName == key.setName) && + &prev.BinNames == &binNames && prev.ReadAllBins == record.ReadAllBins && + &prev.Ops == &ops { + // Can set repeat previous namespace/bin names to save space. + cmd.WriteByte(1) // repeat + } else { + // Write full header, namespace and bin names. + cmd.WriteByte(0) // do not repeat + if len(binNames) > 0 { + cmd.WriteByte(byte(readAttr)) + cmd.writeBatchFields(key, 0, len(binNames)) + for _, binName := range binNames { + cmd.writeOperationForBinName(binName, _READ) + } + } else if len(ops) > 0 { + offset := cmd.dataOffset + cmd.dataOffset++ + cmd.writeBatchFields(key, 0, len(ops)) + cmd.dataBuffer[offset], _ = cmd.writeBatchReadOperations(ops, readAttr) + } else { + attr := byte(readAttr) + if record.ReadAllBins { + attr |= byte(_INFO1_GET_ALL) + } else { + attr |= byte(_INFO1_NOBINDATA) + } + cmd.WriteByte(attr) + cmd.writeBatchFields(key, 0, 0) + } + + prev = record + } + } + + cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) + cmd.end() + cmd.markCompressed(policy) + + return nil +} + +func (cmd *baseCommand) writeBatchFieldsWithFilter(key *Key, filter *Expression, fieldCount, opCount int) Error { + if filter != nil { + fieldCount++ + cmd.writeBatchFields(key, fieldCount, opCount) + expSize, err := filter.size() + if err != nil { + return err + } + if err := cmd.writeFilterExpression(filter, expSize); err != nil { + return err + } + } else { + cmd.writeBatchFields(key, fieldCount, opCount) + } + return nil +} + +func (cmd *baseCommand) writeBatchFields(key *Key, fieldCount, opCount int) Error { + fieldCount += 2 + cmd.WriteUint16(uint16(fieldCount)) + cmd.WriteUint16(uint16(opCount)) + cmd.writeFieldString(key.namespace, NAMESPACE) + cmd.writeFieldString(key.setName, TABLE) + + return nil +} + +func (cmd *baseCommand) setScan(policy *ScanPolicy, namespace *string, setName *string, binNames []string, taskID uint64, nodePartitions *nodePartitions) Error { + cmd.begin() + fieldCount := 0 + + // for grpc + partsFullSize := 0 + partsPartialSize := 0 + maxRecords := int64(0) + if nodePartitions != nil { + partsFullSize = len(nodePartitions.partsFull) * 2 + partsPartialSize = len(nodePartitions.partsPartial) * 20 + maxRecords = int64(nodePartitions.recordMax) + } + + predSize := 0 + if policy.FilterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + if namespace != nil { + cmd.dataOffset += len(*namespace) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if setName != nil { + cmd.dataOffset += len(*setName) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if partsFullSize > 0 { + cmd.dataOffset += partsFullSize + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if partsPartialSize > 0 { + cmd.dataOffset += partsPartialSize + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if maxRecords > 0 { + cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if policy.RecordsPerSecond > 0 { + cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + // Estimate scan timeout size. + cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) + fieldCount++ + + // Allocate space for TaskId field. + cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) + fieldCount++ + + for i := range binNames { + cmd.estimateOperationSizeForBinName(binNames[i]) + } + + if err := cmd.sizeBuffer(false); err != nil { + return err + } + readAttr := _INFO1_READ + + if !policy.IncludeBinData { + readAttr |= _INFO1_NOBINDATA + } + + operationCount := 0 + if len(binNames) > 0 { + operationCount = len(binNames) + } + cmd.writeHeaderRead(&policy.BasePolicy, readAttr, 0, _INFO3_PARTITION_DONE, fieldCount, operationCount) + + if namespace != nil { + cmd.writeFieldString(*namespace, NAMESPACE) + } + + if setName != nil { + cmd.writeFieldString(*setName, TABLE) + } + + if partsFullSize > 0 { + cmd.writeFieldHeader(partsFullSize, PID_ARRAY) + + for _, part := range nodePartitions.partsFull { + cmd.WriteInt16LittleEndian(uint16(part.Id)) + } + } + + if partsPartialSize > 0 { + cmd.writeFieldHeader(partsPartialSize, DIGEST_ARRAY) + + for _, part := range nodePartitions.partsPartial { + if _, err := cmd.Write(part.Digest[:]); err != nil { + return newCommonError(err) + } + } + } + + if policy.FilterExpression != nil { + if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { + return err + } + } + + if maxRecords > 0 { + cmd.writeFieldInt64(maxRecords, MAX_RECORDS) + } + + if policy.RecordsPerSecond > 0 { + cmd.writeFieldInt32(int32(policy.RecordsPerSecond), RECORDS_PER_SECOND) + } + + // Write scan timeout + cmd.writeFieldHeader(4, SOCKET_TIMEOUT) + cmd.WriteInt32(int32(policy.SocketTimeout / time.Millisecond)) // in milliseconds + + cmd.writeFieldHeader(8, TRAN_ID) + cmd.WriteUint64(taskID) + + for i := range binNames { + cmd.writeOperationForBinName(binNames[i], _READ) + } + + cmd.end() + + return nil +} + +func (cmd *baseCommand) setQuery(policy *QueryPolicy, wpolicy *WritePolicy, statement *Statement, taskID uint64, operations []*Operation, background bool, nodePartitions *nodePartitions) Error { + fieldCount := 0 + filterSize := 0 + binNameSize := 0 + predSize := 0 + var ctxSize int + + filterExpression := policy.FilterExpression + if filterExpression == nil && wpolicy != nil { + filterExpression = wpolicy.FilterExpression + } + + isNew := false + if cmd.node != nil { + isNew = cmd.node.cluster.supportsPartitionQuery.Get() + } + + cmd.begin() + + if statement.Namespace != "" { + cmd.dataOffset += len(statement.Namespace) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + // if statement.IndexName != "" { + // cmd.dataOffset += len(statement.IndexName) + int(_FIELD_HEADER_SIZE) + // fieldCount++ + // } + + if statement.SetName != "" { + cmd.dataOffset += len(statement.SetName) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + // Estimate recordsPerSecond field size. This field is used in new servers and not used + // (but harmless to add) in old servers. + if policy.RecordsPerSecond > 0 { + cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + // Estimate socket timeout field size. This field is used in new servers and not used + // (but harmless to add) in old servers. + cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) + fieldCount++ + + // Allocate space for TaskId field. + cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) + fieldCount++ + + if statement.Filter != nil { + idxType := statement.Filter.IndexCollectionType() + + // Estimate INDEX_TYPE field. + if idxType != ICT_DEFAULT { + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 1 + fieldCount++ + } + + // Estimate INDEX_RANGE field. + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + filterSize++ // num filters + + sz, err := statement.Filter.EstimateSize() + if err != nil { + return err + } + filterSize += sz + + cmd.dataOffset += filterSize + fieldCount++ + + // Query bin names are specified as a field (Scan bin names are specified later as operations) + // in old servers. Estimate size for selected bin names. + if !isNew { + if len(statement.BinNames) > 0 { + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + binNameSize++ // num bin names + + for _, binName := range statement.BinNames { + binNameSize += len(binName) + 1 + } + cmd.dataOffset += binNameSize + fieldCount++ + } + } + + if statement.Filter.ctx != nil { + ctxSize, err = statement.Filter.estimatePackedCtxSize() + if err != nil { + return newCommonError(err) + } + if ctxSize > 0 { + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + ctxSize + fieldCount++ + } + } + } + + partsFullSize := 0 + partsPartialSize := 0 + maxRecords := int64(0) + partsPartialBValSize := 0 + + // Calling query with no filters is more efficiently handled by a primary index scan. + // Estimate scan options size. + if nodePartitions != nil { + partsFullSize = len(nodePartitions.partsFull) * 2 + partsPartialSize = len(nodePartitions.partsPartial) * 20 + if statement.Filter != nil { + partsPartialBValSize = len(nodePartitions.partsPartial) * 8 + } + maxRecords = nodePartitions.recordMax + } + + if partsFullSize > 0 { + cmd.dataOffset += partsFullSize + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if partsPartialSize > 0 { + cmd.dataOffset += partsPartialSize + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if partsPartialBValSize > 0 { + cmd.dataOffset += partsPartialBValSize + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + // Estimate max records size; + if maxRecords > 0 { + cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if filterExpression != nil { + var err Error + predSize, err = cmd.estimateExpressionSize(filterExpression) + if err != nil { + return err + } + if predSize > 0 { + fieldCount++ + } + } + + var functionArgs *ValueArray + if statement.functionName != "" { + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 1 // udf type + cmd.dataOffset += len(statement.packageName) + int(_FIELD_HEADER_SIZE) + cmd.dataOffset += len(statement.functionName) + int(_FIELD_HEADER_SIZE) + + // function args + cmd.dataOffset += int(_FIELD_HEADER_SIZE) + if len(statement.functionArgs) > 0 { + functionArgs = NewValueArray(statement.functionArgs) + fasz, err := functionArgs.EstimateSize() + if err != nil { + return err + } + + cmd.dataOffset += fasz + } + + fieldCount += 4 + } + + operationCount := 0 + + // Operations (used in query execute) and bin names (used in scan/query) are mutually exclusive. + if len(operations) > 0 { + if !background { + return newError(types.PARAMETER_ERROR, "Operations not allowed in foreground query") + } + + for _, op := range operations { + if !op.opType.isWrite { + return newError(types.PARAMETER_ERROR, "Read operations not allowed in background query") + } + if err := cmd.estimateOperationSizeForOperation(op, false); err != nil { + return err + } + } + operationCount = len(operations) + } else if len(statement.BinNames) > 0 && (isNew || statement.Filter == nil) { + for _, binName := range statement.BinNames { + cmd.estimateOperationSizeForBinName(binName) + } + operationCount = len(statement.BinNames) + } + + ////////////////////////////////////////////////////////////////////////// + + if err := cmd.sizeBuffer(false); err != nil { + return err + } + + if background { + cmd.writeHeaderWrite(wpolicy, _INFO2_WRITE, fieldCount, operationCount) + } else { + readAttr := _INFO1_READ | _INFO1_NOBINDATA + writeAttr := 0 + + if policy.IncludeBinData { + readAttr = _INFO1_READ + } + if policy.ShortQuery || policy.ExpectedDuration == SHORT { + readAttr |= _INFO1_SHORT_QUERY + } else if policy.ExpectedDuration == LONG_RELAX_AP { + writeAttr |= _INFO2_RELAX_AP_LONG_QUERY + } + infoAttr := 0 + if isNew || statement.Filter == nil { + infoAttr = _INFO3_PARTITION_DONE + } + cmd.writeHeaderRead(&policy.BasePolicy, readAttr, writeAttr, infoAttr, fieldCount, operationCount) + } + + if statement.Namespace != "" { + cmd.writeFieldString(statement.Namespace, NAMESPACE) + } + + if statement.IndexName != "" { + cmd.writeFieldString(statement.IndexName, INDEX_NAME) + } + + if statement.SetName != "" { + cmd.writeFieldString(statement.SetName, TABLE) + } + + cmd.writeFieldHeader(8, TRAN_ID) + cmd.WriteUint64(taskID) + + if statement.Filter != nil { + idxType := statement.Filter.IndexCollectionType() + + if idxType != ICT_DEFAULT { + cmd.writeFieldHeader(1, INDEX_TYPE) + cmd.WriteByte(byte(idxType)) + } + + cmd.writeFieldHeader(filterSize, INDEX_RANGE) + cmd.WriteByte(byte(1)) // number of filters + + _, err := statement.Filter.write(cmd) + if err != nil { + return err + } + + if !isNew { + // Query bin names are specified as a field (Scan bin names are specified later as operations) + // in old servers. + if len(statement.BinNames) > 0 { + cmd.writeFieldHeader(binNameSize, QUERY_BINLIST) + cmd.WriteByte(byte(len(statement.BinNames))) + + for _, binName := range statement.BinNames { + len := copy(cmd.dataBuffer[cmd.dataOffset+1:], binName) + cmd.dataBuffer[cmd.dataOffset] = byte(len) + cmd.dataOffset += len + 1 + } + } + } + + if ctxSize > 0 { + cmd.writeFieldHeader(ctxSize, INDEX_CONTEXT) + if _, err = statement.Filter.packCtx(cmd); err != nil { + return newCommonError(err) + } + } + } + + // Calling query with no filters is more efficiently handled by a primary index scan. + if partsFullSize > 0 { + cmd.writeFieldHeader(partsFullSize, PID_ARRAY) + + for _, part := range nodePartitions.partsFull { + cmd.WriteInt16LittleEndian(uint16(part.Id)) + } + } + + if partsPartialSize > 0 { + cmd.writeFieldHeader(partsPartialSize, DIGEST_ARRAY) + + for _, part := range nodePartitions.partsPartial { + if _, err := cmd.Write(part.Digest[:]); err != nil { + return newCommonError(err) + } + } + } + + if partsPartialBValSize > 0 { + cmd.writeFieldHeader(partsPartialBValSize, BVAL_ARRAY) + + for _, part := range nodePartitions.partsPartial { + cmd.WriteInt64LittleEndian(uint64(part.BVal)) + } + } + + if maxRecords > 0 { + cmd.writeFieldInt64(maxRecords, MAX_RECORDS) + } + + // Write scan timeout + cmd.writeFieldHeader(4, SOCKET_TIMEOUT) + cmd.WriteInt32(int32(policy.SocketTimeout / time.Millisecond)) // in milliseconds + + // Write records per second. + if policy.RecordsPerSecond > 0 { + cmd.writeFieldInt32(int32(policy.RecordsPerSecond), RECORDS_PER_SECOND) + } + + if filterExpression != nil { + if err := cmd.writeFilterExpression(filterExpression, predSize); err != nil { + return err + } + } + + if statement.functionName != "" { + cmd.writeFieldHeader(1, UDF_OP) + if statement.ReturnData { + cmd.dataBuffer[cmd.dataOffset] = byte(1) + } else { + cmd.dataBuffer[cmd.dataOffset] = byte(2) + } + cmd.dataOffset++ + + cmd.writeFieldString(statement.packageName, UDF_PACKAGE_NAME) + cmd.writeFieldString(statement.functionName, UDF_FUNCTION) + if err := cmd.writeUdfArgs(functionArgs); err != nil { + return err + } + } + + if len(operations) > 0 { + for _, op := range operations { + if err := cmd.writeOperationForOperation(op); err != nil { + return err + } + } + } else if len(statement.BinNames) > 0 && (isNew || statement.Filter == nil) { + // scan binNames come last + for _, binName := range statement.BinNames { + cmd.writeOperationForBinName(binName, _READ) + } + } + + cmd.end() + + return nil +} + +func (cmd *baseCommand) estimateKeySize(key *Key, sendKey bool) (int, Error) { + fieldCount := 0 + + if key.namespace != "" { + cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + if key.setName != "" { + cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) + fieldCount++ + } + + cmd.dataOffset += int(_DIGEST_SIZE + _FIELD_HEADER_SIZE) + fieldCount++ + + if sendKey { + // field header size + key size + sz, err := key.userKey.EstimateSize() + if err != nil { + return sz, err + } + cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 + fieldCount++ + } + + return fieldCount, nil +} + +func (cmd *baseCommand) estimateUdfSize(packageName string, functionName string, args *ValueArray) (int, Error) { + cmd.dataOffset += len(packageName) + int(_FIELD_HEADER_SIZE) + cmd.dataOffset += len(functionName) + int(_FIELD_HEADER_SIZE) + + sz, err := args.EstimateSize() + if err != nil { + return 0, err + } + + // fmt.Println(args, sz) + + cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + return 3, nil +} + +func (cmd *baseCommand) estimateOperationSizeForBin(bin *Bin) Error { + cmd.dataOffset += len(bin.Name) + int(_OPERATION_HEADER_SIZE) + sz, err := bin.Value.EstimateSize() + if err != nil { + return err + } + cmd.dataOffset += sz + return nil +} + +func (cmd *baseCommand) estimateOperationSizeForBinNameAndValue(name string, value interface{}) Error { + cmd.dataOffset += len(name) + int(_OPERATION_HEADER_SIZE) + sz, err := NewValue(value).EstimateSize() + if err != nil { + return err + } + cmd.dataOffset += sz + return nil +} + +func (cmd *baseCommand) estimateOperationSizeForOperation(operation *Operation, isBatch bool) Error { + if isBatch && operation.opType.isWrite { + return newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read") + } + + size, err := operation.size() + if err != nil { + return err + } + + cmd.dataOffset += size + return nil +} + +func (cmd *baseCommand) estimateOperationSizeForBinName(binName string) { + cmd.dataOffset += len(binName) + int(_OPERATION_HEADER_SIZE) +} + +func (cmd *baseCommand) estimateOperationSize() { + cmd.dataOffset += int(_OPERATION_HEADER_SIZE) +} + +func (cmd *baseCommand) estimateExpressionSize(exp *Expression) (int, Error) { + size, err := exp.size() + if err != nil { + return size, err + } + + cmd.dataOffset += size + int(_FIELD_HEADER_SIZE) + return size, nil +} + +// Header write for write commands. +func (cmd *baseCommand) writeHeaderWrite(policy *WritePolicy, writeAttr, fieldCount, operationCount int) { + // Set flags. + generation := uint32(0) + readAttr := 0 + infoAttr := 0 + + switch policy.RecordExistsAction { + case UPDATE: + case UPDATE_ONLY: + infoAttr |= _INFO3_UPDATE_ONLY + case REPLACE: + infoAttr |= _INFO3_CREATE_OR_REPLACE + case REPLACE_ONLY: + infoAttr |= _INFO3_REPLACE_ONLY + case CREATE_ONLY: + writeAttr |= _INFO2_CREATE_ONLY + } + + switch policy.GenerationPolicy { + case NONE: + case EXPECT_GEN_EQUAL: + generation = policy.Generation + writeAttr |= _INFO2_GENERATION + case EXPECT_GEN_GT: + generation = policy.Generation + writeAttr |= _INFO2_GENERATION_GT + } + + if policy.CommitLevel == COMMIT_MASTER { + infoAttr |= _INFO3_COMMIT_MASTER + } + + if policy.DurableDelete { + writeAttr |= _INFO2_DURABLE_DELETE + } + + // if (policy.Xdr) { + // readAttr |= _INFO1_XDR; + // } + + // Write all header data except total size which must be written last. + cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. + cmd.dataBuffer[9] = byte(readAttr) + cmd.dataBuffer[10] = byte(writeAttr) + cmd.dataBuffer[11] = byte(infoAttr) + cmd.dataBuffer[12] = 0 // unused + cmd.dataBuffer[13] = 0 // clear the result code + cmd.dataOffset = 14 + cmd.WriteUint32(generation) + cmd.WriteUint32(policy.Expiration) + cmd.WriteInt32(0) // TODO: server timeout + cmd.WriteInt16(int16(fieldCount)) + cmd.WriteInt16(int16(operationCount)) + cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +// Header write for operate command. +func (cmd *baseCommand) writeHeaderReadWrite(policy *WritePolicy, args *operateArgs, fieldCount int) { + // Set flags. + generation := uint32(0) + ttl := int64(policy.ReadTouchTTLPercent) + if args.hasWrite { + ttl = int64(policy.Expiration) + } + readAttr := args.readAttr + writeAttr := args.writeAttr + infoAttr := 0 + operationCount := len(args.operations) + + switch policy.RecordExistsAction { + case UPDATE: + case UPDATE_ONLY: + infoAttr |= _INFO3_UPDATE_ONLY + case REPLACE: + infoAttr |= _INFO3_CREATE_OR_REPLACE + case REPLACE_ONLY: + infoAttr |= _INFO3_REPLACE_ONLY + case CREATE_ONLY: + writeAttr |= _INFO2_CREATE_ONLY + } + + switch policy.GenerationPolicy { + case NONE: + case EXPECT_GEN_EQUAL: + generation = policy.Generation + writeAttr |= _INFO2_GENERATION + case EXPECT_GEN_GT: + generation = policy.Generation + writeAttr |= _INFO2_GENERATION_GT + } + + if policy.CommitLevel == COMMIT_MASTER { + infoAttr |= _INFO3_COMMIT_MASTER + } + + if policy.DurableDelete { + writeAttr |= _INFO2_DURABLE_DELETE + } + + // if (policy.xdr) { + // readAttr |= _INFO1_XDR; + // } + + switch policy.ReadModeSC { + case ReadModeSCSession: + case ReadModeSCLinearize: + infoAttr |= _INFO3_SC_READ_TYPE + case ReadModeSCAllowReplica: + infoAttr |= _INFO3_SC_READ_RELAX + case ReadModeSCAllowUnavailable: + infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX + } + + if policy.ReadModeAP == ReadModeAPAll { + readAttr |= _INFO1_READ_MODE_AP_ALL + } + + if policy.UseCompression { + readAttr |= _INFO1_COMPRESS_RESPONSE + } + + // Write all header data except total size which must be written last. + cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. + cmd.dataBuffer[9] = byte(readAttr) + cmd.dataBuffer[10] = byte(writeAttr) + cmd.dataBuffer[11] = byte(infoAttr) + cmd.dataBuffer[12] = 0 // unused + cmd.dataBuffer[13] = 0 // clear the result code + cmd.dataOffset = 14 + cmd.WriteUint32(generation) + cmd.WriteInt32(int32(ttl)) + cmd.WriteInt32(0) // timeout + cmd.WriteInt16(int16(fieldCount)) + cmd.WriteInt16(int16(operationCount)) + cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +// Header write for read commands. +func (cmd *baseCommand) writeHeaderRead(policy *BasePolicy, readAttr, writeAttr, infoAttr, fieldCount, operationCount int) { + switch policy.ReadModeSC { + case ReadModeSCSession: + case ReadModeSCLinearize: + infoAttr |= _INFO3_SC_READ_TYPE + case ReadModeSCAllowReplica: + infoAttr |= _INFO3_SC_READ_RELAX + case ReadModeSCAllowUnavailable: + infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX + } + + if policy.ReadModeAP == ReadModeAPAll { + readAttr |= _INFO1_READ_MODE_AP_ALL + } + + if policy.UseCompression { + readAttr |= _INFO1_COMPRESS_RESPONSE + } + + // Write all header data except total size which must be written last. + cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. + cmd.dataBuffer[9] = byte(readAttr) + cmd.dataBuffer[10] = byte(writeAttr) + cmd.dataBuffer[11] = byte(infoAttr) + + for i := 12; i < 18; i++ { + cmd.dataBuffer[i] = 0 + } + cmd.dataOffset = 18 + cmd.WriteInt32(policy.ReadTouchTTLPercent) + cmd.WriteInt32(0) // timeout + cmd.WriteInt16(int16(fieldCount)) + cmd.WriteInt16(int16(operationCount)) + cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +// Header write for read header commands. +func (cmd *baseCommand) writeHeaderReadHeader(policy *BasePolicy, readAttr, fieldCount, operationCount int) { + infoAttr := 0 + + switch policy.ReadModeSC { + case ReadModeSCSession: + case ReadModeSCLinearize: + infoAttr |= _INFO3_SC_READ_TYPE + case ReadModeSCAllowReplica: + infoAttr |= _INFO3_SC_READ_RELAX + case ReadModeSCAllowUnavailable: + infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX + } + + if policy.ReadModeAP == ReadModeAPAll { + readAttr |= _INFO1_READ_MODE_AP_ALL + } + + // Write all header data except total size which must be written last. + cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. + cmd.dataBuffer[9] = byte(readAttr) + cmd.dataBuffer[10] = byte(0) + cmd.dataBuffer[11] = byte(infoAttr) + + for i := 12; i < 18; i++ { + cmd.dataBuffer[i] = 0 + } + + cmd.dataOffset = 18 + cmd.WriteInt32(policy.ReadTouchTTLPercent) + // cmd.WriteInt32(serverTimeout) // TODO: handle argument + cmd.WriteInt32(0) + cmd.WriteInt16(int16(fieldCount)) + cmd.WriteInt16(int16(operationCount)) + cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +func (cmd *baseCommand) writeKey(key *Key, sendKey bool) Error { + // Write key into buffer. + if key.namespace != "" { + cmd.writeFieldString(key.namespace, NAMESPACE) + } + + if key.setName != "" { + cmd.writeFieldString(key.setName, TABLE) + } + + cmd.writeFieldBytes(key.digest[:], DIGEST_RIPE) + + if sendKey { + if err := cmd.writeFieldValue(key.userKey, KEY); err != nil { + return err + } + } + + return nil +} + +func (cmd *baseCommand) writeOperationForBin(bin *Bin, operation OperationType) Error { + nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], bin.Name) + + valueLength, err := bin.Value.EstimateSize() + if err != nil { + return err + } + + cmd.WriteInt32(int32(nameLength + valueLength + 4)) + cmd.WriteByte((operation.op)) + cmd.WriteByte((byte(bin.Value.GetType()))) + cmd.WriteByte((byte(0))) + cmd.WriteByte((byte(nameLength))) + cmd.dataOffset += nameLength + _, err = bin.Value.write(cmd) + return err +} + +func (cmd *baseCommand) writeOperationForBinNameAndValue(name string, val interface{}, operation OperationType) Error { + nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], name) + + v := NewValue(val) + + valueLength, err := v.EstimateSize() + if err != nil { + return err + } + + cmd.WriteInt32(int32(nameLength + valueLength + 4)) + cmd.WriteByte((operation.op)) + cmd.WriteByte((byte(v.GetType()))) + cmd.WriteByte((byte(0))) + cmd.WriteByte((byte(nameLength))) + cmd.dataOffset += nameLength + _, err = v.write(cmd) + return err +} + +func (cmd *baseCommand) writeBatchReadOperations(ops []*Operation, readAttr int) (byte, Error) { + for _, op := range ops { + switch op.opType { + case _READ_HEADER: + readAttr |= _INFO1_NOBINDATA + case _READ: + // Read all bins if no bin is specified. + if len(op.binName) == 0 { + readAttr |= _INFO1_GET_ALL + } + default: + } + if err := cmd.writeOperationForOperation(op); err != nil { + return byte(readAttr), err + } + } + + return byte(readAttr), nil +} + +func (cmd *baseCommand) writeOperationForOperation(operation *Operation) Error { + nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], operation.binName) + + if operation.encoder == nil { + valueLength, err := operation.binValue.EstimateSize() + if err != nil { + return err + } + + cmd.WriteInt32(int32(nameLength + valueLength + 4)) + cmd.WriteByte((operation.opType.op)) + cmd.WriteByte((byte(operation.binValue.GetType()))) + cmd.WriteByte((byte(0))) + cmd.WriteByte((byte(nameLength))) + cmd.dataOffset += nameLength + _, err = operation.binValue.write(cmd) + return err + } + + valueLength, err := operation.encoder(operation, nil) + if err != nil { + return err + } + + cmd.WriteInt32(int32(nameLength + valueLength + 4)) + cmd.WriteByte((operation.opType.op)) + cmd.WriteByte((byte(ParticleType.BLOB))) + cmd.WriteByte((byte(0))) + cmd.WriteByte((byte(nameLength))) + cmd.dataOffset += nameLength + _, err = operation.encoder(operation, cmd) + return err +} + +func (cmd *baseCommand) writeOperationForBinName(name string, operation OperationType) { + nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], name) + cmd.WriteInt32(int32(nameLength + 4)) + cmd.WriteByte((operation.op)) + cmd.WriteByte(byte(0)) + cmd.WriteByte(byte(0)) + cmd.WriteByte(byte(nameLength)) + cmd.dataOffset += nameLength +} + +func (cmd *baseCommand) writeOperationForOperationType(operation OperationType) { + cmd.WriteInt32(int32(4)) + cmd.WriteByte(operation.op) + cmd.WriteByte(0) + cmd.WriteByte(0) + cmd.WriteByte(0) +} + +func (cmd *baseCommand) writeFilterExpression(exp *Expression, expSize int) Error { + cmd.writeFieldHeader(expSize, FILTER_EXP) + if _, err := exp.pack(cmd); err != nil { + return err + } + return nil +} + +func (cmd *baseCommand) writeFieldValue(value Value, ftype FieldType) Error { + vlen, err := value.EstimateSize() + if err != nil { + return err + } + cmd.writeFieldHeader(vlen+1, ftype) + cmd.WriteByte(byte(value.GetType())) + + _, err = value.write(cmd) + return err +} + +func (cmd *baseCommand) writeUdfArgs(value *ValueArray) Error { + if value != nil { + vlen, err := value.EstimateSize() + if err != nil { + return err + } + cmd.writeFieldHeader(vlen, UDF_ARGLIST) + _, err = value.pack(cmd) + return err + } + + cmd.writeFieldHeader(0, UDF_ARGLIST) + return nil +} + +func (cmd *baseCommand) writeFieldInt32(val int32, ftype FieldType) { + cmd.writeFieldHeader(4, ftype) + cmd.WriteInt32(val) +} + +func (cmd *baseCommand) writeFieldInt64(val int64, ftype FieldType) { + cmd.writeFieldHeader(8, ftype) + cmd.WriteInt64(val) +} + +func (cmd *baseCommand) writeFieldString(str string, ftype FieldType) { + flen := copy(cmd.dataBuffer[(cmd.dataOffset+int(_FIELD_HEADER_SIZE)):], str) + cmd.writeFieldHeader(flen, ftype) + cmd.dataOffset += flen +} + +func (cmd *baseCommand) writeFieldBytes(bytes []byte, ftype FieldType) { + copy(cmd.dataBuffer[cmd.dataOffset+int(_FIELD_HEADER_SIZE):], bytes) + + cmd.writeFieldHeader(len(bytes), ftype) + cmd.dataOffset += len(bytes) +} + +func (cmd *baseCommand) writeFieldHeader(size int, ftype FieldType) { + cmd.WriteInt32(int32(size + 1)) + cmd.WriteByte((byte(ftype))) +} + +func (cmd *baseCommand) begin() { + cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) +} + +func (cmd *baseCommand) sizeBuffer(compress bool) Error { + return cmd.sizeBufferSz(cmd.dataOffset, compress) +} + +func (cmd *baseCommand) validateHeader(header int64) Error { + msgVersion := (uint64(header) & 0xFF00000000000000) >> 56 + if msgVersion != 2 { + return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected version to be 2, but got %v", msgVersion)) + } + + msgType := (uint64(header) & 0x00FF000000000000) >> 49 + if !(msgType == 1 || msgType == 3 || msgType == 4) { + return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected type to be 1, 3 or 4, but got %v", msgType)) + } + + msgSize := header & 0x0000FFFFFFFFFFFF + if msgSize > int64(MaxBufferSize) { + return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected size to be under 10MiB, but got %v", msgSize)) + } + + return nil +} + +const ( + msgHeaderPad = 16 + zlibHeaderPad = 2 +) + +func (cmd *baseCommand) sizeBufferSz(size int, willCompress bool) Error { + + if willCompress { + // adds zlib and proto pads to the size of the buffer + size += msgHeaderPad + zlibHeaderPad + } + + // Corrupted data streams can result in a huge length. + // Do a sanity check here. + if size > MaxBufferSize || size < 0 { + return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid size for buffer: %d", size)) + } + + if cmd.conn != nil && cmd.conn.buffHist != nil { + cmd.conn.buffHist.Add(uint64(size)) + } + + if size <= len(cmd.dataBuffer) { + // don't touch the buffer + // this is a noop, here to silence the linters + cmd.dataBuffer = cmd.dataBuffer + } else if size <= cap(cmd.dataBuffer) { + cmd.dataBuffer = cmd.dataBuffer[:size] + } else { + // not enough space + cmd.dataBuffer = buffPool.Get(size) + } + + // The trick here to keep a ref to the buffer, and set the buffer itself + // to a padded version of the original: + // | Proto Header | Original Compressed Size | compressed message | + // | 8 Bytes | 8 Bytes | | + if willCompress { + cmd.dataBufferCompress = cmd.dataBuffer + cmd.dataBuffer = cmd.dataBufferCompress[msgHeaderPad+zlibHeaderPad:] + } + + return nil +} + +func (cmd *baseCommand) end() { + var proto = int64(cmd.dataOffset-8) | (_CL_MSG_VERSION << 56) | (_AS_MSG_TYPE << 48) + binary.BigEndian.PutUint64(cmd.dataBuffer[0:], uint64(proto)) +} + +func (cmd *baseCommand) markCompressed(policy Policy) { + cmd.compressed = policy.compress() +} + +func (cmd *baseCommand) compress() Error { + if cmd.compressed && cmd.dataOffset > _COMPRESS_THRESHOLD { + b := bytes.NewBuffer(cmd.dataBufferCompress[msgHeaderPad:]) + b.Reset() + w := zlib.NewWriter(b) + + // There seems to be a bug either in Go's zlib or in zlibc + // which messes up a single write block of bigger than 64KB to + // the deflater. + // Things work in multiple writes of 64KB though, so this is + // how we're going to do it. + i := 0 + const step = 64 * 1024 + for i+step < cmd.dataOffset { + n, err := w.Write(cmd.dataBuffer[i : i+step]) + i += n + if err != nil { + return newErrorAndWrap(err, types.SERIALIZE_ERROR) + } + } + + if i < cmd.dataOffset { + if _, err := w.Write(cmd.dataBuffer[i:cmd.dataOffset]); err != nil { + return newErrorAndWrap(err, types.SERIALIZE_ERROR) + } + } + + // flush + if err := w.Close(); err != nil { + return newErrorAndWrap(err, types.SERIALIZE_ERROR) + } + + compressedSz := b.Len() + + // check if compression ended up inflating the data. + // If so, the internal buffer has grown and reallocated, try to reuse it. + // If not possible to reuse it, reallocate a buffer. + if compressedSz+msgHeaderPad > len(cmd.dataBufferCompress) { + // compression added to the size of the message + buf := buffPool.Get(compressedSz + msgHeaderPad) + if n := copy(buf[msgHeaderPad:], b.Bytes()); n < compressedSz { + return newError(types.SERIALIZE_ERROR) + } + cmd.dataBufferCompress = buf + } + + // Use compressed buffer if compression completed within original buffer size. + var proto = int64(compressedSz+8) | (_CL_MSG_VERSION << 56) | (_AS_MSG_TYPE_COMPRESSED << 48) + binary.BigEndian.PutUint64(cmd.dataBufferCompress[0:], uint64(proto)) + binary.BigEndian.PutUint64(cmd.dataBufferCompress[8:], uint64(cmd.dataOffset)) + + cmd.dataBuffer = cmd.dataBufferCompress + cmd.dataOffset = compressedSz + msgHeaderPad + cmd.dataBufferCompress = nil + } + + return nil +} + +// isCompressed returns the length of the compressed buffer. +// If the buffer is not compressed, the result will be -1 +func (cmd *baseCommand) compressedSize() int { + proto := Buffer.BytesToInt64(cmd.dataBuffer, 0) + size := proto & 0xFFFFFFFFFFFF + + msgType := (proto >> 48) & 0xff + + if msgType != _AS_MSG_TYPE_COMPRESSED { + return -1 + } + + return int(size) +} + +func (cmd *baseCommand) batchInDoubt(isWrite bool, commandSentCounter int) bool { + return isWrite && commandSentCounter > 1 +} + +func (cmd *baseCommand) isRead() bool { + return true +} + +// grpcPutBufferBack puts the assigned buffer back in the pool. +// This function should only be called from grpc commands. +func (cmd *baseCommand) grpcPutBufferBack() { + // put the data buffer back in the pool in case it gets used again + buffPool.Put(cmd.dataBuffer) + cmd.dataBuffer = nil +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Execute +// +/////////////////////////////////////////////////////////////////////////////// + +func (cmd *baseCommand) execute(ifc command) Error { + policy := ifc.getPolicy(ifc).GetBasePolicy() + deadline := policy.deadline() + + return cmd.executeAt(ifc, policy, deadline, -1) +} + +func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, deadline time.Time, iterations int) (errChain Error) { + // for exponential backoff + interval := policy.SleepBetweenRetries + + transStart := time.Now() + + notFirstIteration := false + isClientTimeout := false + loopCount := 0 + + var err Error + + // Execute command until successful, timed out or maximum iterations have been reached. + for { + cmd.commandSentCounter++ + loopCount++ + + // too many retries + if (policy.MaxRetries <= 0 && cmd.commandSentCounter > 1) || (policy.MaxRetries > 0 && cmd.commandSentCounter > policy.MaxRetries) { + if cmd.node != nil && cmd.node.cluster != nil { + cmd.node.cluster.maxRetriesExceededCount.GetAndIncrement() + } + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + return chainErrors(ErrMaxRetriesExceeded.err(), errChain).iter(cmd.commandSentCounter).setInDoubt(ifc.isRead(), cmd.commandSentCounter).setNode(cmd.node) + } + + // Sleep before trying again, after the first iteration + if policy.SleepBetweenRetries > 0 && notFirstIteration { + // Do not sleep if you know you'll wake up after the deadline + if policy.TotalTimeout > 0 && time.Now().Add(interval).After(deadline) { + break + } + + time.Sleep(interval) + if policy.SleepMultiplier > 1 { + interval = time.Duration(float64(interval) * policy.SleepMultiplier) + } + } + + if notFirstIteration { + applyTransactionRetryMetrics(cmd.node) + + if !ifc.prepareRetry(ifc, isClientTimeout || (err != nil && err.Matches(types.SERVER_NOT_AVAILABLE))) { + if bc, ok := ifc.(batcher); ok { + // Batch may be retried in separate commands. + alreadyRetried, err := bc.retryBatch(bc, cmd.node.cluster, deadline, cmd.commandSentCounter) + if alreadyRetried { + // Batch was retried in separate subcommands. Complete this command. + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + if err != nil { + return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + } + return nil + } + + // chain the errors and retry + if err != nil { + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + continue + } + } + } + } + + // NOTE: This is important to be after the prepareRetry block above + isClientTimeout = false + + notFirstIteration = true + + // check for command timeout + if policy.TotalTimeout > 0 && time.Now().After(deadline) { + break + } + + // set command node, so when you return a record it has the node + cmd.node, err = ifc.getNode(ifc) + if cmd.node == nil || !cmd.node.IsActive() || err != nil { + isClientTimeout = false + + // chain the errors + if err != nil { + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + } + + // Node is currently inactive. Retry. + continue + } + + // check if node has encountered too many errors + if err = cmd.node.validateErrorCount(); err != nil { + isClientTimeout = false + + applyTransactionErrorMetrics(cmd.node) + + // chain the errors + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + + // Max error rate achieved, try again per policy + continue + } + + cmd.conn, err = ifc.getConnection(policy) + if err != nil { + isClientTimeout = false + + // chain the errors + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + + applyTransactionErrorMetrics(cmd.node) + + // exit immediately if connection pool is exhausted and the corresponding policy option is set + if policy.ExitFastOnExhaustedConnectionPool && errors.Is(err, ErrConnectionPoolExhausted) { + break + } + + if errors.Is(err, ErrConnectionPoolEmpty) || errors.Is(err, ErrConnectionPoolExhausted) { + if errors.Is(err, ErrConnectionPoolExhausted) || (errors.Is(err, ErrConnectionPoolEmpty) && loopCount == 1) { + isClientTimeout = true + } + // if the connection pool is empty, we still haven't tried + // the transaction to increase the iteration count. + cmd.commandSentCounter-- + } + logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) + continue + } + + // Assign the connection buffer to the command buffer + cmd.dataBuffer = cmd.conn.dataBuffer + + // Set command buffer. + err = ifc.writeBuffer(ifc) + if err != nil { + applyTransactionErrorMetrics(cmd.node) + + // chain the errors + err = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + + // All runtime exceptions are considered fatal. Do not retry. + // Close socket to flush out possible garbage. Do not put back in pool. + cmd.conn.Close() + cmd.conn = nil + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + return err + } + + // Reset timeout in send buffer (destined for server) and socket. + binary.BigEndian.PutUint32(cmd.dataBuffer[22:], 0) + if !deadline.IsZero() { + serverTimeout := time.Until(deadline) + if serverTimeout < time.Millisecond { + serverTimeout = time.Millisecond + } + binary.BigEndian.PutUint32(cmd.dataBuffer[22:], uint32(serverTimeout/time.Millisecond)) + } + + // now that the deadline has been set in the buffer, compress the contents + if err = cmd.compress(); err != nil { + applyTransactionErrorMetrics(cmd.node) + return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + } + + // now that the deadline has been set in the buffer, compress the contents + if err = cmd.prepareBuffer(ifc, deadline); err != nil { + applyTransactionErrorMetrics(cmd.node) + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node) + } + + // Send command. + cmd.commandWasSent = true + _, err = cmd.conn.Write(cmd.dataBuffer[:cmd.dataOffset]) + if err != nil { + applyTransactionErrorMetrics(cmd.node) + + // chain the errors + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + + isClientTimeout = false + if deviceOverloadError(err) { + cmd.node.incrErrorCount() + } + + // IO errors are considered temporary anomalies. Retry. + // Close socket to flush out possible garbage. Do not put back in pool. + cmd.conn.Close() + cmd.conn = nil + + logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) + continue + } + + // Parse results. + err = ifc.parseResult(ifc, cmd.conn) + if err != nil { + applyTransactionErrorMetrics(cmd.node) + + // chain the errors + errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + + if networkError(err) { + isTimeout := errors.Is(err, ErrTimeout) + isClientTimeout = isTimeout + if !isTimeout { + if deviceOverloadError(err) { + cmd.node.incrErrorCount() + } + } + + // IO errors are considered temporary anomalies. Retry. + // Close socket to flush out possible garbage. Do not put back in pool. + cmd.conn.Close() + + logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) + + // retry only for non-streaming commands + if !cmd.oneShot { + cmd.conn = nil + continue + } + } + + // close the connection + // cancelling/closing the batch/multi commands will return an error, which will + // close the connection to throw away its data and signal the server about the + // situation. We will not put back the connection in the buffer. + if ifc.canPutConnBack() && cmd.conn.IsConnected() && KeepConnection(err) { + // Put connection back in pool. + cmd.node.PutConnection(cmd.conn) + } else { + cmd.conn.Close() + cmd.conn = nil + } + + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + return errChain.setInDoubt(ifc.isRead(), cmd.commandSentCounter) + } + + applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) + + // in case it has grown and re-allocated, it means + // it was borrowed from the pool, sp put it back. + if &cmd.dataBufferCompress != &cmd.conn.origDataBuffer { + buffPool.Put(cmd.dataBufferCompress) + } else if &cmd.dataBuffer != &cmd.conn.origDataBuffer { + buffPool.Put(cmd.dataBuffer) + } + + cmd.dataBuffer = nil + cmd.dataBufferCompress = nil + cmd.conn.dataBuffer = cmd.conn.origDataBuffer + + // Put connection back in pool. + ifc.putConnection(cmd.conn) + + // command has completed successfully. Exit method. + return nil + + } + + // execution timeout + if cmd.node != nil && cmd.node.cluster != nil { + cmd.node.cluster.totalTimeoutExceededCount.GetAndIncrement() + } + errChain = chainErrors(ErrTimeout.err(), errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) + return errChain +} + +func (cmd *baseCommand) prepareBuffer(ifc command, deadline time.Time) Error { + // Set command buffer. + if err := ifc.writeBuffer(ifc); err != nil { + return err + } + + // Reset timeout in send buffer (destined for server) and socket. + binary.BigEndian.PutUint32(cmd.dataBuffer[22:], 0) + if !deadline.IsZero() { + serverTimeout := time.Until(deadline) + if serverTimeout < time.Millisecond { + serverTimeout = time.Millisecond + } + binary.BigEndian.PutUint32(cmd.dataBuffer[22:], uint32(serverTimeout/time.Millisecond)) + } + + // now that the deadline has been set in the buffer, compress the contents + return cmd.compress() +} + +func (cmd *baseCommand) canPutConnBack() bool { + return true +} + +func (cmd *baseCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + panic("Abstract method. Should not end up here") +} + +func networkError(err Error) bool { + return err.Matches(types.NETWORK_ERROR, types.TIMEOUT) +} + +func deviceOverloadError(err Error) bool { + return err.Matches(types.DEVICE_OVERLOAD) +} + +func applyTransactionMetrics(node *Node, tt transactionType, tb time.Time) { + if node != nil && node.cluster.MetricsEnabled() { + applyMetrics(tt, &node.stats, tb) + } +} + +func applyTransactionErrorMetrics(node *Node) { + if node != nil { + node.stats.TransactionErrorCount.GetAndIncrement() + } +} + +func applyTransactionRetryMetrics(node *Node) { + if node != nil { + node.stats.TransactionRetryCount.GetAndIncrement() + } +} + +func applyMetrics(tt transactionType, metrics *nodeStats, s time.Time) { + d := uint64(time.Since(s).Microseconds()) + switch tt { + case ttGet: + metrics.GetMetrics.Add(d) + case ttGetHeader: + metrics.GetHeaderMetrics.Add(d) + case ttExists: + metrics.ExistsMetrics.Add(d) + case ttPut: + metrics.PutMetrics.Add(d) + case ttDelete: + metrics.DeleteMetrics.Add(d) + case ttOperate: + metrics.OperateMetrics.Add(d) + case ttQuery: + metrics.QueryMetrics.Add(d) + case ttScan: + metrics.ScanMetrics.Add(d) + case ttUDF: + metrics.UDFMetrics.Add(d) + case ttBatchRead: + metrics.BatchReadMetrics.Add(d) + case ttBatchWrite: + metrics.BatchWriteMetrics.Add(d) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/commit_policy.go b/aerospike-tls/vendor-aerospike-client-go/commit_policy.go new file mode 100644 index 00000000..cf34300a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/commit_policy.go @@ -0,0 +1,29 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +// CommitLevel indicates the desired consistency guarantee when committing a transaction on the server. +type CommitLevel int + +const ( + // COMMIT_ALL indicates the server should wait until successfully committing master and all replicas. + COMMIT_ALL CommitLevel = iota + + // COMMIT_MASTER indicates the server should wait until successfully committing master only. + COMMIT_MASTER +) diff --git a/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go b/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go new file mode 100644 index 00000000..144b59b0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go @@ -0,0 +1,103 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Complex Index operations test", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + }) + + gg.Describe("Complex Index Creation", func() { + // connection data + var err error + var ns = *namespace + var set = randString(40) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + + const keyCount = 1000 + + valueList := []interface{}{1, 2, 3, "a", "ab", "abc"} + valueMap := map[interface{}]interface{}{"a": "b", 0: 1, 1: "a", "b": 2} + + bin1 := as.NewBin("Aerospike1", valueList) + bin2 := as.NewBin("Aerospike2", valueMap) + + gg.BeforeEach(func() { + for i := 0; i < keyCount; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + gg.Context("Create non-existing complex index", func() { + + gg.It("must create a complex Index for Lists", func() { + idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING, as.ICT_LIST) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.DropIndex(wpolicy, ns, set, set+bin1.Name) + + // wait until index is created + <-idxTask.OnComplete() + + // no duplicate index is allowed + _, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + gg.It("must create a complex Index for Map Keys", func() { + idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin2.Name+"keys", bin2.Name, as.STRING, as.ICT_MAPKEYS) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.DropIndex(wpolicy, ns, set, set+bin2.Name+"keys") + + // wait until index is created + <-idxTask.OnComplete() + + // no duplicate index is allowed + _, err = client.CreateIndex(wpolicy, ns, set, set+bin2.Name+"keys", bin1.Name, as.STRING) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + gg.It("must create a complex Index for Map Values", func() { + idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin2.Name+"values", bin2.Name, as.STRING, as.ICT_MAPVALUES) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.DropIndex(wpolicy, ns, set, set+bin2.Name+"values") + + // wait until index is created + <-idxTask.OnComplete() + + // no duplicate index is allowed + _, err = client.CreateIndex(wpolicy, ns, set, set+bin2.Name+"values", bin1.Name, as.STRING) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + }) + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go b/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go new file mode 100644 index 00000000..2adff807 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go @@ -0,0 +1,238 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Query operations on complex types", gg.Ordered, func() { + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + const keyCount = 1000 + + valueList := []interface{}{1, 2, 3, "a", "ab", "abc", []byte{1}, []byte{2, 3}, []byte{1, 3, 5}} + valueMap := map[interface{}]interface{}{"a": "b", 0: 1, 1: "a", "b": 2, 6: []byte{1, 2, 3}} + + bin1 := as.NewBin("List", valueList) + bin2 := as.NewBin("Map", valueMap) + var keys map[string]*as.Key + + gg.BeforeAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + keys = make(map[string]*as.Key, keyCount) + set = randString(50) + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + keys[string(key.Digest())] = key + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin1.Name+"N", bin1.Name, as.NUMERIC, as.ICT_LIST) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"N"+"keys", bin2.Name, as.NUMERIC, as.ICT_MAPKEYS) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"N"+"values", bin2.Name, as.NUMERIC, as.ICT_MAPVALUES) + + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin1.Name+"S", bin1.Name, as.STRING, as.ICT_LIST) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"S"+"keys", bin2.Name, as.STRING, as.ICT_MAPKEYS) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"S"+"values", bin2.Name, as.STRING, as.ICT_MAPVALUES) + + if serverIsNewerThan("7") { + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin1.Name+"B", bin1.Name, as.BLOB, as.ICT_LIST) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"B"+"keys", bin2.Name, as.BLOB, as.ICT_MAPKEYS) + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin2.Name+"B"+"values", bin2.Name, as.BLOB, as.ICT_MAPVALUES) + } + }) + + gg.AfterAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + dropIndex(nil, ns, set, set+bin1.Name+"N") + dropIndex(nil, ns, set, set+bin2.Name+"N"+"keys") + dropIndex(nil, ns, set, set+bin2.Name+"N"+"values") + + dropIndex(nil, ns, set, set+bin1.Name+"S") + dropIndex(nil, ns, set, set+bin2.Name+"S"+"keys") + dropIndex(nil, ns, set, set+bin2.Name+"S"+"values") + + if serverIsNewerThan("7") { + dropIndex(nil, ns, set, set+bin1.Name+"B") + dropIndex(nil, ns, set, set+bin2.Name+"B"+"keys") + dropIndex(nil, ns, set, set+bin2.Name+"B"+"values") + } + }) + + var queryPolicy = as.NewQueryPolicy() + + gg.It("must Query a specific element in list and get only relevant records back", func() { + if serverIsOlderThan("7") { + gg.Skip("Not supported on the servers prior to v7") + return + } + + // Only supported by server v7+ + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{1, "a", []byte{1, 3, 5}} { + stm.SetFilter(as.NewContainsFilter(bin1.Name, as.ICT_LIST, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + cnt++ + _, exists := keys[string(rec.Key.Digest())] + gm.Expect(exists).To(gm.Equal(true)) + } + + gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) + } + }) + + gg.It("must Query a specific non-existig element in list and get no records back", func() { + if serverIsOlderThan("7") { + gg.Skip("Not supported on the servers prior to v7") + return + } + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{-1, "aaaa", []byte{0, 1, 255}} { + stm.SetFilter(as.NewContainsFilter(bin1.Name, as.ICT_LIST, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 0)) + } + }) + + gg.It("must Query a key in map and get only relevant records back", func() { + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{1, "a"} { + stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPKEYS, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + cnt++ + _, exists := keys[string(rec.Key.Digest())] + gm.Expect(exists).To(gm.Equal(true)) + } + + gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) + } + }) + + gg.It("must Query a specific non-existig key in map and get no records back", func() { + if serverIsOlderThan("7") { + gg.Skip("Not supported on the servers prior to v7") + return + } + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{-1, "aaaa", []byte{255, 245, 5}} { + stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPKEYS, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 0)) + } + }) + + gg.It("must Query a value in map and get only relevant records back", func() { + if serverIsOlderThan("7") { + gg.Skip("Not supported on the servers prior to v7") + return + } + + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{1, "a", []byte{1, 2, 3}} { + stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPVALUES, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + cnt++ + _, exists := keys[string(rec.Key.Digest())] + gm.Expect(exists).To(gm.Equal(true)) + } + + gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) + } + }) + + gg.It("must Query a specific non-existig value in map and get no records back", func() { + if serverIsOlderThan("7") { + gg.Skip("Not supported on the servers prior to v7") + return + } + + stm := as.NewStatement(ns, set) + for _, v := range []interface{}{-1, "aaaa", []byte{255, 255, 5}} { + stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPVALUES, v)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 0)) + } + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/connection.go b/aerospike-tls/vendor-aerospike-client-go/connection.go new file mode 100644 index 00000000..3b977a1d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/connection.go @@ -0,0 +1,596 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "compress/zlib" + "crypto/tls" + "io" + "net" + "runtime" + "strconv" + "sync" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + "github.com/aerospike/aerospike-client-go/v7/types/histogram" +) + +const _BUFF_ADJUST_INTERVAL = 5 * time.Second + +var ( + // DefaultBufferSize specifies the initial size of the connection buffer when it is created. + // If not big enough (as big as the average record), it will be reallocated to size again + // which will be more expensive. + DefaultBufferSize = 64 * 1024 // 64 KiB + + // MaxBufferSize protects against allocating massive memory blocks + // for buffers. Tweak this number if you are returning a lot of + // large records in your requests. + MaxBufferSize = 1024 * 1024 * 120 // 120 MiB + + // PoolCutOffBufferSize specifies the largest buffer size that will be pooled. Anything larger will be + // allocated per request and thrown away afterwards to avoid allocating very big buffers. + PoolCutOffBufferSize = 1024 * 1024 // 1MiB + + // MinBufferSize specifies the smallest buffer size that would be allocated for connections. Smaller buffer + // requests will allocate at least this amount of memory. This protects against allocating too many small + // buffers that would require reallocation and putting pressure on the GC. + MinBufferSize = 8 * 1024 // 16 KiB +) + +// Connection represents a connection with a timeout. +// Connections maintain a buffer to minimize requesting buffers from the pool. +// If a returned record requires a bigger buffer, the connection will borrow a larger +// buffer from the pool and temporarily use it, returning it after the request. +// A histogram keeps track of the sizes of buffers used for the connection, and the median +// value is used to resize the connection buffer on intervals to optimize memory usage and +// minimize GC pressure. +type Connection struct { + node *Node + + // timeouts + socketTimeout time.Duration + deadline time.Time + + // duration after which connection is considered idle + idleTimeout time.Duration + idleDeadline time.Time + + // connection object + conn net.Conn + + // histogram to adjust the buff size to optimal value over time + buffHist *histogram.Log2 + bufferAdjustDeadline time.Time + + // to avoid having a buffer pool and contention + dataBuffer []byte + + // This is a reference to the original data buffer. + // After a big buffer is used temporarily, we will use + // this field to reset the dataBuffer field to the original + // smaller buffer. + origDataBuffer []byte + + compressed bool + inflater io.ReadCloser + // inflater may consume more bytes than required. + // LimitReader is used to avoid that problem. + limitReader *io.LimitedReader + + closer sync.Once + + grpcConn bool + grpcReadCallback func() ([]byte, Error) + grpcReader io.ReadWriter +} + +// makes sure that the connection is closed eventually, even if it is not consumed +func connectionFinalizer(c *Connection) { + c.Close() +} + +// errToAerospikeErr will convert golang's net and io errors into *AerospikeError +// If the errors is nil, nil be returned. If conn is not nil, its node value +// will be set for the error. +func errToAerospikeErr(conn *Connection, err error) (aerr Error) { + if err == nil { + return nil + } + + if terr, ok := err.(net.Error); ok { + if terr.Timeout() { + if conn != nil && conn.node != nil { + conn.node.stats.ConnectionsTimeoutErrors.IncrementAndGet() + } + aerr = newErrorAndWrap(err, types.TIMEOUT) + } else { + aerr = newErrorAndWrap(err, types.NETWORK_ERROR) + } + } else { + aerr = newErrorAndWrap(err, types.NETWORK_ERROR) + } + + // set node if exists + if conn != nil { + aerr.setNode(conn.node) + } + + return aerr +} + +// newGrpcFakeConnection creates a connection that fakes a real connection for when grpc connections are required. +// These connections only support reading to allow parsing of the returned payload. +func newGrpcFakeConnection(payload []byte, callback func() ([]byte, Error)) *Connection { + buf := bytes.NewBuffer(payload) + return &Connection{ + grpcConn: true, + grpcReader: buf, + grpcReadCallback: callback, + limitReader: &io.LimitedReader{R: buf, N: 0}, + } +} + +// newConnection creates a connection on the network and returns the pointer +// A minimum timeout of 2 seconds will always be applied. +// If the connection is not established in the specified timeout, +// an error will be returned +func newConnection(address string, timeout time.Duration) (*Connection, Error) { + newConn := &Connection{dataBuffer: buffPool.Get(DefaultBufferSize)} + newConn.buffHist = histogram.NewLog2(32) + newConn.bufferAdjustDeadline = time.Now().Add(_BUFF_ADJUST_INTERVAL) + newConn.origDataBuffer = newConn.dataBuffer + + runtime.SetFinalizer(newConn, connectionFinalizer) + + // don't wait indefinitely + if timeout == 0 { + timeout = 5 * time.Second + } + + conn, err := net.DialTimeout("tcp", address, timeout) + if err != nil { + logger.Logger.Debug("Connection to address `%s` failed to establish with error: %s", address, err.Error()) + return nil, errToAerospikeErr(nil, err) + } + newConn.conn = conn + newConn.limitReader = &io.LimitedReader{R: conn, N: 0} + + // set timeout at the last possible moment + if err := newConn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { + newConn.Close() + return nil, err + } + + return newConn, nil +} + +// NewConnection creates a TLS connection on the network and returns the pointer. +// A minimum timeout of 2 seconds will always be applied. +// If the connection is not established in the specified timeout, +// an error will be returned +func NewConnection(policy *ClientPolicy, host *Host) (*Connection, Error) { + address := net.JoinHostPort(host.Name, strconv.Itoa(host.Port)) + conn, err := newConnection(address, policy.Timeout) + if err != nil { + return nil, err + } + + if policy.TlsConfig == nil { + return conn, nil + } + + // Use version dependent clone function to clone the config + tlsConfig := policy.TlsConfig.Clone() + tlsConfig.ServerName = host.TLSName + + sconn := tls.Client(conn.conn, tlsConfig) + if err := sconn.Handshake(); err != nil { + nerr := newWrapNetworkError(err) + if cerr := sconn.Close(); cerr != nil { + logger.Logger.Debug("Closing connection after handshake error failed: %s", cerr.Error()) + nerr = chainErrors(newWrapNetworkError(cerr), nerr) + } + return nil, nerr + } + + if host.TLSName != "" && !tlsConfig.InsecureSkipVerify { + if err := sconn.VerifyHostname(host.TLSName); err != nil { + nerr := newWrapNetworkError(err) + if cerr := sconn.Close(); cerr != nil { + logger.Logger.Debug("Closing connection after VerifyHostName error failed: %s", cerr.Error()) + nerr = chainErrors(newWrapNetworkError(cerr), nerr) + } + logger.Logger.Error("Connection to address `%s` failed to establish with error: %s", address, err.Error()) + return nil, nerr + } + } + + conn.conn = sconn + return conn, nil +} + +// Write writes the slice to the connection buffer. +func (ctn *Connection) Write(buf []byte) (total int, aerr Error) { + var err error + + // make sure all bytes are written + // Don't worry about the loop, timeout has been set elsewhere + if err = ctn.updateDeadline(); err == nil { + if total, err = ctn.conn.Write(buf); err == nil { + return total, nil + } + + // If all bytes are written, ignore any potential error + // The error will bubble up on the next network io if it matters. + if total == len(buf) { + return total, nil + } + } + + aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) + + if ctn.node != nil { + ctn.node.incrErrorCount() + ctn.node.stats.ConnectionsFailed.IncrementAndGet() + } + + // the line should happen before .Close() + ctn.Close() + + return total, aerr +} + +// Read reads from connection buffer to the provided slice. +func (ctn *Connection) Read(buf []byte, length int) (total int, aerr Error) { + if ctn.grpcConn { + // grpc fake conn + return ctn.grpcRead(buf, length) + } + + var err error + + // if all bytes are not read, retry until successful + // Don't worry about the loop; we've already set the timeout elsewhere + for total < length { + var r int + if err = ctn.updateDeadline(); err != nil { + break + } + + if !ctn.compressed { + r, err = ctn.conn.Read(buf[total:length]) + } else { + r, err = ctn.inflater.Read(buf[total:length]) + if err == io.EOF && total+r == length { + ctn.compressed = false + err = ctn.inflater.Close() + } + } + total += r + if err != nil { + break + } + } + + if total == length { + // If all required bytes are read, ignore any potential error. + // The error will bubble up on the next network io if it matters. + return total, nil + } + + aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) + + if ctn.node != nil { + ctn.node.incrErrorCount() + ctn.node.stats.ConnectionsFailed.IncrementAndGet() + } + + // the line should happen before .Close() + ctn.Close() + + return total, aerr +} + +// Reads the grpc payload +func (ctn *Connection) grpcReadNext() (aerr Error) { + // if there is no payload set, ask for the next chunk + if ctn.grpcReadCallback != nil { + grpcPayload, err := ctn.grpcReadCallback() + if err != nil { + return err + } + + if _, err := ctn.grpcReader.Write(grpcPayload); err != nil { + errToAerospikeErr(ctn, io.EOF) + } + + if ctn.compressed { + ctn.limitReader.R = ctn.grpcReader + } + + return nil + } + return errToAerospikeErr(ctn, io.EOF) +} + +// Reads the grpc payload +func (ctn *Connection) grpcRead(buf []byte, length int) (total int, aerr Error) { + var err error + + // if all bytes are not read, retry until successful + // Don't worry about the loop; we've already set the timeout elsewhere + for total < length { + var r int + if !ctn.compressed { + r, err = ctn.grpcReader.Read(buf[total:length]) + } else { + r, err = ctn.inflater.Read(buf[total:length]) + if err == io.EOF && total+r == length { + ctn.compressed = false + err = ctn.inflater.Close() + } + } + total += r + if err != nil { + if err == io.EOF { + if err := ctn.grpcReadNext(); err != nil { + return total, err + } + continue + } + break + } + } + + if total == length { + // If all required bytes are read, ignore any potential error. + // The error will bubble up on the next network io if it matters. + return total, nil + } + + aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) + + return total, aerr +} + +// IsConnected returns true if the connection is not closed yet. +func (ctn *Connection) IsConnected() bool { + return ctn.conn != nil +} + +// updateDeadline sets connection timeout for both read and write operations. +// this function is called before each read and write operation. If deadline has passed, +// the function will return a TIMEOUT error. +func (ctn *Connection) updateDeadline() Error { + now := time.Now() + var socketDeadline time.Time + if ctn.deadline.IsZero() { + if ctn.socketTimeout > 0 { + socketDeadline = now.Add(ctn.socketTimeout) + } + } else { + if now.After(ctn.deadline) { + return newError(types.TIMEOUT) + } + if ctn.socketTimeout == 0 { + socketDeadline = ctn.deadline + } else { + tDeadline := now.Add(ctn.socketTimeout) + if tDeadline.After(ctn.deadline) { + socketDeadline = ctn.deadline + } else { + socketDeadline = tDeadline + } + } + + // floor to a millisecond to avoid too short timeouts + if socketDeadline.Sub(now) < time.Millisecond { + socketDeadline = now.Add(time.Millisecond) + } + } + + if err := ctn.conn.SetDeadline(socketDeadline); err != nil { + if ctn.node != nil { + ctn.node.stats.ConnectionsFailed.IncrementAndGet() + } + return errToAerospikeErr(ctn, err) + } + + return nil +} + +// SetTimeout sets connection timeout for both read and write operations. +func (ctn *Connection) SetTimeout(deadline time.Time, socketTimeout time.Duration) Error { + ctn.deadline = deadline + ctn.socketTimeout = socketTimeout + + return nil +} + +// Close closes the connection +func (ctn *Connection) Close() { + ctn.closer.Do(func() { + if ctn != nil && ctn.conn != nil { + // deregister + if ctn.node != nil { + ctn.node.connectionCount.DecrementAndGet() + ctn.node.stats.ConnectionsClosed.IncrementAndGet() + } + + if err := ctn.conn.Close(); err != nil { + logger.Logger.Warn(err.Error()) + } + ctn.conn = nil + + // put the data buffer back in the pool in case it gets used again + buffPool.Put(ctn.dataBuffer) + + ctn.dataBuffer = nil + ctn.origDataBuffer = nil + ctn.node = nil + } + }) +} + +// Login will send authentication information to the server. +func (ctn *Connection) login(policy *ClientPolicy, hashedPassword []byte, sessionInfo *sessionInfo) Error { + // need to authenticate + if policy.RequiresAuthentication() { + var err Error + command := newLoginCommand(ctn.dataBuffer) + + if !sessionInfo.isValid() { + err = command.login(policy, ctn, hashedPassword) + } else { + err = command.authenticateViaToken(policy, ctn, sessionInfo.token) + if err != nil && err.Matches(types.INVALID_CREDENTIAL, types.EXPIRED_SESSION) { + // invalidate the token + if ctn.node != nil { + ctn.node.resetSessionInfo() + } + + // retry via user/pass + if hashedPassword != nil { + command = newLoginCommand(ctn.dataBuffer) + err = command.login(policy, ctn, hashedPassword) + } + } + } + + if err != nil { + if ctn.node != nil { + ctn.node.stats.ConnectionsFailed.IncrementAndGet() + } + // Socket not authenticated. Do not put back into pool. + ctn.Close() + return err + } + + si := command.sessionInfo() + if ctn.node != nil && si.isValid() { + ctn.node.sessionInfo.Set(si) + } + } + + return nil +} + +// Login will send authentication information to the server. +// This function is provided for using the connection in conjunction with external libraries. +// The password will be hashed every time, which is a slow operation. +func (ctn *Connection) Login(policy *ClientPolicy) Error { + if !policy.RequiresAuthentication() { + return nil + } + + hashedPassword, err := hashPassword(policy.Password) + if err != nil { + return err + } + + return ctn.login(policy, hashedPassword, nil) +} + +// RequestInfo gets info values by name from the specified connection. +// Timeout should already be set on the connection. +func (ctn *Connection) RequestInfo(names ...string) (map[string]string, Error) { + info, err := newInfo(ctn, names...) + if err != nil { + return nil, err + } + + return info.parseMultiResponse() +} + +// setIdleTimeout sets the idle timeout for the connection. +func (ctn *Connection) setIdleTimeout(timeout time.Duration) { + ctn.idleTimeout = timeout +} + +// isIdle returns true if the connection has reached the idle deadline. +func (ctn *Connection) isIdle() bool { + return ctn.idleTimeout > 0 && time.Now().After(ctn.idleDeadline) +} + +func selectWithinRange[T int | uint | int64 | uint64](min, val, max T) T { + if val < min { + return min + } else if val > max { + return max + } + return val +} + +// refresh extends the idle deadline of the connection. +func (ctn *Connection) refresh() { + now := time.Now() + ctn.idleDeadline = now.Add(ctn.idleTimeout) + if ctn.inflater != nil { + ctn.inflater.Close() + } + ctn.compressed = false + ctn.inflater = nil + ctn.dataBuffer = ctn.origDataBuffer + + // adjust buffer size + if now.After(ctn.bufferAdjustDeadline) { + ctn.bufferAdjustDeadline = now.Add(_BUFF_ADJUST_INTERVAL) + newBuffSize := selectWithinRange(MinBufferSize, int(ctn.buffHist.Median()), PoolCutOffBufferSize) + ctn.buffHist.Reset() + // Do not go lower than 1K and larger than max allowed buffer size + if newBuffSize != len(ctn.dataBuffer) { + ctn.origDataBuffer = nil + // put the current buffer back in the pool + buffPool.Put(ctn.dataBuffer) + + // Get a new one from the pool + ctn.dataBuffer = buffPool.Get(int(newBuffSize)) + ctn.origDataBuffer = ctn.dataBuffer + } + } +} + +// initInflater sets up the zlib inflater to read compressed data from the connection +func (ctn *Connection) initInflater(enabled bool, length int) Error { + ctn.compressed = enabled + ctn.inflater = nil + if ctn.compressed { + ctn.limitReader.N = int64(length) + r, err := zlib.NewReader(ctn.limitReader) + if err != nil { + return newCommonError(err) + } + ctn.inflater = r + } + return nil +} + +// KeepConnection decides if a connection should be kept +// based on the error type. +func KeepConnection(err Error) bool { + // Do not keep connection on client errors. + if err.resultCode() < 0 { + return false + } + + return !err.Matches(types.QUERY_TERMINATED, + types.SCAN_ABORT, + types.QUERY_ABORTED, + types.TIMEOUT) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/connection_heap.go b/aerospike-tls/vendor-aerospike-client-go/connection_heap.go new file mode 100644 index 00000000..cc6cb102 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/connection_heap.go @@ -0,0 +1,280 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "runtime" + "sync" +) + +// singleConnectionHeap is a non-blocking LIFO heap. +// If the heap is empty, nil is returned. +// if the heap is full, offer will return false +type singleConnectionHeap struct { + head, tail uint32 + data []*Connection + size uint32 + full bool + mutex sync.Mutex +} + +// newSingleConnectionHeap creates a new heap with initial size. +func newSingleConnectionHeap(size int) *singleConnectionHeap { + if size <= 0 { + panic("Heap size cannot be less than 1") + } + + return &singleConnectionHeap{ + full: false, + data: make([]*Connection, uint32(size)), + size: uint32(size), + } +} + +func (h *singleConnectionHeap) cleanup() { + h.mutex.Lock() + defer h.mutex.Unlock() + + for i := range h.data { + if h.data[i] != nil { + h.data[i].Close() + } + + h.data[i] = nil + } + + // make sure offer and poll both fail + h.data = nil + h.full = true + h.head = 0 + h.tail = 0 +} + +// Offer adds an item to the heap unless the heap is full. +// In case the heap is full, the item will not be added to the heap +// and false will be returned +func (h *singleConnectionHeap) Offer(conn *Connection) bool { + h.mutex.Lock() + + // make sure heap is not full or cleaned up + if h.full || len(h.data) == 0 { + h.mutex.Unlock() + return false + } + + h.head = (h.head + 1) % h.size + h.full = (h.head == h.tail) + h.data[h.head] = conn + h.mutex.Unlock() + return true +} + +// Poll removes and returns an item from the heap. +// If the heap is empty, nil will be returned. +func (h *singleConnectionHeap) Poll() (res *Connection) { + h.mutex.Lock() + + // the heap has been cleaned up + if len(h.data) == 0 { + h.mutex.Unlock() + return nil + } + + // if heap is not empty + if (h.tail != h.head) || h.full { + res = h.data[h.head] + h.data[h.head] = nil + + h.full = false + if h.head == 0 { + h.head = h.size - 1 + } else { + h.head-- + } + } + + h.mutex.Unlock() + return res +} + +// DropIdleTail closes idle connection in tail. +// It will return true if tail connection was idle and dropped +func (h *singleConnectionHeap) DropIdleTail() bool { + h.mutex.Lock() + defer h.mutex.Unlock() + + // the heap has been cleaned up + if h.data == nil { + return false + } + + // if heap is not empty + if h.full || (h.tail != h.head) { + conn := h.data[(h.tail+1)%h.size] + + if conn.IsConnected() && !conn.isIdle() { + return false + } + + h.tail = (h.tail + 1) % h.size + h.data[h.tail] = nil + h.full = false + if conn.node != nil { + conn.node.stats.ConnectionsIdleDropped.IncrementAndGet() + } + conn.Close() + + return true + } + + return false +} + +// Len returns the number of connections in the heap +func (h *singleConnectionHeap) Len() int { + cnt := 0 + h.mutex.Lock() + + if !h.full { + if h.head >= h.tail { + cnt = int(h.head) - int(h.tail) + } else { + cnt = int(h.size) - (int(h.tail) - int(h.head)) + } + } else { + cnt = int(h.size) + } + h.mutex.Unlock() + return cnt +} + +// connectionHeap is a non-blocking FIFO heap. +// If the heap is empty, nil is returned. +// if the heap is full, offer will return false +type connectionHeap struct { + maxSize int + minSize int + heaps []singleConnectionHeap +} + +// Close cleans up all the data and removes all the references from +// active objects to ensure GC cleans up everything. +func (h *connectionHeap) cleanup() { + for i := range h.heaps { + h.heaps[i].cleanup() + } +} + +func newConnectionHeap(minSize, maxSize int) *connectionHeap { + if minSize > maxSize { + panic("minSize is bigger than maxSize for connection heap") + } + + heapCount := runtime.NumCPU() + if heapCount > maxSize { + heapCount = maxSize + } + + // will be >= 1 + perHeapSize := maxSize / heapCount + + heaps := make([]singleConnectionHeap, heapCount) + for i := range heaps { + heaps[i] = *newSingleConnectionHeap(perHeapSize) + } + + // add a heap for the remainder + remainder := maxSize - heapCount*perHeapSize + if remainder > 0 { + heaps = append(heaps, *newSingleConnectionHeap(remainder)) + } + + return &connectionHeap{ + maxSize: maxSize, + minSize: minSize, + heaps: heaps, + } +} + +// Offer adds an item to the heap unless the heap is full. +// In case the heap is full, the item will not be added to the heap +// and false will be returned +func (h *connectionHeap) Offer(conn *Connection, hint byte) bool { + idx := int(hint) % len(h.heaps) + end := idx + len(h.heaps) + for i := idx; i < end; i++ { + if h.heaps[i%len(h.heaps)].Offer(conn) { + // success + return true + } + } + return false +} + +// Poll removes and returns an item from the heap. +// If the heap is empty, nil will be returned. +func (h *connectionHeap) Poll(hint byte) (res *Connection) { + idx := int(hint) + + end := idx + len(h.heaps) + for i := idx; i < end; i++ { + if conn := h.heaps[i%len(h.heaps)].Poll(); conn != nil { + return conn + } + } + return nil +} + +// DropIdle closes all idle connections. +// It will only drop connections if there are +// at least ClientPolicy.MinConnectionPerNode available +func (h *connectionHeap) DropIdle() { + // decide how many conns are allowed to drop + // in minSize is 0, up to all connection can + // be closed if idle + excessCount := h.LenAll() - h.minSize + if excessCount <= 0 { + return + } + + for i := 0; i < len(h.heaps); i++ { + for h.heaps[i].DropIdleTail() { + excessCount-- + if excessCount == 0 { + return + } + } + } +} + +// Cap returns the total capacity of the connectionHeap +func (h *connectionHeap) Cap() int { + return h.maxSize +} + +// Len returns the number of connections in a specific sub-heap. +func (h *connectionHeap) Len(hint byte) (cnt int) { + return h.heaps[hint].Len() +} + +// LenAll returns the number of connections in all sub-heaps. +func (h *connectionHeap) LenAll() int { + cnt := 0 + for i := range h.heaps { + cnt += h.heaps[i].Len() + } + + return cnt +} diff --git a/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go b/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go new file mode 100644 index 00000000..8986d981 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go @@ -0,0 +1,89 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Connection Heap tests", func() { + + conn := new(Connection) + + gg.Context("singleConnectionHeap", func() { + + gg.It("Must add until full", func() { + h := newSingleConnectionHeap(10) + for i := 0; i < 10; i++ { + gm.Expect(h.Len()).To(gm.Equal(i)) + gm.Expect(h.head).To(gm.Equal(uint32(i))) + gm.Expect(h.tail).To(gm.Equal(uint32(0))) + gm.Expect(h.Offer(conn)).To(gm.BeTrue()) + gm.Expect(h.Len()).To(gm.Equal(i + 1)) + gm.Expect(h.head).To(gm.Equal(uint32(i+1) % 10)) + gm.Expect(h.tail).To(gm.Equal(uint32(0))) + } + + gm.Expect(h.Offer(conn)).To(gm.BeFalse()) + gm.Expect(h.Offer(conn)).To(gm.BeFalse()) + gm.Expect(h.Len()).To(gm.Equal(10)) + gm.Expect(h.full).To(gm.BeTrue()) + gm.Expect(h.head).To(gm.Equal(h.tail)) + }) + + gg.It("Must add until full, then Poll successfully", func() { + h := newSingleConnectionHeap(10) + for i := 0; i < 10; i++ { + gm.Expect(h.Offer(conn)).To(gm.BeTrue()) + } + + for i := 0; i < 10; i++ { + gm.Expect(h.Len()).To(gm.Equal(10 - i)) + gm.Expect(h.head).To(gm.Equal(uint32(10-i) % 10)) + gm.Expect(h.tail).To(gm.Equal(uint32(0))) + gm.Expect(h.Poll()).NotTo(gm.BeNil()) + gm.Expect(h.full).To(gm.BeFalse()) + gm.Expect(h.Len()).To(gm.Equal(10 - i - 1)) + gm.Expect(h.head).To(gm.Equal(uint32(10 - i - 1))) + gm.Expect(h.tail).To(gm.Equal(uint32(0))) + } + + gm.Expect(h.Poll()).To(gm.BeNil()) + gm.Expect(h.Poll()).To(gm.BeNil()) + gm.Expect(h.Len()).To(gm.Equal(0)) + gm.Expect(h.full).To(gm.BeFalse()) + gm.Expect(h.head).To(gm.Equal(h.tail)) + }) + + gg.It("Must add then Poll successfully", func() { + h := newSingleConnectionHeap(10) + gm.Expect(h.Offer(conn)).To(gm.BeTrue()) + gm.Expect(h.Len()).To(gm.Equal(1)) + gm.Expect(h.head).To(gm.Equal(uint32(1))) + gm.Expect(h.full).To(gm.BeFalse()) + + gm.Expect(h.Poll()).NotTo(gm.BeNil()) + gm.Expect(h.Poll()).To(gm.BeNil()) + gm.Expect(h.Len()).To(gm.Equal(0)) + gm.Expect(h.full).To(gm.BeFalse()) + gm.Expect(h.head).To(gm.Equal(uint32(0))) + gm.Expect(h.head).To(gm.Equal(h.tail)) + + }) + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/delete_command.go b/aerospike-tls/vendor-aerospike-client-go/delete_command.go new file mode 100644 index 00000000..4f059d7c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/delete_command.go @@ -0,0 +1,115 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// guarantee deleteCommand implements command interface +var _ command = &deleteCommand{} + +type deleteCommand struct { + singleCommand + + policy *WritePolicy + existed bool +} + +func newDeleteCommand(cluster *Cluster, policy *WritePolicy, key *Key) (*deleteCommand, Error) { + var err Error + var partition *Partition + if cluster != nil { + partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) + if err != nil { + return nil, err + } + } + + newDeleteCmd := &deleteCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + policy: policy, + } + + return newDeleteCmd, nil +} + +func (cmd *deleteCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *deleteCommand) writeBuffer(ifc command) Error { + return cmd.setDelete(cmd.policy, cmd.key) +} + +func (cmd *deleteCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeWrite(cmd.cluster) +} + +func (cmd *deleteCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryWrite(isTimeout) + return true +} + +func (cmd *deleteCommand) parseResult(ifc command, conn *Connection) Error { + // Read header. + if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { + return err + } + + header := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(header); err != nil { + return err + } + + resultCode := cmd.dataBuffer[13] & 0xFF + + switch types.ResultCode(resultCode) { + case 0: + cmd.existed = true + case types.KEY_NOT_FOUND_ERROR: + cmd.existed = false + case types.FILTERED_OUT: + if err := cmd.emptySocket(conn); err != nil { + return err + } + cmd.existed = true + return ErrFilteredOut.err() + default: + return newError(types.ResultCode(resultCode)) + } + + return cmd.emptySocket(conn) +} + +func (cmd *deleteCommand) Existed() bool { + return cmd.existed +} + +func (cmd *deleteCommand) isRead() bool { + return false +} + +func (cmd *deleteCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *deleteCommand) transactionType() transactionType { + return ttDelete +} diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/README.md b/aerospike-tls/vendor-aerospike-client-go/docs/README.md new file mode 100644 index 00000000..10a5f950 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/README.md @@ -0,0 +1,34 @@ +# Introduction + +This package describes the Aerospike Go Client API in detail. + + +## Usage + +The aerospike Go client package is the main entry point to the client API. + +```go + import as "github.com/aerospike/aerospike-client-go/v7" +``` + +Before connecting to a cluster, you must import the package. + +You can then generate a client object for connecting to and operating against as cluster. + +```go + client, err := as.NewClient("127.0.0.1", 3000) +``` + +The application will use the client object to connect to a cluster, then perform operations such as writing and reading records. +Client object is goroutine frinedly, so you can use it in goroutines without synchronization. +It caches its connections and internal state automatically for optimal performance. These settings can also be changed. + +For more details on client operations, see [Client Class](client.md). + +## API Reference + +- [Aerospike Go Client Library Overview](aerospike.md) +- [Client Class](client.md) +- [Object Model](datamodel.md) +- [Policy Objects](policies.md) +- [Logger Object](log.md) diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md b/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md new file mode 100644 index 00000000..00448d7a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md @@ -0,0 +1,103 @@ +# Aerospike Package + +- [Usage](#usage) +- [Structs](#structs) + - [policies](#Policies) + - [logger](#logger) +- [Functions](#functions) + - [NewClient()](#client) + - [NewKey()](#key) + + + +## Usage + +The aerospike package can be imported into your project via: + +```go + import as "github.com/aerospike/aerospike-client-go/v7" +``` + + +## Structs + + + + +### Policies + +Policies contain the allowed values for operation conditions for each of the [client](client.md) operations. + +For details, see [Policies Object](policies.md) + + + + + +### Log + +Log is a collection of the various logging levels available in Aerospike. This logging levels can be used to modify the granularity of logging from the API. +Default level is LOG_ERR. + +```go + as.Logger.SetLevel(as.INFO) +``` + +For details, see [Logger Object](log.md) + + + +### client(host string, port int): *Client + +Creates a new [client](client.md) with the provided configuration. + +Parameters: + +- `name` – Host name or IP to connect to. +- `port` – Host port. + +Returns a new client object. + +Example: + +```go + client, err := as.NewClient("127.0.0.1", 3000) +``` + +For detals, see [Client Class](client.md). + + + + +### NewKey(ns, set string, key interface{}): * + +Creates a new [key object](datamodel.md#key) with the provided arguments. + +Parameters: + +- `ns` – The namespace for the key. +- `set` – The set for the key. +- `key` – The value for the key. + +Returns a new key. + +Example: + +```go + key := as.Key("test", "demo", 123) +``` + +For details, see [Key Object](datamodel.md#key). + diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/client.md b/aerospike-tls/vendor-aerospike-client-go/docs/client.md new file mode 100644 index 00000000..de9a17fa --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/client.md @@ -0,0 +1,745 @@ +# Client Class + +The `Client` class provides operations which can be performed on an Aerospike +database cluster. In order to get an instance of the Client class, you need +to call `NewClient()`: + +```go + client, err := as.NewClient("127.0.0.1", 3000) +``` + +To customize a Client with a ClientPolicy: + +```go + clientPolicy := as.NewClientPolicy() + clientPolicy.ConnectionQueueSize = 64 + clientPolicy.LimitConnectionsToQueueSize = true + clientPolicy.Timeout = 50 * time.Millisecond + + client, err := as.NewClientWithPolicy(clientPolicy, "127.0.0.1", 3000) +``` + +*Notice*: Examples in the section are only intended to illuminate simple use cases without too much distraction. Always follow good coding practices in production. Always check for errors. + +With a new client, you can use any of the methods specified below. You need only *ONE* client object. This object is goroutine-friendly, and pools its resources internally. + +- [Methods](#methods) + - [Add()](#add) + - [Append()](#append) + - [Close()](#close) + - [Delete()](#delete) + - [Exists()](#exists) + - [BatchExists()](#batchexists) + - [Get()](#get) + - [GetHeader()](#getheader) + - [BatchGet()](#batchget) + - [BatchGetHeader()](#batchgetheader) + - [IsConnected()](#isConnected) + - [Operate()](#operate) + - [Prepend()](#prepend) + - [Put()](#put) + - [PutBins()](#putbins) + - [Touch()](#touch) + - [ScanAll()](#scanall) + - [ScanNode()](#scannode) + - [CreateIndex()](#createindex) + - [DropIndex()](#dropindex) + - [RegisterUDF()](#registerudf) + - [RegisterUDFFromFile()](#registerudffromfile) + - [Execute()](#execute) + - [ExecuteUDF()](#executeudf) + - [Query()](#query) + + + +## Methods + + + + +### Add(policy *WritePolicy, key *Key, bins BinMap) error + +Using the provided key, adds values to the mentioned bins. +Bin value types should be of type `integer` for the command to have any effect. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. + +Example: +```go + key := NewKey("test", "demo", 123) + + bins = BinMap { + "e": 2, + "pi": 3, + } + + err := client.Add(nil, key, bins) +``` + + + + +### Append(policy *WritePolicy, key *Key, bins BinMap) error + +Using the provided key, appends provided values to the mentioned bins. +Bin value types should be of type `string` or `[]byte` for the command to have any effect. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. + +Example: +```go + key := NewKey("test", "demo", 123) + + bins = BinMap { + "story": ", and lived happily ever after...", + } + + err := client.Append(nil, key, bins) +``` + + + + +### Close() + +Closes the client connection to the cluster. + +Example: +```go + client.Close() +``` + + + + +### Delete(policy *WritePoicy, key *Key) (existed bool, err error) + +Removes a record with the specified key from the database cluster. + +Parameters: + +- `policy` – (optional) The [delete Policy object](policies.md#RemovePolicy) to use for this operation. +- `key` – A [Key object](datamodel.md#key) used for locating the record to be removed. + +returned values: + +- `existed` – Boolean value that indicates if the Key existed. + +Example: +```go + key := NewKey("test", "demo", 123) + + if existed, err := client.Delete(nil, key); existed { + // do something + } +``` + + + + +### Exists(policy *BasePolicy, key *Key) (bool, error) + +Using the key provided, checks for the existence of a record in the database cluster . + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. + +Example: + +```go + key := NewKey("test", "demo", 123) + + if exists, err := client.Exists(nil, key) { + // do something + } +``` + + + + +### BatchExists(policy *BasePolicy, keys []*Key) ([]bool, error) + +Using the keys provided, checks for the existence of records in the database cluster in one request. + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `keys` – A [Key array](datamodel.md#key), used to locate the records in the cluster. + +Example: + +```go + key1 := NewKey("test", "demo", 123) + key2 := NewKey("test", "demo", 42) + + existanceArray, err := client.Exists(nil, []*Key{key1, key2}) { + // do something + } +``` + + + + +### Get(policy *BasePolicy, key *Key, bins ...string) (*Record, error) + +Using the key provided, reads a record from the database cluster . + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – (optional) Bins to retrieve. Will retrieve all bins if not provided. + +Example: + +```go + key := NewKey("test", "demo", 123) + + rec, err := client.Get(nil, key) // reads all the bins +``` + + + + +### GetHeader(policy *BasePolicy, key *Key) (*Record, error) + +Using the key provided, reads *ONLY* record metadata from the database cluster. Record metadata includes record generation and Expiration (TTL from the moment of retrieval, in seconds) + +```record.Bins``` will always be empty in resulting ```record```. + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. + +Example: + +```go + key := NewKey("test", "demo", 123) + + rec, err := client.GetHeader(nil, key) // No bins will be retrieved +``` + + + + +### BatchGet(policy *BasePolicy, keys *[]Key, bins ...string) ([]*Record, error) + +Using the keys provided, reads all relevant records from the database cluster in a single request. + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `keys` – A [Key array](datamodel.md#key), used to locate the record in the cluster. +- `bins` – (optional) Bins to retrieve. Will retrieve all bins if not provided. + +Example: + +```go + key1 := NewKey("test", "demo", 123) + key2 := NewKey("test", "demo", 42) + + recs, err := client.BatchGet(nil, []*Key{key1, key2}) // reads all the bins +``` + + + + +### BatchGetHeader(policy *BasePolicy, keys *[]Key) ([]*Record, error) + +Using the keys provided, reads all relevant record metadata from the database cluster in a single request. + +```record.Bins``` will always be empty in resulting ```record```. + +Parameters: + +- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. + Pass `nil` for default values. +- `keys` – A [Key array](datamodel.md#key), used to locate the record in the cluster. + +Example: + +```go + key1 := NewKey("test", "demo", 123) + key2 := NewKey("test", "demo", 42) + + recs, err := client.BatchGetHeader(nil, []*Key{key1, key2}) // reads all the bins +``` + + + +### IsConnected() bool + +Checks if the client is connected to the cluster. + + + + +### Prepend(policy *WritePolicy, key *Key, bins BinMap) error + +Using the provided key, prepends provided values to the mentioned bins. +Bin value types should be of type `string` or `[]byte` for the command to have any effect. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. + +Example: +```go + key := NewKey("test", "demo", 123) + + bins = BinMap { + "story": "Long ago, in a galaxy far far away, ", + } + + err := client.Prepend(nil, key, bins) +``` + + + + +### Put(policy *WritePolicy, key *Key, bins BinMap) error + +Writes a record to the database cluster. If the record exists, it modifies the record with bins provided. +To remove a bin, set its value to `nil`. + +#### Node: Under the hood, Put converts BinMap to []Bins and uses ```PutBins```. Use PutBins to avoid unnecessary memory allocation and iteration. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – A [BinMap map](datamodel.md#binmap) used for specifying the fields to store. + +Example: +```go + key := NewKey("test", "demo", 123) + + bins := BinMap { + "a": "Lack of skill dictates economy of style.", + "b": 123, + "c": []int{1, 2, 3}, + "d": map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}, + } + + err := client.Put(nil, key, bins) +``` + + + + +### PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error + +Writes a record to the database cluster. If the record exists, it modifies the record with bins provided. +To remove a bin, set its value to `nil`. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. +- `bins` – A [Bin array](datamodel.md#bin) used for specifying the fields to store. + +Example: +```go + key := NewKey("test", "demo", 123) + + bin1 := NewBin("a", "Lack of skill dictates economy of style.") + bin2 := NewBin("b", 123) + bin3 := NewBin("c", []int{1, 2, 3}) + bin4 := NewBin("d", map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}) + + err := client.PutBins(nil, key, bin1, bin2, bin3, bin4) +``` + + + + +### Touch(policy *WritePolicy, key *Key) error + +Create record if it does not already exist. +If the record exists, the record's time to expiration will be reset to the policy's expiration. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. + +Example: +```go + key := NewKey("test", "demo", 123) + + err := client.Touch(NewWritePolicy(0, 5), key) +``` + + + + +### ScanAll(policy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, error) + +Performs a full Scan on all nodes in the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) + + +Parameters: + +- `policy` – (optional) A [Scan Policy object](policies.md#ScanPolicy) to use for this operation. + Pass `nil` for default values. +- `namespace` – Namespace to perform the scan on. +- `setName` – Name of the Set to perform the scan on. +- `binNames` – Name of bins to retrieve. If not passed, all bins will be retrieved. + +Refer to [Recordset object](datamodel.md#recordset) documentation for details on how to retrieve the data. + +Example: +```go + // scan the whole cluster + recordset, err := client.ScanAll(nil, "test", "demo") + + for res := range recordset.Results() { + if res.Err != nil { + // handle error; or close the recordset and break + } + + // process record + fmt.Println(res.Record) + } +``` + + + + +### ScanNode(policy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, error) + +Performs a full Scan *on a specific node* in the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) + +It works the same as ScanAll() method. + + + + +### CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, error) + +Creates a secondary index. IndexTask will return a IndexTask object which can be used to determine if the operation is completed. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `namespace` – Namespace +- `setName` – Name of the Set +- `indexName` – Name of index +- `binName` – Bin name to create the index on +- `indexType` – STRING or NUMERIC + +Example: + +```go + idxTask, err := client.CreateIndex(nil, "test", "demo", "indexName", "binName", NUMERIC) + panicOnErr(err) + + // wait until index is created. + // OnComplete() channel will return nil on success and an error on errors + err = <- idxTask.OnComplete() + if err != nil { + panic(err) + } +``` + + + +### DropIndex( policy *WritePolicy, namespace string, setName string, indexName string) error + +Drops an index. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `namespace` – Namespace +- `setName` – Name of the Set. +- `indexName` – Name of index + +```go + err := client.DropIndex(nil, "test", "demo", "indexName") +``` + + + + +### RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, error) + +Registers the given UDF on the server. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `udfBody` – UDF source code +- `serverPath` – Path on which the UDF should be put on the server-side +- `language` – Only 'LUA' is currently supported + + +Example: + +```go + const udfBody = `function testFunc1(rec) + local ret = map() -- Initialize the return value (a map) + + local x = rec['bin1'] -- Get the value from record bin named "bin1" + + rec['bin2'] = (x / 2) -- Set the value in record bin named "bin2" + + aerospike:update(rec) -- Update the main record + + ret['status'] = 'OK' -- Populate the return status + return ret -- Return the Return value and/or status + end` + + regTask, err := client.RegisterUDF(nil, []byte(udfBody), "udf1.lua", LUA) + panicOnErr(err) + + // wait until UDF is created + err = <-regTask.OnComplete() + if err != nil { + panic(err) + } +``` + + + + +### RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, error) + +Read the UDF source code from a file and registers it on the server. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `clientPath` – full file path for UDF source code +- `serverPath` – Path on which the UDF should be put on the server-side +- `language` – Only 'LUA' is currently supported + + +Example: + +```go + regTask, err := client.RegisterUDFFromFile(nil, "/path/udf.lua", "udf1.lua", LUA) + panicOnErr(err) + + // wait until UDF is created + err = <- regTask.OnComplete() + if err != nil { + panic(err) + } +``` + + + + +### Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, error) + +Executes a UDF on a record with the given key, and returns the results. + +Parameters: + +- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. + Pass `nil` for default values. +- `packageName` – server path to the UDF +- `functionName` – UDF name +- `args` – (optional) UDF arguments + +Example: + +Considering the UDF registered in RegisterUDF example above: + +```go + res, err := client.Execute(nil, key, "udf1", "testFunc1") + + // res will be a: map[interface{}]interface{}{"status": "OK"} +``` + + + +### ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, error) + +Executes a UDF on all records which satisfy filters set in the statement. If there are filters, it will run on all records in the database. + +Parameters: + +- `policy` – (optional) A [Query Policy object](policies.md#QueryPolicy) to use for this operation. + Pass `nil` for default values. +- `statement` – [Statement object](datamodel.md#statement) to narrow down records. +- `packageName` – server path to the UDF +- `functionName` – UDF name +- `functionArgs` – (optional) UDF arguments + +Example: + +Considering the UDF registered in RegisterUDF example above: + +```go + statement := NewStatement("namespace", "set") + exTask, err := client.ExecuteUDF(nil, statement, "udf1", "testFunc1") + panicOnErr(err) + + // wait until UDF is run on all records + err = <- exTask.OnComplete() + if err != nil { + panic(err) + } +``` + + + + +### Query(policy *QueryPolicy, statement *Statement) (*Recordset, error) + +Performs a query on the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) + + +Parameters: + +- `policy` – (optional) A [Query Policy object](policies.md#QueryPolicy) to use for this operation. + Pass `nil` for default values. +- `statement` – [Statement object](datamodel.md#statement) to narrow down records. + +Refer to [Recordset object](datamodel.md#recordset) documentation for details on how to retrieve the data. + + +Example: + +```go + stm := NewStatement("namespace", "set") + stm.Addfilter(NewRangeFilter("binName", value1, value2)) + + recordset, err := client.Query(nil, stm) + + // consume recordset and check errors + for res := recordset.Results() { + if res.Err != nil { + // handle error, or close the recordset and break + } + + // process record + fmt.Println(res.Record) + } +``` diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md b/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md new file mode 100644 index 00000000..993e6af5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md @@ -0,0 +1,237 @@ +# Data Model + + + + +## BinMap + +BinMap is a type defined as map[string]interface{} to facilitate declaring bin data. + +```go + bins := BinMap{ + "name" : "Abu Rayhan Biruni", + "contribution" : "accurately calculated the radius of earth in 11th century", + "citation" : "https://en.wikipedia.org/wiki/History_of_geodesy#Biruni", + } +``` + + + + +## Record + +A record is how the data is represented and stored in the database. A record is represented as a `struct`. + +Fields are: +- `Bins` — Bins and their values are represented as a BinMap (map[string]interface{}) +- `Key` — Associated Key pointer +- `Node` — Database node from which the record was retrieved from. +- `Expiration` — TimeToLive of the record in seconds. Shows in how many seconds the data will be erased if not updated. +- `Generation` — Record generation (number of times the record has been updated). + +The keys of the Bins are the names of the fields (bins) of a record. The values for each field can either be u/int/8,16,32,64, string, Array or Map. + +Note: Arrays and Maps can contain an array or a map as a value in them. In other words, nesting of complex values is allowed. + +Records are returned as a result of `Get` operations. To write back their values, one needs to pass their Bins field to the `Put` method. + +Simple example of a Read, Change, Update operation: + +```go + // define a client to connect to + client, err := NewClient("127.0.0.1", 3000) + panicOnError(err) + + key, err := NewKey("test", "demo", "key") // key can be of any supported type + panicOnError(err) + + // define some bins + bins := BinMap{ + "bin1": 42, // you can pass any supported type as bin value + "bin2": "An elephant is a mouse with an operating system", + "bin3": []interface{}{"Go", 2009}, + } + + // write the bins + writePolicy := NewWritePolicy(0, 0) + err = client.Put(writePolicy, key, bins) + panicOnError(err) + + // read it back! + readPolicy := NewPolicy() + rec, err := client.Get(readPolicy, key) + panicOnError(err) + + // change data + v := rec.Bins["bin1"].(int) + v += 1 + rec.Bins["bin1"] = v + + // update + err = client.Put(nil, key, rec.Bins) +``` + + + + +## Recordset + +A recordset is the result of a scan or query operation against the database. Records are retrieved one by one from the database, and delivered to the user via `Records` channel. +To prevent too much memory use, the operation will block if the Records channel is full. +Errors are returned on `Errors` channel. If an error is of type NodeError, it will contain the Node, ResultCode and Error message of the error. + +Recordsets can be closed at any time to cancel the operation. + +- `Records` — The resulting records channel. +- `Errors` – The error channel. + +```go + // scan the whole cluster + recordset, err := client.ScanAll(nil, "test", "demo") + + for res := range recordset.Results() { + if res.Err != nil { + // you may be able to find out on which node the error occurred + if ne, ok := err.(NodeError); ok { + node := ne.Node + // do something + } + } + + // process record + fmt.Println(res.Record) + } +``` + + + + +## NewKey(ns, set string, key interface{}) + +A record is addressable via its key. A key is a struct containing: + +- `ns` — The namespace of the key. Must be a String. +- `set` – The set of the key. Must be a String. +- `key` – The value of the key. Can be of any supported types. + +Example: + +```go + key, err := NewKey("test", "demo", "key") // key can be of any supported type + panicOnError(err) +``` + + + + +## NewBin(name string, value interface{}) Value + +Bins are analogous to fields in relational databases. + +- `name` — Bin name. Must be a String. +- `value` – The value of the key. Can be of any supported type. + +Example: + +```go + bin1 := NewBin("name", "Aerospike") // string value + bin2 := NewBin("maxTPS", 1000000) // number value + bin3 := NewBin("notes", + map[interface{}]interface{}{ + "age": 5, + 666: "not allowed in", + "clients": []string{"go", "c", "java", "python", "node", "erlang"}, + }) // go wild! +``` + + + + +## NewStatement(ns string, set string, binNames ...string) *Statement + +A statement indicates which records should be affected by the query. Limits are set by Filter objects. If no filters are set, the query will be a ScanAll. + +- `ns` — The namespace. Must be a String. +- `set` – Set name. Must be a String. +- `binNames` – (optional) name of bins which will be affected. + +The following optional attributes can also be changed in the statement struct: + +- `IndexName` — Query index name. If not set, the server will determine the index from the filter's bin name. +- `Filters` — Optional query filters. Currently, only one filter is allowed by the server on a secondary index lookup. + +```go + stm := NewStatement("namespace", "set", "binName") + + // Use one of the following + + // SQL Eq: select binName from ns.set where binName == 42 + stm.Addfilter(NewEqualFilter("binName", 42)) + + // OR + + // SQL Eq: select binName from ns.set where binName between 0 and 100 + stm.Addfilter(NewRangeFilter("binName", 0, 100)) + + // send the query with default policy + recordset, err := client.Query(nil, stm) + + // consume recordset and check errors + for res := recordset.Results() { + if res.Err != nil { + // handle error + panic(res.Err) + } + + // process record + fmt.Println(res.Record) + } +``` + + + + +## NewEqualFilter(binName string, value interface{}) *Filter + +Create equality filter for query. + +- `binName` — Name of bin which is being targeted. Must be a String. +- `value` – Value which needs to be matched. should be either integer or string + +## NewRangeFilter(binName string, begin int64, end int64) *Filter + +Create range filter for query. String ranges are not supported. + +- `binName` — Name of bin which is being targeted. Must be a String. +- `begin` – Lower bound of the range. It is included in the range. +- `end` – Upper bound of the range. It is included in the range. + +Refer to statement for examples. diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/log.md b/aerospike-tls/vendor-aerospike-client-go/docs/log.md new file mode 100644 index 00000000..2830a31f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/log.md @@ -0,0 +1,24 @@ +#log + +Various log levels available to log from the Aerospike API. +Default is set to OFF. + +```go + import asl "github.com/aerospike/aerospike-client-go/v7/logger" + + asl.Logger.SetLevel(asl.OFF) +``` + +You can set the Logger to any object that supports log.Logger interface. + +## Log levels: + +##### ERROR + +##### WARN + +##### INFO + +##### DEBUG + +##### OFF diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/performance.md b/aerospike-tls/vendor-aerospike-client-go/docs/performance.md new file mode 100644 index 00000000..c1a93c56 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/performance.md @@ -0,0 +1,41 @@ +# Tweaking Performance + +This document details available mechanisms to optimize client performance characteristics, and tries to suggest good practices in using the client in a cluster of computers. + +There are different options in the library to tweak performance for different workloads. It is important to keep in mind that you should benchmark and profile your application under reasonably production-like workloads to gain best possible performance. + +This is a living document and we will keep it updated to help you make the best of our server and client solutions. + +## Client Design Goals + +We have tweaked and profiled the client library under various workloads to achieve the following goals: + + - **Minimal Memory Allocation**: We are conscious of this and have tried to remove as many allocations as possible. We are pooling buffers and hash objects whenever possible to achieve this goal. + + - **Customization Friendly**: We have added parameters to allow you to customize some variables when those variables could influence performance under different workloads. + + - **Determinism**: We have tried to keep the client inner workings deterministic. We have tried to stay away from data structures, or algorithms which are not deterministic. All pool and queue implementations in the client are bound in maximum memory size and perform in predetermined number of cycles. There are no heuristic algorithms in the client. + +Please let us know if you can suggest an improvement anywhere in the library. + +## Tweaking Performance / Best Practices + +1. **Server Connection Limit**: Each server node has a limited number of file descriptors on the operating system for connections. No matter how big, this resource is still limited and can get exhausted by too many connections. Clients pool their connections to database nodes for optimal performance. If node connections are exhausted by existing clients, new clients won't be able to connect to the database. (e.g. When you start up a new application in the cluster) + + To guard against this, you should observe the following in your application design: + + 1.1. **Use only one `Client` object in your application**: `Client` objects pool connections inside and synchronize their inner functionality. They are goroutine friendly. Use only one `Client` object in your application and pass it around. + + 1.2. **Limit `Client` connection pool**: The default number of maximum connection pool size in a client object is 256. Even under extreme load in fast metal, clients rarely use more than even a quarter of this many connection. When there's no available connections in the pool, new connection to server will be made. If the pool is full, connections will be closed after their use to guard against too many connections. + + If this pool is too small, the client will waste time in connecting to the server for each new request; If too big, it will waste server connections. + + At its maximum number of 256 for each client, and `proto-fd-max` set to 10000 in your server node configuration, you can safely have around 50 clients **per server node**. In practice, this will approach 150 high performing clients. You can change this pool size in `ClientPolicy`, and then initialize your `Client` object using `NewClientWithPolicy(policy **ClientPolicy, hostname string, port int)` initializer. + + You can also guard against the number of new connections to each node using `ClientPolicy.LimitConnectionsToQueueSize = true`, so that if a connection is not available in the pool, the client will wait or timeout instead of creating a new client. + +2. **Initial Connection Buffer Size**: Client library retains its buffers to reduce memory allocation. The memory buffers are grown automatically, but the initial size can be set to avoid reallocations in case the initial size is always too small. If you ever determine that the initial pool size is sub-optimal for you application, you can set the size by `DefaultBufferSize`. + +3. **Using `Bin` objects in `Put` operations instead of BinMaps**: `Put` method requires you to pass a map for bin values. While convenient, it will allocate an array of bins on each call, iterate on the map, and make `Bin` objects to use. + + If performance is absolutely important, use `PutBins` method and pass bins yourself. diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/policies.md b/aerospike-tls/vendor-aerospike-client-go/docs/policies.md new file mode 100644 index 00000000..d215ddf2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/docs/policies.md @@ -0,0 +1,254 @@ +# Policies + +Policies provide the ability to modify the behavior of operations. + +This document provides information on the structure of policy objects for specific +operations and the allowed values for some of the policies. + +- [`Policy Objects`](#Objects) +- [`Policy Values`](#Values) + + + +## Objects + +Policy objects are structs which define the behavior of associated operations. + +When invoking an operation, you can choose: +- pass `nil` as policy. A relevant Policy with default values will be generated automatically. +- Use a generator to make the policy; e.g. `NewWritePolicy(gen, ttl)` +- Generate a policy object directly; e.g. +```go + Policy{ + Priority: Priority.DEFAULT, + Timeout: 0 * time.Millisecond, // no timeout + MaxRetries: 2, + SleepBetweenRetries: 500 * time.Millisecond, + SleepMultiplier: 1.5 + } +``` + +Usage Example: + +```go + client.Get(nil, key); + client.Get(NewPolicy(), key); +``` + + + + +### Base Policy Object + +A policy effecting the behaviour of read operations. + +Attributes: + +- `Priority` – Specifies the behavior for the key. + For values, see [Priority Values](policies.md#priority). + * Default: `Priority.DEFAULT` +- `Timeout` – time.Duration datatype. Maximum time to wait for + the operation to complete. If 0 (zero), then the value + means there will be no timeout enforced. + * Default: `0 * time.Milliseconds` (no timeout) +- `MaxRetries` – Number of times to try on connection errors. + * Default: `2` +- `SleepBetweenRetries` – Duration of waiting between retries. + * Default: `500 * time.Milliseconds` +- `SleepMultiplier` - The multiplying factor to be used for exponential + backoff during retries. + * Default: `1.0` + +- `SendKey` – Qualify whether to send user defined key in addition to hash digest on both reads and writes. + If the key is sent on a write, the key will be stored with the record on server + * Default: `false` + + + + +### WritePolicy Object + +A policy effecting the behaviour of write operations. + +Includes All Base Policy attributes, plus: + +- `RecordExistsAction` – Qualify how to handle writes where the record already exists. + For values, see [RecordExistsAction Values](policies.md#exists). + * Default: `RecordExistsAction.UPDATE` +- `GenerationPolicy` – Qualify how to handle record writes based on record generation. + For values, see [GenerationPolicy Values](policies.md#gen). + * Default: `GenerationPolicy.NONE` (generation is not used to restrict writes) +- `Generation` – Expected generation. Generation is the number of times a record has been modified + (including creation) on the server. If a write operation is creating a record, + the expected generation would be 0 + * Default: `0` +- `Expiration` – Record expiration. Also known as ttl (time to live). Seconds record will live before being removed by the server. + For values, see [Expiration Values](policies.md#expiration). + * Default: `Expiration.TTLServerDefault` + + + + + +### QueryPolicy Object + +A policy effecting the behaviour of query operations. + +Includes All Base Policy attributes, plus: + +- `MaxConcurrentNodes` – Maximum number of concurrent requests to server nodes at any point in time. If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries will be made to 8 nodes in parallel. When a query completes, a new query will be issued until all 16 nodes have been queried. + * Default: `0` All nodes. +- `RecordQueueSize` – Number of records to place in queue before blocking. + Records received from multiple server nodes will be placed in a queue. A separate goroutine consumes these records in parallel. If the queue is full, the producer goroutines will block until records are consumed. + * Default: `50` + + + + +### ScanPolicy Object + +A policy effecting the behaviour of scan operations. + +Includes All Base Policy attributes, plus: + +- `ScanPercent` – ScanPercent determines percent of data to scan. Valid integer range is 1 to 100. + * Default: `100` All records. +- `MaxConcurrentNodes` – Maximum number of concurrent requests to server nodes at any point in time. If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then scans will be made to 8 nodes in parallel. When a scan completes, a new scan will be issued until all 16 nodes have been queried. + * Default: `0` All nodes together. +- `ConcurrentNodes` – Issue scan requests in parallel or serially. + * Default: `true` Concurrently. +- `IncludeBinData` – Indicates if bin data is retrieved. If false, only record metadata are retrieved. + * Default: `true` +- `FailOnClusterChange` – Terminate scan if cluster in fluctuating state. + * Default: `true` +- `RecordQueueSize` – Number of records to place in queue before blocking. Records received from multiple server nodes will be placed in a queue. A separate goroutine consumes these records in parallel. If the queue is full, the producer goroutines will block until records are consumed. + * Default: `5000` + + +## Values + +The following are values allowed for various policies. + + + + +### GenerationPolicy Values + +#### NONE + +Writes a record, regardless of generation. + +#### EXPECT_GEN_EQUAL + +Writes a record, ONLY if generations are equal. + +#### EXPECT_GEN_GT + +Writes a record, ONLY if local generation is greater-than remote generation. + + + + +### RecordExistsAction Values + +#### UPDATE + Create or update record. + + Merge write command bins with existing bins. + +#### UPDATE_ONLY + Update record only. Fail if record does not exist. + + Merge write command bins with existing bins. + +#### REPLACE + Create or replace record. + + Delete existing bins not referenced by write command bins. + + Supported by Aerospike 2 server versions >= 2.7.5 and + + Aerospike 3 server versions >= 3.1.6. + +#### REPLACE_ONLY + Replace record only. Fail if record does not exist. + + Delete existing bins not referenced by write command bins. + + Supported by Aerospike 2 server versions >= 2.7.5 and + + Aerospike 3 server versions >= 3.1.6. + +#### CREATE_ONLY + Create only. Fail if record exists. + + + + + +### Priority Values + +#### DEFAULT + The server defines the priority. + +#### LOW + Run the database operation in a background thread. + +#### MEDIUM + Run the database operation at medium priority. + +#### HIGH + Run the database operation at the highest priority. + + + + +### Expiration Values + +#### TTLServerDefault + Default to namespace configuration variable "default-ttl" on the server. + +#### TTLDontExpire + Never expire. + + Supported by Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server. + +#### TTLDontUpdate + Do not change ttl when record is written. + + Supported by Aerospike server versions >= 3.10.1. + +#### > 0 + Actual expiration in seconds. diff --git a/aerospike-tls/vendor-aerospike-client-go/error.go b/aerospike-tls/vendor-aerospike-client-go/error.go new file mode 100644 index 00000000..c1722a2f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/error.go @@ -0,0 +1,528 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "errors" + "fmt" + "runtime" + "strconv" + "strings" + + "github.com/aerospike/aerospike-client-go/v7/types" + grpc "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Error is the internal error interface for the Aerospike client's errors. +// All the public API return this error type. This interface is compatible +// with error interface, including errors.Is and errors.As. +type Error interface { + error + + // Matches will return true is the ResultCode of the error or + // any of the errors wrapped down the chain has any of the + // provided codes. + Matches(rcs ...types.ResultCode) bool + + // IsInDoubt signifies that the write operation may have gone through on the server + // but the client is not able to confirm that due an error. + IsInDoubt() bool + + // resultCode returns the error result code. + resultCode() types.ResultCode + + // Unwrap returns the error inside + Unwrap() error + + // Trace returns a stack trace of where the error originates from + Trace() string + + iter(int) Error + setInDoubt(bool, int) Error + setNode(*Node) Error + markInDoubt(bool) Error + markInDoubtIf(bool) Error + wrap(error) Error +} + +// AerospikeError implements Error interface for aerospike specific errors. +// All errors returning from the library are of this type. +// Errors resulting from Go's stdlib are not translated to this type, unless +// they are a net.Timeout error. Refer to errors_test.go for examples. +// To be able to check for error type, you could use the idiomatic +// errors.Is and errors.As patterns: +// +// if errors.Is(err, as.ErrTimeout) { +// ... +// } +// +// or +// +// if errors.Is(err, &as.AerospikeError{ResultCode: ast.PARAMETER_ERROR}) { +// ... +// } +// +// or +// +// if err.Matches(ast.TIMEOUT, ast.NETWORK_ERROR, ast.PARAMETER_ERROR) { +// ... +// } +// +// or +// +// ae := &as.AerospikeError{} +// if errors.As(err, &ae) { +// println(ae.ResultCode) +// } +type AerospikeError struct { + wrapped error + + // error message + msg string + + // Node where the error occurred + Node *Node + + // ResultCode determines the type of error + ResultCode types.ResultCode + + // InDoubt determines if the command was sent to the server, but + // there is doubt if the server received and executed the command + // and changed the data. Only applies to commands that change data + InDoubt bool + + // Iteration determies on which retry the error occurred + Iteration int + + // Includes stack frames for the error + stackFrames []stackFrame +} + +var _ error = &AerospikeError{} +var _ Error = &AerospikeError{} + +// newError generates a new AerospikeError instance. +// If no message is provided, the result code will be translated into the default +// error message automatically. +func newError(code types.ResultCode, messages ...string) Error { + if len(messages) == 0 { + messages = []string{types.ResultCodeToString(code)} + } + + return &AerospikeError{msg: strings.Join(messages, " "), ResultCode: code, stackFrames: stackTrace(nil)} +} + +func newErrorAndWrap(e error, code types.ResultCode, messages ...string) Error { + ne := newError(code, messages...) + ne.wrap(e) + return ne +} + +func newTimeoutError(e error, messages ...string) Error { + ne := newError(types.TIMEOUT, messages...) + ne.wrap(e) + return ne +} + +func newCommonError(e error, messages ...string) Error { + ne := newError(types.COMMON_ERROR, messages...) + ne.wrap(e) + return ne +} + +func newGrpcError(isWrite bool, e error, messages ...string) Error { + if ae, ok := e.(Error); ok && ae.resultCode() == types.GRPC_ERROR { + return ae + } + + // convert error to Aerospike errors + if e == context.DeadlineExceeded { + return ErrNetTimeout.err().markInDoubt(isWrite) + } else if e == grpc.ErrClientConnTimeout { + return ErrNetTimeout.err().markInDoubt(isWrite) + } else if e == grpc.ErrServerStopped { + return ErrServerNotAvailable.err().markInDoubt(isWrite) + } + + // try to convert the error + code := status.Code(e) + if code == codes.Unknown { + if s := status.Convert(e); s != nil { + code = s.Code() + } + } + + switch code { + case codes.OK: + return nil + case codes.Canceled: + return ErrNetTimeout.err().markInDoubt(isWrite) + case codes.InvalidArgument: + return newError(types.PARAMETER_ERROR, messages...) + case codes.DeadlineExceeded: + return ErrNetTimeout.err().markInDoubt(isWrite) + case codes.NotFound: + return newError(types.SERVER_NOT_AVAILABLE, messages...).markInDoubt(isWrite) + case codes.PermissionDenied: + return newError(types.FAIL_FORBIDDEN, messages...) + case codes.ResourceExhausted: + return newError(types.QUOTA_EXCEEDED, messages...) + case codes.FailedPrecondition: + return newError(types.PARAMETER_ERROR, messages...) + case codes.Aborted: + return newError(types.SERVER_ERROR).markInDoubt(isWrite) + case codes.OutOfRange: + return newError(types.PARAMETER_ERROR, messages...) + case codes.Unimplemented: + return newError(types.SERVER_NOT_AVAILABLE, messages...) + case codes.Internal: + return newError(types.SERVER_ERROR, messages...).markInDoubt(isWrite) + case codes.Unavailable: + return newError(types.SERVER_NOT_AVAILABLE, messages...).markInDoubt(isWrite) + case codes.DataLoss: + return ErrNetwork.err().markInDoubt(isWrite) + case codes.Unauthenticated: + return newError(types.NOT_AUTHENTICATED, messages...) + + case codes.AlreadyExists: + case codes.Unknown: + } + + ne := newError(types.GRPC_ERROR, messages...).markInDoubt(isWrite) + ne.wrap(e) + return ne +} + +// SetInDoubt sets whether it is possible that the write transaction may have completed +// even though this error was generated. This may be the case when a +// client error occurs (like timeout) after the command was sent to the server. +func (ase *AerospikeError) setInDoubt(isRead bool, commandSentCounter int) Error { + ase.InDoubt = !isRead && (commandSentCounter > 1 || (commandSentCounter == 1 && (ase.ResultCode == types.TIMEOUT || ase.ResultCode <= 0))) + return ase +} + +func (ase *AerospikeError) setNode(node *Node) Error { + ase.Node = node + return ase +} + +func (ase *AerospikeError) markInDoubt(v bool) Error { + ase.InDoubt = v + return ase +} + +func (ase *AerospikeError) markInDoubtIf(inDoubt bool) Error { + ase.InDoubt = inDoubt + return ase +} + +func (ase *AerospikeError) resultCode() types.ResultCode { + return ase.ResultCode +} + +// Trace returns a stack trace of where the error originates from +func (ase *AerospikeError) Trace() string { + var sb strings.Builder + for i := range ase.stackFrames { + sb.WriteString(ase.stackFrames[i].String()) + sb.WriteString("\n") + } + + if ase.wrapped != nil { + ae := new(AerospikeError) + if errors.As(ase.wrapped, &ae) { + sb.WriteString("Embedded:\n") + sb.WriteString(ae.Trace()) + } + } + + return sb.String() +} + +// Error implements the error interface +func (ase *AerospikeError) Error() string { + const cErr = "ResultCode: %s, Iteration: %d, InDoubt: %t, Node: %s: %s" + const cErrNL = cErr + "\n %s" + if ase.wrapped != nil { + return fmt.Sprintf(cErrNL, ase.ResultCode.String(), ase.Iteration, ase.InDoubt, ase.Node, ase.msg, ase.wrapped.Error()) + } + return fmt.Sprintf(cErr, ase.ResultCode.String(), ase.Iteration, ase.InDoubt, ase.Node, ase.msg) +} + +func (ase *AerospikeError) wrap(err error) Error { + ase.wrapped = err + return ase +} + +func (ase *AerospikeError) iter(i int) Error { + if ase == nil { + return nil + } + // TODO: Make iteration 1-based + ase.Iteration = i - 1 + return ase +} + +// IsInDoubt signifies that the write operation may have gone through on the server +// but the client is not able to confirm that due an error. +func (ase *AerospikeError) IsInDoubt() bool { + return ase.InDoubt +} + +// Matches returns true if the error or any of its wrapped errors contains +// any of the passed results codes. +// For convenience, it will return false if the error is nil. +func (ase *AerospikeError) Matches(rcs ...types.ResultCode) bool { + // don't panic on nil error, and don't go ahead + // if no result codes are provided + if ase == nil || len(rcs) == 0 { + return false + } + + for i := range rcs { + if ase.ResultCode == rcs[i] { + return true + } + } + + ae := &AerospikeError{} + if ase.wrapped != nil && errors.As(ase.wrapped, &ae) { + return ae.Matches(rcs...) + } + + return false +} + +// As implements the interface for errors.As function. +func (ase *AerospikeError) As(target interface{}) bool { + ae, ok := target.(*AerospikeError) + if !ok { + return false + } + + ae.wrapped = ase.wrapped + ae.msg = ase.msg + ae.ResultCode = ase.ResultCode + ae.InDoubt = ase.InDoubt + ae.Node = ase.Node + return true +} + +// Is compares an error with the AerospikeError. +// If the error is not of type *AerospikeError, it will return false. +// Otherwise, it will compare ResultCode and Node (if it exists), and +// will return a result accordingly. +// If passed error's InDoubt is set to true, the InDoubt property will +// also be checked. You should not check if the error's InDoubt is false, since +// it is not checked when the passed error's InDoubt is false. +func (ase *AerospikeError) Is(e error) bool { + if ase == nil || e == nil { + return false + } + + var target *AerospikeError + + switch t := e.(type) { + case *AerospikeError: + target = t + case *constAerospikeError: + target = &t.AerospikeError + default: + return false + } + + res := (ase.ResultCode == target.ResultCode) && + (ase.Node == target.Node || target.Node == nil) + + if target.InDoubt { + res = res && (ase.InDoubt == target.InDoubt) + } + + return res +} + +// Unwrap will return the error wrapped inside the error, or nil. +func (ase *AerospikeError) Unwrap() error { + return ase.wrapped +} + +/* + Node Error +*/ + +func newNodeError(node *Node, err Error) Error { + if err == nil { + return nil + } + + ae := new(AerospikeError) + errors.As(err, &ae) + + res := *ae + res.Node = node + res.wrap(err) + return &res +} + +func newCustomNodeError(node *Node, code types.ResultCode, messages ...string) Error { + ne := newError(code, messages...) + ne.setNode(node) + return ne +} + +func newWrapNetworkError(err error, messages ...string) Error { + ne := newError(types.NETWORK_ERROR, messages...) + ne.wrap(err) + return ne +} + +func newInvalidNodeError(clusterSize int, partition *Partition) Error { + // important to check for clusterSize first, since partition may be nil sometimes + if clusterSize == 0 { + return ErrClusterIsEmpty.err() + } + res := newError(types.INVALID_NODE_ERROR, "Node not found for partition "+partition.String()+" in partition table.") + res.wrap(nil) + return res +} + +/* + constAerospikeError +*/ + +var _ Error = newError(0) + +// constAerospikeError makes sure that constant errors are not chained and invalidated. +// By having a new type, the compiler will enforce the constants. +type constAerospikeError struct { + AerospikeError +} + +func newConstError(code types.ResultCode, messages ...string) *constAerospikeError { + if len(messages) == 0 { + messages = []string{types.ResultCodeToString(code)} + } + + return &constAerospikeError{AerospikeError{msg: strings.Join(messages, " "), ResultCode: code}} +} + +func (ase *constAerospikeError) err() Error { + v := ase.AerospikeError + v.wrap(nil) + return &v +} + +//revive:disable + +var ( + ErrServerNotAvailable = newConstError(types.SERVER_NOT_AVAILABLE) + ErrInvalidPartitionMap = newConstError(types.INVALID_CLUSTER_PARTITION_MAP, "Partition map errors normally occur when the cluster has partitioned due to network anomaly or node crash, or is not configured properly. Refer to https://www.aerospike.com/docs/operations/configure for more information.") + ErrKeyNotFound = newConstError(types.KEY_NOT_FOUND_ERROR) + ErrRecordsetClosed = newConstError(types.RECORDSET_CLOSED) + ErrConnectionPoolEmpty = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "connection pool is empty. This happens when no connections were available") + ErrConnectionPoolExhausted = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Connection pool is exhausted. This happens when all connection are in-use already, and opening more connections is not allowed due to the limits set in policy.ConnectionQueueSize and policy.LimitConnectionsToQueueSize") + ErrTooManyConnectionsForNode = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "connection limit reached for this node. This value is controlled via ClientPolicy.LimitConnectionsToQueueSize") + ErrTooManyOpeningConnections = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "too many connections are trying to open at once. This value is controlled via ClientPolicy.OpeningConnectionThreshold") + ErrTimeout = newConstError(types.TIMEOUT, "command execution timed out on client: See `Policy.Timeout`") + ErrNetTimeout = newConstError(types.TIMEOUT, "network timeout") + ErrUDFBadResponse = newConstError(types.UDF_BAD_RESPONSE, "invalid UDF return value") + ErrNoOperationsSpecified = newConstError(types.INVALID_COMMAND, "no operations were passed to QueryExecute") + ErrNoBinNamesAllowedInQueryExecute = newConstError(types.INVALID_COMMAND, "`Statement.BinNames` must be empty for QueryExecute") + ErrFilteredOut = newConstError(types.FILTERED_OUT) + ErrPartitionScanQueryNotSupported = newConstError(types.PARAMETER_ERROR, "partition Scans/Queries are not supported by all nodes in this cluster") + ErrScanTerminated = newConstError(types.SCAN_TERMINATED) + ErrQueryTerminated = newConstError(types.QUERY_TERMINATED) + ErrClusterIsEmpty = newConstError(types.INVALID_NODE_ERROR, "cluster is empty") + ErrInvalidUser = newConstError(types.INVALID_USER) + ErrNotAuthenticated = newConstError(types.NOT_AUTHENTICATED) + ErrNetwork = newConstError(types.NETWORK_ERROR) + ErrInvalidObjectType = newConstError(types.SERIALIZE_ERROR, "invalid type for result object. It should be of type struct pointer or addressable") + ErrMaxRetriesExceeded = newConstError(types.MAX_RETRIES_EXCEEDED, "command execution timed out on client: Exceeded number of retries. See `Policy.MaxRetries`.") + ErrInvalidParam = newConstError(types.PARAMETER_ERROR) + ErrLuaPoolEmpty = newConstError(types.COMMON_ERROR, "Error fetching a lua instance from pool") + + errGRPCStreamEnd = newError(types.OK, "GRPC Steam was ended successfully") +) + +//revive:enable + +// chainErrors wraps an error inside a new error. The new (outer) error cannot be nil. +// if the old error is nil, the new error will be returned. +func chainErrors(outer Error, inner error) Error { + if inner == nil && outer == nil { + return nil + } else if inner == nil { + return outer + } else if outer == nil { + if e, ok := inner.(Error); ok { + return e + } + return newCommonError(inner) + } + + var ae *AerospikeError + switch outer.(type) { + case *constAerospikeError: + t := outer.(*constAerospikeError).AerospikeError + ae = &t + case *AerospikeError: + // copy the reference to avoid issues with checking the last error + // when it is chained. + t := *outer.(*AerospikeError) + ae = &t + } + + if inner == nil { + return ae + } + + ae.wrapped = inner + return ae +} + +type stackFrame struct { + fl, fn string + ln int +} + +func (st *stackFrame) String() string { + return st.fl + ":" + strconv.Itoa(st.ln) + " " + st.fn + "()" +} + +func stackTrace(err Error) []stackFrame { + const maxDepth = 10 + sFrames := make([]stackFrame, 0, maxDepth) + for i := 3; i <= maxDepth+3; i++ { + pc, fl, ln, ok := runtime.Caller(i) + if !ok { + break + } + fn := runtime.FuncForPC(pc) + sFrame := stackFrame{ + fl: fl, + fn: fn.Name(), + ln: ln, + } + sFrames = append(sFrames, sFrame) + } + + if len(sFrames) > 0 { + return sFrames + } + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/error_test.go b/aerospike-tls/vendor-aerospike-client-go/error_test.go new file mode 100644 index 00000000..e541c726 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/error_test.go @@ -0,0 +1,145 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "errors" + + ast "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Aerospike Error Tests", func() { + + gg.Context("Matches()", func() { + + gg.It("should handle simple case", func() { + err := newError(ast.UDF_BAD_RESPONSE) + + res := err.Matches(ast.UDF_BAD_RESPONSE) + gm.Expect(res).To(gm.BeTrue()) + }) + + gg.It("should handle simple case", func() { + inner := newError(ast.UDF_BAD_RESPONSE) + err := newError(ast.TIMEOUT).wrap(inner) + + res := err.Matches(ast.UDF_BAD_RESPONSE) + gm.Expect(res).To(gm.BeTrue()) + + res = err.Matches(ast.TIMEOUT) + gm.Expect(res).To(gm.BeTrue()) + + res = err.Matches(ast.UDF_BAD_RESPONSE, ast.TIMEOUT) + gm.Expect(res).To(gm.BeTrue()) + }) + + }) + + gg.Context("chainErrors()", func() { + + gg.It("should handle nil for inner error", func() { + outer := newError(ast.UDF_BAD_RESPONSE) + err := chainErrors(outer, nil) + + res := err.Matches(ast.UDF_BAD_RESPONSE) + gm.Expect(res).To(gm.BeTrue()) + }) + + gg.It("should handle nil for inner error", func() { + inner := newError(ast.UDF_BAD_RESPONSE) + err := chainErrors(nil, inner) + + res := err.Matches(ast.UDF_BAD_RESPONSE) + gm.Expect(res).To(gm.BeTrue()) + }) + + }) + + gg.Context("errors.Is", func() { + + gg.It("should handle simple case", func() { + err := newError(ast.UDF_BAD_RESPONSE) + + res := errors.Is(err, ErrUDFBadResponse) + gm.Expect(res).To(gm.BeTrue()) + }) + + gg.It("should handle complex case", func() { + err := newError(ast.UDF_BAD_RESPONSE) + + res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE}) + gm.Expect(res).To(gm.BeTrue()) + + }) + + gg.It("should handle complex case with inDoubt", func() { + err := newError(ast.UDF_BAD_RESPONSE) + + res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) + gm.Expect(res).To(gm.BeFalse()) + + }) + + gg.It("should handle wrapped cases", func() { + inner := newError(ast.UDF_BAD_RESPONSE) + err := newError(ast.TIMEOUT).wrap(inner) + + res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) + gm.Expect(res).To(gm.BeFalse()) + }) + + gg.It("should handle chained cases", func() { + inner1 := newError(ast.UDF_BAD_RESPONSE) + inner2 := newError(ast.BATCH_DISABLED) + inner := chainErrors(inner2, inner1) + outer := newError(ast.TIMEOUT) + err := chainErrors(outer, inner) + + res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) + gm.Expect(res).To(gm.BeFalse()) + }) + + }) // Context + + gg.Context("errors.As", func() { + + gg.It("should handle simple case", func() { + err := newError(ast.UDF_BAD_RESPONSE) + + ae := new(AerospikeError) + res := errors.As(err, &ae) + gm.Expect(res).To(gm.BeTrue()) + gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE})).To(gm.BeTrue()) + }) + + gg.It("should handle chained case", func() { + inner := newError(ast.UDF_BAD_RESPONSE).setInDoubt(false, 2) + outer := newError(ast.TIMEOUT) + err := chainErrors(outer, inner) + + ae := new(AerospikeError) + res := errors.As(err, &ae) + gm.Expect(res).To(gm.BeTrue()) + gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE})).To(gm.BeTrue()) + gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true})).To(gm.BeTrue()) + gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: false})).To(gm.BeTrue()) + }) + + }) + +}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/example_client_test.go b/aerospike-tls/vendor-aerospike-client-go/example_client_test.go new file mode 100644 index 00000000..df884991 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_client_test.go @@ -0,0 +1,98 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike_test + +import ( + "fmt" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func ExampleClient_Add() { + key, err := as.NewKey(*namespace, "test", "addkey") + if err != nil { + log.Fatal(err) + } + + if _, err = client.Delete(nil, key); err != nil { + log.Fatal(err) + } + + // Add to a non-existing record/bin, should create a record + bin := as.NewBin("bin", 10) + if err = client.AddBins(nil, key, bin); err != nil { + log.Fatal(err) + } + + // Add to 5 to the original 10 + bin = as.NewBin("bin", 5) + if err = client.AddBins(nil, key, bin); err != nil { + log.Fatal(err) + } + + // Check the result + record, err := client.Get(nil, key, bin.Name) + if err != nil { + log.Fatal(err) + } + fmt.Println(record.Bins["bin"]) + + // Demonstrate add and get combined. + bin = as.NewBin("bin", 30) + if record, err = client.Operate(nil, key, as.AddOp(bin), as.GetOp()); err != nil { + log.Fatal(err) + } + + fmt.Println(record.Bins["bin"]) + // Output: + // 15 + // 45 +} + +func ExampleClient_Append() { + key, err := as.NewKey(*namespace, "test", "appendkey") + if err != nil { + log.Fatal(err) + } + + if _, err = client.Delete(nil, key); err != nil { + log.Fatal(err) + } + + // Create by appending to non-existing value + bin1 := as.NewBin("myBin", "Hello") + if err = client.AppendBins(nil, key, bin1); err != nil { + log.Fatal(err) + } + + // Append World + bin2 := as.NewBin("myBin", " World") + if err = client.AppendBins(nil, key, bin2); err != nil { + log.Fatal(err) + } + + record, err := client.Get(nil, key) + if err != nil { + log.Fatal(err) + } + + fmt.Println(record.Bins["myBin"]) + // Output: + // Hello World +} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go new file mode 100644 index 00000000..13e44515 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go @@ -0,0 +1,75 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +/* +myListInt +*/ +var _ as.ListIter = myListInt([]int{}) + +// your custom list +type myListInt []int + +func (ml myListInt) PackList(buf as.BufferEx) (int, error) { + size := 0 + for _, elem := range ml { + n, err := as.PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + + return size, nil +} + +func (ml myListInt) Len() int { + return len(ml) +} + +func ExampleListIter_int() { + // Setup the client here + // client, err := as.NewClient("127.0.0.1", 3000) + // if err != nil { + // log.Fatal(err) + // } + + var v as.Value = as.NewValue(myListInt([]int{1, 2, 3})) + key, err := as.NewKey(*namespace, "test", 1) + if err != nil { + log.Fatal(err) + } + + err = client.Put(nil, key, as.BinMap{"myBin": v}) + if err != nil { + log.Fatal(err) + } + + rec, err := client.Get(nil, key) + if err != nil { + log.Fatal(err) + } + + fmt.Println(rec.Bins["myBin"]) + // Output: + // [1 2 3] +} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go new file mode 100644 index 00000000..8d7a4232 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go @@ -0,0 +1,74 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +/* +myListString +*/ +var _ as.ListIter = myListString([]string{}) + +// your custom list +type myListString []string + +func (ml myListString) PackList(buf as.BufferEx) (int, error) { + size := 0 + for _, elem := range ml { + n, err := as.PackString(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +func (ml myListString) Len() int { + return len(ml) +} + +func ExampleListIter_string() { + // Setup the client here + // client, err := as.NewClient("127.0.0.1", 3000) + // if err != nil { + // log.Fatal(err) + // } + + var v as.Value = as.NewValue(myListString([]string{"a", "b", "c"})) + key, err := as.NewKey(*namespace, "test", 1) + if err != nil { + log.Fatal(err) + } + + err = client.Put(nil, key, as.BinMap{"myBin": v}) + if err != nil { + log.Fatal(err) + } + + rec, err := client.Get(nil, key) + if err != nil { + log.Fatal(err) + } + + fmt.Println(rec.Bins["myBin"]) + // Output: + // [a b c] +} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go new file mode 100644 index 00000000..9fb41538 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go @@ -0,0 +1,78 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +/* +myListTime +*/ +var _ as.ListIter = myListTime([]time.Time{}) + +// your custom list +type myListTime []time.Time + +func (ml myListTime) PackList(buf as.BufferEx) (int, error) { + size := 0 + for _, elem := range ml { + n, err := as.PackInt64(buf, elem.UnixNano()) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +func (ml myListTime) Len() int { + return len(ml) +} + +func ExampleListIter_time() { + // Setup the client here + // client, err := as.NewClient("127.0.0.1", 3000) + // if err != nil { + // log.Fatal(err) + // } + + now1 := time.Unix(123123123, 0) + now2 := time.Unix(123123124, 0) + now3 := time.Unix(123123125, 0) + var v as.Value = as.NewValue(myListTime([]time.Time{now1, now2, now3})) + key, err := as.NewKey(*namespace, "test", 1) + if err != nil { + log.Fatal(err) + } + + err = client.Put(nil, key, as.BinMap{"myBin": v}) + if err != nil { + log.Fatal(err) + } + + rec, err := client.Get(nil, key) + if err != nil { + log.Fatal(err) + } + + fmt.Println(rec.Bins["myBin"]) + // Output: + // [123123123000000000 123123124000000000 123123125000000000] +} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go b/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go new file mode 100644 index 00000000..8da567a5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go @@ -0,0 +1,82 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +/* +myMapStringTime +*/ +var _ as.MapIter = myMapStringTime(map[string]time.Time{}) + +// your custom list +type myMapStringTime map[string]time.Time + +func (mm myMapStringTime) PackMap(buf as.BufferEx) (int, error) { + size := 0 + for key, val := range mm { + n, err := as.PackString(buf, key) + size += n + if err != nil { + return size, err + } + + n, err = as.PackInt64(buf, val.UnixNano()) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +func (mm myMapStringTime) Len() int { + return len(mm) +} + +func ExampleMapIter() { + // Setup the client here + // client, err := as.NewClient("127.0.0.1", 3000) + // if err != nil { + // log.Fatal(err) + // } + + now := time.Unix(123123123, 0) + var v as.Value = as.NewValue(myMapStringTime(map[string]time.Time{"now": now})) + key, err := as.NewKey(*namespace, "test", 1) + if err != nil { + log.Fatal(err) + } + + err = client.Put(nil, key, as.BinMap{"myBin": v}) + if err != nil { + log.Fatal(err) + } + + rec, err := client.Get(nil, key) + if err != nil { + log.Fatal(err) + } + + fmt.Println(rec.Bins["myBin"]) + // Output: + // map[now:123123123000000000] +} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go b/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go new file mode 100644 index 00000000..6da9dac7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go @@ -0,0 +1,88 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func ExamplePartitionFilter_EncodeCursor() { + // Setup the client here + // client, err := as.NewClient("127.0.0.1", 3000) + // if err != nil { + // log.Fatal(err) + // } + + var ns = *namespace + var set = randString(50) + + // initialize the records + keyCount := 1000 + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, i) + if err != nil { + log.Fatal(err) + } + + err = client.Put(nil, key, as.BinMap{"bin": i}) + if err != nil { + log.Fatal(err) + } + } + + // Set up the scan policy + spolicy := as.NewScanPolicy() + spolicy.MaxRecords = 30 + + received := 0 + var buf []byte + for received < keyCount { + pf := as.NewPartitionFilterAll() + + if len(buf) > 0 { + err = pf.DecodeCursor(buf) + if err != nil { + log.Fatal(err) + } + } + + recordset, err := client.ScanPartitions(spolicy, pf, ns, set) + if err != nil { + log.Fatal(err) + } + + counter := 0 + for range recordset.Results() { + counter++ + received++ + } + + if counter > 30 { + log.Fatal("More records received than requested.") + } + + buf, err = pf.EncodeCursor() + if err != nil { + log.Fatal(err) + } + } + + fmt.Println(received) + // Output: + // 1000 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go b/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go new file mode 100644 index 00000000..a3f561f4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go @@ -0,0 +1,86 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "addkey") + shared.PanicOnError(err) + + binName := "addbin" + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + // Perform some adds and check results. + bin := as.NewBin(binName, 10) + log.Println("Initial add will create record. Initial value is ", bin.Value, ".") + client.AddBins(shared.WritePolicy, key, bin) + + bin = as.NewBin(binName, 5) + log.Println("Add ", bin.Value, " to existing record.") + client.AddBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + // The value received from the server is an unsigned byte stream. + // Convert to an integer before comparing with expected. + received := record.Bins[bin.Name] + expected := 15 + + if received == expected { + log.Printf("Add successful: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Add mismatch: Expected %d. Received %d.", expected, received) + } + + // Demonstrate add and get combined. + bin = as.NewBin(binName, 30) + log.Println("Add ", bin.Value, " to existing record.") + record, err = client.Operate(shared.WritePolicy, key, as.AddOp(bin), as.GetOp()) + shared.PanicOnError(err) + + expected = 45 + received = record.Bins[bin.Name] + + if received == expected { + log.Printf("Add successful: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Add mismatch: Expected %d. Received %d.", expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go b/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go new file mode 100644 index 00000000..e106bc33 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go @@ -0,0 +1,67 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "appendkey") + shared.PanicOnError(err) + + binName := "appendbin" + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + bin := as.NewBin(binName, "Hello") + log.Println("Initial append will create record. Initial value is ", bin.Value, ".") + client.AppendBins(shared.WritePolicy, key, bin) + + bin = as.NewBin(binName, " World") + log.Println("Append \"", bin.Value, "\" to existing record.") + client.AppendBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + received := record.Bins[bin.Name] + expected := "Hello World" + + if received == expected { + log.Printf("Append successful: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Append mismatch: Expected %s. Received %s.", expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go b/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go new file mode 100644 index 00000000..7d875d3e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go @@ -0,0 +1,163 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "strconv" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + asl "github.com/aerospike/aerospike-client-go/v7/logger" +) + +func main() { + keyPrefix := "batchkey" + valuePrefix := "batchvalue" + binName := "batchbin" + size := 8 + + writeRecords(shared.Client, keyPrefix, binName, valuePrefix, size) + // batchExists(shared.Client, keyPrefix, size) + // batchReads(shared.Client, keyPrefix, binName, size) + // batchReadHeaders(shared.Client, keyPrefix, size) + + log.Println("Example finished successfully.") +} + +/** + * Write records individually. + */ +func writeRecords( + client *as.Client, + keyPrefix string, + binName string, + valuePrefix string, + size int, +) { + for i := 1; i <= size; i++ { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i)) + bin := as.NewBin(binName, valuePrefix+strconv.Itoa(i)) + + log.Printf("Put: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) + + client.PutBins(shared.WritePolicy, key, bin) + } +} + +/** + * Check existence of records in one batch. + */ +func batchExists( + client *as.Client, + + keyPrefix string, + size int, +) { + // Batch into one call. + keys := make([]*as.Key, size) + for i := 0; i < size; i++ { + keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) + } + + existsArray, err := client.BatchExists(nil, keys) + shared.PanicOnError(err) + + for i := 0; i < len(existsArray); i++ { + key := keys[i] + exists := existsArray[i] + log.Printf("Record: ns=%s set=%s key=%s exists=%t", + key.Namespace(), key.SetName(), key.Value(), exists) + } +} + +/** + * Read records in one batch. + */ +func batchReads( + client *as.Client, + keyPrefix string, + binName string, + size int, +) { + // Batch gets into one call. + keys := make([]*as.Key, size) + for i := 0; i < size; i++ { + keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) + } + + records, err := client.BatchGet(nil, keys, binName) + shared.PanicOnError(err) + + for i := 0; i < len(records); i++ { + key := keys[i] + record := records[i] + level := asl.ERR + var value interface{} + + if record != nil { + level = asl.INFO + value = record.Bins[binName] + } + asl.Logger.LogAtLevel(level, "Record: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), binName, value) + } + + if len(records) != size { + log.Fatalf("Record size mismatch. Expected %d. Received %d.", size, len(records)) + } +} + +/** + * Read record header data in one batch. + */ +func batchReadHeaders( + client *as.Client, + keyPrefix string, + size int, +) { + // Batch gets into one call. + keys := make([]*as.Key, size) + for i := 0; i < size; i++ { + keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) + } + + records, err := client.BatchGetHeader(nil, keys) + shared.PanicOnError(err) + + for i := 0; i < len(records); i++ { + key := keys[i] + record := records[i] + level := asl.ERR + generation := uint32(0) + expiration := uint32(0) + + if record != nil && (record.Generation > 0 || record.Expiration > 0) { + level = asl.INFO + generation = record.Generation + expiration = record.Expiration + } + asl.Logger.LogAtLevel(level, "Record: ns=%s set=%s key=%s generation=%d expiration=%d", + key.Namespace(), key.SetName(), key.Value(), generation, expiration) + } + + if len(records) != size { + log.Fatalf("Record size mismatch. Expected %d. Received %d.", size, len(records)) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go b/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go new file mode 100644 index 00000000..6f9de262 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go @@ -0,0 +1,76 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + as "github.com/aerospike/aerospike-client-go/v7" +) + +// Person is a custom data type to be converted to a blob +type Person struct { + name string +} + +// EncodeBlob defines The AerospikeBlob interface +func (p Person) EncodeBlob() ([]byte, error) { + return []byte(p.name), nil +} + +// DecodeBlob is optional, and should be used manually +func (p *Person) DecodeBlob(buf []byte) error { + p.name = string(buf) + return nil +} + +func main() { + // define a client to connect to + client, err := as.NewClient("127.0.0.1", 3000) + panicOnError(err) + + namespace := "test" + setName := "people" + key, err := as.NewKey(namespace, setName, "key") // user key can be of any supported type + panicOnError(err) + + // define some bins + bins := as.BinMap{ + "bin1": Person{name: "Albert Einstein"}, + "bin2": &Person{name: "Richard Feynman"}, + } + + // write the bins + writePolicy := as.NewWritePolicy(0, 0) + err = client.Put(writePolicy, key, bins) + panicOnError(err) + + // read it back! + readPolicy := as.NewPolicy() + rec, err := client.Get(readPolicy, key) + panicOnError(err) + + result := &Person{} + + // decode first object + result.DecodeBlob(rec.Bins["bin1"].([]byte)) + + // decode second object + result.DecodeBlob(rec.Bins["bin2"].([]byte)) +} + +func panicOnError(err error) { + if err != nil { + panic(err) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go b/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go new file mode 100644 index 00000000..f5cb04a8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go @@ -0,0 +1,104 @@ +package main + +import ( + "fmt" + "log" + "strconv" + "strings" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + replFactor, err := replicationFactor(client, *shared.Namespace) + shared.PanicOnError(err) + log.Println("Replication Factor:", replFactor) + + totalObjects, err := countSetObjects(client, *shared.Namespace, *shared.Set) + shared.PanicOnError(err) + log.Println("Total Objects:", totalObjects) + + totalUniqueObjects := totalObjects / replFactor + log.Println("Total Unique Object Count:", totalUniqueObjects) +} + +func countSetObjects(client *as.Client, ns, set string) (int, error) { + const statKey = "objects" + + // get the list of cluster nodes + nodes := client.GetNodes() + + infop := as.NewInfoPolicy() + + objCount := 0 + + // iterate over nodes +N: + for _, n := range nodes { + cmd := fmt.Sprintf("sets/%s/%s", ns, set) + info, err := n.RequestInfo(infop, cmd) + if err != nil { + return -1, err + } + vals := strings.Split(info[cmd], ":") + for _, val := range vals { + if i := strings.Index(val, statKey); i > -1 { + cnt, err := strconv.Atoi(val[i+len(statKey)+1:]) + if err != nil { + return -1, err + } + objCount += cnt + continue N + } + } + } + + return objCount, nil +} + +func replicationFactor(client *as.Client, ns string) (int, error) { + const statKey = "effective_replication_factor" + + // get the list of cluster nodes + nodes := client.GetNodes() + + infop := as.NewInfoPolicy() + + replFactor := -1 + + // iterate over nodes +N: + for _, n := range nodes { + cmd := fmt.Sprintf("namespace/%s", ns) + info, err := n.RequestInfo(infop, cmd) + if err != nil { + return -1, err + } + vals := strings.Split(info[cmd], ";") + // fmt.Println(vals) + for _, val := range vals { + if i := strings.Index(val, statKey); i > -1 { + rf, err := strconv.Atoi(val[i+len(statKey)+1:]) + if err != nil { + return -1, err + } + + if replFactor == -1 { + replFactor = rf + } else if replFactor != rf { + return -1, fmt.Errorf("Inconsistent replication factor for namespace %s in cluster", ns) + } + + continue N + } + } + } + + return replFactor, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go b/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go new file mode 100644 index 00000000..041d7050 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go @@ -0,0 +1,135 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "reflect" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +var ( + ll = [][]int64{{40937, 1388370, 1543094673, 26, 1545655173}, {40937, 523757, 1543094673, 26, 1545655173}, {40937, 639127, 1543094673, 26, 1545655173}, {16626, 516619, 1545372572, 2, 1545547652}, {16626, 516616, 1545372572, 2, 1545547652}, {8787, 489902, 1543897224, 23, 1545655164}, {8787, 489899, 1543897224, 23, 1545655164}, {8787, 408082, 1543897224, 23, 1545655164}, {8787, 407868, 1543897224, 23, 1545655164}, {20487, 963712, 1545372572, 1, 1545655172}, {20487, 856483, 1545372572, 1, 1545655172}, {20487, 690802, 1545372572, 1, 1545655172}, {40937, 773994, 1545372572, 1, 1545655172}, {40937, 773992, 1545372572, 1, 1545655172}, {40937, 773965, 1545372572, 1, 1545655172}, {40937, 773399, 1545372572, 1, 1545655172}, {40937, 773369, 1545372572, 1, 1545655172}, {40937, 671901, 1545372572, 1, 1545655172}, {40937, 368122, 1545372572, 1, 1545655172}, {40937, 368110, 1545372572, 1, 1545655172}, {40937, 368055, 1545372572, 1, 1545655172}, {40937, 368052, 1545372572, 1, 1545655172}, {40937, 368047, 1545372572, 1, 1545655172}, {40937, 368046, 1545372572, 1, 1545655172}, {40937, 367852, 1545372572, 1, 1545655172}, {40937, 367845, 1545372572, 1, 1545655172}, {40937, 367819, 1545372572, 1, 1545655172}, {40937, 367799, 1545372572, 1, 1545655172}, {40937, 366992, 1545372572, 1, 1545655172}, {40937, 358050, 1545372572, 1, 1545655172}, {40937, 356916, 1545372572, 1, 1545655172}, {40937, 356914, 1545372572, 1, 1545655172}, {40937, 356884, 1545372572, 1, 1545655172}, {40937, 24148, 1545372572, 1, 1545655172}, {40937, 14970, 1545372572, 1, 1545655172}, {27768, 1081131, 1544417593, 1, 1544417593}, {27768, 1081125, 1544417593, 1, 1544417593}, {27768, 1081117, 1544417593, 1, 1544417593}, {27768, 1081111, 1544417593, 1, 1544417593}, {27768, 614520, 1544417593, 1, 1544417593}, {27768, 550328, 1544417593, 1, 1544417593}, {16016, 516619, 1544270206, 1, 1544270206}, {16016, 516616, 1544270206, 1, 1544270206}, {11510, 516619, 1544270101, 1, 1544270101}, {11510, 516616, 1544270101, 1, 1544270101}, {11510, 287241, 1544270101, 1, 1544270101}, {11510, 179159, 1544270101, 1, 1544270101}, {11510, 158627, 1544270101, 1, 1544270101}, {11510, 158623, 1544270101, 1, 1544270101}, {11510, 142416, 1544270101, 1, 1544270101}, {9980, 1142192, 1544270101, 1, 1544270101}, {11510, 191410, 1544270101, 1, 1544270101}, {11510, 152422, 1544270101, 1, 1544270101}, {11510, 32104, 1544270101, 1, 1544270101}, {11510, 1116, 1544270101, 1, 1544270101}, {8787, 38845, 1544270101, 2, 1545655201}, {9980, 1082750, 1544270101, 2, 1545655201}, {19506, 516619, 1544270101, 2, 1545655201}, {19506, 516616, 1544270101, 2, 1545655201}, {19506, 287241, 1544270101, 2, 1545655201}, {19506, 179159, 1544270101, 2, 1545655201}, {19506, 158627, 1544270101, 2, 1545655201}, {19506, 158623, 1544270101, 2, 1545655201}, {19506, 142416, 1544270101, 2, 1545655201}, {9980, 1142179, 1544270101, 2, 1545655201}, {19506, 422943, 1544270101, 2, 1545655201}, {19506, 345569, 1544270101, 2, 1545655201}, {19506, 63617, 1544270101, 2, 1545655201}, {19506, 1116, 1544270101, 2, 1545655201}, {20932, 516619, 1543990832, 1, 1543990832}, {20932, 516616, 1543990832, 1, 1543990832}, {20932, 458514, 1543990832, 1, 1543990832}, {20932, 369986, 1543990832, 1, 1543990832}, {20932, 203333, 1543990832, 1, 1543990832}, {20932, 1116, 1543990832, 1, 1543990832}, {12057, 516619, 1543917498, 1, 1543917498}, {12057, 516616, 1543917498, 1, 1543917498}, {12057, 422964, 1543917498, 1, 1543917498}, {12057, 191957, 1543917498, 1, 1543917498}, {12057, 161051, 1543917498, 1, 1543917498}, {12057, 1116, 1543917498, 1, 1543917498}, {38311, 516619, 1543664706, 1, 1543664706}, {38311, 516616, 1543664706, 1, 1543664706}, {38311, 670098, 1543664706, 1, 1543664706}, {38311, 638284, 1543664706, 1, 1543664706}, {38311, 1116, 1543664706, 1, 1543664706}, {23179, 516619, 1543563095, 1, 1543563095}, {23179, 516616, 1543563095, 1, 1543563095}, {23179, 413003, 1543563095, 1, 1543563095}, {23179, 412965, 1543563095, 1, 1543563095}, {23179, 1116, 1543563095, 1, 1543563095}, {40937, 494200, 1543094673, 1, 1545655173}, {40937, 494199, 1543094673, 1, 1545655173}, {40937, 494194, 1543094673, 1, 1545655173}, {40937, 494152, 1543094673, 1, 1545655173}, {40937, 494147, 1543094673, 1, 1545655173}, {40937, 494135, 1543094673, 1, 1545655173}, {11673, 516619, 1541558619, 1, 1541558619}, {11673, 516616, 1541558619, 1, 1541558619}, {11673, 191573, 1541558619, 1, 1541558619}, {11673, 141981, 1541558619, 1, 1541558619}, {11673, 1116, 1541558619, 1, 1541558619}, {8787, 800649, 1540008292, 8, 1541558572}, {8787, 800648, 1540008292, 8, 1541558572}, {28570, 839888, 1541517901, 1, 1541517901}, {28570, 839887, 1541517901, 1, 1541517901}, {28570, 839877, 1541517901, 1, 1541517901}, {28570, 502177, 1541517901, 1, 1541517901}, {28570, 437522, 1541517901, 1, 1541517901}, {28570, 196361, 1541517901, 1, 1541517901}, {28570, 155579, 1541517901, 1, 1541517901}, {28570, 129720, 1541517901, 1, 1541517901}, {28570, 129716, 1541517901, 1, 1541517901}, {28570, 74510, 1541517901, 1, 1541517901}, {28570, 44089, 1541517901, 1, 1541517901}, {28570, 44078, 1541517901, 1, 1541517901}, {28570, 36454, 1541517901, 1, 1541517901}, {28570, 34133, 1541517901, 1, 1541517901}, {28570, 34127, 1541517901, 1, 1541517901}, {28570, 31089, 1541517901, 1, 1541517901}, {28570, 31038, 1541517901, 1, 1541517901}, {28570, 30789, 1541517901, 1, 1541517901}, {28570, 120446, 1541517901, 1, 1541517901}, {28570, 30740, 1541517901, 1, 1541517901}, {28570, 973402, 1540008922, 2, 1541517862}, {28570, 973401, 1540008922, 2, 1541517862}, {28570, 838084, 1540008922, 2, 1541517862}, {28570, 838080, 1540008922, 2, 1541517862}, {28570, 196353, 1540008922, 2, 1541517862}, {28570, 195519, 1540008922, 2, 1541517862}, {28570, 43878, 1540008922, 2, 1541517862}, {28570, 43876, 1540008922, 2, 1541517862}, {28570, 516619, 1540008922, 2, 1541517862}, {28570, 516616, 1540008922, 2, 1541517862}, {28570, 973303, 1540008922, 2, 1541517862}, {28570, 839958, 1540008922, 2, 1541517862}, {28570, 839864, 1540008922, 2, 1541517862}, {28570, 671901, 1540008922, 2, 1541517862}, {28570, 129719, 1540008922, 2, 1541517862}, {28570, 34115, 1540008922, 2, 1541517862}, {28570, 31026, 1540008922, 2, 1541517862}, {28570, 24148, 1540008922, 2, 1541517862}, {28570, 6463, 1540008922, 2, 1541517862}, {28570, 5915, 1540008922, 2, 1541517862}, {28569, 497873, 1540008922, 2, 1541517862}, {28569, 26031, 1540008922, 2, 1541517862}, {28569, 1116, 1540008922, 2, 1541517862}, {10071, 516619, 1540008295, 2, 1541516935}, {10071, 516616, 1540008295, 2, 1541516935}, {10071, 1122656, 1540008295, 2, 1541516935}, {10071, 188230, 1540008295, 2, 1541516935}, {10071, 26031, 1540008295, 2, 1541516935}, {10071, 1116, 1540008295, 2, 1541516935}, {67930, 516619, 1539958836, 3, 1540180956}, {67930, 516616, 1539958836, 3, 1540180956}, {67930, 1384048, 1539958836, 3, 1540180956}, {67930, 1384044, 1539958836, 3, 1540180956}, {67930, 1116, 1539958836, 3, 1540180956}, {28570, 839869, 1540008922, 1, 1540008922}, {28570, 839866, 1540008922, 1, 1540008922}, {28570, 839865, 1540008922, 1, 1540008922}, {28570, 685624, 1540008922, 1, 1540008922}, {28570, 678302, 1540008922, 1, 1540008922}, {28570, 678266, 1540008922, 1, 1540008922}, {28570, 678263, 1540008922, 1, 1540008922}, {28570, 678186, 1540008922, 1, 1540008922}, {28570, 502150, 1540008922, 1, 1540008922}, {28570, 502132, 1540008922, 1, 1540008922}, {28570, 437443, 1540008922, 1, 1540008922}, {28570, 437413, 1540008922, 1, 1540008922}, {28570, 417952, 1540008922, 1, 1540008922}, {28570, 417939, 1540008922, 1, 1540008922}, {28570, 219690, 1540008922, 1, 1540008922}, {28570, 196479, 1540008922, 1, 1540008922}, {28570, 149483, 1540008922, 1, 1540008922}, {28570, 120450, 1540008922, 1, 1540008922}, {28570, 120449, 1540008922, 1, 1540008922}, {28570, 120448, 1540008922, 1, 1540008922}, {28570, 101942, 1540008922, 1, 1540008922}, {28570, 54949, 1540008922, 1, 1540008922}, {28570, 54938, 1540008922, 1, 1540008922}, {28570, 54926, 1540008922, 1, 1540008922}, {28570, 54921, 1540008922, 1, 1540008922}, {28570, 43912, 1540008922, 1, 1540008922}, {28570, 43886, 1540008922, 1, 1540008922}, {28570, 43880, 1540008922, 1, 1540008922}, {28570, 34124, 1540008922, 1, 1540008922}, {28570, 34123, 1540008922, 1, 1540008922}, {28570, 34121, 1540008922, 1, 1540008922}, {28570, 32042, 1540008922, 1, 1540008922}, {28570, 31007, 1540008922, 1, 1540008922}, {28570, 30984, 1540008922, 1, 1540008922}, {28570, 30983, 1540008922, 1, 1540008922}, {28570, 30957, 1540008922, 1, 1540008922}, {28570, 30730, 1540008922, 1, 1540008922}, {28570, 25315, 1540008922, 1, 1540008922}, {28570, 25231, 1540008922, 1, 1540008922}, {28570, 1315277, 1540008922, 1, 1540008922}, {28570, 1315276, 1540008922, 1, 1540008922}, {28570, 1315275, 1540008922, 1, 1540008922}, {28570, 1315273, 1540008922, 1, 1540008922}, {28570, 1315272, 1540008922, 1, 1540008922}, {28570, 1084896, 1540008922, 1, 1540008922}, {28570, 1084894, 1540008922, 1, 1540008922}, {28570, 1084766, 1540008922, 1, 1540008922}, {28570, 1084765, 1540008922, 1, 1540008922}, {28570, 973557, 1540008922, 1, 1540008922}, {28570, 973497, 1540008922, 1, 1540008922}, {28570, 956784, 1540008922, 1, 1540008922}, {28570, 956775, 1540008922, 1, 1540008922}, {28570, 956774, 1540008922, 1, 1540008922}, {28570, 946292, 1540008922, 1, 1540008922}, {28570, 946286, 1540008922, 1, 1540008922}, {28570, 946267, 1540008922, 1, 1540008922}, {28570, 842371, 1540008922, 1, 1540008922}, {28570, 765557, 1540008922, 1, 1540008922}, {28570, 697212, 1540008922, 1, 1540008922}, {28570, 679835, 1540008922, 1, 1540008922}, {28570, 678299, 1540008922, 1, 1540008922}, {28570, 671925, 1540008922, 1, 1540008922}, {28570, 671924, 1540008922, 1, 1540008922}, {28570, 501723, 1540008922, 1, 1540008922}, {28570, 296271, 1540008922, 1, 1540008922}, {28570, 149481, 1540008922, 1, 1540008922}, {28570, 129721, 1540008922, 1, 1540008922}, {28570, 120439, 1540008922, 1, 1540008922}, {28570, 36903, 1540008922, 1, 1540008922}, {28570, 34128, 1540008922, 1, 1540008922}, {28570, 25320, 1540008922, 1, 1540008922}, {28570, 25253, 1540008922, 1, 1540008922}, {28570, 25222, 1540008922, 1, 1540008922}, {28570, 2090, 1540008922, 1, 1540008922}, {23594, 516619, 1540008299, 1, 1540008299}, {23594, 516616, 1540008299, 1, 1540008299}, {23594, 417719, 1540008299, 1, 1540008299}, {23594, 401813, 1540008299, 1, 1540008299}, {23594, 1116, 1540008299, 1, 1540008299}, {26358, 516619, 1540008299, 1, 1540008299}, {26358, 516616, 1540008299, 1, 1540008299}, {26358, 287241, 1540008299, 1, 1540008299}, {26358, 179159, 1540008299, 1, 1540008299}, {26358, 158627, 1540008299, 1, 1540008299}, {26358, 158623, 1540008299, 1, 1540008299}, {26358, 142416, 1540008299, 1, 1540008299}, {26358, 828103, 1540008299, 1, 1540008299}, {26358, 819629, 1540008299, 1, 1540008299}, {26358, 1113411, 1540008299, 1, 1540008299}, {26358, 453015, 1540008299, 1, 1540008299}, {26358, 453011, 1540008299, 1, 1540008299}, {26358, 1116, 1540008299, 1, 1540008299}, {9516, 516619, 1540008299, 1, 1540008299}, {9516, 516616, 1540008299, 1, 1540008299}, {9516, 422962, 1540008299, 1, 1540008299}, {9516, 187674, 1540008299, 1, 1540008299}, {9516, 3007, 1540008299, 1, 1540008299}, {9516, 1116, 1540008299, 1, 1540008299}, {16646, 516619, 1540008299, 1, 1540008299}, {16646, 516616, 1540008299, 1, 1540008299}, {16646, 279385, 1540008299, 1, 1540008299}, {16646, 244293, 1540008299, 1, 1540008299}, {16646, 1116, 1540008299, 1, 1540008299}, {43982, 516619, 1540008298, 1, 1540008298}, {43982, 516616, 1540008298, 1, 1540008298}, {43982, 833456, 1540008298, 1, 1540008298}, {43982, 832740, 1540008298, 1, 1540008298}, {43982, 1116, 1540008298, 1, 1540008298}, {7732, 516619, 1540008294, 1, 1540008294}, {7732, 516616, 1540008294, 1, 1540008294}, {8787, 1315277, 1540008294, 1, 1540008294}, {8787, 1315276, 1540008294, 1, 1540008294}, {8787, 1315275, 1540008294, 1, 1540008294}, {8787, 1315273, 1540008294, 1, 1540008294}, {8787, 1315272, 1540008294, 1, 1540008294}, {8787, 1084896, 1540008294, 1, 1540008294}, {8787, 1084894, 1540008294, 1, 1540008294}, {8787, 1084766, 1540008294, 1, 1540008294}, {8787, 1084765, 1540008294, 1, 1540008294}, {8787, 973557, 1540008294, 1, 1540008294}, {8787, 973497, 1540008294, 1, 1540008294}, {8787, 973303, 1540008294, 1, 1540008294}, {8787, 765557, 1540008294, 1, 1540008294}, {8787, 697212, 1540008294, 1, 1540008294}, {8787, 685730, 1540008294, 1, 1540008294}, {8787, 685727, 1540008294, 1, 1540008294}, {8787, 685723, 1540008294, 1, 1540008294}, {8787, 685624, 1540008294, 1, 1540008294}, {8787, 671901, 1540008294, 1, 1540008294}, {8787, 287241, 1540008294, 1, 1540008294}, {8787, 179159, 1540008294, 1, 1540008294}, {8787, 158627, 1540008294, 1, 1540008294}, {8787, 158623, 1540008294, 1, 1540008294}, {8787, 142416, 1540008294, 1, 1540008294}, {8787, 36903, 1540008294, 1, 1540008294}, {8787, 2090, 1540008294, 1, 1540008294}, {9980, 1082754, 1540008294, 1, 1540008294}, {7732, 185880, 1540008294, 1, 1540008294}, {7732, 1119, 1540008294, 1, 1540008294}, {7732, 1116, 1540008294, 1, 1540008294}, {20487, 516619, 1540008292, 1, 1540008292}, {20487, 516616, 1540008292, 1, 1540008292}, {20487, 364206, 1540008292, 1, 1540008292}, {20487, 358960, 1540008292, 1, 1540008292}, {20487, 1116, 1540008292, 1, 1540008292}, {41111, 516619, 1540008292, 3, 1540008292}, {41111, 516616, 1540008292, 3, 1540008292}, {41111, 742014, 1540008292, 3, 1540008292}, {41111, 740077, 1540008292, 3, 1540008292}, {41111, 1116, 1540008292, 3, 1540008292}, {29860, 516619, 1538708906, 1, 1538708906}, {29860, 516616, 1538708906, 1, 1538708906}, {29860, 514572, 1538708906, 1, 1538708906}, {29860, 496357, 1538708906, 1, 1538708906}, {29860, 1116, 1538708906, 1, 1538708906}} + cll = SliceListInt64(ll) +) + +// SliceInt64 is a custom data type +type SliceInt64 []int64 + +// Len implements the ListIter interface +func (sli SliceInt64) Len() int { + return len(sli) +} + +// PackList implements the ListIter interface +func (sli SliceInt64) PackList(buf as.BufferEx) (int, error) { + size := 0 + for _, elem := range sli { + n, err := as.PackInt64(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// SliceListInt64 is a custom data type +type SliceListInt64 [][]int64 + +// Len returns the length of the array +func (sli SliceListInt64) Len() int { + return len(sli) +} + +// PackList implements the ListIter interface +func (sli SliceListInt64) PackList(buf as.BufferEx) (int, error) { + size := 0 + for _, l := range sli { + n, err := as.PackList(buf, SliceInt64(l)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "addkey") + shared.PanicOnError(err) + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + bin := as.NewBin("bin", ll) + b := time.Now() + for i := 0; i < 10000; i++ { + if err := client.PutBins(shared.WritePolicy, key, bin); err != nil { + log.Panicf("Get failed %s: %s", key, err) + } + } + t := time.Since(b) + log.Println("Performance WITHOUT custom iterator:", t) + + bin = as.NewBin("bin", cll) + b = time.Now() + for i := 0; i < 10000; i++ { + if err := client.PutBins(shared.WritePolicy, key, bin); err != nil { + log.Panicf("Get failed %s: %s", key, err) + } + } + t = time.Since(b) + log.Println("Performance WITH custom iterator:", t) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + // The value received from the server is an unsigned byte stream. + // Convert to an integer before comparing with expected. + received := [][]int64{} // returns as [][]interface{}, need to be converted + for _, l1 := range record.Bins[bin.Name].([]interface{}) { + l := []int64{} + for _, l2 := range l1.([]interface{}) { + l = append(l, int64(l2.(int))) + } + received = append(received, l) + } + expected := ll + + if reflect.DeepEqual(received, expected) { + log.Printf("Packing successful: ns=%s set=%s key=%s bin=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name) + } else { + log.Fatalf("Packing mismatch: Expected %#v.\n Received %#v.", expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go b/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go new file mode 100644 index 00000000..59e70437 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go @@ -0,0 +1,140 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "math" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +func main() { + expireExample(shared.Client) + noExpireExample(shared.Client) + + log.Println("Example finished successfully.") +} + +/** + * Write and twice read an expiration record. + */ +func expireExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "expirekey") + bin := as.NewBin("expirebin", "expirevalue") + + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expiration=2", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) + + // Specify that record expires 2 seconds after it's written. + writePolicy := as.NewWritePolicy(0, 2) + client.PutBins(writePolicy, key, bin) + + // Read the record before it expires, showing it is there. + log.Printf("Get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + if record == nil { + log.Fatalf( + "Failed to get record: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + received := record.Bins[bin.Name] + expected := bin.Value.String() + if received == expected { + log.Printf("Get record successful: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Expire record mismatch: Expected %s. Received %s.", + expected, received) + } + + // Read the record after it expires, showing it's gone. + log.Printf("Sleeping for 3 seconds ...") + time.Sleep(3 * time.Second) + record, err = client.Get(shared.Policy, key, bin.Name) + if ae, ok := err.(*as.AerospikeError); !ok || ae.ResultCode != ast.KEY_NOT_FOUND_ERROR { + shared.PanicOnError(err) + } + if record == nil { + log.Printf("Expiry of record successful. Record not found.") + } else { + log.Fatalf("Found record when it should have expired.") + } +} + +/** + * Write and twice read a non-expiring tuple using the new "NoExpire" value (-1). + * This example is most effective when the Default Namespace Time To Live (TTL) + * is set to a small value, such as 5 seconds. When we sleep beyond that + * time, we show that the NoExpire TTL flag actually works. + */ +func noExpireExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "expirekey") + bin := as.NewBin("expirebin", "noexpirevalue") + + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expiration=NoExpire", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) + + // Specify that record NEVER expires. + // The "Never Expire" value is -1, or 0xFFFFFFFF. + writePolicy := as.NewWritePolicy(0, 2) + writePolicy.Expiration = math.MaxUint32 + client.PutBins(writePolicy, key, bin) + + // Read the record, showing it is there. + log.Printf("Get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + if record == nil { + log.Fatalf( + "Failed to get record: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + received := record.Bins[bin.Name] + expected := bin.Value.String() + if received == expected { + log.Printf("Get record successful: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Expire record mismatch: Expected %s. Received %s.", + expected, received) + } + + // Read this Record after the Default Expiration, showing it is still there. + // We should have set the Namespace TTL at 5 sec. + log.Printf("Sleeping for 10 seconds ...") + time.Sleep(10 * time.Second) + record, err = client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf("Record expired and should NOT have.") + } + log.Printf("Found Record (correctly) after default TTL.") + +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go b/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go new file mode 100644 index 00000000..4b8a8dee --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go @@ -0,0 +1,85 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "strings" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + testKeyRegex(shared.Client) + + log.Println("Example finished successfully.") +} + +/** + * Use an expression to regex compare on a key + */ +func testKeyRegex(client *as.Client) { + wp := as.NewWritePolicy(0, 0) + wp.SendKey = true + + if err := client.Truncate(nil, *shared.Namespace, *shared.Set, nil); err != nil { + log.Fatalln(err.Error()) + } + + putBins(wp, "jacksapplekey1", as.BinMap{"Jack": 26}) + putBins(wp, "jillgrapekey2", as.BinMap{"Jill": 20}) + putBins(wp, "mangokey3", as.BinMap{"James": 38}) + putBins(wp, "Jimkey4apple", as.BinMap{"Jim": 46}) + putBins(wp, "JuliaGrapekey5", as.BinMap{"Julia": 62}) + putBins(wp, "SallyMANGOkey6", as.BinMap{"Sally": 32}) + putBins(wp, "SeanaPPlekey7", as.BinMap{"Sean": 24}) + putBins(wp, "SamGRAPEkey8", as.BinMap{"Sam": 12}) + putBins(wp, "Susankey9", as.BinMap{"Susan": 42}) + putBins(wp, "SandraPeachkey0", as.BinMap{"Sandra": 34}) + + stmt := as.NewStatement(*shared.Namespace, *shared.Set) + exp := as.ExpRegexCompare("^.*apple.*", as.ExpRegexFlagICASE, as.ExpKey(as.ExpTypeSTRING)) + + qp := as.NewQueryPolicy() + qp.FilterExpression = exp + rs, err := client.Query(qp, stmt) + if err != nil { + log.Fatalln(err.Error()) + } + + for res := range rs.Results() { + if res.Err != nil { + log.Fatalln(err.Error()) + } + log.Println(res.Record) + if !strings.Contains(strings.ToLower(res.Record.Key.Value().GetObject().(string)), "apple") { + log.Fatalf("Wrong key returned: %s. Expected to include 'apple' (case-insensitive)", res.Record.Key.Value()) + } + } +} + +func putBins(wp *as.WritePolicy, akey string, bins as.BinMap) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, akey) + if err != nil { + log.Fatalln(err.Error()) + } + if err = shared.Client.Put(wp, key, bins); err != nil { + log.Fatalln(err.Error()) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go b/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go new file mode 100644 index 00000000..fa4f9a14 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go @@ -0,0 +1,123 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "errors" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +func main() { + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "genkey") + binName := "genbin" + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + // Set some values for the same record. + bin := as.NewBin(binName, "genvalue1") + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) + + client.PutBins(shared.WritePolicy, key, bin) + + bin = as.NewBin(binName, "genvalue2") + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) + + client.PutBins(shared.WritePolicy, key, bin) + + // Retrieve record and its generation count. + record, err := client.Get(shared.Policy, key, bin.Name) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + received := record.Bins[bin.Name] + expected := bin.Value.String() + + if received == expected { + log.Printf("Get successful: namespace=%s set=%s key=%s bin=%s value=%s generation=%d", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received, record.Generation) + } else { + log.Fatalf("Get mismatch: Expected %s. Received %s.", + expected, received) + } + + // Set record and fail if it's not the expected generation. + bin = as.NewBin(binName, "genvalue3") + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expected generation=%d", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, record.Generation) + + writePolicy := as.NewWritePolicy(0, 2) + writePolicy.GenerationPolicy = as.EXPECT_GEN_EQUAL + writePolicy.Generation = record.Generation + client.PutBins(writePolicy, key, bin) + + // Set record with invalid generation and check results . + bin = as.NewBin(binName, "genvalue4") + writePolicy.Generation = 9999 + log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expected generation=%d", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, writePolicy.Generation) + + err = client.PutBins(writePolicy, key, bin) + if err != nil { + if ae, ok := err.(*as.AerospikeError); ok && ae.ResultCode != ast.GENERATION_ERROR { + shared.PanicOnError(errors.New("Should have received generation error instead of success")) + } + log.Printf("Success: Generation error returned as expected.") + } else { + log.Fatalf( + "Unexpected set return code: namespace=%s set=%s key=%s bin=%s value=%s code=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, err) + } + + // Verify results. + record, err = client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + received = record.Bins[bin.Name] + expected = "genvalue3" + + if received == expected { + log.Printf("Get successful: namespace=%s set=%s key=%s bin=%s value=%s generation=%d", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received, record.Generation) + } else { + log.Fatalf("Get mismatch: Expected %s. Received %s.", + expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go b/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go new file mode 100644 index 00000000..1afece68 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go @@ -0,0 +1,92 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package main + +import ( + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + prepareExample(shared.Client) + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func prepareExample(client *as.Client) { + // The Data + bins := []as.BinMap{ + { + "name": "Bike Shop", + "demand": 17923, + "capacity": 17, + "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.009318762,80.003157854]}`), + }, + { + "name": "Residential Block", + "demand": 2429, + "capacity": 2974, + "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.00961276, 80.003422154]}`), + }, + { + "name": "Restaurant", + "demand": 49589, + "capacity": 4231, + "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.009318762,80.003157854]}`), + }, + { + "name": "Cafe", + "demand": 247859, + "capacity": 26, + "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.00961276, 80.003422154]}`), + }, + } + + // write the records to the database + for i, b := range bins { + // define some bins + key, _ := as.NewKey(*shared.Namespace, *shared.Set, i) + err := client.Put(nil, key, b) + shared.PanicOnError(err) + } + + log.Println("Sample records were written to the disk...") + + // queries only work on indices; you should create the index only once + // The index is created on the namespace, set and bin that should be indexed. + client.CreateIndex(nil, *shared.Namespace, *shared.Set, "testset_geo_index", "coord", as.GEO2DSPHERE) +} + +func runExample(client *as.Client) { + stm := as.NewStatement(*shared.Namespace, *shared.Set) + // there are multiple different types of filters. You can find the list in the docs. + stm.SetFilter(as.NewGeoWithinRadiusFilter("coord", float64(13.009318762), float64(80.003157854), float64(50000))) + recordset, err := client.Query(nil, stm) + shared.PanicOnError(err) + + count := 0 + for res := range recordset.Results() { + shared.PanicOnError(res.Err) + log.Println(res.Record.Bins) + count++ + } + + // 4 region should be found + log.Println("Records found:", count) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore b/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore new file mode 100644 index 00000000..bb69de41 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore @@ -0,0 +1 @@ +get \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go b/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go new file mode 100644 index 00000000..4c6847b3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go @@ -0,0 +1,92 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "flag" + "fmt" + "os" + "strconv" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var ( + host = "127.0.0.1" + port = 3000 + namespace = "test" + set = "demo" +) + +func main() { + + var err error + + // arguments + flag.StringVar(&host, "host", host, "Remote host") + flag.IntVar(&port, "port", port, "Remote port") + flag.StringVar(&namespace, "namespace", namespace, "Namespace") + flag.StringVar(&set, "set", set, "Set name") + + // parse flags + flag.Parse() + + // args + args := flag.Args() + + if len(args) < 1 { + printError("Missing argument") + } + + client, err := as.NewClient(host, port) + panicOnError(err) + + var key *as.Key + + skey := flag.Arg(0) + ikey, err := strconv.ParseInt(skey, 10, 64) + if err == nil { + key, err = as.NewKey(namespace, set, ikey) + panicOnError(err) + } else { + key, err = as.NewKey(namespace, set, skey) + panicOnError(err) + } + + policy := as.NewPolicy() + rec, err := client.Get(policy, key) + panicOnError(err) + if rec != nil { + printOK("%v", rec.Bins) + } else { + printError("record not found: namespace=%s set=%s key=%v", key.Namespace(), key.SetName(), key.Value()) + } +} + +func panicOnError(err error) { + if err != nil { + panic(err) + } +} + +func printOK(format string, a ...interface{}) { + fmt.Printf("ok: "+format+"\n", a...) + os.Exit(0) +} + +func printError(format string, a ...interface{}) { + fmt.Printf("error: "+format+"\n", a...) + os.Exit(1) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go b/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go new file mode 100644 index 00000000..8a24b309 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go @@ -0,0 +1,55 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func main() { + // remove timestamps from log messages + log.SetFlags(0) + + // connect to the host + cp := as.NewClientPolicy() + cp.Timeout = 10 * time.Second + + // cp.User = "admin" + // cp.Password = "admin" + + conn, err := as.NewConnection(cp, as.NewHost("localhost", 3000)) + if err != nil { + log.Fatalln(err.Error()) + } + + // Login if needed + // if err := conn.Login(cp); err != nil { + // log.Fatalln(err.Error()) + // } + + infoMap, err := conn.RequestInfo("") + if err != nil { + log.Fatalln(err.Error()) + } + + cnt := 1 + for k, v := range infoMap { + log.Printf("%d : %s\n %s\n", cnt, k, v) + cnt++ + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go b/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go new file mode 100644 index 00000000..9ad559ab --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go @@ -0,0 +1,282 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "bytes" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + testListStrings(shared.Client) + testListComplex(shared.Client) + testMapStrings(shared.Client) + testMapComplex(shared.Client) + testListMapCombined(shared.Client) + testListOperate(shared.Client) + + log.Println("Example finished successfully.") +} + +/** + * Write/Read []string directly instead of relying on java serializer. + */ +func testListStrings(client *as.Client) { + log.Printf("Read/Write []string") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey1") + client.Delete(shared.WritePolicy, key) + + list := []string{"string1", "string2", "string3"} + + bin := as.NewBin("listbin1", list) + client.PutBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + receivedList := record.Bins[bin.Name].([]interface{}) + + validateSize(3, len(receivedList)) + validate("string1", receivedList[0]) + validate("string2", receivedList[1]) + validate("string3", receivedList[2]) + + log.Printf("Read/Write []string successful.") +} + +/** + * Write/Read []interface{} directly instead of relying on java serializer. + */ +func testListComplex(client *as.Client) { + log.Printf("Read/Write []interface{}") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey2") + client.Delete(shared.WritePolicy, key) + + blob := []byte{3, 52, 125} + list := []interface{}{"string1", 2, blob} + + bin := as.NewBin("listbin2", list) + client.PutBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + receivedList := record.Bins[bin.Name].([]interface{}) + + validateSize(3, len(receivedList)) + validate("string1", receivedList[0]) + // Server convert numbers to long, so must expect long. + validate(2, receivedList[1]) + validateBytes(blob, receivedList[2].([]byte)) + + log.Printf("Read/Write []interface{} successful.") +} + +/** + * Write/Read map[string]string directly instead of relying on java serializer. + */ +func testMapStrings(client *as.Client) { + log.Printf("Read/Write map[string]string") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "mapkey1") + client.Delete(shared.WritePolicy, key) + + amap := map[string]string{"key1": "string1", + "key2": "string2", + "key3": "string3", + } + bin := as.NewBin("mapbin1", amap) + client.PutBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + receivedMap := record.Bins[bin.Name].(map[interface{}]interface{}) + + validateSize(3, len(receivedMap)) + validate("string1", receivedMap["key1"]) + validate("string2", receivedMap["key2"]) + validate("string3", receivedMap["key3"]) + + log.Printf("Read/Write map[string]string successful") +} + +/** + * Write/Read map[interface{}]interface{} directly instead of relying on java serializer. + */ +func testMapComplex(client *as.Client) { + log.Printf("Read/Write map[interface{}]interface{}") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "mapkey2") + client.Delete(shared.WritePolicy, key) + + blob := []byte{3, 52, 125} + list := []int{ + 100034, + 12384955, + 3, + 512, + } + + amap := map[interface{}]interface{}{ + "key1": "string1", + "key2": 2, + "key3": blob, + "key4": list, + } + + bin := as.NewBin("mapbin2", amap) + client.PutBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + receivedMap := record.Bins[bin.Name].(map[interface{}]interface{}) + + validateSize(4, len(receivedMap)) + validate("string1", receivedMap["key1"]) + // Server convert numbers to long, so must expect long. + validate(2, receivedMap["key2"]) + validateBytes(blob, receivedMap["key3"].([]byte)) + + receivedInner := receivedMap["key4"].([]interface{}) + validateSize(4, len(receivedInner)) + validate(100034, receivedInner[0]) + validate(12384955, receivedInner[1]) + validate(3, receivedInner[2]) + validate(512, receivedInner[3]) + + log.Printf("Read/Write map[interface{}]interface{} successful") +} + +/** + * Write/Read Array/Map combination directly instead of relying on java serializer. + */ +func testListMapCombined(client *as.Client) { + log.Printf("Read/Write Array/Map") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listmapkey") + client.Delete(shared.WritePolicy, key) + + blob := []byte{3, 52, 125} + inner := []interface{}{ + "string2", + 5, + } + + innerMap := map[interface{}]interface{}{ + "a": 1, + 2: "b", + 3: blob, + "list": inner, + } + + list := []interface{}{ + "string1", + 8, + inner, + innerMap, + } + + bin := as.NewBin("listmapbin", list) + client.PutBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + received := record.Bins[bin.Name].([]interface{}) + + validateSize(4, len(received)) + validate("string1", received[0]) + // Server convert numbers to long, so must expect long. + validate(8, received[1]) + + receivedInner := received[2].([]interface{}) + validateSize(2, len(receivedInner)) + validate("string2", receivedInner[0]) + validate(5, receivedInner[1]) + + receivedMap := received[3].(map[interface{}]interface{}) + validateSize(4, len(receivedMap)) + validate(1, receivedMap["a"]) + validate("b", receivedMap[2]) + validateBytes(blob, receivedMap[3].([]byte)) + + receivedInner2 := receivedMap["list"].([]interface{}) + validateSize(2, len(receivedInner2)) + validate("string2", receivedInner2[0]) + validate(5, receivedInner2[1]) + + log.Printf("Read/Write Array/Map successful") +} + +/** + * Write/Read a single item into a list using the operate command + */ +func testListOperate(client *as.Client) { + log.Printf("Read/Write List operate") + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey1") + client.Delete(shared.WritePolicy, key) + + alist := []string{"string1", "string2", "string3"} + + // Create a list as a bin + bin := as.NewBin("listbin1", alist) + client.PutBins(shared.WritePolicy, key, bin) + + writePolicy := as.NewWritePolicy(0, 0) + listPolicy := as.NewListPolicy(as.ListOrderUnordered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsNoFail) + + // add a unique item to the list as an operate command + _, err := client.Operate(writePolicy, key, + as.ListAppendWithPolicyOp(listPolicy, "listbin1", "string4")) + shared.PanicOnError(err) + + // add (ignore) duplicate value in the list + _, err = client.Operate(writePolicy, key, + as.ListAppendWithPolicyOp(listPolicy, "listbin1", "string4")) + shared.PanicOnError(err) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + receivedList := record.Bins[bin.Name].([]interface{}) + validateSize(4, len(receivedList)) + validate("string1", receivedList[0]) + validate("string2", receivedList[1]) + validate("string3", receivedList[2]) + validate("string4", receivedList[3]) + + log.Printf("Read/Write list operate successful") +} + +func validateSize(expected, received int) { + if received != expected { + log.Fatalf( + "Size mismatch: expected=%d received=%d", expected, received) + } +} + +func validate(expected, received interface{}) { + if !(received == expected) { + log.Fatalf( + "Mismatch: expected=%v received=%v", expected, received) + } +} + +func validateBytes(expected []byte, received []byte) { + if !bytes.Equal(expected, received) { + log.Fatalf( + "Mismatch: expected=%v received=%v", expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go b/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go new file mode 100644 index 00000000..c180a277 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go @@ -0,0 +1,61 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + // Write initial record. + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "opkey") + bin1 := as.NewBin("optintbin", 7) + bin2 := as.NewBin("optstringbin", "string value") + log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", + key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) + client.PutBins(shared.WritePolicy, key, bin1, bin2) + + // Add integer, write new string and read record. + bin3 := as.NewBin(bin1.Name, 4) + bin4 := as.NewBin(bin2.Name, "new string") + log.Println("Add: ", bin3.Value) + log.Println("Write: ", bin4.Value) + log.Println("Read:") + + record, err := client.Operate(shared.WritePolicy, key, as.AddOp(bin3), as.PutOp(bin4), as.GetOp()) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + binExpected := as.NewBin(bin3.Name, 11) + shared.ValidateBin(key, binExpected, record) + shared.ValidateBin(key, bin4, record) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go b/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go new file mode 100644 index 00000000..430d3ce3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go @@ -0,0 +1,69 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "prependkey") + shared.PanicOnError(err) + + binName := "prependbin" + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + bin := as.NewBin(binName, "World") + log.Println("Initial prepend will create record. Initial value is ", bin.Value, ".") + client.PrependBins(shared.WritePolicy, key, bin) + + bin = as.NewBin(binName, "Hello ") + log.Println("Prepend \"", bin.Value, "\" to existing record.") + client.PrependBins(shared.WritePolicy, key, bin) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + // The value received from the server is an unsigned byte stream. + // Convert to an integer before comparing with expected. + received := record.Bins[bin.Name] + expected := "Hello World" + + if received == expected { + log.Printf("Prepend successful: ns=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Fatalf("Prepend mismatch: Expected %s. Received %s.", expected, received) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore b/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore new file mode 100644 index 00000000..a232311c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore @@ -0,0 +1 @@ +put \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go b/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go new file mode 100644 index 00000000..ea1a42a1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go @@ -0,0 +1,108 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "encoding/json" + "flag" + "fmt" + "os" + "strconv" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var ( + host = "127.0.0.1" + port = 3000 + namespace = "test" + set = "demo" +) + +func main() { + + var err error + + // arguments + flag.StringVar(&host, "host", host, "Remote host") + flag.IntVar(&port, "port", port, "Remote port") + flag.StringVar(&namespace, "namespace", namespace, "Namespace") + flag.StringVar(&set, "set", set, "Set name") + + // parse flags + flag.Parse() + + // args + args := flag.Args() + + if len(args) < 2 { + printError("Missing argument(s)") + } + + client, err := as.NewClient(host, port) + panicOnError(err) + + var key *as.Key + var rec as.BinMap + + skey := flag.Arg(0) + ikey, err := strconv.ParseInt(skey, 10, 64) + if err == nil { + key, err = as.NewKey(namespace, set, ikey) + panicOnError(err) + } else { + key, err = as.NewKey(namespace, set, skey) + panicOnError(err) + } + + srec := flag.Arg(1) + json.Unmarshal([]byte(srec), &rec) + + for k, v := range rec { + switch w := v.(type) { + case float64: + rec[k] = int64(w) + case bool: + if w { + rec[k] = int64(1) + } else { + rec[k] = int64(0) + } + } + } + + policy := as.NewWritePolicy(0, 0) + err = client.Put(policy, key, rec) + panicOnError(err) + if rec != nil { + printError("record updated: namespace=%s set=%s key=%v", key.Namespace(), key.SetName(), key.Value()) + } +} + +func panicOnError(err error) { + if err != nil { + panic(err) + } +} + +func printOK(format string, a ...interface{}) { + fmt.Printf("ok: "+format+"\n", a...) + os.Exit(0) +} + +func printError(format string, a ...interface{}) { + fmt.Printf("error: "+format+"\n", a...) + os.Exit(1) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go b/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go new file mode 100644 index 00000000..ede57ee9 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go @@ -0,0 +1,100 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License") you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "fmt" + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runSingleBinExample(shared.Client) + runMultiBinExample(shared.Client) + runGetHeaderExample(shared.Client) + + log.Println("Example finished successfully.") +} + +// Execute put and get on a server configured as multi-bin. This is the server default. +func runMultiBinExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") + bin1 := as.NewBin("bin1", "value1") + bin2 := as.NewBin("bin2", "value2") + + log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", + key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) + + client.PutBins(shared.WritePolicy, key, bin1, bin2) + + log.Printf("Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) + + record, err := client.Get(shared.Policy, key) + shared.PanicOnError(err) + + if record == nil { + panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) + } + + shared.ValidateBin(key, bin1, record) + shared.ValidateBin(key, bin2, record) +} + +// Execute put and get on a server configured as single-bin. +func runSingleBinExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") + bin := as.NewBin("", "value") + + log.Printf("Single Put: namespace=%s set=%s key=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Value) + + client.PutBins(shared.WritePolicy, key, bin) + + log.Printf("Single Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) + + record, err := client.Get(shared.Policy, key) + shared.PanicOnError(err) + + if record == nil { + panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) + } + + shared.ValidateBin(key, bin, record) +} + +// Read record header data. +func runGetHeaderExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") + + log.Printf("Get record header: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) + record, err := client.GetHeader(shared.Policy, key) + shared.PanicOnError(err) + + if record == nil { + panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) + } + + // Generation should be greater than zero. Make sure it's populated. + if record.Generation == 0 { + panic(fmt.Errorf("Invalid record header: generation=%d expiration=%d", record.Generation, record.Expiration)) + } + log.Printf("Received: generation=%d expiration=%d (%s)\n", record.Generation, record.Expiration, time.Duration(record.Expiration)*time.Second) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go new file mode 100644 index 00000000..e5b39060 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go @@ -0,0 +1,72 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "os" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +const keyCount = 1000 + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + // Set LuaPath + luaPath, _ := os.Getwd() + luaPath += "/udf/" + as.SetLuaPath(luaPath) + + filename := "average" + regTask, err := client.RegisterUDFFromFile(nil, luaPath+filename+".lua", filename+".lua", as.LUA) + shared.PanicOnError(err) + + // wait until UDF is created + shared.PanicOnError(<-regTask.OnComplete()) + + sum := 0 + for i := 1; i <= keyCount; i++ { + sum += i + key, err := as.NewKey(*shared.Namespace, *shared.Set, i) + shared.PanicOnError(err) + + bin1 := as.NewBin("bin1", i) + client.PutBins(nil, key, bin1) + } + + average := float64(sum) / float64(keyCount) + + t := time.Now() + stm := as.NewStatement(*shared.Namespace, *shared.Set) + res, err := client.QueryAggregate(nil, stm, filename, filename, as.StringValue("bin1")) + shared.PanicOnError(err) + + for rec := range res.Results() { + res := rec.Record.Bins["SUCCESS"].(map[interface{}]interface{}) + log.Printf("Result from Map/Reduce: %v\n", res) + log.Printf("Result %f should equal %f\n", res["sum"].(float64)/res["count"].(float64), average) + } + log.Println("Map/Reduce took", time.Now().Sub(t)) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go new file mode 100644 index 00000000..9099aeb8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go @@ -0,0 +1,68 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "os" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +const keyCount = 1000 + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + // Set LuaPath + luaPath, _ := os.Getwd() + luaPath += "/udf/" + as.SetLuaPath(luaPath) + + filename := "sum_single_bin" + regTask, err := client.RegisterUDFFromFile(nil, luaPath+filename+".lua", filename+".lua", as.LUA) + shared.PanicOnError(err) + + // wait until UDF is created + shared.PanicOnError(<-regTask.OnComplete()) + + sum := 0 + for i := 1; i <= keyCount; i++ { + sum += i + key, err := as.NewKey(*shared.Namespace, *shared.Set, i) + shared.PanicOnError(err) + + bin1 := as.NewBin("bin1", i) + client.PutBins(nil, key, bin1) + } + + t := time.Now() + stm := as.NewStatement(*shared.Namespace, *shared.Set) + res, err := client.QueryAggregate(nil, stm, filename, filename, as.StringValue("bin1")) + shared.PanicOnError(err) + + for rec := range res.Results() { + log.Printf("Result %f should equal %d\n", rec.Record.Bins["SUCCESS"], sum) + } + log.Println("Map/Reduce took", time.Now().Sub(t)) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua new file mode 100644 index 00000000..053e3ca1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua @@ -0,0 +1,18 @@ +function average(s, name) + + local function mapper(out, rec) + out['sum'] = (out['sum'] or 0) + (rec[name] or 0) + out['count'] = (out['count'] or 0) + 1 + return out + end + + local function reducer(a, b) + local out = map() + + out['sum'] = a['sum'] + b['sum'] + out['count'] = a['count'] + b['count'] + return out + end + + return s : aggregate(map{sum = 0, count = 0}, mapper) : reduce(reducer) +end diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua new file mode 100644 index 00000000..d273521e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua @@ -0,0 +1,11 @@ +local function reducer(val1,val2) + return val1 + val2 +end + +function sum_single_bin(stream,name) + local function mapper(rec) + return rec[name] + end + + return stream : map(mapper) : reduce(reducer) +end diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go b/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go new file mode 100644 index 00000000..8966a3ae --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go @@ -0,0 +1,98 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "errors" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +func main() { + runReplaceExample(shared.Client) + runReplaceOnlyExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func runReplaceExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "replacekey") + shared.PanicOnError(err) + bin1 := as.NewBin("bin1", "value1") + bin2 := as.NewBin("bin2", "value2") + bin3 := as.NewBin("bin3", "value3") + + log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", + key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) + + shared.PanicOnError(client.PutBins(shared.WritePolicy, key, bin1, bin2)) + + log.Printf("Replace with: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin3.Name, bin3.Value) + + wpolicy := as.NewWritePolicy(0, 0) + wpolicy.RecordExistsAction = as.REPLACE + client.PutBins(wpolicy, key, bin3) + + log.Printf("Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) + + record, err := client.Get(shared.Policy, key) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) + } + + if record.Bins[bin1.Name] == nil { + log.Printf(bin1.Name + " was deleted as expected.") + } else { + log.Fatalln(bin1.Name + " found when it should have been deleted.") + } + + if record.Bins[bin2.Name] == nil { + log.Printf(bin2.Name + " was deleted as expected.") + } else { + log.Fatalln(bin2.Name + " found when it should have been deleted.") + } + shared.ValidateBin(key, bin3, record) +} + +func runReplaceOnlyExample(client *as.Client) { + key, err := as.NewKey(*shared.Namespace, *shared.Set, "replaceonlykey") + shared.PanicOnError(err) + bin := as.NewBin("bin", "value") + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + log.Printf("Replace record requiring that it exists: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + + wpolicy := as.NewWritePolicy(0, 0) + wpolicy.RecordExistsAction = as.REPLACE_ONLY + err = client.PutBins(wpolicy, key, bin) + if errors.Is(err, &as.AerospikeError{ResultCode: ast.KEY_NOT_FOUND_ERROR}) { + log.Printf("Success. `Not found` error returned as expected.") + } else { + log.Fatalln("Failure. This command should have resulted in an error.") + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go new file mode 100644 index 00000000..d95adeb3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go @@ -0,0 +1,66 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + log.Printf("Scan parallel: namespace=" + *shared.Namespace + " set=" + *shared.Set) + recordCount := 0 + begin := time.Now() + policy := as.NewScanPolicy() + policy.MaxRecords = 30 + + pf := as.NewPartitionFilterAll() + + receivedRecords := 1 + for receivedRecords > 0 { + receivedRecords = 0 + + log.Println("Scanning Page:", recordCount/int(policy.MaxRecords)) + recordset, err := client.ScanPartitions(policy, pf, *shared.Namespace, *shared.Set) + shared.PanicOnError(err) + + for rec := range recordset.Results() { + if rec.Err != nil { + // if there was an error, handle it if needed + // Scans are retried in Aerospike servers v5+ + log.Println(err) + continue + } + + recordCount++ + receivedRecords++ + } + } + + log.Println("Total records returned: ", recordCount) + log.Println("Elapsed time: ", time.Since(begin), " seconds") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go new file mode 100644 index 00000000..3dd36128 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go @@ -0,0 +1,64 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + log.Printf("Scan parallel: namespace=" + *shared.Namespace + " set=" + *shared.Set) + + recordCount := 0 + begin := time.Now() + policy := as.NewScanPolicy() + recordset, err := client.ScanAll(policy, *shared.Namespace, *shared.Set) + shared.PanicOnError(err) + + for rec := range recordset.Results() { + if rec.Err != nil { + // if there was an error, handle it if needed + // Scans are retried in Aerospike servers v5+ + log.Println(err) + continue + } + + recordCount++ + + if (recordCount % 100000) == 0 { + log.Println("Records ", recordCount) + } + } + + end := time.Now() + seconds := float64(end.Sub(begin)) / float64(time.Second) + log.Println("Total records returned: ", recordCount) + log.Println("Elapsed time: ", seconds, " seconds") + performance := shared.Round(float64(recordCount)/float64(seconds), 0.5, 0) + log.Println("Records/second: ", performance) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go new file mode 100644 index 00000000..3f2d0092 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go @@ -0,0 +1,94 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + + log.Println("Example finished successfully.") +} + +// Metrics is a custom data type +type Metrics struct { + count int + total int +} + +var setMap = make(map[string]Metrics) + +func runExample(client *as.Client) { + log.Println("Scan series: namespace=", *shared.Namespace, " set=", *shared.Set) + + // Limit scan to recordsPerSecond. This will take more time, but it will reduce + // the load on the server. + policy := as.NewScanPolicy() + policy.RecordsPerSecond = 5000 + + nodeList := client.GetNodes() + begin := time.Now() + + for _, node := range nodeList { + log.Println("Scan node ", node.GetName()) + recordset, err := client.ScanNode(policy, node, *shared.Namespace, *shared.Set) + shared.PanicOnError(err) + + for res := range recordset.Results() { + if res.Err != nil { + // if there was an error, stop + shared.PanicOnError(err) + } + + rec := res.Record + metrics, exists := setMap[rec.Key.SetName()] + + if !exists { + metrics = Metrics{} + } + metrics.count++ + metrics.total++ + setMap[rec.Key.SetName()] = metrics + } + + for k, v := range setMap { + log.Println("Node ", node, " set ", k, " count: ", v.count) + v.count = 0 + } + } + + end := time.Now() + seconds := float64(end.Sub(begin)) / float64(time.Second) + log.Println("Elapsed time: ", seconds, " seconds") + + total := 0 + + for k, v := range setMap { + log.Println("Total set ", k, " count: ", v.total) + total += v.total + } + log.Println("Grand total: ", total) + performance := shared.Round(float64(total)/seconds, 0.5, 0) + log.Println("Records/second: ", performance) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go b/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go new file mode 100644 index 00000000..47daa04d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go @@ -0,0 +1,132 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package shared + +import ( + "bytes" + "flag" + "fmt" + "log" + "math" + "os" + "runtime" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +// WritePolicy is shared for all examples +var WritePolicy = as.NewWritePolicy(0, 0) + +// Policy is shared for all examples +var Policy = as.NewPolicy() + +// Host is shared for all examples +var Host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") + +// Port is shared for all examples +var Port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") + +// User is shared for all examples +var User = flag.String("U", "", "Aerospike username.") + +// Password is shared for all examples +var Password = flag.String("P", "", "Aerospike password.") + +// Namespace is shared for all examples +var Namespace = flag.String("n", "test", "Aerospike namespace.") + +// Set is shared for all examples +var Set = flag.String("s", "testset", "Aerospike set name.") +var showUsage = flag.Bool("u", false, "Show usage information.") + +// Client is shared for all examples +var Client *as.Client + +// ValidateBin takes the original bin and the record retrieved from the database +// and compares their values +func ValidateBin(key *as.Key, bin *as.Bin, record *as.Record) { + if !bytes.Equal(record.Key.Digest(), key.Digest()) { + log.Fatalln(fmt.Sprintf("key `%s` is not the same as key `%s`.", key, record.Key)) + } + + if record.Bins[bin.Name] != bin.Value.GetObject() { + log.Fatalln(fmt.Sprintf("bin `%s: %v` is not the same as bin `%v`.", bin.Name, bin.Value, record.Bins[bin.Name])) + } +} + +// PanicOnError will exit if the error is not nil +func PanicOnError(err error) { + if err != nil { + log.Fatalln(err.Error()) + } +} + +func printParams() { + log.Printf("hosts:\t\t%s", *Host) + log.Printf("port:\t\t%d", *Port) + log.Printf("user:\t\t%s", *User) + log.Printf("password:\t\t%s", "*") + log.Printf("namespace:\t\t%s", *Namespace) + log.Printf("set:\t\t%s", *Set) +} + +// Round takes a float64 nu,ber and rounds it to the parameters +func Round(val float64, roundOn float64, places int) (newVal float64) { + var round float64 + pow := math.Pow(10, float64(places)) + digit := pow * val + _, div := math.Modf(digit) + _div := math.Copysign(div, val) + _roundOn := math.Copysign(roundOn, val) + if _div >= _roundOn { + round = math.Ceil(digit) + } else { + round = math.Floor(digit) + } + newVal = round / pow + return +} + +// reads input flags and interprets the complex ones +func init() { + // use all cpus in the system for concurrency + runtime.GOMAXPROCS(runtime.NumCPU()) + + log.SetOutput(os.Stdout) + + flag.Parse() + + if *showUsage { + flag.Usage() + os.Exit(0) + } + + printParams() + + cp := as.NewClientPolicy() + cp.User = *User + cp.Password = *Password + cp.Timeout = 3 * time.Second + + var err error + Client, err = as.NewClientWithPolicy(cp, *Host, *Port) + if err != nil { + PanicOnError(err) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go b/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go new file mode 100644 index 00000000..2107840f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go @@ -0,0 +1,98 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +func main() { + // define a client to connect to + client, err := as.NewClient("127.0.0.1", 3000) + panicOnError(err) + + namespace := "test" + setName := "aerospike" + key, err := as.NewKey(namespace, setName, "key") // user key can be of any supported type + panicOnError(err) + + // define some bins + bins := as.BinMap{ + "bin1": 42, // you can pass any supported type as bin value + "bin2": "An elephant is a mouse with an operating system", + "bin3": []interface{}{"Go", 17981}, + } + + // write the bins + writePolicy := as.NewWritePolicy(0, 0) + err = client.Put(writePolicy, key, bins) + panicOnError(err) + + // read it back! + readPolicy := as.NewPolicy() + rec, err := client.Get(readPolicy, key) + panicOnError(err) + + fmt.Printf("%#v\n", *rec) + + // Add to bin1 + err = client.Add(writePolicy, key, as.BinMap{"bin1": 1}) + panicOnError(err) + + rec2, err := client.Get(readPolicy, key) + panicOnError(err) + + fmt.Printf("value of %s: %v\n", "bin1", rec2.Bins["bin1"]) + + // prepend and append to bin2 + err = client.Prepend(writePolicy, key, as.BinMap{"bin2": "Frankly: "}) + panicOnError(err) + err = client.Append(writePolicy, key, as.BinMap{"bin2": "."}) + panicOnError(err) + + rec3, err := client.Get(readPolicy, key) + panicOnError(err) + + fmt.Printf("value of %s: %v\n", "bin2", rec3.Bins["bin2"]) + + // delete bin3 + err = client.Put(writePolicy, key, as.BinMap{"bin3": nil}) + rec4, err := client.Get(readPolicy, key) + panicOnError(err) + + fmt.Printf("bin3 does not exist anymore: %#v\n", *rec4) + + // check if key exists + exists, err := client.Exists(readPolicy, key) + panicOnError(err) + fmt.Printf("key exists in the database: %#v\n", exists) + + // delete the key, and check if key exists + existed, err := client.Delete(writePolicy, key) + panicOnError(err) + fmt.Printf("did key exist before delete: %#v\n", existed) + + exists, err = client.Exists(readPolicy, key) + panicOnError(err) + fmt.Printf("key exists: %#v\n", exists) +} + +func panicOnError(err error) { + if err != nil { + panic(err) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go b/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go new file mode 100644 index 00000000..4cdbb4c6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go @@ -0,0 +1,140 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License") you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "crypto/tls" + "crypto/x509" + "flag" + "log" + "os" + "path/filepath" + + as "github.com/aerospike/aerospike-client-go/v7" +) + +var host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") +var port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") +var showUsage = flag.Bool("u", false, "Show usage information.") + +var tlsName = flag.String("tlsName", "", "Aerospike server TLS name") +var encryptOnly = flag.Bool("encryptOnly", false, "Should the TLS connection be encrypted only without authentication?") + +var useSystemCerts = flag.Bool("useSystemCerts", false, "Add system certificates to the RootCA list?") +var serverCertDir = flag.String("serverCertDir", "", "Server certificate dir.") +var clientCertFile = flag.String("clientCertFile", "", "Client Cert File") +var clientKeyFile = flag.String("clientKeyFile", "", "Client Key File") + +func printParams() { + log.Printf("hosts:\t\t%s", *host) + log.Printf("port:\t\t%d", *port) +} + +func main() { + log.SetOutput(os.Stdout) + + flag.Parse() + + if *showUsage { + flag.Usage() + os.Exit(0) + } + + printParams() + serverCertPool, clientCertPool := readCertificates(*serverCertDir, *clientCertFile, *clientKeyFile) + + clientPolicy := as.NewClientPolicy() + + if len(*tlsName) > 0 || *encryptOnly == true { + // Setup TLS Config + tlsConfig := &tls.Config{ + Certificates: clientCertPool, + RootCAs: serverCertPool, + InsecureSkipVerify: *encryptOnly, + PreferServerCipherSuites: true, + } + tlsConfig.BuildNameToCertificate() + + clientPolicy.TlsConfig = tlsConfig + } + + client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) + if err != nil { + log.Fatalln("Failed to connect to the server cluster: ", err) + } + + log.Println("Connection successful. Discovered nodes:", client.Cluster().GetNodes()) + + log.Println("Example finished successfully.") +} + +func readCertificates(serverCertDir string, clientCertFile, clientKeyFile string) (serverPool *x509.CertPool, clientPool []tls.Certificate) { + var err error + + if *useSystemCerts { + // Try to load system CA certs, otherwise just make an empty pool + serverPool, err = x509.SystemCertPool() + if serverPool == nil || err != nil { + log.Printf("FAILED: Adding system certificates to the pool failed: %s", err) + serverPool = x509.NewCertPool() + } + } + + // Load server certs from directory + if len(serverCertDir) > 0 { + serverCerts := dirFiles(serverCertDir) + // Adding server certificates to the pool. + // These certificates are used to verify the identity of the server nodes to the client. + for _, caFile := range serverCerts { + caCert, err := os.ReadFile(caFile) + if err != nil { + log.Fatalf("FAILED: Adding server certificate %s to the pool failed: %s", caFile, err) + } + + log.Printf("Adding server certificate %s to the pool...", caFile) + serverPool.AppendCertsFromPEM(caCert) + } + } + + // Try to load client cert + if len(clientCertFile)+len(clientKeyFile) > 0 { + // Loading the client certificate. + // This certificate is used to verify the identity of the client to the server nodes. + cert, err := tls.LoadX509KeyPair(clientCertFile, clientKeyFile) + if err != nil { + log.Fatalf("FAILED: Adding client certificate %s to the pool failed: %s", clientCertFile, err) + } + + log.Printf("Adding client certificate %s to the pool...", clientCertFile) + clientPool = append(clientPool, cert) + } + + return serverPool, clientPool +} + +func dirFiles(root string) (files []string) { + err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + files = append(files, path) + return nil + }) + if err != nil { + log.Fatalln(err) + } + + return files +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go b/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go new file mode 100644 index 00000000..9b9ab62c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go @@ -0,0 +1,81 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "log" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +func main() { + runExample(shared.Client) + log.Println("Example finished successfully.") +} + +func runExample(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "touchkey") + bin := as.NewBin("touchbin", "touchvalue") + + log.Printf("Create record with 2 second expiration.") + writePolicy := as.NewWritePolicy(0, 2) + client.PutBins(writePolicy, key, bin) + + log.Printf("Touch same record with 5 second expiration.") + writePolicy.Expiration = 5 + record, err := client.Operate(writePolicy, key, as.TouchOp(), as.GetHeaderOp()) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s bin=%s value=nil", + key.Namespace(), key.SetName(), key.Value(), bin.Name) + } + + if record.Expiration == 0 { + log.Fatalf( + "Failed to get record expiration: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + log.Printf("Sleep 3 seconds.") + time.Sleep(3 * time.Second) + + record, err = client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Fatalf( + "Failed to get: namespace=%s set=%s key=%s", + key.Namespace(), key.SetName(), key.Value()) + } + + log.Printf("Success. Record still exists.") + log.Printf("Sleep 4 seconds.") + time.Sleep(4 * time.Second) + + record, err = client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + + if record == nil { + log.Printf("Success. Record expired as expected.") + } else { + log.Fatalf("Found record when it should have expired.") + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go b/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go new file mode 100644 index 00000000..dc0a5115 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go @@ -0,0 +1,281 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package main + +import ( + "bytes" + "log" + + as "github.com/aerospike/aerospike-client-go/v7" + shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" +) + +const udf = ` +local function putBin(r,name,value) + if not aerospike:exists(r) then aerospike:create(r) end + r[name] = value + aerospike:update(r) +end + +-- Set a particular bin +function writeBin(r,name,value) + putBin(r,name,value) +end + +-- Get a particular bin +function readBin(r,name) + return r[name] +end + +-- Return generation count of record +function getGeneration(r) + return record.gen(r) +end + +-- Update record only if gen hasn't changed +function writeIfGenerationNotChanged(r,name,value,gen) + if record.gen(r) == gen then + r[name] = value + aerospike:update(r) + end +end + +-- Set a particular bin only if record does not already exist. +function writeUnique(r,name,value) + if not aerospike:exists(r) then + aerospike:create(r) + r[name] = value + aerospike:update(r) + end +end + +-- Validate value before writing. +function writeWithValidation(r,name,value) + if (value >= 1 and value <= 10) then + putBin(r,name,value) + else + error("1000:Invalid value") + end +end + +-- Record contains two integer bins, name1 and name2. +-- For name1 even integers, add value to existing name1 bin. +-- For name1 integers with a multiple of 5, delete name2 bin. +-- For name1 integers with a multiple of 9, delete record. +function processRecord(r,name1,name2,addValue) + local v = r[name1] + + if (v % 9 == 0) then + aerospike:remove(r) + return + end + + if (v % 5 == 0) then + r[name2] = nil + aerospike:update(r) + return + end + + if (v % 2 == 0) then + r[name1] = v + addValue + aerospike:update(r) + end +end + +-- Set expiration of record +-- function expire(r,ttl) +-- if record.ttl(r) == gen then +-- r[name] = value +-- aerospike:update(r) +-- end +-- end +` + +func main() { + register(shared.Client) + writeUsingUdf(shared.Client) + writeIfGenerationNotChanged(shared.Client) + writeIfNotExists(shared.Client) + writeWithValidation(shared.Client) + writeListMapUsingUdf(shared.Client) + writeBlobUsingUdf(shared.Client) + + log.Println("Example finished successfully.") +} + +func register(client *as.Client) { + task, err := client.RegisterUDF(shared.WritePolicy, []byte(udf), "record_example.lua", as.LUA) + shared.PanicOnError(err) + <-task.OnComplete() +} + +func writeUsingUdf(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey1") + bin := as.NewBin("udfbin1", "string value") + + client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(bin.Name), bin.Value) + + record, err := client.Get(shared.Policy, key, bin.Name) + shared.PanicOnError(err) + expected := bin.Value.String() + received := record.Bins[bin.Name].(string) + + if received == expected { + log.Printf("Data matched: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), bin.Name, received) + } else { + log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) + } +} + +func writeIfGenerationNotChanged(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey2") + bin := as.NewBin("udfbin2", "string value") + + // Seed record. + client.PutBins(shared.WritePolicy, key, bin) + + // Get record generation. + gen, err := client.Execute(shared.WritePolicy, key, "record_example", "getGeneration") + shared.PanicOnError(err) + + // Write record if generation has not changed. + client.Execute(shared.WritePolicy, key, "record_example", "writeIfGenerationNotChanged", as.NewValue(bin.Name), bin.Value, as.NewValue(gen)) + log.Printf("Record written.") +} + +func writeIfNotExists(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey3") + binName := "udfbin3" + + // Delete record if it already exists. + client.Delete(shared.WritePolicy, key) + + // Write record only if not already exists. This should succeed. + client.Execute(shared.WritePolicy, key, "record_example", "writeUnique", as.NewValue(binName), as.NewValue("first")) + + // Verify record written. + record, err := client.Get(shared.Policy, key, binName) + shared.PanicOnError(err) + expected := "first" + received := record.Bins[binName].(string) + + if received == expected { + log.Printf("Record written: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), binName, received) + } else { + log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) + } + + // Write record second time. This should fail. + log.Printf("Attempt second write.") + client.Execute(shared.WritePolicy, key, "record_example", "writeUnique", as.NewValue(binName), as.NewValue("second")) + + // Verify record not written. + record, err = client.Get(shared.Policy, key, binName) + shared.PanicOnError(err) + received = record.Bins[binName].(string) + + if received == expected { + log.Printf("Success. Record remained unchanged: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), binName, received) + } else { + log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) + } +} + +func writeWithValidation(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey4") + binName := "udfbin4" + + // Lua function writeWithValidation accepts number between 1 and 10. + // Write record with valid value. + log.Printf("Write with valid value.") + client.Execute(shared.WritePolicy, key, "record_example", "writeWithValidation", as.NewValue(binName), as.NewValue(4)) + + // Write record with invalid value. + log.Printf("Write with invalid value.") + + _, err := client.Execute(shared.WritePolicy, key, "record_example", "writeWithValidation", as.NewValue(binName), as.NewValue(11)) + if err == nil { + log.Printf("UDF should not have succeeded!") + } else { + log.Printf("Success. UDF resulted in exception as expected.") + } +} + +func writeListMapUsingUdf(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey5") + + inner := []interface{}{"string2", int64(8)} + innerMap := map[interface{}]interface{}{"a": int64(1), int64(2): "b", "list": inner} + list := []interface{}{"string1", int64(4), inner, innerMap} + + binName := "udfbin5" + + client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(binName), as.NewValue(list)) + + received, err := client.Execute(shared.WritePolicy, key, "record_example", "readBin", as.NewValue(binName)) + shared.PanicOnError(err) + + if testEq(received.([]interface{}), list) { + log.Printf("UDF data matched: namespace=%s set=%s key=%s bin=%s value=%s", + key.Namespace(), key.SetName(), key.Value(), binName, received) + } else { + log.Println("UDF data mismatch") + log.Println("Expected ", list) + log.Println("Received ", received) + } +} + +func writeBlobUsingUdf(client *as.Client) { + key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey6") + binName := "udfbin6" + + // Create packed blob using standard java tools. + dos := bytes.Buffer{} + // dos.Write(9845) + dos.WriteString("Hello world.") + blob := dos.Bytes() + + client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(binName), as.NewValue(blob)) + received, err := client.Execute(shared.WritePolicy, key, "record_example", "readBin", as.NewValue(binName)) + shared.PanicOnError(err) + + if bytes.Equal(blob, received.([]byte)) { + log.Printf("Blob data matched: namespace=%s set=%s key=%s bin=%v value=%v", + key.Namespace(), key.SetName(), key.Value(), binName, received) + } else { + log.Fatalf( + "Mismatch: expected=%v received=%v", blob, received) + } +} + +func testEq(a, b []interface{}) bool { + if len(a) != len(b) { + return false + } + + for i := range a { + if a[i] != b[i] { + return false + } + } + + return true +} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_command.go b/aerospike-tls/vendor-aerospike-client-go/execute_command.go new file mode 100644 index 00000000..9877a70c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/execute_command.go @@ -0,0 +1,81 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type executeCommand struct { + readCommand + + // overwrite + policy *WritePolicy + packageName string + functionName string + args *ValueArray +} + +func newExecuteCommand( + cluster *Cluster, + policy *WritePolicy, + key *Key, + packageName string, + functionName string, + args *ValueArray, +) (executeCommand, Error) { + var err Error + var partition *Partition + if cluster != nil { + partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) + if err != nil { + return executeCommand{}, err + } + } + + readCommand, err := newReadCommand(cluster, &policy.BasePolicy, key, nil, partition) + if err != nil { + return executeCommand{}, err + } + + return executeCommand{ + readCommand: readCommand, + policy: policy, + packageName: packageName, + functionName: functionName, + args: args, + }, nil +} + +func (cmd *executeCommand) writeBuffer(ifc command) Error { + return cmd.setUdf(cmd.policy, cmd.key, cmd.packageName, cmd.functionName, cmd.args) +} + +func (cmd *executeCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeWrite(cmd.cluster) +} + +func (cmd *executeCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryWrite(isTimeout) + return true +} + +func (cmd *executeCommand) isRead() bool { + return false +} + +func (cmd *executeCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *executeCommand) transactionType() transactionType { + return ttUDF +} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_task.go b/aerospike-tls/vendor-aerospike-client-go/execute_task.go new file mode 100644 index 00000000..9d441f24 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/execute_task.go @@ -0,0 +1,148 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "strconv" + "strings" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// ExecuteTask is used to poll for long running server execute job completion. +type ExecuteTask struct { + *baseTask + + taskID uint64 + scan bool + + clnt ClientIfc + + // The following map keeps an account of what nodes were ever observed with the job registered on them. + // If the job was ever observed, the task will return true for it is not found anymore (purged from task queue after completion) + observed map[string]struct{} +} + +// NewExecuteTask initializes task with fields needed to query server nodes. +func NewExecuteTask(cluster *Cluster, statement *Statement) *ExecuteTask { + return &ExecuteTask{ + baseTask: newTask(cluster), + taskID: statement.TaskId, + scan: statement.IsScan(), + observed: make(map[string]struct{}, len(cluster.GetNodes())), + } +} + +// TaskId returns the task id that was sent to the server. +func (etsk *ExecuteTask) TaskId() uint64 { + return etsk.taskID +} + +// IsDone queries all nodes for task completion status. +func (etsk *ExecuteTask) IsDone() (bool, Error) { + if etsk.clnt != nil { + return etsk.grpcIsDone() + } + + var module string + if etsk.scan { + module = "scan" + } else { + module = "query" + } + + taskId := strconv.FormatUint(etsk.taskID, 10) + + cmd1 := "query-show:trid=" + taskId + cmd2 := module + "-show:trid=" + taskId + cmd3 := "jobs:module=" + module + ";cmd=get-job;trid=" + taskId + + nodes := etsk.cluster.GetNodes() + + for _, node := range nodes { + var command string + if node.SupportsPartitionQuery() { + // query-show works for both scan and query. + command = cmd1 + } else if node.SupportsQueryShow() { + command = cmd2 + } else { + command = cmd3 + } + + responseMap, err := node.requestInfoWithRetry(&etsk.cluster.infoPolicy, 5, command) + if err != nil { + return false, err + } + response := responseMap[command] + + if strings.HasPrefix(response, "ERROR:2") { + // If the server node is v6+, it will immediately put the job on queue, so if it is not found, + // it means that it is completed. + if !node.SupportsPartitionQuery() { + // Task not found. On server prior to v6, this could mean task was already completed or not started yet. + // If the job was not observed before, its completion is in doubt. + // Otherwise it means it was completed. + if _, existed := etsk.observed[node.GetName()]; !existed && etsk.retries.Get() < 20 { + // If the job was not found in some nodes, it may mean that the job was not started yet. + // So we will keep retrying. + return false, nil + } + } + + // Assume the task was completed. + continue + } + + if strings.HasPrefix(response, "ERROR:") { + // Mark done and quit immediately. + return false, newError(types.UDF_BAD_RESPONSE, response) + } + + // mark the node as observed + etsk.observed[node.GetName()] = struct{}{} + + find := "status=" + index := strings.Index(response, find) + + if index < 0 { + return false, nil + } + + begin := index + len(find) + response = response[begin:] + find = ":" + index = strings.Index(response, find) + + if index < 0 { + continue + } + + status := strings.ToLower(response[:index]) + if !strings.HasPrefix(status, "done") { + return false, nil + } + } + + return true, nil +} + +// OnComplete returns a channel which will be closed when the task is +// completed. +// If an error is encountered while performing the task, an error +// will be sent on the channel. +func (etsk *ExecuteTask) OnComplete() chan Error { + return etsk.onComplete(etsk) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go b/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go new file mode 100644 index 00000000..cbd62d7b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go @@ -0,0 +1,22 @@ +//go:build !as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +func (etsk *ExecuteTask) grpcIsDone() (bool, Error) { + // should not be called out of the grpc proxy server context + panic("UNREACHABLE") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exists_command.go b/aerospike-tls/vendor-aerospike-client-go/exists_command.go new file mode 100644 index 00000000..6eebbf9d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exists_command.go @@ -0,0 +1,109 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// guarantee existsCommand implements command interface +var _ command = &existsCommand{} + +type existsCommand struct { + singleCommand + + policy *BasePolicy + exists bool +} + +func newExistsCommand(cluster *Cluster, policy *BasePolicy, key *Key) (*existsCommand, Error) { + var err Error + var partition *Partition + if cluster != nil { + partition, err = PartitionForRead(cluster, policy, key) + if err != nil { + return nil, err + } + } + + return &existsCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + policy: policy, + }, nil +} + +func (cmd *existsCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *existsCommand) writeBuffer(ifc command) Error { + return cmd.setExists(cmd.policy, cmd.key) +} + +func (cmd *existsCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeRead(cmd.cluster) +} + +func (cmd *existsCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryRead(isTimeout) + return true +} + +func (cmd *existsCommand) parseResult(ifc command, conn *Connection) Error { + // Read header. + if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { + return err + } + + header := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(header); err != nil { + return err + } + + resultCode := cmd.dataBuffer[13] & 0xFF + + switch types.ResultCode(resultCode) { + case 0: + cmd.exists = true + case types.KEY_NOT_FOUND_ERROR: + cmd.exists = false + case types.FILTERED_OUT: + if err := cmd.emptySocket(conn); err != nil { + return err + } + cmd.exists = true + return ErrFilteredOut.err() + default: + return newError(types.ResultCode(resultCode)) + } + + return cmd.emptySocket(conn) +} + +func (cmd *existsCommand) Exists() bool { + return cmd.exists +} + +func (cmd *existsCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *existsCommand) transactionType() transactionType { + return ttExists +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_bit.go b/aerospike-tls/vendor-aerospike-client-go/exp_bit.go new file mode 100644 index 00000000..9c392915 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_bit.go @@ -0,0 +1,424 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License.package aerospike + +package aerospike + +const bitwiseMODULE = 1 +const bitwiseINT_FLAGS_SIGNED = 1 + +const ( + _BitExpOpRESIZE = 0 + _BitExpOpINSERT = 1 + _BitExpOpREMOVE = 2 + _BitExpOpSET = 3 + _BitExpOpOR = 4 + _BitExpOpXOR = 5 + _BitExpOpAND = 6 + _BitExpOpNOT = 7 + _BitExpOpLSHIFT = 8 + _BitExpOpRSHIFT = 9 + _BitExpOpADD = 10 + _BitExpOpSUBTRACT = 11 + _BitExpOpSETINT = 12 + _BitExpOpGET = 50 + _BitExpOpCOUNT = 51 + _BitExpOpLSCAN = 52 + _BitExpOpRSCAN = 53 + _BitExpOpGETINT = 54 +) + +// ExpBitResize creates an expression that resizes []byte to byteSize according to resizeFlags +// and returns []byte. +func ExpBitResize( + policy *BitPolicy, + byteSize *Expression, + resizeFlags BitResizeFlags, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpRESIZE), + byteSize, + IntegerValue(policy.flags), + IntegerValue(resizeFlags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitInsert creates an expression that inserts value bytes into []byte bin at byteOffset and returns []byte. +func ExpBitInsert( + policy *BitPolicy, + byteOffset *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpINSERT), + byteOffset, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitRemove creates an expression that removes bytes from []byte bin at byteOffset for byteSize and returns []byte. +func ExpBitRemove( + policy *BitPolicy, + byteOffset *Expression, + byteSize *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpREMOVE), + byteOffset, + byteSize, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitSet creates an expression that sets value on []byte bin at bitOffset for bitSize and returns []byte. +func ExpBitSet( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpSET), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitOr creates an expression that performs bitwise "or" on value and []byte bin at bitOffset for bitSize +// and returns []byte. +func ExpBitOr( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpOR), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitXor creates an expression that performs bitwise "xor" on value and []byte bin at bitOffset for bitSize +// and returns []byte. +func ExpBitXor( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpXOR), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitAnd creates an expression that performs bitwise "and" on value and []byte bin at bitOffset for bitSize +// and returns []byte. +// +// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] +// bitOffset = 23 +// bitSize = 9 +// value = [0b00111100, 0b10000000] +// bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101] +func ExpBitAnd( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpAND), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitNot creates an expression that negates []byte bin starting at bitOffset for bitSize and returns []byte. +func ExpBitNot( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpNOT), + bitOffset, + bitSize, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitLShift creates an expression that shifts left []byte bin starting at bitOffset for bitSize and returns []byte. +func ExpBitLShift( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + shift *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpLSHIFT), + bitOffset, + bitSize, + shift, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitRShift creates an expression that shifts right []byte bin starting at bitOffset for bitSize and returns []byte. +func ExpBitRShift( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + shift *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpRSHIFT), + bitOffset, + bitSize, + shift, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitAdd creates an expression that adds value to []byte bin starting at bitOffset for bitSize and returns []byte. +// `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. +// If add overflows/underflows, `BitOverflowAction` is used. +func ExpBitAdd( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + signed bool, + action BitOverflowAction, + bin *Expression, +) *Expression { + flags := byte(action) + if signed { + flags |= bitwiseINT_FLAGS_SIGNED + } + args := []ExpressionArgument{ + IntegerValue(_BitExpOpADD), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + IntegerValue(flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitSubtract creates an expression that subtracts value from []byte bin starting at bitOffset for bitSize and returns []byte. +// `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. +// If add overflows/underflows, `BitOverflowAction` is used. +func ExpBitSubtract( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + signed bool, + action BitOverflowAction, + bin *Expression, +) *Expression { + flags := byte(action) + if signed { + flags |= bitwiseINT_FLAGS_SIGNED + } + args := []ExpressionArgument{ + IntegerValue(_BitExpOpSUBTRACT), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + IntegerValue(flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitSetInt creates an expression that sets value to []byte bin starting at bitOffset for bitSize and returns []byte. +// `BitSize` must be <= 64. +func ExpBitSetInt( + policy *BitPolicy, + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpSETINT), + bitOffset, + bitSize, + value, + IntegerValue(policy.flags), + } + + return expBitAddWrite(bin, args) +} + +// ExpBitGet creates an expression that returns bits from []byte bin starting at bitOffset for bitSize. +func ExpBitGet( + bitOffset *Expression, + bitSize *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpGET), + bitOffset, + bitSize, + } + + return expBitAddRead(bin, ExpTypeBLOB, args) +} + +// ExpBitCount creates an expression that returns integer count of set bits from []byte bin starting at +// bitOffset for bitSize. +func ExpBitCount( + bitOffset *Expression, + bitSize *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpCOUNT), + bitOffset, + bitSize, + } + + return expBitAddRead(bin, ExpTypeINT, args) +} + +// ExpBitLScan creates an expression that returns integer bit offset of the first specified value bit in []byte bin +// starting at bitOffset for bitSize. +func ExpBitLScan( + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpLSCAN), + bitOffset, + bitSize, + value, + } + + return expBitAddRead(bin, ExpTypeINT, args) +} + +// ExpBitRScan creates an expression that returns integer bit offset of the last specified value bit in []byte bin +// starting at bitOffset for bitSize. +func ExpBitRScan( + bitOffset *Expression, + bitSize *Expression, + value *Expression, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpRSCAN), + bitOffset, + bitSize, + value, + } + + return expBitAddRead(bin, ExpTypeINT, args) +} + +// ExpBitGetInt Create expression that returns integer from []byte bin starting at bitOffset for bitSize. +// Signed indicates if bits should be treated as a signed number. +func ExpBitGetInt( + bitOffset *Expression, + bitSize *Expression, + signed bool, + bin *Expression, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_BitExpOpGETINT), + bitOffset, + bitSize, + } + if signed { + args = append(args, IntegerValue(bitwiseINT_FLAGS_SIGNED)) + } + + return expBitAddRead(bin, ExpTypeINT, args) +} + +func expBitAddWrite(bin *Expression, arguments []ExpressionArgument) *Expression { + flags := int64(bitwiseMODULE | _MODIFY) + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &ExpTypeBLOB, + exps: nil, + arguments: arguments, + } +} + +func expBitAddRead( + bin *Expression, + returnType ExpType, + arguments []ExpressionArgument, +) *Expression { + flags := int64(bitwiseMODULE) + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go new file mode 100644 index 00000000..c0cef8f7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go @@ -0,0 +1,455 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Filters - Bitwise", gg.Ordered, func() { + + const keyCount = 100 + + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + var qpolicy = as.NewQueryPolicy() + + gg.BeforeAll(func() { + for ii := 0; ii < keyCount; ii++ { + key, _ := as.NewKey(ns, set, ii) + bin := as.BinMap{"bin": []byte{0b00000001, 0b01000010}} + client.Delete(wpolicy, key) + err := client.Put(nil, key, bin) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + data := []as.Value{as.NewValue("asd"), as.NewValue(ii)} + data2 := []as.Value{as.NewValue("asd"), as.NewValue(ii), as.NewValue(ii + 1)} + + ops := []*as.Operation{ + as.HLLAddOp( + as.DefaultHLLPolicy(), + "hllbin", + data, + 8, + 0, + ), + as.HLLAddOp( + as.DefaultHLLPolicy(), + "hllbin2", + data2, + 8, + 0, + ), + } + + _, err = client.Operate(nil, key, ops...) + gm.Expect(err).NotTo(gm.HaveOccurred()) + } + }) + + runQuery := func(filter *as.Expression, set_name string) *as.Recordset { + qpolicy.FilterExpression = filter + stmt := as.NewStatement(ns, set_name) + rs, err := client.Query(qpolicy, stmt) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + return rs + } + + countResults := func(rs *as.Recordset) int { + count := 0 + + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + + return count + } + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(16), + as.ExpBlobBin("bin"), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(16), + as.ExpBitResize( + as.DefaultBitPolicy(), + as.ExpIntVal(4), + as.BitResizeFlagsDefault, + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(16), + as.ExpBitInsert( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpBlobVal([]byte{0b11111111}), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(9), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitRemove( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitSet( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobVal([]byte{0b10101010}), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(4), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitOr( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobVal([]byte{0b10101010}), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(5), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitXor( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobVal([]byte{0b10101011}), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(4), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitAnd( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobVal([]byte{0b10101011}), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitNot( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(7), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitLShift( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(16), + as.ExpIntVal(9), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitRShift( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpIntVal(3), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitAdd( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpIntVal(128), + false, + as.BitOverflowActionWrap, + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitSubtract( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpIntVal(1), + false, + as.BitOverflowActionWrap, + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitCount( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBitSetInt( + as.DefaultBitPolicy(), + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpIntVal(255), + as.ExpBlobBin("bin"), + ), + ), + as.ExpIntVal(8), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitGet( + as.ExpIntVal(0), + as.ExpIntVal(8), + as.ExpBlobBin("bin"), + ), + as.ExpBlobVal([]byte{0b00000001}), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitLScan( + as.ExpIntVal(8), + as.ExpIntVal(8), + as.ExpBoolVal(true), + as.ExpBlobBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitRScan( + as.ExpIntVal(8), + as.ExpIntVal(8), + as.ExpBoolVal(true), + as.ExpBlobBin("bin"), + ), + as.ExpIntVal(6), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It(" should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBitGetInt( + as.ExpIntVal(0), + as.ExpIntVal(8), + false, + as.ExpBlobBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_hll.go b/aerospike-tls/vendor-aerospike-client-go/exp_hll.go new file mode 100644 index 00000000..27764513 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_hll.go @@ -0,0 +1,213 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +const hllMODULE int64 = 2 + +var ( + _HllExpOpINIT = 0 + _HllExpOpADD = 1 + _HllExpOpCOUNT = 50 + _HllExpOpUNION = 51 + _HllExpOpUNIONCOUNT = 52 + _HllExpOpINTERSECTCOUNT = 53 + _HllExpOpSIMILARITY = 54 + _HllExpOpDESCRIBE = 55 + _HllExpOpMAYCONTAIN = 56 +) + +// ExpHLLInit creates expression that creates a new HLL or resets an existing HLL. +func ExpHLLInit( + policy *HLLPolicy, + indexBitCount *Expression, + bin *Expression, +) *Expression { + return ExpHLLInitWithMinHash(policy, indexBitCount, ExpIntVal(-1), bin) +} + +// ExpHLLInitWithMinHash creates expression that creates a new HLL or resets an existing HLL with minhash bits. +// indexBitCount + minHashBitCount must be <= 64. +func ExpHLLInitWithMinHash( + policy *HLLPolicy, + indexBitCount *Expression, + minHashCount *Expression, + bin *Expression, +) *Expression { + return expHLLAddWrite( + bin, + []ExpressionArgument{ + IntegerValue(_HllExpOpINIT), + indexBitCount, + minHashCount, + IntegerValue(policy.flags), + }, + ) +} + +// ExpHLLAdd creates an expression that adds list values to a HLL set and returns HLL set. +// The function assumes HLL bin already exists. +// indexBitCount + minHashBitCount must be <= 64. +func ExpHLLAdd(policy *HLLPolicy, list *Expression, bin *Expression) *Expression { + return ExpHLLAddWithIndexAndMinHash(policy, list, ExpIntVal(-1), ExpIntVal(-1), bin) +} + +// ExpHLLAddWithIndex creates an expression that adds values to a HLL set and returns HLL set. +// If HLL bin does not exist, use `indexBitCount` to create HLL bin. +func ExpHLLAddWithIndex( + policy *HLLPolicy, + list *Expression, + indexBitCount *Expression, + bin *Expression, +) *Expression { + return ExpHLLAddWithIndexAndMinHash(policy, list, indexBitCount, ExpIntVal(-1), bin) +} + +// ExpHLLAddWithIndexAndMinHash creates an expression that adds values to a HLL set and returns HLL set. If HLL bin does not +// exist, use `indexBitCount` and `minHashBitCount` to create HLL set. +// indexBitCount + minHashBitCount must be <= 64. +func ExpHLLAddWithIndexAndMinHash( + policy *HLLPolicy, + list *Expression, + indexBitCount *Expression, + minHashCount *Expression, + bin *Expression, +) *Expression { + return expHLLAddWrite( + bin, + []ExpressionArgument{ + IntegerValue(_HllExpOpADD), + list, + indexBitCount, + minHashCount, + IntegerValue(policy.flags), + }, + ) +} + +// ExpHLLGetCount creates an expression that returns estimated number of elements in the HLL bin. +func ExpHLLGetCount(bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeINT, + []ExpressionArgument{ + IntegerValue(_HllExpOpCOUNT), + }, + ) +} + +// ExpHLLGetUnion creates an expression that returns a HLL object that is the union of all specified HLL objects +// in the list with the HLL bin. +func ExpHLLGetUnion(list *Expression, bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeHLL, + []ExpressionArgument{ + IntegerValue(_HllExpOpUNION), + list, + }, + ) +} + +// ExpHLLGetUnionCount creates an expression that returns estimated number of elements that would be contained by +// the union of these HLL objects. +func ExpHLLGetUnionCount(list *Expression, bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeINT, + []ExpressionArgument{ + IntegerValue(_HllExpOpUNIONCOUNT), + list, + }, + ) +} + +// ExpHLLGetIntersectCount creates an expression that returns estimated number of elements that would be contained by +// the intersection of these HLL objects. +func ExpHLLGetIntersectCount(list *Expression, bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeINT, + []ExpressionArgument{ + IntegerValue(_HllExpOpINTERSECTCOUNT), + list, + }, + ) +} + +// ExpHLLGetSimilarity creates an expression that returns estimated similarity of these HLL objects as a 64 bit float. +func ExpHLLGetSimilarity(list *Expression, bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeFLOAT, + []ExpressionArgument{ + IntegerValue(_HllExpOpSIMILARITY), + list, + }, + ) +} + +// ExpHLLDescribe creates an expression that returns `indexBitCount` and `minHashBitCount` used to create HLL bin +// in a list of longs. `list[0]` is `indexBitCount` and `list[1]` is `minHashBitCount`. +func ExpHLLDescribe(bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeLIST, + []ExpressionArgument{ + IntegerValue(_HllExpOpDESCRIBE), + }, + ) +} + +// ExpHLLMayContain creates an expression that returns one if HLL bin may contain all items in the list. +func ExpHLLMayContain(list *Expression, bin *Expression) *Expression { + return expHLLAddRead( + bin, + ExpTypeINT, + []ExpressionArgument{ + IntegerValue(_HllExpOpMAYCONTAIN), + list, + }, + ) +} + +func expHLLAddRead( + bin *Expression, + returnType ExpType, + arguments []ExpressionArgument, +) *Expression { + flags := hllMODULE + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} + +func expHLLAddWrite(bin *Expression, arguments []ExpressionArgument) *Expression { + flags := hllMODULE | _MODIFY + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &ExpTypeHLL, + exps: nil, + arguments: arguments, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go new file mode 100644 index 00000000..9b8410c5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go @@ -0,0 +1,200 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Filters - HLL", gg.Ordered, func() { + + const keyCount = 100 + + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + var qpolicy = as.NewQueryPolicy() + + gg.BeforeAll(func() { + for ii := 0; ii < keyCount; ii++ { + key, _ := as.NewKey(ns, set, ii) + bin := as.BinMap{"bin": ii, "lbin": []interface{}{ii, "a"}} + client.Delete(wpolicy, key) + err := client.Put(nil, key, bin) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + data := []as.Value{as.NewValue("asd"), as.NewValue(ii)} + data2 := []as.Value{as.NewValue("asd"), as.NewValue(ii), as.NewValue(ii + 1)} + + ops := []*as.Operation{ + as.HLLAddOp( + as.DefaultHLLPolicy(), + "hllbin", + data, + 8, + 0, + ), + as.HLLAddOp( + as.DefaultHLLPolicy(), + "hllbin2", + data2, + 8, + 0, + ), + } + + _, err = client.Operate(nil, key, ops...) + gm.Expect(err).NotTo(gm.HaveOccurred()) + } + }) + + runQuery := func(filter *as.Expression, set_name string) *as.Recordset { + qpolicy.FilterExpression = filter + stmt := as.NewStatement(ns, set_name) + rs, err := client.Query(qpolicy, stmt) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + return rs + } + + countResults := func(rs *as.Recordset) int { + count := 0 + + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + + return count + } + + gg.It("ExpHLLGetCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpHLLGetCount( + as.ExpHLLAddWithIndexAndMinHash( + as.DefaultHLLPolicy(), + as.ExpListVal(as.NewValue(48715414)), + as.ExpIntVal(8), + as.ExpIntVal(0), + as.ExpHLLBin("hllbin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpHLLMayContain should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpHLLMayContain( + as.ExpListVal(as.NewValue(55)), + as.ExpHLLBin("hllbin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpListGetByIndex should work", func() { + rs := runQuery( + as.ExpLess( + as.ExpListGetByIndex( + as.ListReturnTypeValue, + as.ExpTypeINT, + as.ExpIntVal(0), + as.ExpHLLDescribe(as.ExpHLLBin("hllbin")), + ), + as.ExpIntVal(10), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpHLLGetUnion should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpHLLGetCount( + as.ExpHLLGetUnion( + as.ExpHLLBin("hllbin"), + as.ExpHLLBin("hllbin2"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ExpHLLGetUnionCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpHLLGetUnionCount( + as.ExpHLLBin("hllbin"), + as.ExpHLLBin("hllbin2"), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ExpHLLGetIntersectCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpHLLGetIntersectCount( + as.ExpHLLBin("hllbin"), + as.ExpHLLBin("hllbin2"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpHLLGetSimilarity should work", func() { + rs := runQuery( + as.ExpGreater( + as.ExpHLLGetSimilarity( + as.ExpHLLBin("hllbin"), + as.ExpHLLBin("hllbin2"), + ), + as.ExpFloatVal(0.5), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_list.go b/aerospike-tls/vendor-aerospike-client-go/exp_list.go new file mode 100644 index 00000000..a48b0747 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_list.go @@ -0,0 +1,675 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License.package aerospike + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const expListMODULE int64 = 0 + +// ExpListAppend creates an expression that appends value to end of list. +func ExpListAppend( + policy *ListPolicy, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_APPEND), + value, + IntegerValue(policy.attributes), + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListAppendItems creates an expression that appends list items to end of list. +func ExpListAppendItems( + policy *ListPolicy, + list *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_APPEND_ITEMS), + list, + IntegerValue(policy.attributes), + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListInsert creates an expression that inserts value to specified index of list. +func ExpListInsert( + policy *ListPolicy, + index *Expression, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_INSERT), + index, + value, + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListInsertItems creates an expression that inserts each input list item starting at specified index of list. +func ExpListInsertItems( + policy *ListPolicy, + index *Expression, + list *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_INSERT_ITEMS), + index, + list, + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListIncrement creates an expression that increments `list[index]` by value. +// Value expression should resolve to a number. +func ExpListIncrement( + policy *ListPolicy, + index *Expression, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_INCREMENT), + index, + value, + IntegerValue(policy.attributes), + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListSet creates an expression that sets item value at specified index in list. +func ExpListSet( + policy *ListPolicy, + index *Expression, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_SET), + index, + value, + IntegerValue(policy.flags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListClear creates an expression that removes all items in list. +func ExpListClear(bin *Expression, ctx ...*CDTContext) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_CLEAR), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListSort creates an expression that sorts list according to sortFlags. +func ExpListSort( + sortFlags ListSortFlags, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_SORT), + IntegerValue(sortFlags), + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByValue creates an expression that removes list items identified by value. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByValue( + returnType ListReturnType, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_VALUE), + IntegerValue(returnType), + value, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByValueList creates an expression that removes list items identified by values. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByValueList( + returnType ListReturnType, + values *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_LIST), + IntegerValue(returnType), + values, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByValueRange creates an expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). +// If valueBegin is nil, the range is less than valueEnd. If valueEnd is nil, the range is +// greater than equal to valueBegin. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByValueRange( + returnType ListReturnType, + valueBegin *Expression, + valueEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_INTERVAL), + IntegerValue(returnType), + } + if valueBegin != nil { + args = append(args, valueBegin) + } else { + args = append(args, nullValue) + } + if valueEnd != nil { + args = append(args, valueEnd) + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByValueRelativeRankRange creates an expression that removes list items nearest to value and greater by relative rank. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +// +// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: +// +// (value,rank) = [removed items] +// (5,0) = [5,9,11,15] +// (5,1) = [9,11,15] +// (5,-1) = [4,5,9,11,15] +// (3,0) = [4,5,9,11,15] +// (3,3) = [11,15] +// (3,-3) = [0,4,5,9,11,15] +func ExpListRemoveByValueRelativeRankRange( + returnType ListReturnType, + value *Expression, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE), + IntegerValue(returnType), + value, + rank, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByValueRelativeRankRangeCount creates an expression that removes list items nearest to value and greater by relative rank with a count limit. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +// +// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: +// +// (value,rank,count) = [removed items] +// (5,0,2) = [5,9] +// (5,1,1) = [9] +// (5,-1,2) = [4,5] +// (3,0,1) = [4] +// (3,3,7) = [11,15] +// (3,-3,2) = [] +func ExpListRemoveByValueRelativeRankRangeCount( + returnType ListReturnType, + value *Expression, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE), + IntegerValue(returnType), + value, + rank, + count, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByIndex creates an expression that removes list item identified by index. +func ExpListRemoveByIndex( + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_INDEX), + IntegerValue(ListReturnTypeNone), + index, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByIndexRange creates an expression that removes list items starting at specified index to the end of list. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByIndexRange( + returnType ListReturnType, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_INDEX_RANGE), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByIndexRangeCount creates an expression that removes "count" list items starting at specified index. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByIndexRangeCount( + returnType ListReturnType, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_INDEX_RANGE), + IntegerValue(returnType), + index, + count, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByRank creates an expression that removes list item identified by rank. +func ExpListRemoveByRank( + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_RANK), + IntegerValue(ListReturnTypeNone), + rank, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByRankRange creates an expression that removes list items starting at specified rank to the last ranked item. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByRankRange( + returnType ListReturnType, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_RANK_RANGE), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListRemoveByRankRangeCount creates an expression that removes "count" list items starting at specified rank. +// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. +func ExpListRemoveByRankRangeCount( + returnType ListReturnType, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_REMOVE_BY_RANK_RANGE), + IntegerValue(returnType), + rank, + count, + cdtContextList(ctx), + } + return cdtListAddWrite(bin, args, ctx...) +} + +// ExpListSize creates an expression that returns list size. +func ExpListSize(bin *Expression, ctx ...*CDTContext) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_SIZE), + cdtContextList(ctx), + } + return cdtListAddRead(bin, ExpTypeINT, args) +} + +// ExpListGetByValue creates an expression that selects list items identified by value and returns selected +// data specified by returnType. +func ExpListGetByValue( + returnType ListReturnType, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_VALUE), + IntegerValue(returnType), + value, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByValueRange creates an expression that selects list items identified by value range and returns selected data +// specified by returnType. +func ExpListGetByValueRange( + returnType ListReturnType, + valueBegin *Expression, + valueEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(_CDT_LIST_GET_BY_VALUE_INTERVAL), + IntegerValue(returnType), + } + if valueBegin != nil { + args = append(args, valueBegin) + } else { + args = append(args, nullValue) + } + if valueEnd != nil { + args = append(args, valueEnd) + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByValueList creates an expression that selects list items identified by values and returns selected data +// specified by returnType. +func ExpListGetByValueList( + returnType ListReturnType, + values *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_VALUE_LIST), + IntegerValue(returnType), + values, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByValueRelativeRankRange creates an expression that selects list items nearest to value and greater by relative rank +// and returns selected data specified by returnType. +// +// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: +// +// (value,rank) = [selected items] +// (5,0) = [5,9,11,15] +// (5,1) = [9,11,15] +// (5,-1) = [4,5,9,11,15] +// (3,0) = [4,5,9,11,15] +// (3,3) = [11,15] +// (3,-3) = [0,4,5,9,11,15] +func ExpListGetByValueRelativeRankRange( + returnType ListReturnType, + value *Expression, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE), + IntegerValue(returnType), + value, + rank, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByValueRelativeRankRangeCount creates an expression that selects list items nearest to value and greater by relative rank with a count limit +// and returns selected data specified by returnType. +// +// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: +// +// (value,rank,count) = [selected items] +// (5,0,2) = [5,9] +// (5,1,1) = [9] +// (5,-1,2) = [4,5] +// (3,0,1) = [4] +// (3,3,7) = [11,15] +// (3,-3,2) = [] +func ExpListGetByValueRelativeRankRangeCount( + returnType ListReturnType, + value *Expression, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE), + IntegerValue(returnType), + value, + rank, + count, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByIndex creates an expression that selects list item identified by index and returns +// selected data specified by returnType. +func ExpListGetByIndex( + returnType ListReturnType, + valueType ExpType, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_INDEX), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return cdtListAddRead(bin, valueType, args) +} + +// ExpListGetByIndexRange creates an expression that selects list items starting at specified index to the end of list +// and returns selected data specified by returnType . +func ExpListGetByIndexRange( + returnType ListReturnType, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_INDEX_RANGE), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByIndexRangeCount creates an expression that selects "count" list items starting at specified index +// and returns selected data specified by returnType. +func ExpListGetByIndexRangeCount( + returnType ListReturnType, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_INDEX_RANGE), + IntegerValue(returnType), + index, + count, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByRank creates an expression that selects list item identified by rank and returns selected +// data specified by returnType. +func ExpListGetByRank( + returnType ListReturnType, + valueType ExpType, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_RANK), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return cdtListAddRead(bin, valueType, args) +} + +// ExpListGetByRankRange creates an expression that selects list items starting at specified rank to the last ranked item +// and returns selected data specified by returnType. +func ExpListGetByRankRange( + returnType ListReturnType, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_RANK_RANGE), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +// ExpListGetByRankRangeCount creates an expression that selects "count" list items starting at specified rank and returns +// selected data specified by returnType. +func ExpListGetByRankRangeCount( + returnType ListReturnType, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(_CDT_LIST_GET_BY_RANK_RANGE), + IntegerValue(returnType), + rank, + count, + cdtContextList(ctx), + } + return cdtListAddRead(bin, expListGetValueType(returnType), args) +} + +func cdtListAddRead( + bin *Expression, + returnType ExpType, + arguments []ExpressionArgument, +) *Expression { + flags := expListMODULE + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} + +func cdtListAddWrite( + bin *Expression, + arguments []ExpressionArgument, + ctx ...*CDTContext, +) *Expression { + var returnType ExpType + if len(ctx) == 0 { + returnType = ExpTypeLIST + } else if (ctx[0].Id & ctxTypeListIndex) == 0 { + returnType = ExpTypeMAP + } else { + returnType = ExpTypeLIST + } + + flags := expListMODULE | _MODIFY + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} + +func expListGetValueType(returnType ListReturnType) ExpType { + rt := returnType & (^ListReturnTypeInverted) + switch rt { + case ListReturnTypeIndex, ListReturnTypeReverseIndex, ListReturnTypeRank, ListReturnTypeReverseRank: + // This method only called from expressions that can return multiple integers (ie list). + return ExpTypeLIST + case ListReturnTypeCount: + return ExpTypeINT + + case ListReturnTypeValue: + // This method only called from expressions that can return multiple objects (ie list). + return ExpTypeLIST + + case ListReturnTypeExists: + return ExpTypeBOOL + } + panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid ListReturnType: %d", returnType))) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go new file mode 100644 index 00000000..dd78e7fd --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go @@ -0,0 +1,569 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Filters - Lists", gg.Ordered, func() { + + const keyCount = 100 + + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + var qpolicy = as.NewQueryPolicy() + + gg.BeforeAll(func() { + for ii := 0; ii < keyCount; ii++ { + key, _ := as.NewKey(ns, set, ii) + ibin := as.NewBin("bin", []int{1, 2, 3, ii}) + client.Delete(wpolicy, key) + err := client.PutBins(wpolicy, key, ibin) + gm.Expect(err).NotTo(gm.HaveOccurred()) + } + }) + + runQuery := func(filter *as.Expression, set_name string) *as.Recordset { + qpolicy.FilterExpression = filter + stmt := as.NewStatement(ns, set_name) + rs, err := client.Query(qpolicy, stmt) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + return rs + } + + countResults := func(rs *as.Recordset) int { + count := 0 + + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + + return count + } + + gg.It("ExpListAppend should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListAppend( + as.DefaultListPolicy(), + as.ExpIntVal(999), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(5), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListAppendItems should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListAppendItems( + as.DefaultListPolicy(), + as.ExpListVal(as.NewValue(555), as.NewValue("asd")), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(6), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListClear should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListClear(as.ExpListBin("bin")), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ListReturnTypeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByValue( + as.ListReturnTypeCount, + as.ExpIntVal(234), + as.ExpListInsert( + as.DefaultListPolicy(), + as.ExpIntVal(1), + as.ExpIntVal(234), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ListReturnTypeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByValueList( + as.ListReturnTypeCount, + as.ExpListVal(as.NewValue(51), as.NewValue(52)), + as.ExpListBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(2)) + }) + + gg.It("ExpListInsertItems should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListInsertItems( + as.DefaultListPolicy(), + as.ExpIntVal(4), + as.ExpListVal(as.NewValue(222), as.NewValue(223)), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(6), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByIndex( + as.ListReturnTypeValue, + as.ExpTypeINT, + as.ExpIntVal(3), + as.ExpListIncrement( + as.DefaultListPolicy(), + as.ExpIntVal(3), + as.ExpIntVal(100), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(102), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByIndex( + as.ListReturnTypeValue, + as.ExpTypeINT, + as.ExpIntVal(3), + as.ExpListSet( + as.DefaultListPolicy(), + as.ExpIntVal(3), + as.ExpIntVal(100), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(100), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByIndexRangeCount( + as.ListReturnTypeValue, + as.ExpIntVal(2), + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(3), as.NewValue(15)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByIndexRange( + as.ListReturnTypeValue, + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(3), as.NewValue(15)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByRank( + as.ListReturnTypeValue, + as.ExpTypeINT, + as.ExpIntVal(3), + as.ExpListBin("bin"), + ), + as.ExpIntVal(25), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByRankRange( + as.ListReturnTypeValue, + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(3), as.NewValue(25)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByRankRangeCount( + as.ListReturnTypeValue, + as.ExpIntVal(2), + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(3), as.NewValue(3)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByValueRange( + as.ListReturnTypeValue, + as.ExpIntVal(1), + as.ExpIntVal(3), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(1), as.NewValue(2)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ListReturnTypeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByValueRelativeRankRange( + as.ListReturnTypeCount, + as.ExpIntVal(2), + as.ExpIntVal(0), + as.ExpListBin("bin"), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ListReturnTypeValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListGetByValueRelativeRankRangeCount( + as.ListReturnTypeValue, + as.ExpIntVal(2), + as.ExpIntVal(1), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + as.ExpListVal(as.NewValue(3)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpListRemoveByValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByValue( + as.ListReturnTypeNone, + as.ExpIntVal(3), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpListRemoveByValueList should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByValueList( + as.ListReturnTypeNone, + as.ExpListVal(as.NewValue(1), as.NewValue(2)), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ExpListRemoveByValueRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByValueRange( + as.ListReturnTypeNone, + as.ExpIntVal(1), + as.ExpIntVal(3), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ExpListRemoveByValueRelativeRankRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByValueRelativeRankRange( + as.ListReturnTypeNone, + as.ExpIntVal(3), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(97)) + }) + + gg.It("ExpListRemoveByValueRelativeRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByValueRelativeRankRangeCount( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpIntVal(1), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByIndex should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByIndex( + as.ExpIntVal(0), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByIndexRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByIndexRange( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByIndexRangeCount( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByIndexRangeCount( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByRank should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByRank( + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByRankRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByRankRange( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpListRemoveByRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpListSize( + as.ExpListRemoveByRankRangeCount( + as.ListReturnTypeNone, + as.ExpIntVal(2), + as.ExpIntVal(1), + as.ExpListBin("bin"), + ), + ), + as.ExpIntVal(3), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_map.go b/aerospike-tls/vendor-aerospike-client-go/exp_map.go new file mode 100644 index 00000000..7eb27219 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_map.go @@ -0,0 +1,926 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const expMapMODULE int64 = 0 + +// Map expression generator. See {@link com.aerospike.client.exp.Exp}. +// +// The bin expression argument in these methods can be a reference to a bin or the +// result of another expression. Expressions that modify bin values are only used +// for temporary expression evaluation and are not permanently applied to the bin. +// +// Map modify expressions return the bin's value. This value will be a map except +// when the map is nested within a list. In that case, a list is returned for the +// map modify expression. +// +// Valid map key types are: +// +// String +// Integer +// []byte +// +// The server will validate map key types in an upcoming release. +// +// All maps maintain an index and a rank. The index is the item offset from the start of the map, +// for both unordered and ordered maps. The rank is the sorted index of the value component. +// Map supports negative indexing for index and rank. +// +// Index examples: +// +// Index 0: First item in map. +// Index 4: Fifth item in map. +// Index -1: Last item in map. +// Index -3: Third to last item in map. +// Index 1 Count 2: Second and third items in map. +// Index -3 Count 3: Last three items in map. +// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. +// +// +// Rank examples: +// +// Rank 0: Item with lowest value rank in map. +// Rank 4: Fifth lowest ranked item in map. +// Rank -1: Item with highest ranked value in map. +// Rank -3: Item with third highest ranked value in map. +// Rank 1 Count 2: Second and third lowest ranked items in map. +// Rank -3 Count 3: Top three ranked items in map. +// +// +// Nested expressions are supported by optional CTX context arguments. Example: +// +// bin = {key1={key11=9,key12=4}, key2={key21=3,key22=5}} +// Set map value to 11 for map key "key21" inside of map key "key2". +// Get size of map key2. +// ExpMapSize(ExpMapBin("bin"), CtxMapKey(StringValue("key2")) +// result = 2 + +// ExpMapPut creates an expression that writes key/value item to map bin. +func ExpMapPut( + policy *MapPolicy, + key *Expression, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + var args []ExpressionArgument + op := mapWriteOp(policy, false) + if op == cdtMapOpTypeReplace { + args = []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(op), + key, + value, + } + } else { + args = []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(op), + key, + value, + IntegerValue(policy.attributes.attr), + } + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapPutItems creates an expression that writes each map item to map bin. +func ExpMapPutItems( + policy *MapPolicy, + amap *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + var args []ExpressionArgument + var op = mapWriteOp(policy, true) + if op == cdtMapOpTypeReplace { + args = []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(op), + amap, + } + } else { + args = []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(op), + amap, + IntegerValue(policy.attributes.attr), + } + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapIncrement creates an expression that increments values by incr for all items identified by key. +// Valid only for numbers. +func ExpMapIncrement( + policy *MapPolicy, + key *Expression, + incr *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeIncrement), + key, + incr, + cdtContextList(ctx), + IntegerValue(policy.attributes.attr), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapClear creates an expression that removes all items in map. +func ExpMapClear(bin *Expression, ctx ...*CDTContext) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeClear), + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByKey creates an expression that removes map item identified by key. +func ExpMapRemoveByKey( + key *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByKey), + IntegerValue(MapReturnType.NONE), + key, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByKeyList creates an expression that removes map items identified by keys. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByKeyList( + returnType MapReturnTypes, + keys *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveKeyList), + IntegerValue(returnType), + keys, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByKeyRange creates an expression that removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). +// If keyBegin is nil, the range is less than keyEnd. +// If keyEnd is nil, the range is greater than equal to keyBegin. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByKeyRange( + returnType MapReturnTypes, + keyBegin *Expression, + keyEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + var args = []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(cdtMapOpTypeRemoveByKeyInterval), + IntegerValue(returnType), + } + if keyBegin != nil { + args = append(args, keyBegin) + } else { + args = append(args, nullValue) + } + if keyEnd != nil { + args = append(args, keyEnd) + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByKeyRelativeIndexRange creates an expression that removes map items nearest to key and greater by index. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +// +// Examples for map [{0=17},{4=2},{5=15},{9=10}]: +// +// * (value,index) = [removed items] +// * (5,0) = [{5=15},{9=10}] +// * (5,1) = [{9=10}] +// * (5,-1) = [{4=2},{5=15},{9=10}] +// * (3,2) = [{9=10}] +// * (3,-2) = [{0=17},{4=2},{5=15},{9=10}] +func ExpMapRemoveByKeyRelativeIndexRange( + returnType MapReturnTypes, + key *Expression, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByKeyRelIndexRange), + IntegerValue(returnType), + key, + index, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByKeyRelativeIndexRangeCount creates an expression that removes map items nearest to key and greater by index with a count limit. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +// +// Examples for map [{0=17},{4=2},{5=15},{9=10}]: +// +// (value,index,count) = [removed items] +// * (5,0,1) = [{5=15}] +// * (5,1,2) = [{9=10}] +// * (5,-1,1) = [{4=2}] +// * (3,2,1) = [{9=10}] +// * (3,-2,2) = [{0=17}] +func ExpMapRemoveByKeyRelativeIndexRangeCount( + returnType MapReturnTypes, + key *Expression, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByKeyRelIndexRange), + IntegerValue(returnType), + key, + index, + count, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByValue creates an expression that removes map items identified by value. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByValue( + returnType MapReturnTypes, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByValue), + IntegerValue(returnType), + value, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByValueList creates an expression that removes map items identified by values. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByValueList( + returnType MapReturnTypes, + values *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveValueList), + IntegerValue(returnType), + values, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByValueRange creates an expression that removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByValueRange( + returnType MapReturnTypes, + valueBegin *Expression, + valueEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(cdtMapOpTypeRemoveByValueInterval), + IntegerValue(returnType), + } + if valueBegin != nil { + args = append(args, valueBegin) + } else { + args = append(args, nullValue) + } + if valueEnd != nil { + args = append(args, valueEnd) + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByValueRelativeRankRange creates an expression that removes map items nearest to value and greater by relative rank. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// * (value,rank) = [removed items] +// * (11,1) = [{0=17}] +// * (11,-1) = [{9=10},{5=15},{0=17}] +func ExpMapRemoveByValueRelativeRankRange( + returnType MapReturnTypes, + value *Expression, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByValueRelRankRange), + IntegerValue(returnType), + value, + rank, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByValueRelativeRankRangeCount creates an expression that removes map items nearest to value and greater by relative rank with a count limit. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// * (value,rank,count) = [removed items] +// * (11,1,1) = [{0=17}] +// * (11,-1,1) = [{9=10}] +func ExpMapRemoveByValueRelativeRankRangeCount( + returnType MapReturnTypes, + value *Expression, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByValueRelRankRange), + IntegerValue(returnType), + value, + rank, + count, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByIndex creates an expression that removes map item identified by index. +func ExpMapRemoveByIndex( + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByIndex), + IntegerValue(MapReturnType.NONE), + index, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByIndexRange creates an expression that removes map items starting at specified index to the end of map. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByIndexRange( + returnType MapReturnTypes, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByIndexRange), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByIndexRangeCount creates an expression that removes "count" map items starting at specified index. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByIndexRangeCount( + returnType MapReturnTypes, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByIndexRange), + IntegerValue(returnType), + index, + count, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByRank creates an expression that removes map item identified by rank. +func ExpMapRemoveByRank( + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByRank), + IntegerValue(MapReturnType.NONE), + rank, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByRankRange creates an expression that removes map items starting at specified rank to the last ranked item. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByRankRange( + returnType MapReturnTypes, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByRankRange), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapRemoveByRankRangeCount creates an expression that removes "count" map items starting at specified rank. +// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. +func ExpMapRemoveByRankRangeCount( + returnType MapReturnTypes, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeRemoveByRankRange), + IntegerValue(returnType), + rank, + count, + cdtContextList(ctx), + } + return expMapAddWrite(bin, args, ctx...) +} + +// ExpMapSize creates an expression that returns list size. +func ExpMapSize(bin *Expression, ctx ...*CDTContext) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeSize), + cdtContextList(ctx), + } + return expMapAddRead(bin, ExpTypeINT, args) +} + +// ExpMapGetByKey creates an expression that selects map item identified by key and returns selected data +// specified by returnType. +func ExpMapGetByKey( + returnType MapReturnTypes, + valueType ExpType, + key *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByKey), + IntegerValue(returnType), + key, + cdtContextList(ctx), + } + return expMapAddRead(bin, valueType, args) +} + +// ExpMapGetByKeyRange creates an expression that selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). +// If keyBegin is nil, the range is less than keyEnd. +// If keyEnd is nil, the range is greater than equal to keyBegin. +// Expression returns selected data specified by returnType. +func ExpMapGetByKeyRange( + returnType MapReturnTypes, + keyBegin *Expression, + keyEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(cdtMapOpTypeGetByKeyInterval), + IntegerValue(returnType), + } + if keyBegin != nil { + args = append(args, keyBegin) + } else { + args = append(args, nullValue) + } + if keyEnd != nil { + args = append(args, keyEnd) + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByKeyList creates an expression that selects map items identified by keys and returns selected data specified by returnType +func ExpMapGetByKeyList( + returnType MapReturnTypes, + keys *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByKeyList), + IntegerValue(returnType), + keys, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByKeyRelativeIndexRange creates an expression that selects map items nearest to key and greater by index. +// Expression returns selected data specified by returnType. +// +// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: +// +// * (value,index) = [selected items] +// * (5,0) = [{5=15},{9=10}] +// * (5,1) = [{9=10}] +// * (5,-1) = [{4=2},{5=15},{9=10}] +// * (3,2) = [{9=10}] +// * (3,-2) = [{0=17},{4=2},{5=15},{9=10}] +func ExpMapGetByKeyRelativeIndexRange( + returnType MapReturnTypes, + key *Expression, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByKeyRelIndexRange), + IntegerValue(returnType), + key, + index, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByKeyRelativeIndexRangeCount creates an expression that selects map items nearest to key and greater by index with a count limit. +// Expression returns selected data specified by returnType. +// +// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: +// +// * (value,index,count) = [selected items] +// * (5,0,1) = [{5=15}] +// * (5,1,2) = [{9=10}] +// * (5,-1,1) = [{4=2}] +// * (3,2,1) = [{9=10}] +// * (3,-2,2) = [{0=17}] +func ExpMapGetByKeyRelativeIndexRangeCount( + returnType MapReturnTypes, + key *Expression, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByKeyRelIndexRange), + IntegerValue(returnType), + key, + index, + count, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByValue creates an expression that selects map items identified by value and returns selected data +// specified by returnType. +func ExpMapGetByValue( + returnType MapReturnTypes, + value *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByValue), + IntegerValue(returnType), + value, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByValueRange creates an expression that selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) +// If valueBegin is nil, the range is less than valueEnd. +// If valueEnd is nil, the range is greater than equal to valueBegin. +// +// Expression returns selected data specified by returnType. +func ExpMapGetByValueRange( + returnType MapReturnTypes, + valueBegin *Expression, + valueEnd *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + cdtContextList(ctx), + IntegerValue(cdtMapOpTypeGetByValueInterval), + IntegerValue(returnType), + } + if valueBegin != nil { + args = append(args, valueBegin) + } else { + args = append(args, nullValue) + } + if valueEnd != nil { + args = append(args, valueEnd) + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByValueList creates an expression that selects map items identified by values and returns selected data specified by returnType. +func ExpMapGetByValueList( + returnType MapReturnTypes, + values *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByValueList), + IntegerValue(returnType), + values, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByValueRelativeRankRange creates an expression that selects map items nearest to value and greater by relative rank. +// Expression returns selected data specified by returnType. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// * (value,rank) = [selected items] +// * (11,1) = [{0=17}] +// * (11,-1) = [{9=10},{5=15},{0=17}] +func ExpMapGetByValueRelativeRankRange( + returnType MapReturnTypes, + value *Expression, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByValueRelRankRange), + IntegerValue(returnType), + value, + rank, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByValueRelativeRankRangeCount creates an expression that selects map items nearest to value and greater by relative rank with a count limit. +// Expression returns selected data specified by returnType. +// +// Examples for map [{4=2},{9=10},{5=15},{0=17}]: +// +// * (value,rank,count) = [selected items] +// * (11,1,1) = [{0=17}] +// * (11,-1,1) = [{9=10}] +func ExpMapGetByValueRelativeRankRangeCount( + returnType MapReturnTypes, + value *Expression, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByValueRelRankRange), + IntegerValue(returnType), + value, + rank, + count, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByIndex creates an expression that selects map item identified by index and returns selected data specified by returnType. +func ExpMapGetByIndex( + returnType MapReturnTypes, + valueType ExpType, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByIndex), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return expMapAddRead(bin, valueType, args) +} + +// ExpMapGetByIndexRange creates an expression that selects map items starting at specified index to the end of map and returns selected +// data specified by returnType. +func ExpMapGetByIndexRange( + returnType MapReturnTypes, + index *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByIndexRange), + IntegerValue(returnType), + index, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByIndexRangeCount creates an expression that selects "count" map items starting at specified index and returns selected data +// specified by returnType. +func ExpMapGetByIndexRangeCount( + returnType MapReturnTypes, + index *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByIndexRange), + IntegerValue(returnType), + index, + count, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByRank creates an expression that selects map item identified by rank and returns selected data specified by returnType. +func ExpMapGetByRank( + returnType MapReturnTypes, + valueType ExpType, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByRank), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return expMapAddRead(bin, valueType, args) +} + +// ExpMapGetByRankRange creates an expression that selects map items starting at specified rank to the last ranked item and +// returns selected data specified by returnType. +func ExpMapGetByRankRange( + returnType MapReturnTypes, + rank *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByRankRange), + IntegerValue(returnType), + rank, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +// ExpMapGetByRankRangeCount creates an expression that selects "count" map items starting at specified rank and returns selected +// data specified by returnType. +func ExpMapGetByRankRangeCount( + returnType MapReturnTypes, + rank *Expression, + count *Expression, + bin *Expression, + ctx ...*CDTContext, +) *Expression { + args := []ExpressionArgument{ + IntegerValue(cdtMapOpTypeGetByRankRange), + IntegerValue(returnType), + rank, + count, + cdtContextList(ctx), + } + return expMapAddRead(bin, expMapGetValueType(returnType), args) +} + +func expMapAddRead( + bin *Expression, + returnType ExpType, + arguments []ExpressionArgument, +) *Expression { + flags := expMapMODULE + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} + +func expMapAddWrite( + bin *Expression, + arguments []ExpressionArgument, + ctx ...*CDTContext, +) *Expression { + var returnType ExpType + if len(ctx) == 0 { + returnType = ExpTypeMAP + } else if (ctx[0].Id & ctxTypeListIndex) == 0 { + returnType = ExpTypeMAP + } else { + returnType = ExpTypeLIST + } + + flags := expMapMODULE | _MODIFY + return &Expression{ + cmd: &expOpCALL, + val: nil, + bin: bin, + flags: &flags, + module: &returnType, + exps: nil, + arguments: arguments, + } +} + +func expMapGetValueType(returnType mapReturnType) ExpType { + t := returnType & (^MapReturnType.INVERTED) + switch t { + case MapReturnType.INDEX, MapReturnType.REVERSE_INDEX, MapReturnType.RANK, MapReturnType.REVERSE_RANK: + // This method only called from expressions that can return multiple integers (ie list). + return ExpTypeLIST + + case MapReturnType.COUNT: + return ExpTypeINT + case MapReturnType.KEY, MapReturnType.VALUE: + // This method only called from expressions that can return multiple objects (ie list). + return ExpTypeLIST + + case MapReturnType.KEY_VALUE, MapReturnType.ORDERED_MAP, MapReturnType.UNORDERED_MAP: + return ExpTypeMAP + + case MapReturnType.EXISTS: + return ExpTypeBOOL + + } + panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid MapReturnType: %d", returnType))) +} + +// Determines the correct operation to use when setting one or more map values, depending on the +// map policy. +func mapWriteOp(policy *MapPolicy, multi bool) int { + switch policy.flags { + default: + fallthrough + case MapWriteFlagsDefault: + if multi { + return cdtMapOpTypePutItems + } + return cdtMapOpTypePut + case MapWriteFlagsUpdateOnly: + if multi { + return cdtMapOpTypeReplaceItems + } + return cdtMapOpTypeReplace + case MapWriteFlagsCreateOnly: + if multi { + return cdtMapOpTypeAddItems + } + return cdtMapOpTypeAdd + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go new file mode 100644 index 00000000..fa7f7633 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go @@ -0,0 +1,674 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Filters - Maps", gg.Ordered, func() { + + const keyCount = 100 + + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + var qpolicy = as.NewQueryPolicy() + + gg.BeforeAll(func() { + for ii := 0; ii < keyCount; ii++ { + key, _ := as.NewKey(ns, set, ii) + ibin := as.BinMap{"bin": map[string]interface{}{"test": ii, "test2": "a"}} + client.Delete(wpolicy, key) + err := client.Put(wpolicy, key, ibin) + gm.Expect(err).NotTo(gm.HaveOccurred()) + } + }) + + runQuery := func(filter *as.Expression, set_name string) *as.Recordset { + qpolicy.FilterExpression = filter + stmt := as.NewStatement(ns, set_name) + rs, err := client.Query(qpolicy, stmt) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + return rs + } + + countResults := func(rs *as.Recordset) int { + count := 0 + + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + + return count + } + + gg.It("ExpMapGetByKey should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByKey( + as.MapReturnType.VALUE, + as.ExpTypeINT, + as.ExpStringVal("test3"), + as.ExpMapPut( + as.DefaultMapPolicy(), + as.ExpStringVal("test3"), + as.ExpIntVal(999), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(999), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByKeyList should work", func() { + amap := map[interface{}]interface{}{ + "test4": 333, + "test5": 444, + } + rs := runQuery( + as.ExpEq( + as.ExpMapGetByKeyList( + as.MapReturnType.VALUE, + as.ExpListVal(as.NewValue("test4"), as.NewValue("test5")), + as.ExpMapPutItems( + as.DefaultMapPolicy(), + as.ExpMapVal(amap), + as.ExpMapBin("bin"), + ), + ), + as.ExpListVal(as.NewValue(333), as.NewValue(444)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValue( + as.MapReturnType.COUNT, + as.ExpIntVal(5), + as.ExpMapIncrement( + as.DefaultMapPolicy(), + as.ExpStringVal("test"), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapClear should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapClear(as.ExpMapBin("bin")), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByValueList should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueList( + as.MapReturnType.COUNT, + as.ExpListVal(as.NewValue(1), as.NewValue("a")), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapGetByValueRelativeRankRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRelativeRankRange( + as.MapReturnType.COUNT, + as.ExpIntVal(1), + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRelativeRankRangeCount( + as.MapReturnType.COUNT, + as.ExpIntVal(1), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRelativeRankRangeCount( + as.MapReturnType.COUNT, + as.ExpIntVal(1), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRelativeRankRangeCount( + as.MapReturnType.COUNT, + as.ExpIntVal(1), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRelativeRankRangeCount( + as.MapReturnType.COUNT, + as.ExpIntVal(1), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByIndex should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByIndex( + as.MapReturnType.VALUE, + as.ExpTypeINT, + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapGetByIndexRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByIndexRange( + as.MapReturnType.COUNT, + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByIndexRangeCount( + as.MapReturnType.VALUE, + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpListVal(as.NewValue(2)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapGetByRank should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByRank( + as.MapReturnType.VALUE, + as.ExpTypeINT, + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapGetByRankRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByRankRange( + as.MapReturnType.VALUE, + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpListVal(as.NewValue("a")), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByRankRangeCount( + as.MapReturnType.VALUE, + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpListVal(as.NewValue(15)), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapGetByValueRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByValueRange( + as.MapReturnType.COUNT, + as.ExpIntVal(0), + as.ExpIntVal(18), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(18)) + }) + + gg.It("ExpMapGetByKeyRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByKeyRange( + as.MapReturnType.COUNT, + nil, + as.ExpStringVal("test25"), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByKeyRelativeIndexRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByKeyRelativeIndexRange( + as.MapReturnType.COUNT, + as.ExpStringVal("test"), + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapGetByKeyRelativeIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapGetByKeyRelativeIndexRangeCount( + as.MapReturnType.COUNT, + as.ExpStringVal("test"), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByKey should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByKey( + as.ExpStringVal("test"), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByKeyList should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByKeyList( + as.MapReturnType.NONE, + as.ExpListVal(as.NewValue("test"), as.NewValue("test2")), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByKeyRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByKeyRange( + as.MapReturnType.NONE, + as.ExpStringVal("test"), + nil, + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByKeyRelativeIndexRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByKeyRelativeIndexRange( + as.MapReturnType.NONE, + as.ExpStringVal("test"), + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByKeyRelativeIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByKeyRelativeIndexRangeCount( + as.MapReturnType.NONE, + as.ExpStringVal("test"), + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByValue should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByValue( + as.MapReturnType.NONE, + as.ExpIntVal(5), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapRemoveByValueList should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByValueList( + as.MapReturnType.NONE, + as.ExpListVal(as.NewValue("a"), as.NewValue(15)), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpMapRemoveByValueRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByValueRange( + as.MapReturnType.NONE, + as.ExpIntVal(5), + as.ExpIntVal(15), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(10)) + }) + + gg.It("ExpMapRemoveByIndex should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByIndex( + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByIndexRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByIndexRange( + as.MapReturnType.NONE, + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByIndexRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByIndexRangeCount( + as.MapReturnType.NONE, + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByRank should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByRank( + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByRankRange should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByRankRange( + as.MapReturnType.NONE, + as.ExpIntVal(0), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapRemoveByRankRangeCount should work", func() { + rs := runQuery( + as.ExpEq( + as.ExpMapSize( + as.ExpMapRemoveByRankRangeCount( + as.MapReturnType.NONE, + as.ExpIntVal(0), + as.ExpIntVal(1), + as.ExpMapBin("bin"), + ), + ), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_operation.go b/aerospike-tls/vendor-aerospike-client-go/exp_operation.go new file mode 100644 index 00000000..e3d5d291 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_operation.go @@ -0,0 +1,116 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License.package aerospike + +package aerospike + +// ExpReadFlags is used to change mode in expression reads. +type ExpReadFlags int + +const ( + // ExpReadFlagDefault is the default + ExpReadFlagDefault ExpReadFlags = 0 + + // ExpReadFlagEvalNoFail means: + // Ignore failures caused by the expression resolving to unknown or a non-bin type. + ExpReadFlagEvalNoFail ExpReadFlags = 1 << 4 +) + +// ExpWriteFlags is used to change mode in expression writes. +type ExpWriteFlags int + +// Expression write Flags +const ( + // ExpWriteFlagDefault is the default. Allows create or update. + ExpWriteFlagDefault ExpWriteFlags = 0 + + // ExpWriteFlagCreateOnly means: + // If bin does not exist, a new bin will be created. + // If bin exists, the operation will be denied. + // If bin exists, fail with Bin Exists + ExpWriteFlagCreateOnly ExpWriteFlags = 1 << 0 + + // ExpWriteFlagUpdateOnly means: + // If bin exists, the bin will be overwritten. + // If bin does not exist, the operation will be denied. + // If bin does not exist, fail with Bin Not Found + ExpWriteFlagUpdateOnly ExpWriteFlags = 1 << 1 + + // ExpWriteFlagAllowDelete means: + // If expression results in nil value, then delete the bin. + // Otherwise, return OP Not Applicable when NoFail is not set + ExpWriteFlagAllowDelete ExpWriteFlags = 1 << 2 + + // ExpWriteFlagPolicyNoFail means: + // Do not raise error if operation is denied. + ExpWriteFlagPolicyNoFail ExpWriteFlags = 1 << 3 + + // ExpWriteFlagEvalNoFail means: + // Ignore failures caused by the expression resolving to unknown or a non-bin type. + ExpWriteFlagEvalNoFail ExpWriteFlags = 1 << 4 +) + +// ExpWriteOp creates an operation with an expression that writes to record bin. +func ExpWriteOp(binName string, exp *Expression, flags ExpWriteFlags) *Operation { + val, err := encodeExpOperation(exp, int(flags)) + if err != nil { + panic(err) + } + return &Operation{ + opType: _EXP_MODIFY, + binName: binName, + binValue: NewValue(val), + encoder: nil, + } +} + +// ExpReadOp creates an operation with an expression that reads from a record. +func ExpReadOp(name string, exp *Expression, flags ExpReadFlags) *Operation { + val, err := encodeExpOperation(exp, int(flags)) + if err != nil { + panic(err) + } + return &Operation{ + opType: _EXP_READ, + binName: name, + binValue: NewValue(val), + encoder: nil, + } +} + +// newExpOperationEncoder is used to encode the operation expression wire protocol +func encodeExpOperation(exp *Expression, flags int) ([]byte, Error) { + // expression is double packed: first normally, and then as a BLOB in operation + // find the size of packed expression and pack it in temp buffer + tsz, err := exp.size() + if err != nil { + return nil, err + } + + // header + packed bytes + flags = 16 + len bytes max + buf := newBuffer(tsz + 16) + + if _, err = packArrayBegin(buf, 2); err != nil { + return nil, err + } + + if _, err = exp.pack(buf); err != nil { + return nil, err + } + + if _, err = packAInt(buf, flags); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go new file mode 100644 index 00000000..2b62ba64 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go @@ -0,0 +1,389 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "errors" + "sync" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +const udfPredexpBody = `local function putBin(r,name,value) + if not aerospike:exists(r) then aerospike:create(r) end + r[name] = value + aerospike:update(r) +end + +-- Set a particular bin +function writeBin(r,name,value) + putBin(r,name,value) +end + +-- Get a particular bin +function readBin(r,name) + return r[name] +end + +-- Return generation count of record +function getGeneration(r) + return record.gen(r) +end + +-- Update record only if gen hasn't changed +function writeIfGenerationNotChanged(r,name,value,gen) + if record.gen(r) == gen then + r[name] = value + aerospike:update(r) + end +end + +-- Set a particular bin only if record does not already exist. +function writeUnique(r,name,value) + if not aerospike:exists(r) then + aerospike:create(r) + r[name] = value + aerospike:update(r) + end +end + +-- Validate value before writing. +function writeWithValidation(r,name,value) + if (value >= 1 and value <= 10) then + putBin(r,name,value) + else + error("1000:Invalid value") + end +end + +-- Record contains two integer bins, name1 and name2. +-- For name1 even integers, add value to existing name1 bin. +-- For name1 integers with a multiple of 5, delete name2 bin. +-- For name1 integers with a multiple of 9, delete record. +function processRecord(r,name1,name2,addValue) + local v = r[name1] + + if (v % 9 == 0) then + aerospike:remove(r) + return + end + + if (v % 5 == 0) then + r[name2] = nil + aerospike:update(r) + return + end + + if (v % 2 == 0) then + r[name1] = v + addValue + aerospike:update(r) + end +end + +-- Append to end of regular list bin +function appendListBin(r, binname, value) + local l = r[binname] + + if l == nil then + l = list() + end + + list.append(l, value) + r[binname] = l + aerospike:update(r) +end + +-- Set expiration of record +-- function expire(r,ttl) +-- if record.ttl(r) == gen then +-- r[name] = value +-- aerospike:update(r) +-- end +-- end +` + +var _ = gg.Describe("PredExp in Transactions Test", func() { + + gg.BeforeEach(func() { + if !isEnterpriseEdition() { + gg.Skip("Predexp Tests for All transactions are not supported in the Community Edition.") + return + } + }) + + gg.BeforeEach(func() { + if serverIsNewerThan("5.8") { + gg.Skip("Server has removed Predexp") + return + } + }) + + var udfReg sync.Once + + var registerUDF = func() { + udfReg.Do(func() { + regTask, err := client.RegisterUDF(nil, []byte(udfPredexpBody), "udf1.lua", as.LUA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + gm.Expect(<-regTask.OnComplete()).NotTo(gm.HaveOccurred()) + }) + } + + // connection data + var ns = *namespace + var set string + var keyA, keyB *as.Key + + set = randString(50) + keyA, _ = as.NewKey(ns, set, randString(50)) + keyB, _ = as.NewKey(ns, set, randString(50)) + + var binAName string + + var predAEq1WPolicy *as.WritePolicy + var predAEq1BPolicy *as.BatchPolicy + var predAEq1RPolicy *as.BasePolicy + + var binA1 *as.Bin + var binA2 *as.Bin + var binA3 *as.Bin + + binAName = "binAName" + binA1 = as.NewBin(binAName, 1) + binA2 = as.NewBin(binAName, 2) + binA3 = as.NewBin(binAName, 3) + + gg.Describe("PredExp in Transactions Test", func() { + + gg.AfterEach(func() { + _, err := client.Delete(nil, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + _, err = client.Delete(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.BeforeEach(func() { + predAEq1WPolicy = as.NewWritePolicy(0, 0) + predAEq1BPolicy = as.NewBatchPolicy() + predAEq1RPolicy = as.NewPolicy() + + predAEq1BPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) + predAEq1RPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) + predAEq1WPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) + + _, err := client.Delete(nil, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + _, err = client.Delete(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(nil, keyA, binA1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.PutBins(nil, keyB, binA2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("should work for Put", func() { + err := client.PutBins(predAEq1WPolicy, keyA, binA3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + r, err := client.Get(nil, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) + + client.PutBins(predAEq1WPolicy, keyB, binA3) + r, err = client.Get(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) + }) + + gg.It("should work for Put Except...", func() { + err := client.PutBins(predAEq1WPolicy, keyA, binA3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(predAEq1WPolicy, keyB, binA3) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for Get", func() { + r, err := client.Get(predAEq1RPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) + + r, err = client.Get(predAEq1RPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + gm.Expect(r).To(gm.BeNil()) + }) + + gg.It("should work for Get Except...", func() { + _, err := client.Get(predAEq1RPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Get(predAEq1RPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for BatchGet", func() { + keys := []*as.Key{keyA, keyB} + + records, err := client.BatchGet(predAEq1BPolicy, keys) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(errors.Is(err, as.ErrFilteredOut)).To(gm.BeTrue()) + + gm.Expect(records[0].Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) + gm.Expect(records[1]).To(gm.BeNil()) + }) + + gg.It("should work for Delete", func() { + existed, err := client.Delete(predAEq1WPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(existed).To(gm.BeTrue()) + + _, err = client.Get(nil, keyA) + gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) + + _, err = client.Delete(predAEq1WPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + + r, err = client.Get(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) + }) + + gg.It("should work for Delete Except...", func() { + _, err := client.Delete(predAEq1WPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Delete(predAEq1WPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for Durable Delete", func() { + predAEq1WPolicy.DurableDelete = true + + _, err := client.Delete(predAEq1WPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + r, err := client.Get(nil, keyA) + gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) + gm.Expect(r).To(gm.BeNil()) + + _, err = client.Delete(predAEq1WPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + + r, err = client.Get(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) + }) + + gg.It("should work for Durable Delete Except...", func() { + predAEq1WPolicy.DurableDelete = true + + _, err := client.Delete(predAEq1WPolicy, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Delete(predAEq1WPolicy, keyB) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for Operate Read", func() { + r, err := client.Operate(predAEq1WPolicy, keyA, as.GetBinOp(binAName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(r.Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) + + r, err = client.Operate(predAEq1WPolicy, keyB, as.GetBinOp(binAName)) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + gm.Expect(r).To(gm.BeNil()) + }) + + gg.It("should work for Operate Read Except...", func() { + _, err := client.Operate(predAEq1WPolicy, keyA, as.GetBinOp(binAName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Operate(predAEq1WPolicy, keyB, as.GetBinOp(binAName)) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for Operate Write", func() { + r, err := client.Operate(predAEq1WPolicy, keyA, as.PutOp(binA3), as.GetBinOp(binAName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) + + r, err = client.Operate(predAEq1WPolicy, keyB, as.PutOp(binA3), as.GetBinOp(binAName)) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + gm.Expect(r).To(gm.BeNil()) + }) + + gg.It("should work for Operate Write Except...", func() { + _, err := client.Operate(predAEq1WPolicy, keyA, as.PutOp(binA3), as.GetBinOp(binAName)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Operate(predAEq1WPolicy, keyB, as.PutOp(binA3), as.GetBinOp(binAName)) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + gg.It("should work for UDF", func() { + registerUDF() + + _, err := client.Execute(predAEq1WPolicy, keyA, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + r, err := client.Get(nil, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) + + _, err = client.Execute(predAEq1WPolicy, keyB, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + + r, err = client.Get(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) + }) + + gg.It("should work for UDF Except...", func() { + registerUDF() + + _, err := client.Execute(predAEq1WPolicy, keyA, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Execute(predAEq1WPolicy, keyB, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + }) + + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/expression.go b/aerospike-tls/vendor-aerospike-client-go/expression.go new file mode 100644 index 00000000..89a2bfd7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/expression.go @@ -0,0 +1,1430 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License.package aerospike + +package aerospike + +import ( + "encoding/base64" + + "github.com/aerospike/aerospike-client-go/v7/types" + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" +) + +// ExpressionArgument is used for passing arguments to filter expressions. +// The accptable arguments are: +// Value, ExpressionFilter, []*CDTContext +type ExpressionArgument interface { + pack(BufferEx) (int, Error) +} + +// ExpType defines the expression's data type. +type ExpType uint + +var ( + // ExpTypeNIL is NIL Expression Type + ExpTypeNIL ExpType = 0 + // ExpTypeBOOL is BOOLEAN Expression Type + ExpTypeBOOL ExpType = 1 + // ExpTypeINT is INTEGER Expression Type + ExpTypeINT ExpType = 2 + // ExpTypeSTRING is STRING Expression Type + ExpTypeSTRING ExpType = 3 + // ExpTypeLIST is LIST Expression Type + ExpTypeLIST ExpType = 4 + // ExpTypeMAP is MAP Expression Type + ExpTypeMAP ExpType = 5 + // ExpTypeBLOB is BLOB Expression Type + ExpTypeBLOB ExpType = 6 + // ExpTypeFLOAT is FLOAT Expression Type + ExpTypeFLOAT ExpType = 7 + // ExpTypeGEO is GEO String Expression Type + ExpTypeGEO ExpType = 8 + // ExpTypeHLL is HLL Expression Type + ExpTypeHLL ExpType = 9 +) + +type expOp uint + +var ( + expOpUnknown expOp = 0 + expOpEQ expOp = 1 + expOpNE expOp = 2 + expOpGT expOp = 3 + expOpGE expOp = 4 + expOpLT expOp = 5 + expOpLE expOp = 6 + expOpREGEX expOp = 7 + expOpGEO expOp = 8 + expOpAND expOp = 16 + expOpOR expOp = 17 + expOpNOT expOp = 18 + expOpExclusive expOp = 19 + expOpAdd expOp = 20 + expOpSub expOp = 21 + expOpMul expOp = 22 + expOpDiv expOp = 23 + expOpPow expOp = 24 + expOpLog expOp = 25 + expOpMod expOp = 26 + expOpAbs expOp = 27 + expOpFloor expOp = 28 + expOpCeil expOp = 29 + expOpToInt expOp = 30 + expOpToFloat expOp = 31 + expOpIntAnd expOp = 32 + expOpIntOr expOp = 33 + expOpIntXor expOp = 34 + expOpIntNot expOp = 35 + expOpIntLShift expOp = 36 + expOpIntRShift expOp = 37 + expOpIntARShift expOp = 38 + expOpIntCount expOp = 39 + expOpIntLscan expOp = 40 + expOpIntRscan expOp = 41 + expOpMin expOp = 50 + expOpMax expOp = 51 + expOpDIGEST_MODULO expOp = 64 + expOpDEVICE_SIZE expOp = 65 + expOpLAST_UPDATE expOp = 66 + expOpSINCE_UPDATE expOp = 67 + expOpVOID_TIME expOp = 68 + expOpTTL expOp = 69 + expOpSET_NAME expOp = 70 + expOpKEY_EXISTS expOp = 71 + expOpIS_TOMBSTONE expOp = 72 + expOpMEMORY_SIZE expOp = 73 + expOpRECORD_SIZE expOp = 74 + expOpKEY expOp = 80 + expOpBIN expOp = 81 + expOpBIN_TYPE expOp = 82 + expOpCond expOp = 123 + expOpVar expOp = 124 + expOpLet expOp = 125 + expOpQUOTED expOp = 126 + expOpCALL expOp = 127 +) + +const _MODIFY = 0x40 + +// ExpRegexFlags is used to change the Regex Mode in Expression Filters. +type ExpRegexFlags int + +const ( + // ExpRegexFlagNONE uses regex defaults. + ExpRegexFlagNONE ExpRegexFlags = 0 + + // ExpRegexFlagEXTENDED uses POSIX Extended Regular Expression syntax when interpreting regex. + ExpRegexFlagEXTENDED ExpRegexFlags = 1 << 0 + + // ExpRegexFlagICASE does not differentiate cases. + ExpRegexFlagICASE ExpRegexFlags = 1 << 1 + + // ExpRegexFlagNOSUB does not report position of matches. + ExpRegexFlagNOSUB ExpRegexFlags = 1 << 2 + + // ExpRegexFlagNEWLINE does not Match-any-character operators don't match a newline. + ExpRegexFlagNEWLINE ExpRegexFlags = 1 << 3 +) + +// Expression which can be applied to most commands, to control which records are +// affected by the command. +type Expression struct { + // The Operation code + cmd *expOp + // The Primary Value of the Operation + val Value + // The Bin to use it on (REGEX for example) + bin *Expression + // The additional flags for the Operation (REGEX or return_type of Module for example) + flags *int64 + // The optional Module flag for Module operations or Bin Types + module *ExpType + // Sub commands for the CmdExp operation + exps []*Expression + + arguments []ExpressionArgument + + // ready to use buffer to write directly on the wire + bytes []byte +} + +func newFilterExpression( + cmd *expOp, + val Value, + bin *Expression, + flags *int64, + module *ExpType, + exps []*Expression, +) *Expression { + return &Expression{ + cmd: cmd, + val: val, + bin: bin, + flags: flags, + module: module, + exps: exps, + arguments: nil, + } +} + +func (fe *Expression) packExpression( + exps []*Expression, + buf BufferEx, +) (int, Error) { + size := 0 + + if fe.val != nil { + // DEF expression + sz, err := packRawString(buf, fe.val.String()) + size += sz + if err != nil { + return size, err + } + + sz, err = exps[0].pack(buf) + size += sz + if err != nil { + return size, err + } + } else { + if fe.cmd == &expOpLet { + // Let wire format: LET , , , , ..., + count := (len(exps)-1)*2 + 2 + sz, err := packArrayBegin(buf, count) + size += sz + if err != nil { + return size, err + } + } else { + sz, err := packArrayBegin(buf, len(exps)+1) + size += sz + if err != nil { + return size, err + } + } + + sz, err := packAInt64(buf, int64(*fe.cmd)) + size += sz + if err != nil { + return size, err + } + + for _, exp := range exps { + sz, err = exp.pack(buf) + size += sz + if err != nil { + return size, err + } + } + } + return size, nil +} + +func (fe *Expression) packCommand(cmd *expOp, buf BufferEx) (int, Error) { + size := 0 + + switch cmd { + case &expOpREGEX: + sz, err := packArrayBegin(buf, 4) + if err != nil { + return size, err + } + size += sz + // The Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + // Regex Flags + sz, err = packAInt64(buf, *fe.flags) + if err != nil { + return size, err + } + size += sz + // Raw String is needed instead of the msgpack String that the pack_value method would use. + sz, err = packRawString(buf, fe.val.String()) + if err != nil { + return size, err + } + size += sz + // The Bin + sz, err = fe.bin.pack(buf) + if err != nil { + return size, err + } + size += sz + case &expOpCALL: + // Packing logic for Module + sz, err := packArrayBegin(buf, 5) + if err != nil { + return size, err + } + size += sz + // The Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + // The Module Operation + sz, err = packAInt64(buf, int64(*fe.module)) + if err != nil { + return size, err + } + size += sz + // The Module (List/Map or Bitwise) + sz, err = packAInt64(buf, *fe.flags) + if err != nil { + return size, err + } + size += sz + // Encoding the Arguments + if args := fe.arguments; len(args) > 0 { + argLen := 0 + for _, arg := range args { + // First match to estimate the Size and write the Context + switch v := arg.(type) { + case Value, *Expression: + argLen++ + case cdtContextList: + if len(v) > 0 { + sz, err = packArrayBegin(buf, 3) + if err != nil { + return size, err + } + size += sz + + sz, err = packAInt64(buf, 0xff) + if err != nil { + return size, err + } + size += sz + + sz, err = packArrayBegin(buf, len(v)*2) + if err != nil { + return size, err + } + size += sz + + for _, c := range v { + sz, err = c.pack(buf) + if err != nil { + return size, err + } + size += sz + } + } + default: + panic("Value `%v` is not acceptable in Expression Filters as an argument") + } + } + sz, err = packArrayBegin(buf, argLen) + if err != nil { + return size, err + } + size += sz + // Second match to write the real values + for _, arg := range args { + switch val := arg.(type) { + case Value: + sz, err = val.pack(buf) + if err != nil { + return size, err + } + size += sz + case *Expression: + sz, err = val.pack(buf) + if err != nil { + return size, err + } + size += sz + default: + } + } + } else { + // No Arguments + sz, err = fe.val.pack(buf) + if err != nil { + return size, err + } + size += sz + } + // Write the Bin + sz, err = fe.bin.pack(buf) + if err != nil { + return size, err + } + size += sz + case &expOpBIN: + // Bin Encoder + sz, err := packArrayBegin(buf, 3) + if err != nil { + return size, err + } + size += sz + // The Bin Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + // The Bin Type (INT/String etc.) + sz, err = packAInt64(buf, int64(*fe.module)) + if err != nil { + return size, err + } + size += sz + // The name - Raw String is needed instead of the msgpack String that the pack_value method would use. + sz, err = packRawString(buf, fe.val.String()) + if err != nil { + return size, err + } + size += sz + case &expOpVar: + fallthrough + case &expOpBIN_TYPE: + // BinType encoder + sz, err := packArrayBegin(buf, 2) + if err != nil { + return size, err + } + size += sz + // BinType Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + // The name - Raw String is needed instead of the msgpack String that the pack_value method would use. + sz, err = packRawString(buf, fe.val.String()) + if err != nil { + return size, err + } + size += sz + default: + // Packing logic for all other Ops + if value := fe.val; value != nil { + // Operation has a Value + sz, err := packArrayBegin(buf, 2) + if err != nil { + return size, err + } + size += sz + // Write the Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + // Write the Value + sz, err = value.pack(buf) + if err != nil { + return size, err + } + size += sz + } else { + // Operation has no Value + sz, err := packArrayBegin(buf, 1) + if err != nil { + return size, err + } + size += sz + // Write the Operation + sz, err = packAInt64(buf, int64(*cmd)) + if err != nil { + return size, err + } + size += sz + } + } + + return size, nil +} + +func (fe *Expression) packValue(buf BufferEx) (int, Error) { + // Packing logic for Value based Ops + return fe.val.pack(buf) +} + +func (fe *Expression) size() (int, Error) { + return fe.pack(nil) +} + +func (fe *Expression) pack(buf BufferEx) (int, Error) { + if len(fe.bytes) > 0 { + if buf != nil { + return buf.Write(fe.bytes) + } + // return the size + return len(fe.bytes), nil + } else if len(fe.exps) > 0 { + return fe.packExpression(fe.exps, buf) + } else if fe.cmd != nil { + return fe.packCommand(fe.cmd, buf) + } + return fe.packValue(buf) +} + +func (fe *Expression) Base64() (string, Error) { + buf := fe.grpc() + return base64.StdEncoding.EncodeToString(buf), nil +} + +func (fe *Expression) grpc() []byte { + if fe == nil { + return nil + } + + sz, err := fe.size() + if err != nil { + panic(err) + } + + buf := newBuffer(sz) + _, err = fe.pack(buf) + if err != nil { + panic(err) + } + + return buf.Bytes() +} + +// ExpFromBase64 creates an expression from an encoded base64 expression. +func ExpFromBase64(str string) (*Expression, Error) { + b := make([]byte, base64.StdEncoding.DecodedLen(len(str))) + n, err := base64.StdEncoding.Decode(b, []byte(str)) + if err != nil { + return nil, newError(types.PARSE_ERROR, err.Error()) + } + + return &Expression{bytes: b[:n]}, nil +} + +// ExpKey creates a record key expression of specified type. +func ExpKey(expType ExpType) *Expression { + return newFilterExpression( + &expOpKEY, + IntegerValue(int64(expType)), + nil, + nil, + nil, + nil, + ) +} + +// ExpKeyExists creates a function that returns if the primary key is stored in the record meta data +// as a boolean expression. This would occur when `send_key` is true on record write. +func ExpKeyExists() *Expression { + return newFilterExpression(&expOpKEY_EXISTS, nil, nil, nil, nil, nil) +} + +// ExpIntBin creates a 64 bit int bin expression. +func ExpIntBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeINT, + nil, + ) +} + +// ExpStringBin creates a string bin expression. +func ExpStringBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeSTRING, + nil, + ) +} + +// ExpBlobBin creates a blob bin expression. +func ExpBlobBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeBLOB, + nil, + ) +} + +// ExpBoolBin creates a boolean bin expression. +func ExpBoolBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeBOOL, + nil, + ) +} + +// ExpFloatBin creates a 64 bit float bin expression. +func ExpFloatBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeFLOAT, + nil, + ) +} + +// ExpGeoBin creates a geo bin expression. +func ExpGeoBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeGEO, + nil, + ) +} + +// ExpListBin creates a list bin expression. +func ExpListBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeLIST, + nil, + ) +} + +// ExpMapBin creates a map bin expression. +func ExpMapBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeMAP, + nil, + ) +} + +// ExpHLLBin creates a a HLL bin expression +func ExpHLLBin(name string) *Expression { + return newFilterExpression( + &expOpBIN, + StringValue(name), + nil, + nil, + &ExpTypeHLL, + nil, + ) +} + +// ExpBinExists creates a function that returns if bin of specified name exists. +func ExpBinExists(name string) *Expression { + return ExpNotEq(ExpBinType(name), ExpIntVal(ParticleType.NULL)) +} + +// ExpBinType creates a function that returns bin's integer particle type. Valid values are: +// +// NULL = 0 +// INTEGER = 1 +// FLOAT = 2 +// STRING = 3 +// BLOB = 4 +// DIGEST = 6 +// BOOL = 17 +// HLL = 18 +// MAP = 19 +// LIST = 20 +// LDT = 21 +// GEOJSON = 23 +func ExpBinType(name string) *Expression { + // TODO: Improve documentation and provide examples. + return newFilterExpression( + &expOpBIN_TYPE, + StringValue(name), + nil, + nil, + nil, + nil, + ) +} + +// ExpSetName creates a function that returns record set name string. +func ExpSetName() *Expression { + return newFilterExpression(&expOpSET_NAME, nil, nil, nil, nil, nil) +} + +// ExpRecordSize creates an expression that returns the record size. +// This expression usually evaluates quickly because record meta data is cached in memory. +// +// Requires server version 7.0+. This expression replaces [ExpDeviceSize] and +// [ExpMemorySize] since those older expressions are equivalent on server version 7.0+. +func ExpRecordSize() *Expression { + return newFilterExpression(&expOpRECORD_SIZE, nil, nil, nil, nil, nil) +} + +// ExpDeviceSize creates a function that returns record size on disk. +// If server storage-engine is memory, then zero is returned. +// +// This expression should only be used for server versions less than 7.0. Use +// [ExpRecordSize] for server version 7.0+. +func ExpDeviceSize() *Expression { + return newFilterExpression(&expOpDEVICE_SIZE, nil, nil, nil, nil, nil) +} + +// ExpMemorySize creates expression that returns record size in memory. If server storage-engine is +// not memory nor data-in-memory, then zero is returned. This expression usually evaluates +// quickly because record meta data is cached in memory. +// +// Requires server version between 5.3 inclusive and 7.0 exclusive. +// Use [ExpRecordSize] for server version 7.0+. +func ExpMemorySize() *Expression { + return newFilterExpression(&expOpMEMORY_SIZE, nil, nil, nil, nil, nil) +} + +// ExpLastUpdate creates a function that returns record last update time expressed as 64 bit integer +// nanoseconds since 1970-01-01 epoch. +func ExpLastUpdate() *Expression { + return newFilterExpression(&expOpLAST_UPDATE, nil, nil, nil, nil, nil) +} + +// ExpSinceUpdate creates a expression that returns milliseconds since the record was last updated. +// This expression usually evaluates quickly because record meta data is cached in memory. +func ExpSinceUpdate() *Expression { + return newFilterExpression(&expOpSINCE_UPDATE, nil, nil, nil, nil, nil) +} + +// ExpVoidTime creates a function that returns record expiration time expressed as 64 bit integer +// nanoseconds since 1970-01-01 epoch. +func ExpVoidTime() *Expression { + return newFilterExpression(&expOpVOID_TIME, nil, nil, nil, nil, nil) +} + +// ExpTTL creates a function that returns record expiration time (time to live) in integer seconds. +func ExpTTL() *Expression { + return newFilterExpression(&expOpTTL, nil, nil, nil, nil, nil) +} + +// ExpIsTombstone creates a expression that returns if record has been deleted and is still in tombstone state. +// This expression usually evaluates quickly because record meta data is cached in memory. +func ExpIsTombstone() *Expression { + return newFilterExpression(&expOpIS_TOMBSTONE, nil, nil, nil, nil, nil) +} + +// ExpDigestModulo creates a function that returns record digest modulo as integer. +func ExpDigestModulo(modulo int64) *Expression { + return newFilterExpression( + &expOpDIGEST_MODULO, + NewValue(modulo), + nil, + nil, + nil, + nil, + ) +} + +// ExpRegexCompare creates a function like regular expression string operation. +func ExpRegexCompare(regex string, flags ExpRegexFlags, bin *Expression) *Expression { + iflags := int64(flags) + return newFilterExpression( + &expOpREGEX, + StringValue(regex), + bin, + &iflags, + nil, + nil, + ) +} + +// ExpGeoCompare creates a compare geospatial operation. +func ExpGeoCompare(left *Expression, right *Expression) *Expression { + return newFilterExpression( + &expOpGEO, + nil, + nil, + nil, + nil, + []*Expression{left, right}, + ) +} + +// ExpIntVal creates a 64 bit integer value +func ExpIntVal(val int64) *Expression { + return newFilterExpression(nil, IntegerValue(val), nil, nil, nil, nil) +} + +// ExpBoolVal creates a Boolean value +func ExpBoolVal(val bool) *Expression { + return newFilterExpression(nil, BoolValue(val), nil, nil, nil, nil) +} + +// ExpStringVal creates a String bin value +func ExpStringVal(val string) *Expression { + return newFilterExpression(nil, StringValue(val), nil, nil, nil, nil) +} + +// ExpFloatVal creates a 64 bit float bin value +func ExpFloatVal(val float64) *Expression { + return newFilterExpression(nil, FloatValue(val), nil, nil, nil, nil) +} + +// ExpBlobVal creates a Blob bin value +func ExpBlobVal(val []byte) *Expression { + return newFilterExpression(nil, BytesValue(val), nil, nil, nil, nil) +} + +// ExpListVal creates a List bin Value +func ExpListVal(val ...Value) *Expression { + return newFilterExpression( + &expOpQUOTED, + ValueArray(val), + nil, + nil, + nil, + nil, + ) +} + +// ExpValueArrayVal creates a List bin Value +func ExpValueArrayVal(val ValueArray) *Expression { + return newFilterExpression( + &expOpQUOTED, + val, + nil, + nil, + nil, + nil, + ) +} + +// ExpListValueVal creates a List bin Value +func ExpListValueVal(val ...interface{}) *Expression { + return newFilterExpression( + &expOpQUOTED, + NewListValue(val), + nil, + nil, + nil, + nil, + ) +} + +// ExpMapVal creates a Map bin Value +func ExpMapVal(val MapValue) *Expression { + return newFilterExpression(nil, val, nil, nil, nil, nil) +} + +// ExpGeoVal creates a geospatial json string value. +func ExpGeoVal(val string) *Expression { + return newFilterExpression(nil, GeoJSONValue(val), nil, nil, nil, nil) +} + +// ExpNilValue creates a a Nil Value +func ExpNilValue() *Expression { + return newFilterExpression(nil, nullValue, nil, nil, nil, nil) +} + +// ExpInfinityValue creates an Infinity Value +func ExpInfinityValue() *Expression { + return newFilterExpression(nil, infinityValue, nil, nil, nil, nil) +} + +// ExpWildCardValue creates a WildCard Value +func ExpWildCardValue() *Expression { + return newFilterExpression(nil, wildCardValue, nil, nil, nil, nil) +} + +// ExpNot creates a "not" operator expression. +func ExpNot(exp *Expression) *Expression { + return &Expression{ + cmd: &expOpNOT, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{exp}, + arguments: nil, + } +} + +// ExpAnd creates a "and" (&&) operator that applies to a variable number of expressions. +func ExpAnd(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpAND, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpOr creates a "or" (||) operator that applies to a variable number of expressions. +func ExpOr(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpOR, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpExclusive creates an expression that returns true if only one of the expressions are true. +// Requires server version 5.6.0+. +func ExpExclusive(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpExclusive, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpEq creates a equal (==) expression. +func ExpEq(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpEQ, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpNotEq creates a not equal (!=) expression +func ExpNotEq(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpNE, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpGreater creates a greater than (>) operation. +func ExpGreater(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpGT, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpGreaterEq creates a greater than or equal (>=) operation. +func ExpGreaterEq(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpGE, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpLess creates a less than (<) operation. +func ExpLess(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpLT, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpLessEq creates a less than or equals (<=) operation. +func ExpLessEq(left *Expression, right *Expression) *Expression { + return &Expression{ + cmd: &expOpLE, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{left, right}, + arguments: nil, + } +} + +// ExpNumAdd creates "add" (+) operator that applies to a variable number of expressions. +// Return sum of all `FilterExpressions` given. All arguments must resolve to the same type (integer or float). +// Requires server version 5.6.0+. +func ExpNumAdd(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpAdd, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpNumSub creates "subtract" (-) operator that applies to a variable number of expressions. +// If only one `FilterExpressions` is provided, return the negation of that argument. +// Otherwise, return the sum of the 2nd to Nth `FilterExpressions` subtracted from the 1st +// `FilterExpressions`. All `FilterExpressions` must resolve to the same type (integer or float). +// Requires server version 5.6.0+. +func ExpNumSub(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpSub, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpNumMul creates "multiply" (*) operator that applies to a variable number of expressions. +// Return the product of all `FilterExpressions`. If only one `FilterExpressions` is supplied, return +// that `FilterExpressions`. All `FilterExpressions` must resolve to the same type (integer or float). +// Requires server version 5.6.0+. +func ExpNumMul(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpMul, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpNumDiv creates "divide" (/) operator that applies to a variable number of expressions. +// If there is only one `FilterExpressions`, returns the reciprocal for that `FilterExpressions`. +// Otherwise, return the first `FilterExpressions` divided by the product of the rest. +// All `FilterExpressions` must resolve to the same type (integer or float). +// Requires server version 5.6.0+. +func ExpNumDiv(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpDiv, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpNumPow creates "power" operator that raises a "base" to the "exponent" power. +// All arguments must resolve to floats. +// Requires server version 5.6.0+. +func ExpNumPow(base *Expression, exponent *Expression) *Expression { + return &Expression{ + cmd: &expOpPow, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{base, exponent}, + arguments: nil, + } +} + +// ExpNumLog creates "log" operator for logarithm of "num" with base "base". +// All arguments must resolve to floats. +// Requires server version 5.6.0+. +func ExpNumLog(num *Expression, base *Expression) *Expression { + return &Expression{ + cmd: &expOpLog, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{num, base}, + arguments: nil, + } +} + +// ExpNumMod creates "modulo" (%) operator that determines the remainder of "numerator" +// divided by "denominator". All arguments must resolve to integers. +// Requires server version 5.6.0+. +func ExpNumMod(numerator *Expression, denominator *Expression) *Expression { + return &Expression{ + cmd: &expOpMod, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{numerator, denominator}, + arguments: nil, + } +} + +// ExpNumAbs creates operator that returns absolute value of a number. +// All arguments must resolve to integer or float. +// Requires server version 5.6.0+. +func ExpNumAbs(value *Expression) *Expression { + return &Expression{ + cmd: &expOpAbs, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value}, + arguments: nil, + } +} + +// ExpNumFloor creates expression that rounds a floating point number down to the closest integer value. +// The return type is float. +// Requires server version 5.6.0+. +func ExpNumFloor(num *Expression) *Expression { + return &Expression{ + cmd: &expOpFloor, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{num}, + arguments: nil, + } +} + +// ExpNumCeil creates expression that rounds a floating point number up to the closest integer value. +// The return type is float. +// Requires server version 5.6.0+. +func ExpNumCeil(num *Expression) *Expression { + return &Expression{ + cmd: &expOpCeil, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{num}, + arguments: nil, + } +} + +// ExpToInt creates expression that converts an integer to a float. +// Requires server version 5.6.0+. +func ExpToInt(num *Expression) *Expression { + return &Expression{ + cmd: &expOpToInt, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{num}, + arguments: nil, + } +} + +// ExpToFloat creates expression that converts a float to an integer. +// Requires server version 5.6.0+. +func ExpToFloat(num *Expression) *Expression { + return &Expression{ + cmd: &expOpToFloat, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{num}, + arguments: nil, + } +} + +// ExpIntAnd creates integer "and" (&) operator that is applied to two or more integers. +// All arguments must resolve to integers. +// Requires server version 5.6.0+. +func ExpIntAnd(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpIntAnd, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpIntOr creates integer "or" (|) operator that is applied to two or more integers. +// All arguments must resolve to integers. +// Requires server version 5.6.0+. +func ExpIntOr(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpIntOr, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpIntXor creates integer "xor" (^) operator that is applied to two or more integers. +// All arguments must resolve to integers. +// Requires server version 5.6.0+. +func ExpIntXor(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpIntXor, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpIntNot creates integer "not" (~) operator. +// Requires server version 5.6.0+. +func ExpIntNot(exp *Expression) *Expression { + return &Expression{ + cmd: &expOpIntNot, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{exp}, + arguments: nil, + } +} + +// ExpIntLShift creates integer "left shift" (<<) operator. +// Requires server version 5.6.0+. +func ExpIntLShift(value *Expression, shift *Expression) *Expression { + return &Expression{ + cmd: &expOpIntLShift, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value, shift}, + arguments: nil, + } +} + +// ExpIntRShift creates integer "logical right shift" (>>>) operator. +// Requires server version 5.6.0+. +func ExpIntRShift(value *Expression, shift *Expression) *Expression { + return &Expression{ + cmd: &expOpIntRShift, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value, shift}, + arguments: nil, + } +} + +// ExpIntARShift creates integer "arithmetic right shift" (>>) operator. +// The sign bit is preserved and not shifted. +// Requires server version 5.6.0+. +func ExpIntARShift(value *Expression, shift *Expression) *Expression { + return &Expression{ + cmd: &expOpIntARShift, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value, shift}, + arguments: nil, + } +} + +// ExpIntCount creates expression that returns count of integer bits that are set to 1. +// Requires server version 5.6.0+. +func ExpIntCount(exp *Expression) *Expression { + return &Expression{ + cmd: &expOpIntCount, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{exp}, + arguments: nil, + } +} + +// ExpIntLScan creates expression that scans integer bits from left (most significant bit) to +// right (least significant bit), looking for a search bit value. When the +// search value is found, the index of that bit (where the most significant bit is +// index 0) is returned. If "search" is true, the scan will search for the bit +// value 1. If "search" is false it will search for bit value 0. +// Requires server version 5.6.0+. +func ExpIntLScan(value *Expression, search *Expression) *Expression { + return &Expression{ + cmd: &expOpIntLscan, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value, search}, + arguments: nil, + } +} + +// ExpIntRScan creates expression that scans integer bits from right (least significant bit) to +// left (most significant bit), looking for a search bit value. When the +// search value is found, the index of that bit (where the most significant bit is +// index 0) is returned. If "search" is true, the scan will search for the bit +// value 1. If "search" is false it will search for bit value 0. +// Requires server version 5.6.0+. +func ExpIntRScan(value *Expression, search *Expression) *Expression { + return &Expression{ + cmd: &expOpIntRscan, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value, search}, + arguments: nil, + } +} + +// ExpMin creates expression that returns the minimum value in a variable number of expressions. +// All arguments must be the same type (integer or float). +// Requires server version 5.6.0+. +func ExpMin(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpMin, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpMax creates expression that returns the maximum value in a variable number of expressions. +// All arguments must be the same type (integer or float). +// Requires server version 5.6.0+. +func ExpMax(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpMax, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +//-------------------------------------------------- +// Variables +//-------------------------------------------------- + +// ExpCond will conditionally select an action expression from a variable number of expression pairs +// followed by a default action expression. Every action expression must return the same type. +// The only exception is Unknown() which can be mixed with other types. +// +// Requires server version 5.6.0+. +func ExpCond(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpCond, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpLet will define variables and expressions in scope. +// Requires server version 5.6.0+. +func ExpLet(exps ...*Expression) *Expression { + return &Expression{ + cmd: &expOpLet, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: exps, + arguments: nil, + } +} + +// ExpDef will assign variable to an expression that can be accessed later. +// Requires server version 5.6.0+. +func ExpDef(name string, value *Expression) *Expression { + return &Expression{ + cmd: nil, + val: StringValue(name), + bin: nil, + flags: nil, + module: nil, + exps: []*Expression{value}, + arguments: nil, + } +} + +// ExpVar will retrieve expression value from a variable. +// Requires server version 5.6.0+. +func ExpVar(name string) *Expression { + return &Expression{ + cmd: &expOpVar, + val: StringValue(name), + bin: nil, + flags: nil, + module: nil, + exps: nil, + arguments: nil, + } +} + +// ExpUnknown creates unknown value. Used to intentionally fail an expression. +// The failure can be ignored with `ExpWriteFlags` `EVAL_NO_FAIL` +// or `ExpReadFlags` `EVAL_NO_FAIL`. +// Requires server version 5.6.0+. +func ExpUnknown() *Expression { + return &Expression{ + cmd: &expOpUnknown, + val: nil, + bin: nil, + flags: nil, + module: nil, + exps: nil, + arguments: nil, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go b/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go new file mode 100644 index 00000000..d4e39811 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go @@ -0,0 +1,347 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Operations", func() { + + var ns = *namespace + var set = randString(50) + + binA := "A" + binB := "B" + binC := "C" + binD := "D" + binH := "H" + expVar := "EV" + + keyA, _ := as.NewKey(ns, set, "A") + keyB, _ := as.NewKey(ns, set, []byte{'B'}) + + gg.BeforeEach(func() { + _, err := client.Delete(nil, keyA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + _, err = client.Delete(nil, keyB) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(nil, keyA, as.NewBin(binA, 1), as.NewBin(binD, 2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.PutBins(nil, keyB, as.NewBin(binB, 2), as.NewBin(binD, 2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("Expression ops on lists should work", func() { + list := []as.Value{as.StringValue("a"), as.StringValue("b"), as.StringValue("c"), as.StringValue("d")} + exp := as.ExpListVal(list...) + rec, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp("var", exp, as.ExpReadFlagDefault), + ) + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"C": []interface{}{nil, []interface{}{"a", "b", "c", "d"}}, "var": []interface{}{"a", "b", "c", "d"}})) + }) + + gg.It("Read Eval error should work", func() { + exp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) + + r, err := client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + _, err = client.Operate(nil, keyB, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault)) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyB, as.ExpReadOp(expVar, exp, as.ExpReadFlagEvalNoFail)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("Read On Write Eval error should work", func() { + rexp := as.ExpIntBin(binD) + wexp := as.ExpIntBin(binA) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binD, wexp, as.ExpWriteFlagDefault), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + _, err = client.Operate(nil, keyB, + as.ExpWriteOp(binD, wexp, as.ExpWriteFlagDefault), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyB, + as.ExpWriteOp(binD, wexp, as.ExpWriteFlagEvalNoFail), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagEvalNoFail), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("Write Eval error should work", func() { + wexp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) + rexp := as.ExpIntBin(binC) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagDefault), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + _, err = client.Operate(nil, keyB, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagDefault), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyB, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagEvalNoFail), + as.ExpReadOp(expVar, rexp, as.ExpReadFlagEvalNoFail), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("Write Policy error should work", func() { + wexp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) + + _, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.BIN_NOT_FOUND)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly|as.ExpWriteFlagPolicyNoFail), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + _, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + _, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.BIN_EXISTS_ERROR)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly|as.ExpWriteFlagPolicyNoFail), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + dexp := as.ExpNilValue() + + _, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, dexp, as.ExpWriteFlagDefault), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, dexp, as.ExpWriteFlagPolicyNoFail), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + r, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, dexp, as.ExpWriteFlagAllowDelete), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + r, err = client.Operate(nil, keyA, + as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("Return Unknown should work", func() { + exp := as.ExpCond( + as.ExpEq(as.ExpIntBin(binC), as.ExpIntVal(5)), as.ExpUnknown(), + as.ExpBinExists(binA), as.ExpIntVal(5), + as.ExpUnknown(), + ) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + ) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) + + r, err = client.Operate(nil, keyB, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagEvalNoFail), + as.GetBinOp(binC), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) + + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{binC: []interface{}{nil, nil}})) + }) + + gg.It("Return Nil should work", func() { + exp := as.ExpNilValue() + + r, err := client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + as.GetBinOp(binC), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: nil, binC: nil})) + }) + + gg.It("Return Int should work", func() { + exp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5, binC: []interface{}{nil, 5}})) + + r, err = client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5})) + }) + + gg.It("Return Float should work", func() { + exp := as.ExpNumAdd(as.ExpToFloat(as.ExpIntBin(binA)), as.ExpFloatVal(4.1)) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1, binC: []interface{}{nil, 5.1}})) + + r, err = client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1})) + }) + + gg.It("Return String should work", func() { + str := "xxx" + exp := as.ExpStringVal(str) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str, binC: []interface{}{nil, str}})) + + r, err = client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str})) + }) + + gg.It("Return BLOB should work", func() { + blob := []byte{0x78, 0x78, 0x78} + exp := as.ExpBlobVal(blob) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob, binC: []interface{}{nil, blob}})) + + r, err = client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob})) + }) + + gg.It("Return Boolean should work", func() { + exp := as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)) + + r, err := client.Operate(nil, keyA, + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: true, binC: []interface{}{nil, true}})) + }) + + gg.It("Return HLL should work", func() { + exp := as.ExpHLLInit(as.DefaultHLLPolicy(), as.ExpIntVal(4), as.ExpNilValue()) + + r, err := client.Operate(nil, keyA, + as.HLLInitOp(as.DefaultHLLPolicy(), binH, 4, -1), + as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), + as.GetBinOp(binH), + as.GetBinOp(binC), + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{ + binH: []interface{}{ + nil, + as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + }, + binC: []interface{}{ + nil, + as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + }, + expVar: as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + })) + + r, err = client.Operate(nil, keyA, + as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), + ) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r.Bins).To(gm.Equal(as.BinMap{ + expVar: as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), + })) + }) + +}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/expression_test.go b/aerospike-tls/vendor-aerospike-client-go/expression_test.go new file mode 100644 index 00000000..6af030c0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/expression_test.go @@ -0,0 +1,1058 @@ +// Copyright 2017-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Expression Filters", func() { + + var ns = *namespace + var set = randString(50) + // var rpolicy = as.NewPolicy() + var wpolicy = as.NewWritePolicy(0, 0) + var qpolicy = as.NewQueryPolicy() + + var _ = gg.Context("Generic", gg.Ordered, func() { + + var set = "expression_tests" // The name of the set should be consistent because of predexp_modulo tests, since set name is a part of the digest + + const keyCount = 1000 + + gg.AfterAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + dropIndex(nil, ns, set, "intval") + dropIndex(nil, ns, set, "strval") + }) + + gg.BeforeAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + dropIndex(nil, ns, set, "intval") + dropIndex(nil, ns, set, "strval") + + starbucks := [][2]float64{ + {-122.1708441, 37.4241193}, + {-122.1492040, 37.4273569}, + {-122.1441078, 37.4268202}, + {-122.1251714, 37.4130590}, + {-122.0964289, 37.4218102}, + {-122.0776641, 37.4158199}, + {-122.0943475, 37.4114654}, + {-122.1122861, 37.4028493}, + {-122.0947230, 37.3909250}, + {-122.0831037, 37.3876090}, + {-122.0707119, 37.3787855}, + {-122.0303178, 37.3882739}, + {-122.0464861, 37.3786236}, + {-122.0582128, 37.3726980}, + {-122.0365083, 37.3676930}, + } + + for ii := 0; ii < keyCount; ii++ { + + // On iteration 333 we pause for a few mSec and note the + // time. Later we can check last_update time for either + // side of this gap ... + // + // Also, we update the WritePolicy to never expire so + // records w/ 0 TTL can be counted later. + // + + key, err := as.NewKey(ns, set, ii) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + lng := -122.0 + (0.01 * float64(ii)) + lat := 37.5 + (0.01 * float64(ii)) + pointstr := fmt.Sprintf( + "{ \"type\": \"Point\", \"coordinates\": [%f, %f] }", + lng, lat) + + var regionstr string + if ii < len(starbucks) { + regionstr = fmt.Sprintf( + "{ \"type\": \"AeroCircle\", "+ + " \"coordinates\": [[%f, %f], 3000.0 ] }", + starbucks[ii][0], starbucks[ii][1]) + } else { + // Somewhere off Africa ... + regionstr = + "{ \"type\": \"AeroCircle\", " + + " \"coordinates\": [[0.0, 0.0], 3000.0 ] }" + } + + // Accumulate prime factors of the index into a list and map. + listval := []int{} + mapval := map[int]string{} + for _, ff := range []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31} { + if ii >= ff && ii%ff == 0 { + listval = append(listval, ff) + mapval[ff] = fmt.Sprintf("0x%04x", ff) + } + } + + ballast := make([]byte, ii*16) + + bins := as.BinMap{ + "intval": ii, + "strval": fmt.Sprintf("0x%04x", ii), + "modval": ii % 10, + "locval": as.NewGeoJSONValue(pointstr), + "rgnval": as.NewGeoJSONValue(regionstr), + "lstval": listval, + "mapval": mapval, + "ballast": ballast, + } + err = client.Put(wpolicy, key, bins) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + createIndex(wpolicy, ns, set, "intval", "intval", as.NUMERIC) + createIndex(wpolicy, ns, set, "strval", "strval", as.STRING) + }) + + gg.BeforeEach(func() { + qpolicy.FilterExpression = nil + }) + + gg.It("server error with top level expression value node", func() { + // This statement doesn't form a predicate expression. + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter("intval", 0, 400)) + + qpolicy.FilterExpression = as.ExpIntVal(8) + recordset, err := client.Query(qpolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + for res := range recordset.Results() { + gm.Expect(res.Err).To(gm.HaveOccurred()) + } + }) + + gg.It("expression must additionally filter indexed query results", func() { + + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter("intval", 0, 400)) + qpolicy.FilterExpression = as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)) + recordset, err := client.Query(qpolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // The query clause selects [0, 1, ... 400, 401] The predexp + // only takes mod 8 and 9, should be 2 pre decade or 80 total. + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 80)) + }) + + gg.It("expression must work with implied scan", func() { + + stm := as.NewStatement(ns, set) + qpolicy.FilterExpression = as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001")) + recordset, err := client.Query(qpolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 1)) + }) + + gg.It("expression and or and not must all work", func() { + + stm := as.NewStatement(ns, set) + qpolicy.FilterExpression = as.ExpOr( + as.ExpAnd( + as.ExpNot(as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001"))), + as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)), + ), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0104")), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0105")), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0106")), + ) + + recordset, err := client.Query(qpolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 203)) + }) + + gg.It("Base64 encode/decode must work", func() { + + stm := as.NewStatement(ns, set) + + exp := as.ExpOr( + as.ExpAnd( + as.ExpNot(as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001"))), + as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)), + ), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0104")), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0105")), + as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0106")), + ) + + bexp, err := exp.Base64() + gm.Expect(err).ToNot(gm.HaveOccurred()) + + qpolicy.FilterExpression, err = as.ExpFromBase64(bexp) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recordset, err := client.Query(qpolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 203)) + }) + }) + + runQuery := func(filter *as.Expression, set_name string) *as.Recordset { + qpolicy.FilterExpression = filter + stmt := as.NewStatement(ns, set_name) + rs, err := client.Query(qpolicy, stmt) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + return rs + } + + countResults := func(rs *as.Recordset) int { + count := 0 + + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + + return count + } + + var _ = gg.Describe("Expressions", gg.Ordered, func() { + const keyCount = 100 + set = randString(50) + + gg.BeforeAll(func() { + for ii := 0; ii < keyCount; ii++ { + key, _ := as.NewKey(ns, set, ii) + ibin := as.BinMap{ + "bin": ii, + "bin2": fmt.Sprintf("%d", ii), + "bin3": float64(ii) / 3, + "bin4": []byte(fmt.Sprintf("blob%d", ii)), + "bin5": []interface{}{"a", "b", ii}, + "bin6": map[string]interface{}{"a": "test", "b": ii}, + } + client.Delete(wpolicy, key) + client.Put(wpolicy, key, ibin) + + } + }) + + var _ = gg.Context("Data Types", func() { + + gg.It("ExpIntBin must work", func() { + // INT + rs := runQuery( + as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + + }) + + gg.It("ExpStringBin must work", func() { + // STRING + rs := runQuery( + as.ExpEq( + as.ExpStringBin("bin2"), + as.ExpStringVal("1"), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + + }) + + gg.It("ExpFloatBin must work", func() { + rs := runQuery( + as.ExpEq( + as.ExpFloatBin("bin3"), + as.ExpFloatVal(2), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + + }) + + gg.It("ExpBlobBin must work", func() { + rs := runQuery( + as.ExpEq( + as.ExpBlobBin("bin4"), + as.ExpBlobVal([]byte("blob5")), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + + }) + + gg.It("ExpBinType must work", func() { + rs := runQuery( + as.ExpNotEq( + as.ExpBinType("bin"), + as.ExpIntVal(0), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMapReturnType must work", func() { + rs := runQuery( + as.ExpMapGetByValue( + as.MapReturnType.EXISTS, + as.ExpStringVal("test"), + as.ExpMapBin("bin6"), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + }) + + var _ = gg.Context("Logical Ops", func() { + // AND + gg.It("ExpAnd must work", func() { + rs := runQuery( + as.ExpAnd( + as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + as.ExpEq( + as.ExpStringBin("bin2"), + as.ExpStringVal("1"), + ), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + // OR + gg.It("ExpOr must work", func() { + rs := runQuery( + as.ExpOr( + as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(3), + ), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(2)) + }) + // NOT + gg.It("ExpNot must work", func() { + rs := runQuery( + as.ExpNot(as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + )), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + }) + + var _ = gg.Context("Comparisons", func() { + + gg.It("ExpEq must work", func() { + // EQ + rs := runQuery( + as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("ExpNotEq must work", func() { + // NE + rs := runQuery( + as.ExpNotEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + gg.It("ExpLess must work", func() { + // LT + rs := runQuery( + as.ExpLess( + as.ExpIntBin("bin"), + as.ExpIntVal(100), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpLessEq must work", func() { + // LE + rs := runQuery( + as.ExpLessEq( + as.ExpIntBin("bin"), + as.ExpIntVal(100), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpGreater must work", func() { + // GT + rs := runQuery( + as.ExpGreater( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(98)) + }) + + gg.It("ExpGreaterEq must work", func() { + // GE + rs := runQuery( + as.ExpGreaterEq( + as.ExpIntBin("bin"), + as.ExpIntVal(1), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(99)) + }) + + }) // gg.Context + + var _ = gg.Context("Record Ops", func() { + + gg.It("ExpRecordSize must work", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if serverIsOlderThan("7") { + gg.Skip("Not supported servers before v7") + } + + // storage-engine could be memory for which deviceSize() returns zero. + // This just tests that the expression was sent correctly + // because all device sizes are effectively allowed. + rs := runQuery( + as.ExpGreaterEq(as.ExpRecordSize(), as.ExpIntVal(0)), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpDeviceSize must work", func() { + // storage-engine could be memory for which deviceSize() returns zero. + // This just tests that the expression was sent correctly + // because all device sizes are effectively allowed. + rs := runQuery( + as.ExpGreaterEq(as.ExpDeviceSize(), as.ExpIntVal(0)), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpMemorySize must work", func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if len(nsInfo(ns, "device_total_bytes")) > 0 { + gg.Skip("Skipping ExpDeviceSize test since the namespace is persisted and the test works only for Memory-Only namespaces.") + } + + // storage-engine could be disk/device for which memorySize() returns zero. + // This just tests that the expression was sent correctly + // because all device sizes are effectively allowed. + rs := runQuery( + as.ExpGreaterEq(as.ExpMemorySize(), as.ExpIntVal(0)), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpLastUpdate must work", func() { + rs := runQuery( + as.ExpGreater(as.ExpLastUpdate(), as.ExpIntVal(15000)), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpSinceUpdate must work", func() { + time.Sleep(time.Millisecond * 150) + rs := runQuery( + as.ExpGreater(as.ExpSinceUpdate(), as.ExpIntVal(150)), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + // gg.It("ExpVoidTime must work", func() { + // // Records dont expire + // rs := runQuery( + // as.ExpLessEq(as.ExpVoidTime(), as.ExpIntVal(0)), + // set, + // ) + // count := countResults(rs) + // gm.Expect(count).To(gm.Equal(100)) + // }) + + // gg.It("ExpTTL must work", func() { + // rs := runQuery( + // as.ExpLessEq(as.ExpTTL(), as.ExpIntVal(0)), + // set, + // ) + // count := countResults(rs) + // gm.Expect(count).To(gm.Equal(100)) + // }) + + gg.It("ExpIsTombstone must work", func() { + rs := runQuery( + as.ExpNot(as.ExpIsTombstone()), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpSetName must work", func() { + rs := runQuery( + as.ExpEq( + as.ExpSetName(), + as.ExpStringVal(set), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpBinExists must work", func() { + rs := runQuery(as.ExpBinExists("bin4"), set) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpDigestModulo must work", func() { + rs := runQuery( + as.ExpEq(as.ExpDigestModulo(3), as.ExpIntVal(1)), + set, + ) + count := countResults(rs) + gm.Expect(count > 0 && count < 100).To(gm.BeTrue()) + }) + + gg.It("ExpKey must work", func() { + rs := runQuery( + as.ExpEq(as.ExpKey(as.ExpTypeINT), as.ExpIntVal(50)), + set, + ) + count := countResults(rs) + // 0 because key is not saved + gm.Expect(count).To(gm.Equal(0)) + }) + + gg.It("ExpKeyExists must work", func() { + rs := runQuery(as.ExpKeyExists(), set) + count := countResults(rs) + // 0 because key is not saved + gm.Expect(count).To(gm.Equal(0)) + }) + + gg.It("ExpEq Nil test must work", func() { + rs := runQuery( + as.ExpEq(as.ExpNilValue(), as.ExpNilValue()), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(100)) + }) + + gg.It("ExpRegexCompare must work", func() { + rs := runQuery( + as.ExpRegexCompare( + "[1-5]", + as.ExpRegexFlagICASE, + as.ExpStringBin("bin2"), + ), + set, + ) + count := countResults(rs) + gm.Expect(count).To(gm.Equal(75)) + }) + }) + + var _ = gg.Context("Commands", func() { + + rpolicy := as.NewPolicy() + wpolicy := as.NewWritePolicy(0, 0) + spolicy := as.NewScanPolicy() + bpolicy := as.NewBatchPolicy() + + gg.BeforeEach(func() { + for i := 0; i < keyCount; i++ { + key, _ := as.NewKey(ns, set, i) + ibin := as.BinMap{"bin": i} + + client.Delete(wpolicy, key) + client.Put(nil, key, ibin) + } + }) + + gg.It("Delete must work", func() { + // DELETE + key, _ := as.NewKey(ns, set, 15) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(16), + ) + _, err := client.Delete(wpolicy, key) + gm.Expect(err).To(gm.HaveOccurred()) + + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + _, err = client.Delete(wpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Put must work", func() { + // PUT + key, _ := as.NewKey(ns, set, 25) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + err := client.PutBins(wpolicy, key, as.NewBin("bin", 26)) + gm.Expect(err).To(gm.HaveOccurred()) + + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(25), + ) + err = client.PutBins(wpolicy, key, as.NewBin("bin", 26)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Get must work", func() { + // GET + key, _ := as.NewKey(ns, set, 35) + rpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + _, err := client.Get(rpolicy, key) + gm.Expect(err).To(gm.HaveOccurred()) + + rpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(35), + ) + _, err = client.Get(rpolicy, key, "bin") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Exists must work", func() { + // EXISTS + key, _ := as.NewKey(ns, set, 45) + rpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + _, err := client.Exists(rpolicy, key) + gm.Expect(err).To(gm.HaveOccurred()) + + rpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(45), + ) + _, err = client.Exists(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Add must work", func() { + // APPEND + key, _ := as.NewKey(ns, set, 55) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + err := client.AddBins(wpolicy, key, as.NewBin("test55", "test")) + gm.Expect(err).To(gm.HaveOccurred()) + + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(55), + ) + err = client.AddBins(wpolicy, key, as.NewBin("test55", "test")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Prepend must work", func() { + // PREPEND + key, _ := as.NewKey(ns, set, 55) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + err := client.PrependBins(wpolicy, key, as.NewBin("test55", "test")) + gm.Expect(err).To(gm.HaveOccurred()) + + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(55), + ) + err = client.PrependBins(wpolicy, key, as.NewBin("test55", "test")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + }) + + gg.It("Touch must work", func() { + // TOUCH + key, _ := as.NewKey(ns, set, 65) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + err := client.Touch(wpolicy, key) + gm.Expect(err).To(gm.HaveOccurred()) + + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(65), + ) + err = client.Touch(wpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("Scan must work", func() { + // SCAN + spolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(75), + ) + + rs, err := client.ScanAll(spolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + count := 0 + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + count += 1 + } + gm.Expect(count).To(gm.Equal(1)) + }) + + gg.It("Operate must work", func() { + // OPERATE + bin := as.NewBin("test85", 85) + + key, _ := as.NewKey(ns, set, 85) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(15), + ) + _, err := client.Operate(wpolicy, key, as.AddOp(bin)) + gm.Expect(err).To(gm.HaveOccurred()) + + key, _ = as.NewKey(ns, set, 85) + wpolicy.FilterExpression = as.ExpEq( + as.ExpIntBin("bin"), + as.ExpIntVal(85), + ) + _, err = client.Operate(wpolicy, key, as.AddOp(bin)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("Batch must work", func() { + // BATCH GET + keys := []*as.Key{} + for i := 85; i < 90; i++ { + key, _ := as.NewKey(ns, set, i) + keys = append(keys, key) + } + results, err := client.BatchGet(bpolicy, keys) + // all keys other than one are filtered out, so error is returned + gm.Expect(err).ToNot(gm.HaveOccurred()) + + count := 0 + for _, result := range results { + if result != nil { + count++ + } + } + gm.Expect(count).To(gm.Equal(5)) + bpolicy.FilterExpression = as.ExpGreater( + as.ExpIntBin("bin"), + as.ExpIntVal(88), + ) + results, err = client.BatchGet(bpolicy, keys) + // all keys other than one are filtered out, so error is returned + gm.Expect(err).To(gm.HaveOccurred()) + + count = 0 + for _, result := range results { + if result != nil { + count++ + } + } + gm.Expect(count).To(gm.Equal(1)) + }) + }) + + }) // Describe + + var _ = gg.Describe("Expression Filter Operations", gg.Ordered, func() { + binA := "A" + binB := "B" + binC := "C" + binD := "D" + binE := "E" + + keyA, _ := as.NewKey(ns, set, "A") + keyB, _ := as.NewKey(ns, set, []byte{'B'}) + keyC, _ := as.NewKey(ns, set, "C") + + type testParams struct { + desc string + exp *as.Expression + key, expKey *as.Key + bin string + expected int + reverseExp bool + } + matrix := []testParams{ + {"Exclusive", as.ExpExclusive(as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)), as.ExpEq(as.ExpIntBin(binD), as.ExpIntVal(1))), keyA, keyB, binA, 2, false}, + {"AddInt", as.ExpEq(as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntVal(1)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, + {"SubInt", as.ExpEq(as.ExpNumSub(as.ExpIntVal(1), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(-2)), keyA, keyB, binA, 2, false}, + {"MulInt", as.ExpEq(as.ExpNumMul(as.ExpIntVal(2), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, + {"DivInt", as.ExpEq(as.ExpNumDiv(as.ExpIntVal(8), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, + {"ModInt", as.ExpEq(as.ExpNumMod(as.ExpIntBin(binA), as.ExpIntVal(2)), as.ExpIntVal(0)), keyA, keyB, binA, 2, false}, + {"AbsInt", as.ExpEq(as.ExpNumAbs(as.ExpIntBin(binE)), as.ExpIntVal(2)), keyA, keyB, binA, 2, false}, + {"Floor", as.ExpEq(as.ExpNumFloor(as.ExpFloatBin(binB)), as.ExpFloatVal(2)), keyA, keyB, binA, 2, false}, + {"Ceil", as.ExpEq(as.ExpNumCeil(as.ExpFloatBin(binB)), as.ExpFloatVal(3)), keyA, keyB, binA, 2, false}, + {"ToInt", as.ExpEq(as.ExpToInt(as.ExpFloatBin(binB)), as.ExpIntVal(2)), keyA, keyB, binA, 2, false}, + {"ToFloat", as.ExpEq(as.ExpToFloat(as.ExpIntBin(binA)), as.ExpFloatVal(2)), keyA, keyB, binA, 2, false}, + {"IntAnd", as.ExpNot( + as.ExpAnd( + as.ExpEq( + as.ExpIntAnd(as.ExpIntBin(binA), as.ExpIntVal(0)), + as.ExpIntVal(0)), + as.ExpEq( + as.ExpIntAnd(as.ExpIntBin(binA), as.ExpIntVal(0xFFFF)), + as.ExpIntVal(1), + ))), keyA, keyA, binA, 1, true}, + {"IntOr", as.ExpNot( + as.ExpAnd( + as.ExpEq( + as.ExpIntOr(as.ExpIntBin(binA), as.ExpIntVal(0)), + as.ExpIntVal(1)), + as.ExpEq( + as.ExpIntOr(as.ExpIntBin(binA), as.ExpIntVal(0xFF)), + as.ExpIntVal(0xFF), + ))), keyA, keyA, binA, 1, true}, + {"IntXor", as.ExpNot( + as.ExpAnd( + as.ExpEq( + as.ExpIntXor(as.ExpIntBin(binA), as.ExpIntVal(0)), + as.ExpIntVal(1)), + as.ExpEq( + as.ExpIntXor(as.ExpIntBin(binA), as.ExpIntVal(0xFF)), + as.ExpIntVal(0xFE), + ))), keyA, keyA, binA, 1, true}, + {"IntNot", as.ExpNot( + as.ExpEq( + as.ExpIntNot(as.ExpIntBin(binA)), + as.ExpIntVal(-2))), keyA, keyA, binA, 1, true}, + {"LShift", as.ExpNot( + as.ExpEq( + as.ExpIntLShift(as.ExpIntBin(binA), as.ExpIntVal(2)), + as.ExpIntVal(4))), keyA, keyA, binA, 1, true}, + {"RShift", as.ExpNot( + as.ExpEq( + as.ExpIntRShift(as.ExpIntBin(binE), as.ExpIntVal(62)), + as.ExpIntVal(3))), keyB, keyB, binE, -2, true}, + {"ARShift", as.ExpNot( + as.ExpEq( + as.ExpIntARShift(as.ExpIntBin(binE), as.ExpIntVal(62)), + as.ExpIntVal(-1))), keyB, keyB, binE, -2, true}, + {"BitCount", as.ExpNot( + as.ExpEq( + as.ExpIntCount(as.ExpIntBin(binA)), + as.ExpIntVal(1))), keyA, keyA, binA, 1, true}, + {"LScan", as.ExpNot( + as.ExpEq( + as.ExpIntLScan(as.ExpIntBin(binA), as.ExpBoolVal(true)), + as.ExpIntVal(63))), keyA, keyA, binA, 1, true}, + {"RScan", as.ExpNot( + as.ExpEq( + as.ExpIntRScan(as.ExpIntBin(binA), as.ExpBoolVal(true)), + as.ExpIntVal(63))), keyA, keyA, binA, 1, true}, + {"Min", as.ExpNot( + as.ExpEq( + as.ExpMin(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntBin(binE)), + as.ExpIntVal(-1))), keyA, keyA, binA, 1, true}, + {"Max", as.ExpNot( + as.ExpEq( + as.ExpMax(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntBin(binE)), + as.ExpIntVal(1))), keyA, keyA, binA, 1, true}, + {"Cond", as.ExpNot( + as.ExpEq( + as.ExpCond( + as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(0)), as.ExpNumAdd(as.ExpIntBin(binD), as.ExpIntBin(binE)), + as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)), as.ExpNumSub(as.ExpIntBin(binD), as.ExpIntBin(binE)), + as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(2)), as.ExpNumMul(as.ExpIntBin(binD), as.ExpIntBin(binE)), + as.ExpIntVal(-1)), + as.ExpIntVal(2))), keyA, keyA, binA, 1, true}, + + {"AddFloat", as.ExpLet( + as.ExpDef("val", as.ExpNumAdd(as.ExpFloatBin(binB), as.ExpFloatVal(1.1))), + as.ExpAnd( + as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(3.2999)), + as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(3.3001)), + )), + keyA, keyB, binA, 2, false}, + {"LogFloat", as.ExpLet( + as.ExpDef("val", as.ExpNumLog(as.ExpFloatBin(binB), as.ExpFloatVal(2.0))), + as.ExpAnd( + as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(1.1374)), + as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(1.1376)))), keyA, keyB, binA, 2, false}, + {"PowFloat", as.ExpLet( + as.ExpDef("val", as.ExpNumPow(as.ExpFloatBin(binB), as.ExpFloatVal(2.0))), + as.ExpAnd( + as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(4.8399)), + as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(4.8401)))), keyA, keyB, binA, 2, false}, + } + + gg.BeforeAll(func() { + err := client.Put(nil, keyA, as.BinMap{binA: 1, binB: 1.1, binC: "abcde", binD: 1, binE: -1}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.Put(nil, keyB, as.BinMap{binA: 2, binB: 2.2, binC: "abcdeabcde", binD: 1, binE: -2}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.Put(nil, keyC, as.BinMap{binA: 0, binB: -1, binC: 1}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + assertBinEqual := func(key *as.Key, r as.BinMap, binName string, expected interface{}) { + _, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(r[binName]).To(gm.Equal(expected)) + } + + gg.It("Filtering via expressions should work", func() { + for _, params := range matrix { + policy := as.NewPolicy() + policy.FilterExpression = params.exp + _, err := client.Get(policy, params.key) + gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) + + if params.reverseExp { + policy.FilterExpression = as.ExpNot(policy.FilterExpression) + } + + r, err := client.Get(policy, params.expKey) + gm.Expect(err).ToNot(gm.HaveOccurred()) + assertBinEqual(params.key, r.Bins, params.bin, params.expected) + } + }) + + }) + +}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/field_type.go b/aerospike-tls/vendor-aerospike-client-go/field_type.go new file mode 100644 index 00000000..84ff3382 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/field_type.go @@ -0,0 +1,53 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// FieldType represents the type of the field in Aerospike Wire Protocol +type FieldType int + +// FieldType constants used in the Aerospike Wire Protocol. +const ( + NAMESPACE FieldType = 0 + TABLE FieldType = 1 + KEY FieldType = 2 + + //BIN FieldType = 3; + + DIGEST_RIPE FieldType = 4 + + //GU_TID FieldType = 5; + + DIGEST_RIPE_ARRAY FieldType = 6 + TRAN_ID FieldType = 7 // user supplied transaction id, which is simply passed back + SCAN_OPTIONS FieldType = 8 + SOCKET_TIMEOUT FieldType = 9 + RECORDS_PER_SECOND FieldType = 10 + PID_ARRAY FieldType = 11 + DIGEST_ARRAY FieldType = 12 + MAX_RECORDS FieldType = 13 + BVAL_ARRAY FieldType = 15 + INDEX_NAME FieldType = 21 + INDEX_RANGE FieldType = 22 + INDEX_CONTEXT FieldType = 23 + INDEX_TYPE FieldType = 26 + UDF_PACKAGE_NAME FieldType = 30 + UDF_FUNCTION FieldType = 31 + UDF_ARGLIST FieldType = 32 + UDF_OP FieldType = 33 + QUERY_BINLIST FieldType = 40 + BATCH_INDEX FieldType = 41 + BATCH_INDEX_WITH_SET FieldType = 42 + FILTER_EXP FieldType = 43 +) diff --git a/aerospike-tls/vendor-aerospike-client-go/filter.go b/aerospike-tls/vendor-aerospike-client-go/filter.go new file mode 100644 index 00000000..a07c0634 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/filter.go @@ -0,0 +1,228 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" +) + +// Filter specifies a query filter definition. +type Filter struct { + name string + idxType IndexCollectionType + valueParticleType int + begin Value + end Value + ctx []*CDTContext +} + +// NewEqualFilter creates a new equality filter instance for query. +// Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+. +func NewEqualFilter(binName string, value interface{}, ctx ...*CDTContext) *Filter { + val := NewValue(value) + return NewFilter(binName, ICT_DEFAULT, val.GetType(), val, val, ctx) +} + +// NewRangeFilter creates a range filter for query. +// Range arguments must be int64 values. +// String ranges are not supported. +func NewRangeFilter(binName string, begin int64, end int64, ctx ...*CDTContext) *Filter { + vBegin, vEnd := NewValue(begin), NewValue(end) + return NewFilter(binName, ICT_DEFAULT, vBegin.GetType(), vBegin, vEnd, ctx) +} + +// NewContainsFilter creates a contains filter for query on collection index. +// Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+. +func NewContainsFilter(binName string, indexCollectionType IndexCollectionType, value interface{}, ctx ...*CDTContext) *Filter { + v := NewValue(value) + return NewFilter(binName, indexCollectionType, v.GetType(), v, v, ctx) +} + +// NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index. +func NewContainsRangeFilter(binName string, indexCollectionType IndexCollectionType, begin, end int64, ctx ...*CDTContext) *Filter { + vBegin, vEnd := NewValue(begin), NewValue(end) + return NewFilter(binName, indexCollectionType, vBegin.GetType(), vBegin, vEnd, ctx) +} + +// NewGeoWithinRegionFilter creates a geospatial "within region" filter for query. +// Argument must be a valid GeoJSON region. +func NewGeoWithinRegionFilter(binName, region string, ctx ...*CDTContext) *Filter { + v := NewStringValue(region) + return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, v, v, ctx) +} + +// NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index. +// Argument must be a valid GeoJSON region. +func NewGeoWithinRegionForCollectionFilter(binName string, collectionType IndexCollectionType, region string, ctx ...*CDTContext) *Filter { + v := NewStringValue(region) + return NewFilter(binName, collectionType, ParticleType.GEOJSON, v, v, ctx) +} + +// NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query. +// Argument must be a valid GeoJSON point. +func NewGeoRegionsContainingPointFilter(binName, point string, ctx ...*CDTContext) *Filter { + v := NewStringValue(point) + return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, v, v, ctx) +} + +// NewGeoRegionsContainingPointForCollectionFilter creates a geospatial "containing point" filter for query on collection index. +// Argument must be a valid GeoJSON point. +func NewGeoRegionsContainingPointForCollectionFilter(binName string, collectionType IndexCollectionType, point string, ctx ...*CDTContext) *Filter { + v := NewStringValue(point) + return NewFilter(binName, collectionType, ParticleType.GEOJSON, v, v, ctx) +} + +// NewGeoWithinRadiusFilter creates a geospatial "within radius" filter for query. +// Arguments must be valid longitude/latitude/radius (meters) values. +func NewGeoWithinRadiusFilter(binName string, lng, lat, radius float64, ctx ...*CDTContext) *Filter { + rgnStr := fmt.Sprintf("{ \"type\": \"AeroCircle\", "+"\"coordinates\": [[%.8f, %.8f], %f] }", lng, lat, radius) + return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, NewValue(rgnStr), NewValue(rgnStr), ctx) +} + +// NewGeoWithinRadiusForCollectionFilter creates a geospatial "within radius" filter for query on collection index. +// Arguments must be valid longitude/latitude/radius (meters) values. +func NewGeoWithinRadiusForCollectionFilter(binName string, collectionType IndexCollectionType, lng, lat, radius float64, ctx ...*CDTContext) *Filter { + rgnStr := fmt.Sprintf("{ \"type\": \"AeroCircle\", "+"\"coordinates\": [[%.8f, %.8f], %f] }", lng, lat, radius) + return NewFilter(binName, collectionType, ParticleType.GEOJSON, NewValue(rgnStr), NewValue(rgnStr), ctx) +} + +// Create a filter for query. +// Range arguments must be longs or integers which can be cast to longs. +// String ranges are not supported. +func NewFilter(name string, indexCollectionType IndexCollectionType, valueParticleType int, begin Value, end Value, ctx []*CDTContext) *Filter { + return &Filter{ + name: name, + idxType: indexCollectionType, + valueParticleType: valueParticleType, + begin: begin, + end: end, + ctx: ctx, + } +} + +func (fltr *Filter) String() string { + return fmt.Sprintf("Filter: {name: %s, index type: %s, value particle type: %d, begin: %s, end: %s, context: %v}", + fltr.name, + fltr.idxType, + fltr.valueParticleType, + fltr.begin, + fltr.end, + fltr.ctx, + ) +} + +// IndexCollectionType returns filter's index type. +func (fltr *Filter) IndexCollectionType() IndexCollectionType { + return fltr.idxType +} + +// EstimateSize will estimate the size of the filter for wire protocol +func (fltr *Filter) EstimateSize() (int, Error) { + // bin name size(1) + particle type size(1) + begin particle size(4) + end particle size(4) = 10 + szBegin, err := fltr.begin.EstimateSize() + if err != nil { + return szBegin, err + } + + szEnd, err := fltr.end.EstimateSize() + if err != nil { + return szEnd, err + } + + return len(fltr.name) + szBegin + szEnd + 10, nil +} + +func (fltr *Filter) grpcPackCtxPayload() []byte { + sz, err := fltr.estimatePackedCtxSize() + if err != nil { + panic(err) + } + buf := newBuffer(sz) + if _, err := fltr.packCtx(buf); err != nil { + panic(err) + } + return buf.Bytes() +} + +// Retrieve packed Context. +// For internal use only. +func (fltr *Filter) packCtx(cmd BufferEx) (sz int, err Error) { + if len(fltr.ctx) > 0 { + sz, err = cdtContextList(fltr.ctx).packArray(cmd) + } + return sz, err +} + +// Retrieve packed Context size. +// For internal use only. +func (fltr *Filter) estimatePackedCtxSize() (sz int, err Error) { + if len(fltr.ctx) > 0 { + sz, err = cdtContextList(fltr.ctx).packArray(nil) + } + return sz, err +} + +func (fltr *Filter) write(cmd *baseCommand) (int, Error) { + size := 0 + + // Write name length + cmd.WriteByte(byte(len(fltr.name))) + size++ + + // Write Name + n, err := cmd.WriteString(fltr.name) + if err != nil { + return size + n, err + } + size += n + + // Write particle type. + cmd.WriteByte(byte(fltr.valueParticleType)) + size++ + + // Write filter begin. + esz, err := fltr.begin.EstimateSize() + if err != nil { + return size, err + } + + n = cmd.WriteInt32(int32(esz)) + size += n + + n, err = fltr.begin.write(cmd) + if err != nil { + return size + n, err + } + size += n + + // Write filter end. + esz, err = fltr.end.EstimateSize() + if err != nil { + return size, err + } + + n = cmd.WriteInt32(int32(esz)) + size += n + + n, err = fltr.end.write(cmd) + if err != nil { + return size + n, err + } + size += n + + return size, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/generation_policy.go b/aerospike-tls/vendor-aerospike-client-go/generation_policy.go new file mode 100644 index 00000000..94efbc8d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/generation_policy.go @@ -0,0 +1,30 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// GenerationPolicy determines how to handle record writes based on record generation. +type GenerationPolicy int + +const ( + // NONE means: Do not use record generation to restrict writes. + NONE GenerationPolicy = iota + + // EXPECT_GEN_EQUAL means: Update/Delete record if expected generation is equal to server generation. Otherwise, fail. + EXPECT_GEN_EQUAL + + // EXPECT_GEN_GT means: Update/Delete record if expected generation greater than the server generation. Otherwise, fail. + // This is useful for restore after backup. + EXPECT_GEN_GT +) diff --git a/aerospike-tls/vendor-aerospike-client-go/generics.go b/aerospike-tls/vendor-aerospike-client-go/generics.go new file mode 100644 index 00000000..a3964798 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/generics.go @@ -0,0 +1,3643 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type stringSlice []string + +// PackList packs StringSlice as msgpack. +func (ts stringSlice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackString(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of StringSlice +func (ts stringSlice) Len() int { + return len(ts) +} + +type intSlice []int + +// PackList packs IntSlice as msgpack. +func (ts intSlice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of IntSlice +func (ts intSlice) Len() int { + return len(ts) +} + +type int8Slice []int8 + +// PackList packs Int8Slice as msgpack. +func (ts int8Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Int8Slice +func (ts int8Slice) Len() int { + return len(ts) +} + +type int16Slice []int16 + +// PackList packs Int16Slice as msgpack. +func (ts int16Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Int16Slice +func (ts int16Slice) Len() int { + return len(ts) +} + +type int32Slice []int32 + +// PackList packs Int32Slice as msgpack. +func (ts int32Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Int32Slice +func (ts int32Slice) Len() int { + return len(ts) +} + +type int64Slice []int64 + +// PackList packs Int64Slice as msgpack. +func (ts int64Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Int64Slice +func (ts int64Slice) Len() int { + return len(ts) +} + +type uint16Slice []uint16 + +// PackList packs Uint16Slice as msgpack. +func (ts uint16Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Uint16Slice +func (ts uint16Slice) Len() int { + return len(ts) +} + +type uint32Slice []uint32 + +// PackList packs Uint32Slice as msgpack. +func (ts uint32Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackInt64(buf, int64(elem)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Uint32Slice +func (ts uint32Slice) Len() int { + return len(ts) +} + +type uint64Slice []uint64 + +// PackList packs Uint64Slice as msgpack. +func (ts uint64Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackUInt64(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Uint64Slice +func (ts uint64Slice) Len() int { + return len(ts) +} + +type float32Slice []float32 + +// PackList packs Float32Slice as msgpack. +func (ts float32Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackFloat32(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Float32Slice +func (ts float32Slice) Len() int { + return len(ts) +} + +type float64Slice []float64 + +// PackList packs Float64Slice as msgpack. +func (ts float64Slice) PackList(buf BufferEx) (int, error) { + size := 0 + for _, elem := range ts { + n, err := PackFloat64(buf, elem) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of Float64Slice +func (ts float64Slice) Len() int { + return len(ts) +} + +/////////////////////////////////////////////////////////////////////////////////////////// + +type stringStringMap map[string]string + +// PackMap packs TypeMap as msgpack. +func (tm stringStringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringStringMap) Len() int { + return len(tm) +} + +type stringIntMap map[string]int + +// PackMap packs TypeMap as msgpack. +func (tm stringIntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringIntMap) Len() int { + return len(tm) +} + +type stringInt8Map map[string]int8 + +// PackMap packs TypeMap as msgpack. +func (tm stringInt8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringInt8Map) Len() int { + return len(tm) +} + +type stringInt16Map map[string]int16 + +// PackMap packs TypeMap as msgpack. +func (tm stringInt16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringInt16Map) Len() int { + return len(tm) +} + +type stringInt32Map map[string]int32 + +// PackMap packs TypeMap as msgpack. +func (tm stringInt32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringInt32Map) Len() int { + return len(tm) +} + +type stringInt64Map map[string]int64 + +// PackMap packs TypeMap as msgpack. +func (tm stringInt64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringInt64Map) Len() int { + return len(tm) +} + +type stringUint16Map map[string]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm stringUint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringUint16Map) Len() int { + return len(tm) +} + +type stringUint32Map map[string]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm stringUint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringUint32Map) Len() int { + return len(tm) +} + +type stringFloat32Map map[string]float32 + +// PackMap packs TypeMap as msgpack. +func (tm stringFloat32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringFloat32Map) Len() int { + return len(tm) +} + +type stringFloat64Map map[string]float64 + +// PackMap packs TypeMap as msgpack. +func (tm stringFloat64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringFloat64Map) Len() int { + return len(tm) +} + +type intStringMap map[int]string + +// PackMap packs TypeMap as msgpack. +func (tm intStringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intStringMap) Len() int { + return len(tm) +} + +type intIntMap map[int]int + +// PackMap packs TypeMap as msgpack. +func (tm intIntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intIntMap) Len() int { + return len(tm) +} + +type intInt8Map map[int]int8 + +// PackMap packs TypeMap as msgpack. +func (tm intInt8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intInt8Map) Len() int { + return len(tm) +} + +type intInt16Map map[int]int16 + +// PackMap packs TypeMap as msgpack. +func (tm intInt16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intInt16Map) Len() int { + return len(tm) +} + +type intInt32Map map[int]int32 + +// PackMap packs TypeMap as msgpack. +func (tm intInt32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intInt32Map) Len() int { + return len(tm) +} + +type intInt64Map map[int]int64 + +// PackMap packs TypeMap as msgpack. +func (tm intInt64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intInt64Map) Len() int { + return len(tm) +} + +type intUint16Map map[int]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm intUint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intUint16Map) Len() int { + return len(tm) +} + +type intUint32Map map[int]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm intUint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intUint32Map) Len() int { + return len(tm) +} + +type intFloat32Map map[int]float32 + +// PackMap packs TypeMap as msgpack. +func (tm intFloat32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intFloat32Map) Len() int { + return len(tm) +} + +type intFloat64Map map[int]float64 + +// PackMap packs TypeMap as msgpack. +func (tm intFloat64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intFloat64Map) Len() int { + return len(tm) +} + +type intInterfaceMap map[int]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm intInterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intInterfaceMap) Len() int { + return len(tm) +} + +type int8StringMap map[int8]string + +// PackMap packs TypeMap as msgpack. +func (tm int8StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8StringMap) Len() int { + return len(tm) +} + +type int8IntMap map[int8]int + +// PackMap packs TypeMap as msgpack. +func (tm int8IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8IntMap) Len() int { + return len(tm) +} + +type int8Int8Map map[int8]int8 + +// PackMap packs TypeMap as msgpack. +func (tm int8Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Int8Map) Len() int { + return len(tm) +} + +type int8Int16Map map[int8]int16 + +// PackMap packs TypeMap as msgpack. +func (tm int8Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Int16Map) Len() int { + return len(tm) +} + +type int8Int32Map map[int8]int32 + +// PackMap packs TypeMap as msgpack. +func (tm int8Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Int32Map) Len() int { + return len(tm) +} + +type int8Int64Map map[int8]int64 + +// PackMap packs TypeMap as msgpack. +func (tm int8Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Int64Map) Len() int { + return len(tm) +} + +type int8Uint16Map map[int8]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm int8Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Uint16Map) Len() int { + return len(tm) +} + +type int8Uint32Map map[int8]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm int8Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Uint32Map) Len() int { + return len(tm) +} + +type int8Float32Map map[int8]float32 + +// PackMap packs TypeMap as msgpack. +func (tm int8Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Float32Map) Len() int { + return len(tm) +} + +type int8Float64Map map[int8]float64 + +// PackMap packs TypeMap as msgpack. +func (tm int8Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Float64Map) Len() int { + return len(tm) +} + +type int8InterfaceMap map[int8]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm int8InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8InterfaceMap) Len() int { + return len(tm) +} + +type int16StringMap map[int16]string + +// PackMap packs TypeMap as msgpack. +func (tm int16StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16StringMap) Len() int { + return len(tm) +} + +type int16IntMap map[int16]int + +// PackMap packs TypeMap as msgpack. +func (tm int16IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16IntMap) Len() int { + return len(tm) +} + +type int16Int8Map map[int16]int8 + +// PackMap packs TypeMap as msgpack. +func (tm int16Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Int8Map) Len() int { + return len(tm) +} + +type int16Int16Map map[int16]int16 + +// PackMap packs TypeMap as msgpack. +func (tm int16Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Int16Map) Len() int { + return len(tm) +} + +type int16Int32Map map[int16]int32 + +// PackMap packs TypeMap as msgpack. +func (tm int16Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Int32Map) Len() int { + return len(tm) +} + +type int16Int64Map map[int16]int64 + +// PackMap packs TypeMap as msgpack. +func (tm int16Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Int64Map) Len() int { + return len(tm) +} + +type int16Uint16Map map[int16]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm int16Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Uint16Map) Len() int { + return len(tm) +} + +type int16Uint32Map map[int16]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm int16Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Uint32Map) Len() int { + return len(tm) +} + +type int16Float32Map map[int16]float32 + +// PackMap packs TypeMap as msgpack. +func (tm int16Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Float32Map) Len() int { + return len(tm) +} + +type int16Float64Map map[int16]float64 + +// PackMap packs TypeMap as msgpack. +func (tm int16Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Float64Map) Len() int { + return len(tm) +} + +type int16InterfaceMap map[int16]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm int16InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16InterfaceMap) Len() int { + return len(tm) +} + +type int32StringMap map[int32]string + +// PackMap packs TypeMap as msgpack. +func (tm int32StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32StringMap) Len() int { + return len(tm) +} + +type int32IntMap map[int32]int + +// PackMap packs TypeMap as msgpack. +func (tm int32IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32IntMap) Len() int { + return len(tm) +} + +type int32Int8Map map[int32]int8 + +// PackMap packs TypeMap as msgpack. +func (tm int32Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Int8Map) Len() int { + return len(tm) +} + +type int32Int16Map map[int32]int16 + +// PackMap packs TypeMap as msgpack. +func (tm int32Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Int16Map) Len() int { + return len(tm) +} + +type int32Int32Map map[int32]int32 + +// PackMap packs TypeMap as msgpack. +func (tm int32Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Int32Map) Len() int { + return len(tm) +} + +type int32Int64Map map[int32]int64 + +// PackMap packs TypeMap as msgpack. +func (tm int32Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Int64Map) Len() int { + return len(tm) +} + +type int32Uint16Map map[int32]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm int32Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Uint16Map) Len() int { + return len(tm) +} + +type int32Uint32Map map[int32]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm int32Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Uint32Map) Len() int { + return len(tm) +} + +type int32Float32Map map[int32]float32 + +// PackMap packs TypeMap as msgpack. +func (tm int32Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Float32Map) Len() int { + return len(tm) +} + +type int32Float64Map map[int32]float64 + +// PackMap packs TypeMap as msgpack. +func (tm int32Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Float64Map) Len() int { + return len(tm) +} + +type int32InterfaceMap map[int32]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm int32InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32InterfaceMap) Len() int { + return len(tm) +} + +type int64StringMap map[int64]string + +// PackMap packs TypeMap as msgpack. +func (tm int64StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64StringMap) Len() int { + return len(tm) +} + +type int64IntMap map[int64]int + +// PackMap packs TypeMap as msgpack. +func (tm int64IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64IntMap) Len() int { + return len(tm) +} + +type int64Int8Map map[int64]int8 + +// PackMap packs TypeMap as msgpack. +func (tm int64Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Int8Map) Len() int { + return len(tm) +} + +type int64Int16Map map[int64]int16 + +// PackMap packs TypeMap as msgpack. +func (tm int64Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Int16Map) Len() int { + return len(tm) +} + +type int64Int32Map map[int64]int32 + +// PackMap packs TypeMap as msgpack. +func (tm int64Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Int32Map) Len() int { + return len(tm) +} + +type int64Int64Map map[int64]int64 + +// PackMap packs TypeMap as msgpack. +func (tm int64Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Int64Map) Len() int { + return len(tm) +} + +type int64Uint16Map map[int64]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm int64Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Uint16Map) Len() int { + return len(tm) +} + +type int64Uint32Map map[int64]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm int64Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Uint32Map) Len() int { + return len(tm) +} + +type int64Float32Map map[int64]float32 + +// PackMap packs TypeMap as msgpack. +func (tm int64Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Float32Map) Len() int { + return len(tm) +} + +type int64Float64Map map[int64]float64 + +// PackMap packs TypeMap as msgpack. +func (tm int64Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Float64Map) Len() int { + return len(tm) +} + +type int64InterfaceMap map[int64]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm int64InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64InterfaceMap) Len() int { + return len(tm) +} + +type uint16StringMap map[uint16]string + +// PackMap packs TypeMap as msgpack. +func (tm uint16StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16StringMap) Len() int { + return len(tm) +} + +type uint16IntMap map[uint16]int + +// PackMap packs TypeMap as msgpack. +func (tm uint16IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16IntMap) Len() int { + return len(tm) +} + +type uint16Int8Map map[uint16]int8 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Int8Map) Len() int { + return len(tm) +} + +type uint16Int16Map map[uint16]int16 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Int16Map) Len() int { + return len(tm) +} + +type uint16Int32Map map[uint16]int32 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Int32Map) Len() int { + return len(tm) +} + +type uint16Int64Map map[uint16]int64 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Int64Map) Len() int { + return len(tm) +} + +type uint16Uint16Map map[uint16]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Uint16Map) Len() int { + return len(tm) +} + +type uint16Uint32Map map[uint16]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Uint32Map) Len() int { + return len(tm) +} + +type uint16Float32Map map[uint16]float32 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Float32Map) Len() int { + return len(tm) +} + +type uint16Float64Map map[uint16]float64 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Float64Map) Len() int { + return len(tm) +} + +type uint16InterfaceMap map[uint16]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm uint16InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16InterfaceMap) Len() int { + return len(tm) +} + +type uint32StringMap map[uint32]string + +// PackMap packs TypeMap as msgpack. +func (tm uint32StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32StringMap) Len() int { + return len(tm) +} + +type uint32IntMap map[uint32]int + +// PackMap packs TypeMap as msgpack. +func (tm uint32IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32IntMap) Len() int { + return len(tm) +} + +type uint32Int8Map map[uint32]int8 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Int8Map) Len() int { + return len(tm) +} + +type uint32Int16Map map[uint32]int16 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Int16Map) Len() int { + return len(tm) +} + +type uint32Int32Map map[uint32]int32 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Int32Map) Len() int { + return len(tm) +} + +type uint32Int64Map map[uint32]int64 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Int64Map) Len() int { + return len(tm) +} + +type uint32Uint16Map map[uint32]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Uint16Map) Len() int { + return len(tm) +} + +type uint32Uint32Map map[uint32]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Uint32Map) Len() int { + return len(tm) +} + +type uint32Float32Map map[uint32]float32 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Float32Map) Len() int { + return len(tm) +} + +type uint32Float64Map map[uint32]float64 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Float64Map) Len() int { + return len(tm) +} + +type uint32InterfaceMap map[uint32]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm uint32InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32InterfaceMap) Len() int { + return len(tm) +} + +type float32StringMap map[float32]string + +// PackMap packs TypeMap as msgpack. +func (tm float32StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32StringMap) Len() int { + return len(tm) +} + +type float32IntMap map[float32]int + +// PackMap packs TypeMap as msgpack. +func (tm float32IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32IntMap) Len() int { + return len(tm) +} + +type float32Int8Map map[float32]int8 + +// PackMap packs TypeMap as msgpack. +func (tm float32Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Int8Map) Len() int { + return len(tm) +} + +type float32Int16Map map[float32]int16 + +// PackMap packs TypeMap as msgpack. +func (tm float32Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Int16Map) Len() int { + return len(tm) +} + +type float32Int32Map map[float32]int32 + +// PackMap packs TypeMap as msgpack. +func (tm float32Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Int32Map) Len() int { + return len(tm) +} + +type float32Int64Map map[float32]int64 + +// PackMap packs TypeMap as msgpack. +func (tm float32Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Int64Map) Len() int { + return len(tm) +} + +type float32Uint16Map map[float32]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm float32Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Uint16Map) Len() int { + return len(tm) +} + +type float32Uint32Map map[float32]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm float32Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Uint32Map) Len() int { + return len(tm) +} + +type float32Float32Map map[float32]float32 + +// PackMap packs TypeMap as msgpack. +func (tm float32Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Float32Map) Len() int { + return len(tm) +} + +type float32Float64Map map[float32]float64 + +// PackMap packs TypeMap as msgpack. +func (tm float32Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Float64Map) Len() int { + return len(tm) +} + +type float32InterfaceMap map[float32]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm float32InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32InterfaceMap) Len() int { + return len(tm) +} + +type float64StringMap map[float64]string + +// PackMap packs TypeMap as msgpack. +func (tm float64StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64StringMap) Len() int { + return len(tm) +} + +type float64IntMap map[float64]int + +// PackMap packs TypeMap as msgpack. +func (tm float64IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64IntMap) Len() int { + return len(tm) +} + +type float64Int8Map map[float64]int8 + +// PackMap packs TypeMap as msgpack. +func (tm float64Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Int8Map) Len() int { + return len(tm) +} + +type float64Int16Map map[float64]int16 + +// PackMap packs TypeMap as msgpack. +func (tm float64Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Int16Map) Len() int { + return len(tm) +} + +type float64Int32Map map[float64]int32 + +// PackMap packs TypeMap as msgpack. +func (tm float64Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Int32Map) Len() int { + return len(tm) +} + +type float64Int64Map map[float64]int64 + +// PackMap packs TypeMap as msgpack. +func (tm float64Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Int64Map) Len() int { + return len(tm) +} + +type float64Uint16Map map[float64]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm float64Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Uint16Map) Len() int { + return len(tm) +} + +type float64Uint32Map map[float64]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm float64Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Uint32Map) Len() int { + return len(tm) +} + +type float64Float32Map map[float64]float32 + +// PackMap packs TypeMap as msgpack. +func (tm float64Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Float32Map) Len() int { + return len(tm) +} + +type float64Float64Map map[float64]float64 + +// PackMap packs TypeMap as msgpack. +func (tm float64Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Float64Map) Len() int { + return len(tm) +} + +type float64InterfaceMap map[float64]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm float64InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64InterfaceMap) Len() int { + return len(tm) +} + +type stringUint64Map map[string]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm stringUint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackString(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm stringUint64Map) Len() int { + return len(tm) +} + +type intUint64Map map[int]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm intUint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm intUint64Map) Len() int { + return len(tm) +} + +type int8Uint64Map map[int8]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm int8Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int8Uint64Map) Len() int { + return len(tm) +} + +type int16Uint64Map map[int16]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm int16Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int16Uint64Map) Len() int { + return len(tm) +} + +type int32Uint64Map map[int32]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm int32Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int32Uint64Map) Len() int { + return len(tm) +} + +type int64Uint64Map map[int64]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm int64Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm int64Uint64Map) Len() int { + return len(tm) +} + +type uint16Uint64Map map[uint16]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm uint16Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint16Uint64Map) Len() int { + return len(tm) +} + +type uint32Uint64Map map[uint32]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm uint32Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackInt64(buf, int64(k)) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint32Uint64Map) Len() int { + return len(tm) +} + +type float32Uint64Map map[float32]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm float32Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat32(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float32Uint64Map) Len() int { + return len(tm) +} + +type float64Uint64Map map[float64]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm float64Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackFloat64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm float64Uint64Map) Len() int { + return len(tm) +} + +type uint64StringMap map[uint64]string + +// PackMap packs TypeMap as msgpack. +func (tm uint64StringMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackString(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64StringMap) Len() int { + return len(tm) +} + +type uint64IntMap map[uint64]int + +// PackMap packs TypeMap as msgpack. +func (tm uint64IntMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64IntMap) Len() int { + return len(tm) +} + +type uint64Int8Map map[uint64]int8 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Int8Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Int8Map) Len() int { + return len(tm) +} + +type uint64Int16Map map[uint64]int16 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Int16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Int16Map) Len() int { + return len(tm) +} + +type uint64Int32Map map[uint64]int32 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Int32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Int32Map) Len() int { + return len(tm) +} + +type uint64Int64Map map[uint64]int64 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Int64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Int64Map) Len() int { + return len(tm) +} + +type uint64Uint16Map map[uint64]uint16 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Uint16Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Uint16Map) Len() int { + return len(tm) +} + +type uint64Uint32Map map[uint64]uint32 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Uint32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackInt64(buf, int64(v)) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Uint32Map) Len() int { + return len(tm) +} + +type uint64Uint64Map map[uint64]uint64 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Uint64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackUInt64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Uint64Map) Len() int { + return len(tm) +} + +type uint64Float32Map map[uint64]float32 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Float32Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat32(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Float32Map) Len() int { + return len(tm) +} + +type uint64Float64Map map[uint64]float64 + +// PackMap packs TypeMap as msgpack. +func (tm uint64Float64Map) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = PackFloat64(buf, v) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64Float64Map) Len() int { + return len(tm) +} + +type uint64InterfaceMap map[uint64]interface{} + +// PackMap packs TypeMap as msgpack. +func (tm uint64InterfaceMap) PackMap(buf BufferEx) (int, error) { + size := 0 + for k, v := range tm { + n, err := PackUInt64(buf, k) + size += n + if err != nil { + return size, err + } + + n, err = packObject(buf, v, false) + size += n + if err != nil { + return size, err + } + } + return size, nil +} + +// Len return the length of TypeSlice +func (tm uint64InterfaceMap) Len() int { + return len(tm) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/geo_test.go b/aerospike-tls/vendor-aerospike-client-go/geo_test.go new file mode 100644 index 00000000..1e5793ec --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/geo_test.go @@ -0,0 +1,203 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Geo Spacial Tests", gg.Ordered, func() { + + gg.BeforeEach(func() { + if !featureEnabled("geo") { + gg.Skip("Geo Tests will not run since feature is not supported by the server.") + return + } + }) + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + var size = 20 + const keyCount = 1000 + + var binName = "GeoBin" + + gg.BeforeAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + // queries only work on indices + dropIndex(wpolicy, ns, set, set+binName) + createIndex(wpolicy, ns, set, set+binName, binName, as.GEO2DSPHERE) + }) + + gg.AfterAll(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + dropIndex(wpolicy, ns, set, set+binName) + }) + + gg.It("must Query a specific Region Containing a Point and get only relevant records back", func() { + + regions := []as.GeoJSONValue{ + as.NewGeoJSONValue(`{ + "type": "Polygon", + "coordinates": [ + [[-122.500000, 37.000000],[-121.000000, 37.000000], + [-121.000000, 38.080000],[-122.500000, 38.080000], + [-122.500000, 37.000000]] + ] + }`), + // `{ + // "type": "Polygon", + // "coordinates": [ + // [[-125.500000, 33.000000],[-124.000000, 31.000000], + // [-123.000000, 32.080000],[-123.500000, 32.080000], + // [-126.500000, 34.000000]] + // ] + // }`, + } + + for i, ptsb := range regions { + key, _ := as.NewKey(ns, set, i) + bin := as.NewBin(binName, ptsb) + err := client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + points := []as.GeoJSONValue{ + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-122.000000, 37.500000] }`), + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.700000, 37.800000] }`), + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.900000, 37.600000] }`), + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.800000, 37.700000] }`), + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.600000, 37.900000] }`), + as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.500000, 38.000000] }`), + } + + for _, rgnsb := range points { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewGeoWithinRegionFilter(binName, string(rgnsb))) + recordset, err := client.Query(nil, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + count := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + gm.Expect(regions).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) + count++ + } + + // 1 region should be found + gm.Expect(count).To(gm.Equal(1)) + } + }) + + gg.It("must Query a specific Point in Region and get only relevant records back", func() { + + points := []as.GeoJSONValue{} + for i := 0; i < size; i++ { + lng := -122.0 + (0.1 * float64(i)) + lat := 37.5 + (0.1 * float64(i)) + ptsb := "{ \"type\": \"Point\", \"coordinates\": [" + ptsb += fmt.Sprintf("%f", lng) + ptsb += ", " + ptsb += fmt.Sprintf("%f", lat) + ptsb += "] }" + + points = append(points, as.NewGeoJSONValue(ptsb)) + + key, _ := as.NewKey(ns, set, i) + bin := as.NewBin(binName, as.NewGeoJSONValue(ptsb)) + err := client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + rgnsb := `{ + "type": "Polygon", + "coordinates": [ + [[-122.500000, 37.000000],[-121.000000, 37.000000], + [-121.000000, 38.080000],[-122.500000, 38.080000], + [-122.500000, 37.000000]] + ] + }` + + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewGeoRegionsContainingPointFilter(binName, rgnsb)) + recordset, err := client.Query(nil, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + count := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + gm.Expect(points).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) + count++ + } + + // 6 points should be found + gm.Expect(count).To(gm.Equal(6)) + }) + + gg.It("must Query specific Points in Region denoted by a point and radius and get only relevant records back", func() { + + points := []as.GeoJSONValue{} + for i := 0; i < size; i++ { + lng := -122.0 + (0.1 * float64(i)) + lat := 37.5 + (0.1 * float64(i)) + ptsb := "{ \"type\": \"Point\", \"coordinates\": [" + ptsb += fmt.Sprintf("%f", lng) + ptsb += ", " + ptsb += fmt.Sprintf("%f", lat) + ptsb += "] }" + + points = append(points, as.NewGeoJSONValue(ptsb)) + + key, _ := as.NewKey(ns, set, i) + bin := as.NewBin(binName, as.NewGeoJSONValue(ptsb)) + err := client.PutBins(wpolicy, key, bin) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + lon := float64(-122.0) + lat := float64(37.5) + radius := float64(50000.0) + + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewGeoWithinRadiusFilter(binName, lon, lat, radius)) + recordset, err := client.Query(nil, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + count := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + gm.Expect(points).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) + count++ + } + + // 6 points should be found + gm.Expect(count).To(gm.Equal(4)) + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/go.mod b/aerospike-tls/vendor-aerospike-client-go/go.mod new file mode 100644 index 00000000..6f2b6d8e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/go.mod @@ -0,0 +1,35 @@ +module github.com/aerospike/aerospike-client-go/v7 + +go 1.20 + +require ( + github.com/onsi/ginkgo/v2 v2.16.0 + github.com/onsi/gomega v1.32.0 + github.com/yuin/gopher-lua v1.1.1 + golang.org/x/sync v0.7.0 + google.golang.org/grpc v1.63.3 + google.golang.org/protobuf v1.34.2 +) + +require ( + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect + github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +retract ( + v7.3.0 // `Client.BatchGetOperate` issue + v7.7.0 // nil deref in tend logic +) diff --git a/aerospike-tls/vendor-aerospike-client-go/go.sum b/aerospike-tls/vendor-aerospike-client-go/go.sum new file mode 100644 index 00000000..b2dbf46a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/go.sum @@ -0,0 +1,82 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= +github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/grpc v1.63.3 h1:FGVegD7MHo/zhaGduk/R85WvSFJ+si70UQIJ0fg+BiU= +google.golang.org/grpc v1.63.3/go.mod h1:5FFeE/YiGPD2flWFCrCx8K3Ay7hALATnKiI8U3avIuw= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/aerospike-tls/vendor-aerospike-client-go/helper_test.go b/aerospike-tls/vendor-aerospike-client-go/helper_test.go new file mode 100644 index 00000000..30af0ba1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/helper_test.go @@ -0,0 +1,52 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +func ParseInfoErrorCode(response string) Error { + return parseInfoErrorCode(response) +} + +func (e *AerospikeError) Msg() string { + return e.msg +} + +func (clstr *Cluster) GetMasterNode(partition *Partition) (*Node, Error) { + return partition.getMasterNode(clstr) +} + +// implements GomegaStringer to avoid some of the pain points +// in formatting the code +func (nd *Node) GomegaString() string { + return nd.String() +} + +func (ptn *Partition) GetMasterNode(cluster *Cluster) (*Node, Error) { + return ptn.getMasterNode(cluster) +} + +func (ptn *Partition) GetMasterProlesNode(cluster *Cluster) (*Node, Error) { + return ptn.getMasterProlesNode(cluster) +} + +// fillMinCounts will fill the connection pool to the minimum required +// by the ClientPolicy.MinConnectionsPerNode +func (nd *Node) ConnsCount() int { + return nd.connectionCount.Get() +} + +// CloseConnections closes all the node connections +func (nd *Node) CloseConnections() { + nd.closeConnections() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_operation.go b/aerospike-tls/vendor-aerospike-client-go/hll_operation.go new file mode 100644 index 00000000..c32e079c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/hll_operation.go @@ -0,0 +1,303 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import ( + "fmt" + + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" +) + +// HyperLogLog (HLL) operations. +// Requires server versions >= 4.9. +// +// HyperLogLog operations on HLL items nested in lists/maps are not currently +// supported by the server. +const ( + _HLL_INIT = 0 + _HLL_ADD = 1 + _HLL_SET_UNION = 2 + _HLL_SET_COUNT = 3 + _HLL_FOLD = 4 + _HLL_COUNT = 50 + _HLL_UNION = 51 + _HLL_UNION_COUNT = 52 + _HLL_INTERSECT_COUNT = 53 + _HLL_SIMILARITY = 54 + _HLL_DESCRIBE = 55 +) + +// HLLInitOp creates HLL init operation with minhash bits. +// Server creates a new HLL or resets an existing HLL. +// Server does not return a value. +// +// policy write policy, use DefaultHLLPolicy for default +// binName name of bin +// indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. +// minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. +// indexBitCount + minHashBitCount must be <= 64. +func HLLInitOp(policy *HLLPolicy, binName string, indexBitCount, minHashBitCount int) *Operation { + return &Operation{ + opType: _HLL_MODIFY, + binName: binName, + binValue: ListValue{_HLL_INIT, IntegerValue(indexBitCount), IntegerValue(minHashBitCount), IntegerValue(policy.flags)}, + encoder: newHLLEncoder, + } +} + +// HLLAddOp creates HLL add operation with minhash bits. +// Server adds values to HLL set. If HLL bin does not exist, use indexBitCount and minHashBitCount +// to create HLL bin. Server returns number of entries that caused HLL to update a register. +// +// policy write policy, use DefaultHLLPolicy for default +// binName name of bin +// list list of values to be added +// indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. +// minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. +// indexBitCount + minHashBitCount must be <= 64. +func HLLAddOp(policy *HLLPolicy, binName string, list []Value, indexBitCount, minHashBitCount int) *Operation { + return &Operation{ + opType: _HLL_MODIFY, + binName: binName, + binValue: ListValue{_HLL_ADD, ValueArray(list), IntegerValue(indexBitCount), IntegerValue(minHashBitCount), IntegerValue(policy.flags)}, + encoder: newHLLEncoder, + } +} + +// HLLSetUnionOp creates HLL set union operation. +// Server sets union of specified HLL objects with HLL bin. +// Server does not return a value. +// +// policy write policy, use DefaultHLLPolicy for default +// binName name of bin +// list list of HLL objects +func HLLSetUnionOp(policy *HLLPolicy, binName string, list []HLLValue) *Operation { + return &Operation{ + opType: _HLL_MODIFY, + binName: binName, + binValue: ListValue{_HLL_SET_UNION, _HLLValueArray(list), IntegerValue(policy.flags)}, + encoder: newHLLEncoder, + } +} + +// HLLRefreshCountOp creates HLL refresh operation. +// Server updates the cached count (if stale) and returns the count. +// +// binName name of bin +func HLLRefreshCountOp(binName string) *Operation { + return &Operation{ + opType: _HLL_MODIFY, + binName: binName, + binValue: ListValue{_HLL_SET_COUNT}, + encoder: newHLLEncoder, + } +} + +// HLLFoldOp creates HLL fold operation. +// Servers folds indexBitCount to the specified value. +// This can only be applied when minHashBitCount on the HLL bin is 0. +// Server does not return a value. +// +// binName name of bin +// indexBitCount number of index bits. Must be between 4 and 16 inclusive. +func HLLFoldOp(binName string, indexBitCount int) *Operation { + return &Operation{ + opType: _HLL_MODIFY, + binName: binName, + binValue: ListValue{_HLL_FOLD, IntegerValue(indexBitCount)}, + encoder: newHLLEncoder, + } + +} + +// HLLGetCountOp creates HLL getCount operation. +// Server returns estimated number of elements in the HLL bin. +// +// binName name of bin +func HLLGetCountOp(binName string) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_COUNT}, + encoder: newHLLEncoder, + } + +} + +// HLLGetUnionOp creates HLL getUnion operation. +// Server returns an HLL object that is the union of all specified HLL objects in the list +// with the HLL bin. +// +// binName name of bin +// list list of HLL objects +func HLLGetUnionOp(binName string, list []HLLValue) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_UNION, _HLLValueArray(list)}, + encoder: newHLLEncoder, + } + +} + +// HLLGetUnionCountOp creates HLL getUnionCount operation. +// Server returns estimated number of elements that would be contained by the union of these +// HLL objects. +// +// binName name of bin +// list list of HLL objects +func HLLGetUnionCountOp(binName string, list []HLLValue) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_UNION_COUNT, _HLLValueArray(list)}, + encoder: newHLLEncoder, + } +} + +// HLLGetIntersectCountOp creates HLL getIntersectCount operation. +// Server returns estimated number of elements that would be contained by the intersection of +// these HLL objects. +// +// binName name of bin +// list list of HLL objects +func HLLGetIntersectCountOp(binName string, list []HLLValue) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_INTERSECT_COUNT, _HLLValueArray(list)}, + encoder: newHLLEncoder, + } +} + +// HLLGetSimilarityOp creates HLL getSimilarity operation. +// Server returns estimated similarity of these HLL objects. Return type is a double. +// +// binName name of bin +// list list of HLL objects +func HLLGetSimilarityOp(binName string, list []HLLValue) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_SIMILARITY, _HLLValueArray(list)}, + encoder: newHLLEncoder, + } +} + +// HLLDescribeOp creates HLL describe operation. +// Server returns indexBitCount and minHashBitCount used to create HLL bin in a list of longs. +// The list size is 2. +// +// binName name of bin +func HLLDescribeOp(binName string) *Operation { + return &Operation{ + opType: _HLL_READ, + binName: binName, + binValue: ListValue{_HLL_DESCRIBE}, + encoder: newHLLEncoder, + } +} + +// hllEncoder is used to encode the HLL operations to wire protocol +func newHLLEncoder(op *Operation, packer BufferEx) (int, Error) { + params := op.binValue.(ListValue) + opType := params[0].(int) + if len(op.binValue.(ListValue)) > 1 { + return packHLLIfcParamsAsArray(packer, int16(opType), params[1:]) + } + return packHLLIfcParamsAsArray(packer, int16(opType), nil) +} + +func packHLLIfcParamsAsArray(packer BufferEx, opType int16, params ListValue) (int, Error) { + return packHLLIfcVarParamsAsArray(packer, opType, []interface{}(params)...) +} + +func packHLLIfcVarParamsAsArray(packer BufferEx, opType int16, params ...interface{}) (int, Error) { + size := 0 + n, err := packArrayBegin(packer, len(params)+1) + if err != nil { + return size + n, err + } + size += n + + if n, err = packAInt(packer, int(opType)); err != nil { + return size + n, err + } + size += n + + if len(params) > 0 { + for i := range params { + if n, err = packObject(packer, params[i], false); err != nil { + return size + n, err + } + size += n + } + } + + return size, nil +} + +/////////////////////////////////////////////////////////////////////////////////////// + +// _HLLValueArray encapsulates an array of Value. +// Supported by Aerospike 3+ servers only. +type _HLLValueArray []HLLValue + +func (va _HLLValueArray) EstimateSize() (int, Error) { + return packHLLValueArray(nil, va) +} + +func (va _HLLValueArray) write(cmd BufferEx) (int, Error) { + return packHLLValueArray(cmd, va) +} + +func (va _HLLValueArray) pack(cmd BufferEx) (int, Error) { + return packHLLValueArray(cmd, va) +} + +// GetType returns wire protocol value type. +func (va _HLLValueArray) GetType() int { + return ParticleType.LIST +} + +// GetObject returns original value as an interface{}. +func (va _HLLValueArray) GetObject() interface{} { + return []HLLValue(va) +} + +// String implements Stringer interface. +func (va _HLLValueArray) String() string { + return fmt.Sprintf("%v", []HLLValue(va)) +} + +func packHLLValueArray(cmd BufferEx, list _HLLValueArray) (int, Error) { + size := 0 + n, err := packArrayBegin(cmd, len(list)) + if err != nil { + return n, err + } + size += n + + for i := range list { + n, err = list[i].pack(cmd) + if err != nil { + return 0, err + } + size += n + } + + return size, err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go b/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go new file mode 100644 index 00000000..8bbd63f4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go @@ -0,0 +1,901 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "strconv" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" +) + +var _ = gg.Describe("HyperLogLog Test", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var binName string = "ophbin" + var nEntries int = 1 << 8 + + var minIndexBits int = 4 + var maxIndexBits int = 16 + var minMinhashBits int = 4 + var maxMinhashBits int = 51 + + key, _ := as.NewKey(ns, set, "ophkey") + key0, _ := as.NewKey(ns, set, "ophkey0") + key1, _ := as.NewKey(ns, set, "ophkey1") + key2, _ := as.NewKey(ns, set, "ophkey2") + keys := []*as.Key{key0, key1, key2} + + var entries []as.Value + var legalIndexBits []int + var legalDescriptions [][]int + var illegalDescriptions [][]int + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + for i := 0; i < nEntries; i++ { + entries = append(entries, as.StringValue("key "+strconv.Itoa(i))) + } + + for index_bits := minIndexBits; index_bits <= maxIndexBits; index_bits += 4 { + combined_bits := maxMinhashBits + index_bits + max_allowed_minhash_bits := maxMinhashBits + + if combined_bits > 64 { + max_allowed_minhash_bits -= combined_bits - 64 + } + + mid_minhash_bits := (max_allowed_minhash_bits + index_bits) / 2 + var legal_zero []int + var legal_min []int + var legal_mid []int + var legal_max []int + + legalIndexBits = append(legalIndexBits, index_bits) + legal_zero = append(legal_zero, index_bits) + legal_min = append(legal_min, index_bits) + legal_mid = append(legal_mid, index_bits) + legal_max = append(legal_max, index_bits) + + legal_zero = append(legal_zero, 0) + legal_min = append(legal_min, minMinhashBits) + legal_mid = append(legal_mid, mid_minhash_bits) + legal_max = append(legal_max, max_allowed_minhash_bits) + + legalDescriptions = append(legalDescriptions, legal_zero) + legalDescriptions = append(legalDescriptions, legal_min) + legalDescriptions = append(legalDescriptions, legal_mid) + legalDescriptions = append(legalDescriptions, legal_max) + } + + for index_bits := minIndexBits - 1; index_bits <= maxIndexBits+5; index_bits += 4 { + if index_bits < minIndexBits || index_bits > maxIndexBits { + var illegal_zero []int + var illegal_min []int + var illegal_max []int + + illegal_zero = append(illegal_zero, index_bits) + illegal_min = append(illegal_min, index_bits) + illegal_max = append(illegal_max, index_bits) + + illegal_zero = append(illegal_zero, 0) + illegal_min = append(illegal_min, minMinhashBits-1) + illegal_max = append(illegal_max, maxMinhashBits) + + illegalDescriptions = append(illegalDescriptions, illegal_zero) + illegalDescriptions = append(illegalDescriptions, illegal_min) + illegalDescriptions = append(illegalDescriptions, illegal_max) + } else { + var illegal_min []int + var illegal_max []int + var illegal_max1 []int + + illegal_min = append(illegal_min, index_bits) + illegal_max = append(illegal_max, index_bits) + + illegal_min = append(illegal_min, minMinhashBits-1) + illegal_max = append(illegal_max, maxMinhashBits+1) + + illegalDescriptions = append(illegalDescriptions, illegal_min) + illegalDescriptions = append(illegalDescriptions, illegal_max) + + if index_bits+maxMinhashBits > 64 { + illegal_max1 = append(illegal_max1, index_bits) + illegal_max1 = append(illegal_max1, 1+maxMinhashBits-(64-(index_bits+maxMinhashBits))) + illegalDescriptions = append(illegalDescriptions, illegal_max1) + } + } + } + }) + + expectErrors := func(key *as.Key, eresult ast.ResultCode, ops ...*as.Operation) { + _, err := client.Operate(nil, key, ops...) + gm.Expect(err).To(gm.HaveOccurred()) + + gm.Expect(err.Matches(eresult)).To(gm.BeTrue()) + } + + expectSuccess := func(key *as.Key, ops ...*as.Operation) *as.Record { + record, err := client.Operate(nil, key, ops...) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(record).NotTo(gm.BeNil()) + return record + } + + checkBits := func(index_bits, minhash_bits int) bool { + return !(index_bits < minIndexBits || index_bits > maxIndexBits || + (minhash_bits != 0 && minhash_bits < minMinhashBits) || + minhash_bits > maxMinhashBits || index_bits+minhash_bits > 64) + } + + relativeCountError := func(n_index_bits int) float64 { + return 1.04 / math.Sqrt(math.Pow(2, float64(n_index_bits))) + } + + expectDescription := func(description []interface{}, index_bits, minhash_bits int) { + gm.Expect(index_bits).To(gm.Equal(description[0])) + gm.Expect(minhash_bits).To(gm.Equal(description[1])) + } + + expectInit := func(index_bits, minhash_bits int, should_pass bool) { + p := as.DefaultHLLPolicy() + ops := []*as.Operation{ + as.HLLInitOp(p, binName, index_bits, minhash_bits), + as.HLLGetCountOp(binName), + as.HLLRefreshCountOp(binName), + as.HLLDescribeOp(binName), + } + + if !should_pass { + expectErrors(key, ast.PARAMETER_ERROR, ops...) + return + } + + record := expectSuccess(key, ops...) + result_list := record.Bins[binName].([]interface{}) + count := result_list[1] + count1 := result_list[2] + description := result_list[3].([]interface{}) + + expectDescription(description, index_bits, minhash_bits) + gm.Expect(0).To(gm.Equal(count)) + gm.Expect(0).To(gm.Equal(count1)) + } + + gg.It("Init should work", func() { + _, err := client.Delete(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for _, desc := range legalDescriptions { + expectInit(desc[0], desc[1], true) + } + + for _, desc := range illegalDescriptions { + expectInit(desc[0], desc[1], false) + } + }) + + gg.It("HLL Flags should work", func() { + index_bits := 4 + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1)) + + // create_only + c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) + + expectSuccess(key, as.HLLInitOp(c, binName, index_bits, -1)) + expectErrors(key, ast.BIN_EXISTS_ERROR, + as.HLLInitOp(c, binName, index_bits, -1)) + + // update_only + u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) + + expectSuccess(key, as.HLLInitOp(u, binName, index_bits, -1)) + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + expectErrors(key, ast.BIN_NOT_FOUND, + as.HLLInitOp(u, binName, index_bits, -1)) + + // create_only no_fail + cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) + + expectSuccess(key, as.HLLInitOp(cn, binName, index_bits, -1)) + expectSuccess(key, as.HLLInitOp(cn, binName, index_bits, -1)) + + // update_only no_fail + un := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly | as.HLLWriteFlagsNoFail) + + expectSuccess(key, as.HLLInitOp(un, binName, index_bits, -1)) + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + expectSuccess(key, as.HLLInitOp(un, binName, index_bits, -1)) + + // fold + expectSuccess(key, as.HLLInitOp(c, binName, index_bits, -1)) + + f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) + + expectErrors(key, ast.PARAMETER_ERROR, + as.HLLInitOp(f, binName, index_bits, -1)) + }) + + gg.It("Bad Init should NOT work", func() { + p := as.DefaultHLLPolicy() + + expectSuccess(key, as.DeleteOp(), as.HLLInitOp(p, binName, maxIndexBits, 0)) + expectErrors(key, ast.OP_NOT_APPLICABLE, + as.HLLInitOp(p, binName, -1, maxMinhashBits)) + }) + + isWithinRelativeError := func(expected, estimate int, relative_error float64) bool { + return float64(expected)*(1-relative_error) <= float64(estimate) || float64(estimate) <= float64(expected)*(1+relative_error) + } + + expectHLLCount := func(index_bits int, hll_count, expected int) { + count_err_6sigma := relativeCountError(index_bits) * 6 + + gm.Expect(isWithinRelativeError(expected, hll_count, count_err_6sigma)).To(gm.BeTrue()) + } + + expectAddInit := func(index_bits, minhash_bits int) { + client.Delete(nil, key) + + p := as.DefaultHLLPolicy() + ops := []*as.Operation{ + as.HLLAddOp(p, binName, entries, index_bits, minhash_bits), + as.HLLGetCountOp(binName), + as.HLLRefreshCountOp(binName), + as.HLLDescribeOp(binName), + as.HLLAddOp(p, binName, entries, -1, -1), + } + + if !checkBits(index_bits, minhash_bits) { + expectErrors(key, ast.PARAMETER_ERROR, ops...) + return + } + + record := expectSuccess(key, ops...) + result_list := record.Bins[binName].([]interface{}) + count := result_list[1].(int) + count1 := result_list[2].(int) + description := result_list[3].([]interface{}) + n_added := result_list[4] + + expectDescription(description, index_bits, minhash_bits) + expectHLLCount(index_bits, count, len(entries)) + gm.Expect(count).To(gm.Equal(count1)) + gm.Expect(n_added).To(gm.Equal(0)) + } + + gg.It("Add Init should work", func() { + for _, desc := range legalDescriptions { + expectAddInit(desc[0], desc[1]) + } + }) + + gg.It("Add Flags should work", func() { + index_bits := 4 + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1)) + + // create_only + c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) + + expectSuccess(key, as.HLLAddOp(c, binName, entries, index_bits, -1)) + expectErrors(key, ast.BIN_EXISTS_ERROR, + as.HLLAddOp(c, binName, entries, index_bits, -1)) + + // update_only + u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) + + expectErrors(key, ast.PARAMETER_ERROR, + as.HLLAddOp(u, binName, entries, index_bits, -1)) + + // create_only no_fail + cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) + + expectSuccess(key, as.HLLAddOp(cn, binName, entries, index_bits, -1)) + expectSuccess(key, as.HLLAddOp(cn, binName, entries, index_bits, -1)) + + // fold + expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) + + f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) + + expectErrors(key, ast.PARAMETER_ERROR, + as.HLLAddOp(f, binName, entries, index_bits, -1)) + }) + + expectFold := func(vals0, vals1 []as.Value, index_bits int) { + p := as.DefaultHLLPolicy() + + for ix := minIndexBits; ix <= index_bits; ix++ { + if !checkBits(index_bits, 0) || !checkBits(ix, 0) { + // gm.Expected valid inputs + gm.Expect(true).To(gm.BeFalse()) + } + + recorda := expectSuccess(key, + as.DeleteOp(), + as.HLLAddOp(p, binName, vals0, index_bits, -1), + as.HLLGetCountOp(binName), + as.HLLRefreshCountOp(binName), + as.HLLDescribeOp(binName)) + + resulta_list := recorda.Bins[binName].([]interface{}) + counta := resulta_list[1].(int) + counta1 := resulta_list[2].(int) + descriptiona := resulta_list[3].([]interface{}) + + expectDescription(descriptiona, index_bits, 0) + expectHLLCount(index_bits, counta, len(vals0)) + gm.Expect(counta).To(gm.Equal(counta1)) + + recordb := expectSuccess(key, + as.HLLFoldOp(binName, ix), + as.HLLGetCountOp(binName), + as.HLLAddOp(p, binName, vals0, -1, -1), + as.HLLAddOp(p, binName, vals1, -1, -1), + as.HLLGetCountOp(binName), + as.HLLDescribeOp(binName)) + + resultb_list := recordb.Bins[binName].([]interface{}) + countb := resultb_list[1].(int) + n_added0 := resultb_list[2].(int) + countb1 := resultb_list[4].(int) + descriptionb := resultb_list[5].([]interface{}) + + gm.Expect(0).To(gm.Equal(n_added0)) + expectDescription(descriptionb, ix, 0) + expectHLLCount(ix, countb, len(vals0)) + expectHLLCount(ix, countb1, len(vals0)+len(vals1)) + } + } + + gg.It("Fold should work", func() { + var vals0 []as.Value + var vals1 []as.Value + + for i := 0; i < nEntries/2; i++ { + vals0 = append(vals0, as.StringValue("key "+strconv.Itoa(i))) + } + + for i := nEntries / 2; i < nEntries; i++ { + vals1 = append(vals1, as.StringValue("key "+strconv.Itoa(i))) + } + + for index_bits := 4; index_bits < maxIndexBits; index_bits++ { + expectFold(vals0, vals1, index_bits) + } + }) + + gg.It("Fold Exists should work", func() { + index_bits := 10 + fold_down := 4 + fold_up := 16 + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), + as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) + + // Exists. + expectSuccess(key, as.HLLFoldOp(binName, fold_down)) + expectErrors(key, ast.OP_NOT_APPLICABLE, + as.HLLFoldOp(binName, fold_up)) + + // Does not exist. + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + + expectErrors(key, ast.BIN_NOT_FOUND, + as.HLLFoldOp(binName, fold_down)) + }) + + expectSetUnion := func(vals [][]as.Value, index_bits int, folding, allow_folding bool) { + p := as.DefaultHLLPolicy() + u := as.DefaultHLLPolicy() + + if allow_folding { + u = as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) + } + + union_expected := 0 + folded := false + + for i := 0; i < len(keys); i++ { + ix := index_bits + + if folding { + ix -= i + + if ix < minIndexBits { + ix = minIndexBits + } + + if ix < index_bits { + folded = true + } + } + + sub_vals := vals[i] + + union_expected += len(sub_vals) + + record := expectSuccess(keys[i], + as.DeleteOp(), + as.HLLAddOp(p, binName, sub_vals, ix, -1), + as.HLLGetCountOp(binName)) + result_list := record.Bins[binName].([]interface{}) + count := result_list[1].(int) + + expectHLLCount(ix, count, len(sub_vals)) + } + + var hlls []as.HLLValue + + for i := 0; i < len(keys); i++ { + record := expectSuccess(keys[i], as.GetBinOp(binName), as.HLLGetCountOp(binName)) + result_list := record.Bins[binName].([]interface{}) + hll := result_list[0].(as.HLLValue) + + gm.Expect(hll).NotTo(gm.BeNil()) + hlls = append(hlls, hll) + } + + ops := []*as.Operation{ + as.DeleteOp(), + as.HLLInitOp(p, binName, index_bits, -1), + as.HLLSetUnionOp(u, binName, hlls), + as.HLLGetCountOp(binName), + as.DeleteOp(), // And recreate it to test creating empty. + as.HLLSetUnionOp(p, binName, hlls), + as.HLLGetCountOp(binName), + } + + if folded && !allow_folding { + expectErrors(key, ast.OP_NOT_APPLICABLE, ops...) + return + } + + record_union := expectSuccess(key, ops...) + union_result_list := record_union.Bins[binName].([]interface{}) + union_count := union_result_list[2].(int) + union_count2 := union_result_list[4].(int) + + expectHLLCount(index_bits, union_count, union_expected) + gm.Expect(union_count).To(gm.Equal(union_count2)) + + for i := 0; i < len(keys); i++ { + sub_vals := vals[i] + record := expectSuccess(key, + as.HLLAddOp(p, binName, sub_vals, index_bits, -1), + as.HLLGetCountOp(binName)) + result_list := record.Bins[binName].([]interface{}) + n_added := result_list[0].(int) + count := result_list[1].(int) + + gm.Expect(0).To(gm.Equal(n_added)) + gm.Expect(union_count).To(gm.Equal(count)) + expectHLLCount(index_bits, count, union_expected) + } + } + + gg.It("Set Union should work", func() { + var vals [][]as.Value + + for i := 0; i < len(keys); i++ { + var sub_vals []as.Value + + for j := 0; j < nEntries/3; j++ { + sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) + } + + vals = append(vals, sub_vals) + } + + for _, index_bits := range legalIndexBits { + expectSetUnion(vals, index_bits, false, false) + expectSetUnion(vals, index_bits, false, true) + expectSetUnion(vals, index_bits, true, false) + expectSetUnion(vals, index_bits, true, true) + } + }) + + gg.It("Set Union Flags should work", func() { + index_bits := 6 + low_n_bits := 4 + high_n_bits := 8 + otherName := binName + "o" + + // Keep record around win binName is removed. + var hlls []as.HLLValue + record := expectSuccess(key, + as.DeleteOp(), + as.HLLAddOp(as.DefaultHLLPolicy(), otherName, entries, index_bits, -1), + as.GetBinOp(otherName)) + result_list := record.Bins[otherName].([]interface{}) + hll := result_list[1].(as.HLLValue) + + hlls = append(hlls, hll) + + // create_only + c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) + + expectSuccess(key, as.HLLSetUnionOp(c, binName, hlls)) + expectErrors(key, ast.BIN_EXISTS_ERROR, + as.HLLSetUnionOp(c, binName, hlls)) + + // update_only + u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) + + expectSuccess(key, as.HLLSetUnionOp(u, binName, hlls)) + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + expectErrors(key, ast.BIN_NOT_FOUND, + as.HLLSetUnionOp(u, binName, hlls)) + + // create_only no_fail + cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) + + expectSuccess(key, as.HLLSetUnionOp(cn, binName, hlls)) + expectSuccess(key, as.HLLSetUnionOp(cn, binName, hlls)) + + // update_only no_fail + un := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly | as.HLLWriteFlagsNoFail) + + expectSuccess(key, as.HLLSetUnionOp(un, binName, hlls)) + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + expectSuccess(key, as.HLLSetUnionOp(un, binName, hlls)) + + // fold + f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) + + // fold down + expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, high_n_bits, -1)) + expectSuccess(key, as.HLLSetUnionOp(f, binName, hlls)) + + // fold up + expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, low_n_bits, -1)) + expectSuccess(key, as.HLLSetUnionOp(f, binName, hlls)) + }) + + gg.It("Refresh Count should work", func() { + index_bits := 6 + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), + as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) + + // Exists. + expectSuccess(key, as.HLLRefreshCountOp(binName), + as.HLLRefreshCountOp(binName)) + expectSuccess(key, as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, -1, -1)) + expectSuccess(key, as.HLLRefreshCountOp(binName), + as.HLLRefreshCountOp(binName)) + + // Does not exist. + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + expectErrors(key, ast.BIN_NOT_FOUND, + as.HLLRefreshCountOp(binName)) + }) + + gg.It("Get Count should work", func() { + index_bits := 6 + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, index_bits, -1)) + + // Exists. + record := expectSuccess(key, as.HLLGetCountOp(binName)) + count := record.Bins[binName].(int) + expectHLLCount(index_bits, count, len(entries)) + + // Does not exist. + expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) + record = expectSuccess(key, as.HLLGetCountOp(binName)) + gm.Expect(record.Bins[binName]).To(gm.BeNil()) + }) + + gg.It("Get Union should work", func() { + index_bits := 14 + expected_union_count := 0 + var vals [][]as.Value + var hlls []as.HLLValue + + for i := 0; i < len(keys); i++ { + var sub_vals []as.Value + + for j := 0; j < nEntries/3; j++ { + sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) + } + + record := expectSuccess(keys[i], + as.DeleteOp(), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, sub_vals, index_bits, -1), + as.GetBinOp(binName)) + + result_list := record.Bins[binName].([]interface{}) + hlls = append(hlls, result_list[1].(as.HLLValue)) + expected_union_count += len(sub_vals) + vals = append(vals, sub_vals) + } + + // Keep record around win binName is removed. + expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, vals[0], index_bits, -1)) + + record := expectSuccess(key, + as.HLLGetUnionOp(binName, hlls), + as.HLLGetUnionCountOp(binName, hlls)) + result_list := record.Bins[binName].([]interface{}) + union_count := result_list[1].(int) + + expectHLLCount(index_bits, union_count, expected_union_count) + + union_hll := result_list[0].(as.HLLValue) + + record = expectSuccess(key, + as.PutOp(as.NewBin(binName, union_hll)), + as.HLLGetCountOp(binName)) + result_list = record.Bins[binName].([]interface{}) + union_count_2 := result_list[1].(int) + + gm.Expect(union_count).To(gm.Equal(union_count_2)) + }) + + gg.It("Put should work", func() { + for _, desc := range legalDescriptions { + index_bits := desc[0] + minhash_bits := desc[1] + + expectSuccess(key, + as.DeleteOp(), as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, minhash_bits)) + + record, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + hll := record.Bins[binName].(as.HLLValue) + + client.Delete(nil, key) + client.PutBins(nil, key, as.NewBin(binName, hll)) + + record = expectSuccess(key, + as.HLLGetCountOp(binName), + as.HLLDescribeOp(binName)) + + result_list := record.Bins[binName].([]interface{}) + count := result_list[0].(int) + description := result_list[1].([]interface{}) + + gm.Expect(count).To(gm.Equal(0)) + expectDescription(description, index_bits, minhash_bits) + } + }) + + absoluteSimilarityError := func(index_bits, minhash_bits int, expected_similarity float64) float64 { + min_err_index := 1 / math.Sqrt(float64(int64(1< math.Abs(expected_similarity-similarity)).To(gm.BeTrue()) + gm.Expect(isWithinRelativeError(expected_intersect_count, intersect_count, sim_err_6sigma)).To(gm.BeTrue()) + } + + expectSimilarityOp := func(overlap float64, common []as.Value, vals [][]as.Value, index_bits, + minhash_bits int) { + var hlls []as.HLLValue + + for i := 0; i < len(keys); i++ { + record := expectSuccess(keys[i], + as.DeleteOp(), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, vals[i], index_bits, minhash_bits), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, common, index_bits, minhash_bits), + as.GetBinOp(binName)) + + result_list := record.Bins[binName].([]interface{}) + hlls = append(hlls, result_list[2].(as.HLLValue)) + } + + // Keep record around win binName is removed. + record := expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, minhash_bits), + as.HLLSetUnionOp(as.DefaultHLLPolicy(), binName, hlls), + as.HLLDescribeOp(binName)) + result_list := record.Bins[binName].([]interface{}) + description := result_list[1].([]interface{}) + + expectDescription(description, index_bits, minhash_bits) + + record = expectSuccess(key, + as.HLLGetSimilarityOp(binName, hlls), + as.HLLGetIntersectCountOp(binName, hlls)) + result_list = record.Bins[binName].([]interface{}) + sim := result_list[0].(float64) + intersect_count := result_list[1].(int) + expected_similarity := overlap + expected_intersect_count := len(common) + + expectHMHSimilarity(index_bits, minhash_bits, sim, expected_similarity, intersect_count, + expected_intersect_count) + } + + gg.It("Similarity should work", func() { + if *proxy { + gg.Skip("Too long for the Proxy Client") + } + + overlaps := []float64{0.0001, 0.001, 0.01, 0.1, 0.5} + + nEntries := 1 << 18 + for _, overlap := range overlaps { + expected_intersect_count := int(math.Floor(float64(nEntries) * overlap)) + var common []as.Value + + for i := 0; i < expected_intersect_count; i++ { + common = append(common, as.StringValue("common"+strconv.Itoa(i))) + } + + var vals [][]as.Value + unique_entries_per_node := (nEntries - expected_intersect_count) / 3 + + for i := 0; i < len(keys); i++ { + var sub_vals []as.Value + + for j := 0; j < unique_entries_per_node; j++ { + sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) + } + + vals = append(vals, sub_vals) + } + + for _, desc := range legalDescriptions { + index_bits := desc[0] + minhash_bits := desc[1] + + if minhash_bits == 0 { + continue + } + + expectSimilarityOp(overlap, common, vals, index_bits, minhash_bits) + } + } + }) + + gg.It("Empty Similarity should work", func() { + for _, desc := range legalDescriptions { + nIndexBits := desc[0] + nMinhashBits := desc[1] + + record := expectSuccess(key, + as.DeleteOp(), + as.HLLInitOp(as.DefaultHLLPolicy(), binName, nIndexBits, nMinhashBits), + as.GetBinOp(binName)) + + resultList := record.Bins[binName].([]interface{}) + var hlls []as.HLLValue + + hlls = append(hlls, resultList[1].(as.HLLValue)) + + record = expectSuccess(key, + as.HLLGetSimilarityOp(binName, hlls), + as.HLLGetIntersectCountOp(binName, hlls)) + + resultList = record.Bins[binName].([]interface{}) + + sim := resultList[0].(float64) + intersectCount := resultList[1].(int) + + gm.Expect(0).To(gm.Equal(intersectCount)) + gm.Expect(math.IsNaN(sim)).To(gm.BeTrue()) + } + }) + + gg.It("Intersect should work", func() { + otherBinName := binName + "other" + + for _, desc := range legalDescriptions { + indexBits := desc[0] + minhashBits := desc[1] + + if minhashBits != 0 { + break + } + + record := expectSuccess(key, + as.DeleteOp(), + as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, indexBits, minhashBits), + as.GetBinOp(binName), + as.HLLAddOp(as.DefaultHLLPolicy(), otherBinName, entries, indexBits, 4), + as.GetBinOp(otherBinName)) + + var hlls []as.HLLValue + var hmhs []as.HLLValue + resultList := record.Bins[binName].([]interface{}) + + hlls = append(hlls, resultList[1].(as.HLLValue)) + hlls = append(hlls, hlls[0]) + + resultList = record.Bins[otherBinName].([]interface{}) + hmhs = append(hmhs, resultList[1].(as.HLLValue)) + hmhs = append(hmhs, hmhs[0]) + + record = expectSuccess(key, + as.HLLGetIntersectCountOp(binName, hlls), + as.HLLGetSimilarityOp(binName, hlls)) + resultList = record.Bins[binName].([]interface{}) + + intersectCount := resultList[0].(int) + + gm.Expect(float64(intersectCount) < 1.8*float64(len(entries))).To(gm.BeTrue()) + + hlls = append(hlls, hlls[0]) + + expectErrors(key, ast.PARAMETER_ERROR, + as.HLLGetIntersectCountOp(binName, hlls)) + expectErrors(key, ast.PARAMETER_ERROR, + as.HLLGetSimilarityOp(binName, hlls)) + + record = expectSuccess(key, + as.HLLGetIntersectCountOp(binName, hmhs), + as.HLLGetSimilarityOp(binName, hmhs)) + resultList = record.Bins[binName].([]interface{}) + intersectCount = resultList[0].(int) + + gm.Expect(float64(intersectCount) < 1.8*float64(len(entries))).To(gm.BeTrue()) + + hmhs = append(hmhs, hmhs[0]) + + expectErrors(key, ast.OP_NOT_APPLICABLE, + as.HLLGetIntersectCountOp(binName, hmhs)) + expectErrors(key, ast.OP_NOT_APPLICABLE, + as.HLLGetSimilarityOp(binName, hmhs)) + } + }) + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_policy.go b/aerospike-tls/vendor-aerospike-client-go/hll_policy.go new file mode 100644 index 00000000..12a24acd --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/hll_policy.go @@ -0,0 +1,30 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// HLLPolicy determines the HyperLogLog operation policy. +type HLLPolicy struct { + flags int +} + +// DefaultHLLPolicy uses the default policy when performing HLL operations. +func DefaultHLLPolicy() *HLLPolicy { + return &HLLPolicy{HLLWriteFlagsDefault} +} + +// NewHLLPolicy uses specified HLLWriteFlags when performing HLL operations. +func NewHLLPolicy(flags int) *HLLPolicy { + return &HLLPolicy{flags} +} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go b/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go new file mode 100644 index 00000000..4719044f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go @@ -0,0 +1,40 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// HLLWriteFlags specifies the HLL write operation flags. + +const ( + // HLLWriteFlagsDefault is Default. Allow create or update. + HLLWriteFlagsDefault = 0 + + // HLLWriteFlagsCreateOnly behaves like the following: + // If the bin already exists, the operation will be denied. + // If the bin does not exist, a new bin will be created. + HLLWriteFlagsCreateOnly = 1 + + // HLLWriteFlagsUpdateOnly behaves like the following: + // If the bin already exists, the bin will be overwritten. + // If the bin does not exist, the operation will be denied. + HLLWriteFlagsUpdateOnly = 2 + + // HLLWriteFlagsNoFail does not raise error if operation is denied. + HLLWriteFlagsNoFail = 4 + + // HLLWriteFlagsAllowFold allows the resulting set to be the minimum of provided index bits. + // Also, allow the usage of less precise HLL algorithms when minHash bits + // of all participating sets do not match. + HLLWriteFlagsAllowFold = 8 +) diff --git a/aerospike-tls/vendor-aerospike-client-go/host.go b/aerospike-tls/vendor-aerospike-client-go/host.go new file mode 100644 index 00000000..0e3e969e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/host.go @@ -0,0 +1,71 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "net" + "strconv" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Host name/port of database server. +type Host struct { + + // Host name or IP address of database server. + Name string + + //TLSName defines the TLS certificate name used for secure connections. + TLSName string + + // Port of database server. + Port int +} + +// NewHost initializes new host instance. +func NewHost(name string, port int) *Host { + return &Host{Name: name, Port: port} +} + +// Implements stringer interface +func (h *Host) String() string { + return net.JoinHostPort(h.Name, strconv.Itoa(h.Port)) +} + +// Implements stringer interface +func (h *Host) equals(other *Host) bool { + return h.Name == other.Name && h.Port == other.Port +} + +// NewHosts initializes new host instances by a passed slice of addresses. +func NewHosts(addresses ...string) ([]*Host, Error) { + aerospikeHosts := make([]*Host, 0, len(addresses)) + for _, address := range addresses { + hostStr, portStr, err := net.SplitHostPort(address) + if err != nil { + return nil, newErrorAndWrap(err, types.PARAMETER_ERROR, fmt.Sprintf("error parsing address %s: %s", address, err)) + } + port, err := strconv.Atoi(portStr) + if err != nil { + return nil, newErrorAndWrap(err, types.PARAMETER_ERROR, fmt.Sprintf("error converting port %s: %s", address, err)) + } + + host := NewHost(hostStr, port) + aerospikeHosts = append(aerospikeHosts, host) + } + + return aerospikeHosts, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/host_test.go b/aerospike-tls/vendor-aerospike-client-go/host_test.go new file mode 100644 index 00000000..95c45f6b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/host_test.go @@ -0,0 +1,43 @@ +// Copyright 2013-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + + gg.Describe("Host", func() { + + gg.It("must handle multiple valid host strings", func() { + // use the same client for all + hosts, err := as.NewHosts("host1:4000", "host2:3000", "127.0.0.1:1200", "[2001:0db8:85a3:0000:0000:8a2e:0370]:7334") + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(hosts).To(gm.Equal([]*as.Host{as.NewHost("host1", 4000), as.NewHost("host2", 3000), as.NewHost("127.0.0.1", 1200), as.NewHost("2001:0db8:85a3:0000:0000:8a2e:0370", 7334)})) + }) + + gg.It("must error on invalid host strings", func() { + // use the same client for all + hosts, err := as.NewHosts("host1:4000", "host2://+3000") + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(hosts).To(gm.BeNil()) + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go b/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go new file mode 100644 index 00000000..dc85253d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go @@ -0,0 +1,73 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" +) + +// IndexCollectionType is the secondary index collection type. +type IndexCollectionType int + +const ( + + // ICT_DEFAULT is the Normal scalar index. + ICT_DEFAULT IndexCollectionType = iota + + // ICT_LIST is Index list elements. + ICT_LIST + + // ICT_MAPKEYS is Index map keys. + ICT_MAPKEYS + + // ICT_MAPVALUES is Index map values. + ICT_MAPVALUES +) + +func (ict IndexCollectionType) String() string { + switch ict { + // Normal scalar index. + case ICT_DEFAULT: + return "ICT_DEFAULT" + // Index list elements. + case ICT_LIST: + return "ICT_LIST" + // Index map keys. + case ICT_MAPKEYS: + return "ICT_MAPKEYS" + // Index map values. + case ICT_MAPVALUES: + return "ICT_MAPVALUES" + } + panic(unreachable) +} + +// ictToString converts IndexCollectionType to string representations +func ictToString(ict IndexCollectionType) string { + switch ict { + + case ICT_LIST: + return "LIST" + + case ICT_MAPKEYS: + return "MAPKEYS" + + case ICT_MAPVALUES: + return "MAPVALUES" + + default: + panic(fmt.Sprintf("Unknown IndexCollectionType value %v", ict)) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/index_test.go b/aerospike-tls/vendor-aerospike-client-go/index_test.go new file mode 100644 index 00000000..299f2688 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/index_test.go @@ -0,0 +1,113 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "math/rand" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Index operations test", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + }) + + gg.Describe("Index creation", func() { + + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + + const keyCount = 1000 + bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", randString(100)) + + gg.BeforeEach(func() { + for i := 0; i < keyCount; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + gg.Context("Create non-existing index", func() { + + gg.It("must create an Index", func() { + idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.DropIndex(wpolicy, ns, set, set+bin1.Name) + + // wait until index is created + <-idxTask.OnComplete() + + // no duplicate index is allowed + // _, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + // gm.Expect(err).To(gm.HaveOccurred()) + // gm.Expect(err.Matches(ast.INDEX_FOUND)).To(gm.BeTrue()) + }) + + gg.It("must drop an Index", func() { + idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until index is created + <-idxTask.OnComplete() + + err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.It("must drop an Index, and recreate it again to verify", func() { + idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until index is created + gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) + + // dropping second time is not expected to raise any errors + err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // create the index again; should not encounter any errors + idxTask, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until index is created + gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) + + err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + }) + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/index_type.go b/aerospike-tls/vendor-aerospike-client-go/index_type.go new file mode 100644 index 00000000..f3e060c1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/index_type.go @@ -0,0 +1,32 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// IndexType the type of the secondary index. +type IndexType string + +const ( + // NUMERIC specifies an index on numeric values. + NUMERIC IndexType = "NUMERIC" + + // STRING specifies an index on string values. + STRING IndexType = "STRING" + + // BLOB specifies a []byte index. Requires server version 7.0+. + BLOB IndexType = "BLOB" + + // GEO2DSPHERE specifies 2-dimensional spherical geospatial index. + GEO2DSPHERE IndexType = "GEO2DSPHERE" +) diff --git a/aerospike-tls/vendor-aerospike-client-go/info.go b/aerospike-tls/vendor-aerospike-client-go/info.go new file mode 100644 index 00000000..79bc4697 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/info.go @@ -0,0 +1,105 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "encoding/binary" + "strings" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const ( + _DEFAULT_TIMEOUT = 2 * time.Second + _NO_TIMEOUT = 365 * 24 * time.Hour +) + +// Access server's info monitoring protocol. +type info struct { + msg *types.Message +} + +// Send multiple commands to server and store results. +// Timeout should already be set on the connection. +func newInfo(conn *Connection, commands ...string) (*info, Error) { + commandStr := strings.Trim(strings.Join(commands, "\n"), " ") + if strings.Trim(commandStr, " ") != "" { + commandStr += "\n" + } + newInfo := &info{ + msg: types.NewMessage(types.MSG_INFO, []byte(commandStr)), + } + + if err := newInfo.sendCommand(conn); err != nil { + return nil, err + } + return newInfo, nil +} + +// Issue request and set results buffer. This method is used internally. +// The static request methods should be used instead. +func (nfo *info) sendCommand(conn *Connection) Error { + b, err := nfo.msg.Serialize() + if err != nil { + return newCommonError(err) + } + + // Write + if _, err = conn.Write(b); err != nil { + logger.Logger.Debug("Failed to send command: %s", err.Error()) + return errToAerospikeErr(nil, err) + } + + // Read - reuse input buffer. + header := bytes.NewBuffer(make([]byte, types.MSG_HEADER_SIZE)) + if _, err = conn.Read(header.Bytes(), types.MSG_HEADER_SIZE); err != nil { + return errToAerospikeErr(nil, err) + } + if err = binary.Read(header, binary.BigEndian, &nfo.msg.MessageHeader); err != nil { + logger.Logger.Debug("Failed to read command response.") + return newCommonError(err) + } + + //logger.Logger.Debug("Header Response: %v %v %v %v", t.Type, t.Version, t.Length(), t.DataLen) + if err = nfo.msg.Resize(nfo.msg.Length()); err != nil { + return newCommonError(err) + } + _, err = conn.Read(nfo.msg.Data, len(nfo.msg.Data)) + return errToAerospikeErr(nil, err) +} + +func (nfo *info) parseMultiResponse() (map[string]string, Error) { + responses := make(map[string]string) + data := strings.Trim(string(nfo.msg.Data), "\n") + + keyValuesArr := strings.Split(data, "\n") + for _, keyValueStr := range keyValuesArr { + KeyValArr := strings.Split(keyValueStr, "\t") + + switch len(KeyValArr) { + case 1: + responses[KeyValArr[0]] = "" + case 2: + responses[KeyValArr[0]] = KeyValArr[1] + default: + logger.Logger.Error("Requested info buffer does not adhere to the protocol: %s", data) + } + } + + return responses, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/info_policy.go b/aerospike-tls/vendor-aerospike-client-go/info_policy.go new file mode 100644 index 00000000..1442e010 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/info_policy.go @@ -0,0 +1,51 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// InfoPolicy contains attributes used for info commands. +type InfoPolicy struct { + + // Info command socket timeout. + // Default is 2 seconds. + Timeout time.Duration +} + +// NewInfoPolicy generates a new InfoPolicy with default values. +func NewInfoPolicy() *InfoPolicy { + return &InfoPolicy{ + Timeout: _DEFAULT_TIMEOUT, + } +} + +func (p *InfoPolicy) deadline() time.Time { + var deadline time.Time + if p != nil && p.Timeout > 0 { + deadline = time.Now().Add(p.Timeout) + } + + return deadline +} + +func (p *InfoPolicy) timeout() time.Duration { + if p != nil && p.Timeout > 0 { + return p.Timeout + } + + return _DEFAULT_TIMEOUT +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go new file mode 100644 index 00000000..6af02aac --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go @@ -0,0 +1,72 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import ( + "fmt" + "sync" +) + +// Array implement a fixed width array with atomic semantics +type Array struct { + items []interface{} + length int + mutex sync.RWMutex +} + +// NewArray generates a new Array instance. +func NewArray(length int) *Array { + return &Array{ + length: length, + items: make([]interface{}, length), + } +} + +// Get atomically retrieves an element from the Array. +// If idx is out of range, it will return nil +func (aa *Array) Get(idx int) interface{} { + // do not lock if not needed + if idx < 0 || idx >= aa.length { + return nil + } + + aa.mutex.RLock() + res := aa.items[idx] + aa.mutex.RUnlock() + return res +} + +// Set atomically sets an element in the Array. +// If idx is out of range, it will return an error +func (aa *Array) Set(idx int, node interface{}) error { + // do not lock if not needed + if idx < 0 || idx >= aa.length { + return fmt.Errorf("index %d is larger than array size (%d)", idx, aa.length) + } + + aa.mutex.Lock() + aa.items[idx] = node + aa.mutex.Unlock() + return nil +} + +// Length returns the array size. +func (aa *Array) Length() int { + aa.mutex.RLock() + res := aa.length + aa.mutex.RUnlock() + + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go new file mode 100644 index 00000000..1607e9ba --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go @@ -0,0 +1,27 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "testing" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func TestAerospike(t *testing.T) { + gm.RegisterFailHandler(gg.Fail) + gg.RunSpecs(t, "Atomic Types Suite") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go new file mode 100644 index 00000000..933fd459 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go @@ -0,0 +1,83 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import ( + "sync" +) + +// Bool implements a synchronized boolean value +type Bool struct { + m sync.Mutex + val bool +} + +// NewBool generates a new Boolean instance. +func NewBool(value bool) *Bool { + return &Bool{ + val: value, + } +} + +// String implements the Stringer interface +func (ab *Bool) String() string { + res := ab.Get() + if res { + return "true" + } + return "false" +} + +// GomegaString implements the GomegaStringer interface +// to prevent race conditions in tests +func (ab *Bool) GomegaString() string { + return ab.String() +} + +// Get atomically retrieves the boolean value. +func (ab *Bool) Get() bool { + ab.m.Lock() + res := ab.val + ab.m.Unlock() + return res +} + +// Set atomically sets the boolean value. +func (ab *Bool) Set(newVal bool) { + ab.m.Lock() + ab.val = newVal + ab.m.Unlock() +} + +// Or atomically applies OR operation to the boolean value. +func (ab *Bool) Or(newVal bool) bool { + if !newVal { + return ab.Get() + } + ab.Set(newVal) + return true +} + +// CompareAndToggle atomically sets the boolean value if the current value is equal to updated value. +func (ab *Bool) CompareAndToggle(expect bool) bool { + res := false + ab.m.Lock() + if ab.val == expect { + res = true + ab.val = !ab.val + } + ab.m.Unlock() + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go new file mode 100644 index 00000000..f78496e0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go @@ -0,0 +1,77 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "runtime" + "sync" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Atomic Bool", func() { + // atomic tests require actual parallelism + runtime.GOMAXPROCS(runtime.NumCPU()) + + var ab *atomic.Bool + + gg.BeforeEach(func() { + ab = atomic.NewBool(true) + }) + + gg.It("must CompareAndToggle correctly", func() { + gm.Expect(ab.CompareAndToggle(true)).To(gm.BeTrue()) + gm.Expect(ab.CompareAndToggle(true)).To(gm.BeFalse()) + }) + + gg.It("must CompareAndToggle correctly", func() { + var count int = 1e5 + wg := new(sync.WaitGroup) + wg.Add(count * 4) + for i := 0; i < count; i++ { + go func() { + defer wg.Done() + ab.Set(true) + }() + } + + for i := 0; i < count; i++ { + go func() { + defer wg.Done() + ab.Set(false) + }() + } + + for i := 0; i < count; i++ { + go func() { + defer wg.Done() + ab.Get() + }() + } + + for i := 0; i < count; i++ { + go func(i int) { + defer wg.Done() + ab.CompareAndToggle(i%2 == 0) + }(i) + } + + wg.Wait() + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go new file mode 100644 index 00000000..3e944f1f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go @@ -0,0 +1,82 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import "sync" + +// Guard allows synchronized access to a value +type Guard[T any] struct { + val *T + m sync.Mutex +} + +// NewGuard creates a new instance of Guard +func NewGuard[T any](val *T) *Guard[T] { + return &Guard[T]{val: val} +} + +// Do calls the passed closure. +func (g *Guard[T]) Do(f func(*T)) { + g.m.Lock() + defer g.m.Unlock() + f(g.val) +} + +// DoVal calls the passed closure with a dereferenced internal value. +func (g *Guard[T]) DoVal(f func(T)) { + g.m.Lock() + defer g.m.Unlock() + f(*g.val) +} + +// Call the passed closure allowing to replace the content. +func (g *Guard[T]) Update(f func(**T)) { + g.m.Lock() + defer g.m.Unlock() + f(&g.val) +} + +// Calls the passed closure allowing to replace the content. +// It will call the init func if the internal values is nil. +func (g *Guard[T]) InitDo(init func() *T, f func(*T)) { + g.m.Lock() + defer g.m.Unlock() + if g.val == nil { + g.val = init() + } + f(g.val) +} + +// Calls the passed closure allowing to replace the content. +// It will call the init func if the internal values is nil. +// It is used for reference values like slices and maps. +func (g *Guard[T]) InitDoVal(init func() T, f func(T)) { + g.m.Lock() + defer g.m.Unlock() + if g.val == nil { + t := init() + g.val = &t + } + f(*g.val) +} + +// Release returns the internal value and sets it to nil +func (g *Guard[T]) Release() *T { + g.m.Lock() + defer g.m.Unlock() + res := g.val + g.val = nil + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go new file mode 100644 index 00000000..dc868d79 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go @@ -0,0 +1,118 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "runtime" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Atomic Guard", func() { + // atomic tests require actual parallelism + runtime.GOMAXPROCS(runtime.NumCPU()) + + type S struct { + a int + b bool + } + + var grd *atomic.Guard[S] + + gg.BeforeEach(func() { + grd = atomic.NewGuard[S](&S{a: 1, b: true}) + }) + + gg.It("must pass internal value correctly", func() { + grd.Do(func(s *S) { + gm.Expect(*s).To(gm.Equal(S{a: 1, b: true})) + }) + + }) + + gg.It("must assign/copy internal value correctly", func() { + local := S{a: 99, b: false} + grd.Do(func(s *S) { + *s = local + }) + + grd.Do(func(s *S) { + gm.Expect(*s).To(gm.Equal(S{a: 99, b: false})) + }) + + }) + + gg.It("must initialize and assign internal value correctly", func() { + flocal := func() *S { return &S{a: 99, b: false} } + + var grd atomic.Guard[S] + grd.Do(func(s *S) { + gm.Expect(s).To(gm.BeNil()) + }) + + grd.InitDo(flocal, func(s *S) { + gm.Expect(*s).To(gm.Equal(S{a: 99, b: false})) + s.a++ + s.b = true + }) + + grd.InitDo(flocal, func(s *S) { + gm.Expect(*s).To(gm.Equal(S{a: 100, b: true})) + }) + + grd.Do(func(s *S) { + gm.Expect(*s).To(gm.Equal(S{a: 100, b: true})) + }) + }) + + gg.It("must initialize and assign internal value correctly", func() { + flocal := func() map[int]int { return map[int]int{1: 1, 2: 2, 3: 3} } + + var grd atomic.Guard[map[int]int] + grd.Do(func(s *map[int]int) { + gm.Expect(s).To(gm.BeNil()) + }) + + grd.InitDoVal(flocal, func(s map[int]int) { + gm.Expect(s).To(gm.Equal(map[int]int{1: 1, 2: 2, 3: 3})) + }) + + grd.InitDoVal(flocal, func(s map[int]int) { + gm.Expect(s).To(gm.Equal(map[int]int{1: 1, 2: 2, 3: 3})) + for i := 4; i < 100; i++ { + s[i] = i + } + }) + + grd.DoVal(func(s map[int]int) { + gm.Expect(len(s)).To(gm.Equal(99)) + }) + }) + + gg.It("must replace internal value's reference correctly", func() { + local := S{a: 99, b: false} + grd.Update(func(s **S) { + *s = &local + }) + + grd.Do(func(s *S) { + gm.Expect(s == &local).To(gm.BeTrue()) + }) + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go new file mode 100644 index 00000000..ad783fbc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go @@ -0,0 +1,157 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import ( + "strconv" + "sync" +) + +// Int implements an int value with atomic semantics +type Int struct { + m sync.Mutex + val int +} + +// NewInt generates a newVal Int instance. +func NewInt(value int) *Int { + return &Int{ + val: value, + } +} + +// String implements the Stringer interface +func (ai *Int) String() string { + res := ai.Get() + return strconv.Itoa(res) +} + +// GomegaString implements the GomegaStringer interface +// to prevent race conditions during tests +func (ai *Int) GomegaString() string { + return ai.String() +} + +// AddAndGet atomically adds the given value to the current value. +func (ai *Int) AddAndGet(delta int) int { + ai.m.Lock() + ai.val += delta + res := ai.val + ai.m.Unlock() + return res +} + +// CloneAndSet atomically clones the atomic Int and sets the value to the given updated value. +func (ai *Int) Clone() Int { + ai.m.Lock() + res := Int{ + val: ai.val, + } + ai.m.Unlock() + return res +} + +// CloneAndSet atomically clones the atomic Int and sets the value to the given updated value. +func (ai *Int) CloneAndSet(value int) Int { + ai.m.Lock() + res := Int{ + val: ai.val, + } + ai.val = value + ai.m.Unlock() + return res +} + +// CompareAndSet atomically sets the value to the given updated value if the current value == expected value. +// Returns true if the expectation was met +func (ai *Int) CompareAndSet(expect int, update int) bool { + res := false + ai.m.Lock() + if ai.val == expect { + ai.val = update + res = true + } + ai.m.Unlock() + return res +} + +// DecrementAndGet atomically decrements current value by one and returns the result. +func (ai *Int) DecrementAndGet() int { + ai.m.Lock() + ai.val-- + res := ai.val + ai.m.Unlock() + return res +} + +// Get atomically retrieves the current value. +func (ai *Int) Get() int { + ai.m.Lock() + res := ai.val + ai.m.Unlock() + return res +} + +// GetAndAdd atomically adds the given delta to the current value and returns the result. +func (ai *Int) GetAndAdd(delta int) int { + ai.m.Lock() + res := ai.val + ai.val += delta + ai.m.Unlock() + return res +} + +// GetAndDecrement atomically decrements the current value by one and returns the result. +func (ai *Int) GetAndDecrement() int { + ai.m.Lock() + res := ai.val + ai.val-- + ai.m.Unlock() + return res +} + +// GetAndIncrement atomically increments current value by one and returns the result. +func (ai *Int) GetAndIncrement() int { + ai.m.Lock() + res := ai.val + ai.val++ + ai.m.Unlock() + return res +} + +// GetAndSet atomically sets current value to the given value and returns the old value. +func (ai *Int) GetAndSet(newValue int) int { + ai.m.Lock() + res := ai.val + ai.val = newValue + ai.m.Unlock() + return res +} + +// IncrementAndGet atomically increments current value by one and returns the result. +func (ai *Int) IncrementAndGet() int { + ai.m.Lock() + ai.val++ + res := ai.val + ai.m.Unlock() + return res +} + +// Set atomically sets current value to the given value. +func (ai *Int) Set(newValue int) { + ai.m.Lock() + ai.val = newValue + ai.m.Unlock() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go new file mode 100644 index 00000000..6e3b2ef5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go @@ -0,0 +1,52 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "runtime" + "sync" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Atomic Int", func() { + // atomic tests require actual parallelism + runtime.GOMAXPROCS(runtime.NumCPU()) + + var ai *atomic.Int + wg := new(sync.WaitGroup) + + gg.BeforeEach(func() { + ai = atomic.NewInt(0) + }) + + gg.It("must Offer() more elements than queue's capacity, and still not block", func() { + var count int = 1e6 + wg.Add(count) + for i := 0; i < count; i++ { + go func() { + defer wg.Done() + ai.IncrementAndGet() + }() + } + + wg.Wait() + gm.Expect(ai.Get()).To(gm.Equal(count)) + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go new file mode 100644 index 00000000..200c2ef3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go @@ -0,0 +1,118 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import ( + "sync" +) + +// Map implements a Map with atomic semantics. +type Map[K comparable, V any] struct { + m map[K]V + mutex sync.RWMutex +} + +// New generates a new Map instance. +func New[K comparable, V any](length int) *Map[K, V] { + return &Map[K, V]{ + m: make(map[K]V, length), + } +} + +// Get atomically retrieves an element from the Map. +func (m *Map[K, V]) Get(k K) V { + m.mutex.RLock() + res := m.m[k] + m.mutex.RUnlock() + return res +} + +// Set atomically sets an element in the Map. +// If idx is out of range, it will return an error. +func (m *Map[K, V]) Set(k K, v V) { + m.mutex.Lock() + m.m[k] = v + m.mutex.Unlock() +} + +// Replace replaces the internal map with the provided one. +func (m *Map[K, V]) Replace(nm map[K]V) { + m.mutex.Lock() + m.m = nm + m.mutex.Unlock() +} + +// Length returns the Map size. +func (m *Map[K, V]) Length() int { + m.mutex.RLock() + res := len(m.m) + m.mutex.RUnlock() + + return res +} + +// Length returns the Map size. +func (m *Map[K, V]) Clone() map[K]V { + m.mutex.RLock() + res := make(map[K]V, len(m.m)) + for k, v := range m.m { + res[k] = v + } + m.mutex.RUnlock() + + return res +} + +// Delete will remove the key and return its value. +func (m *Map[K, V]) Delete(k K) V { + m.mutex.Lock() + res := m.m[k] + delete(m.m, k) + m.mutex.Unlock() + return res +} + +// DeleteDeref will dereference and remove the key and return its value. +func (m *Map[K, V]) DeleteDeref(k *K) V { + m.mutex.Lock() + res := m.m[*k] + delete(m.m, *k) + m.mutex.Unlock() + return res +} + +// DeleteAllDeref will dereferences and removes the keys. +func (m *Map[K, V]) DeleteAll(ks ...K) { + m.mutex.Lock() + for i := range ks { + delete(m.m, ks[i]) + } + m.mutex.Unlock() +} + +// DeleteAll will remove the keys. +func (m *Map[K, V]) DeleteAllDeref(ks ...*K) { + m.mutex.Lock() + for i := range ks { + delete(m.m, *ks[i]) + } + m.mutex.Unlock() +} + +func MapAllF[K comparable, V any, U any](m *Map[K, V], f func(map[K]V) U) U { + m.mutex.RLock() + defer m.mutex.RUnlock() + return f(m.m) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go new file mode 100644 index 00000000..3dbb5209 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go @@ -0,0 +1,81 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic + +import "sync" + +// Queue is a non-blocking FIFO queue. +// If the queue is empty, nil is returned. +// if the queue is full, offer will return false +type Queue struct { + head, tail uint32 + data []interface{} + size uint32 + wrapped bool + mutex sync.Mutex +} + +// NewQueue creates a new queue with initial size. +func NewQueue(size int) *Queue { + if size <= 0 { + panic("Queue size cannot be less than 1") + } + + return &Queue{ + wrapped: false, + data: make([]interface{}, uint32(size)), + size: uint32(size), + } +} + +// Offer adds an item to the queue unless the queue is full. +// In case the queue is full, the item will not be added to the queue +// and false will be returned +func (q *Queue) Offer(obj interface{}) bool { + q.mutex.Lock() + + // make sure queue is not full + if q.tail == q.head && q.wrapped { + q.mutex.Unlock() + return false + } + + if q.head+1 == q.size { + q.wrapped = true + } + + q.head = (q.head + 1) % q.size + q.data[q.head] = obj + q.mutex.Unlock() + return true +} + +// Poll removes and returns an item from the queue. +// If the queue is empty, nil will be returned. +func (q *Queue) Poll() (res interface{}) { + q.mutex.Lock() + + // if queue is not empty + if q.wrapped || (q.tail != q.head) { + if q.tail+1 == q.size { + q.wrapped = false + } + q.tail = (q.tail + 1) % q.size + res = q.data[q.tail] + } + + q.mutex.Unlock() + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go new file mode 100644 index 00000000..3299489f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go @@ -0,0 +1,72 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "runtime" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +type testStruct struct{ i int } + +var _ = gg.Describe("Atomic Queue", func() { + // atomic tests require actual parallelism + runtime.GOMAXPROCS(runtime.NumCPU()) + + var qcap int + var q *atomic.Queue + var elem interface{} + + gg.BeforeEach(func() { + qcap = 10 + q = atomic.NewQueue(qcap) + }) + + gg.It("must Offer() more elements than queue's capacity, and still not block", func() { + for i := 0; i < 2*qcap; i++ { + q.Offer(&testStruct{}) + } + }) + + gg.It("must Poll() more elements than queue's capacity, and still not block", func() { + for i := 0; i < 2*qcap; i++ { + elem = q.Poll() + } + gm.Expect(elem).To(gm.BeNil()) + }) + + gg.It("must Offer() more elements than queue's capacity, and Poll() as many as capacity", func() { + // test for many iterations + for j := 0; j < 10; j++ { + for i := 0; i < 2*qcap; i++ { + q.Offer(&testStruct{i}) + } + + for i := 0; i < 2*qcap; i++ { + obj := q.Poll() + if i < qcap { + gm.Expect(obj.(*testStruct).i).To(gm.Equal(i)) + } else { + gm.Expect(obj).To(gm.BeNil()) + } + } + } + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go new file mode 100644 index 00000000..c7d072bb --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go @@ -0,0 +1,61 @@ +package atomic + +import "sync" + +// SyncVal allows synchronized access to a value +type SyncVal[T any] struct { + val T + lock sync.RWMutex +} + +// NewSyncVal creates a new instance of SyncVal +func NewSyncVal[T any](val T) *SyncVal[T] { + return &SyncVal[T]{val: val} +} + +// Set updates the value of SyncVal with the passed argument +func (sv *SyncVal[T]) Set(val T) { + sv.lock.Lock() + sv.val = val + sv.lock.Unlock() +} + +// Get returns the value inside the SyncVal +func (sv *SyncVal[T]) Get() T { + sv.lock.RLock() + val := sv.val + sv.lock.RUnlock() + return val +} + +// GetSyncedVia returns the value returned by the function f. +func (sv *SyncVal[T]) GetSyncedVia(f func(T) (T, error)) (T, error) { + sv.lock.RLock() + defer sv.lock.RUnlock() + + val, err := f(sv.val) + return val, err +} + +// Update gets a function and passes the value of SyncVal to it. +// If the resulting err is nil, it will update the value of SyncVal. +// It will return the resulting error to the caller. +func (sv *SyncVal[T]) Update(f func(T) (T, error)) error { + sv.lock.Lock() + defer sv.lock.Unlock() + + val, err := f(sv.val) + if err == nil { + sv.val = val + } + return err +} + +// MapSyncValue returns the value returned by the function f. +func MapSyncValue[T any, U any](sv *SyncVal[T], f func(T) (U, error)) (U, error) { + sv.lock.RLock() + defer sv.lock.RUnlock() + + val, err := f(sv.val) + return val, err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go new file mode 100644 index 00000000..7c56a3ab --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go @@ -0,0 +1,23 @@ +package atomic + +import "sync/atomic" + +// TypedVal allows synchronized access to a value +type TypedVal[T any] atomic.Value + +// Set updates the value of TypedVal with the passed argument +func (sv *TypedVal[T]) Set(val T) { + (*atomic.Value)(sv).Store(&val) +} + +// Get returns the value inside the TypedVal +func (sv *TypedVal[T]) Get() T { + res := (*atomic.Value)(sv).Load() + if res != nil { + return *res.(*T) + } + + // return zero value; for pointers, it will be nil + var t T + return t +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go new file mode 100644 index 00000000..e45e14a2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go @@ -0,0 +1,126 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package atomic_test + +import ( + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("TypedVal", func() { + + gg.Context("Storage must support", func() { + + gg.Context("Primitives", func() { + + gg.It("int", func() { + var t int = 5 + var tv atomic.TypedVal[int] + tv.Set(t) + gm.Expect(tv.Get()).To(gm.Equal(t)) + }) + + gg.It("string", func() { + var t string = "Hello!" + var tv atomic.TypedVal[string] + tv.Set(t) + gm.Expect(tv.Get()).To(gm.Equal(t)) + }) + + gg.It("slice", func() { + var t = []int{1, 2, 3} + var tv atomic.TypedVal[[]int] + tv.Set(t) + gm.Expect(tv.Get()).To(gm.Equal(t)) + + tv.Set(nil) + var tt []int + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + gg.It("map", func() { + var t = map[string]int{"a": 1, "b": 2, "c": 3} + var tv atomic.TypedVal[map[string]int] + tv.Set(t) + gm.Expect(tv.Get()).To(gm.Equal(t)) + + tv.Set(nil) + var tt map[string]int + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + }) + + gg.Context("Pointers", func() { + + gg.It("*int", func() { + var t int = 5 + var tv atomic.TypedVal[*int] + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + tv.Set(nil) + var tt *int + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + gg.It("*string", func() { + var t string = "Hello!" + var tv atomic.TypedVal[*string] + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + tv.Set(nil) + var tt *string + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + gg.It("slice", func() { + var t = []int{1, 2, 3} + var tv atomic.TypedVal[*[]int] + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + t = nil + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + tv.Set(nil) + var tt *[]int + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + gg.It("map", func() { + var t = map[string]int{"a": 1, "b": 2, "c": 3} + var tv atomic.TypedVal[*map[string]int] + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + t = nil + tv.Set(&t) + gm.Expect(tv.Get()).To(gm.Equal(&t)) + + tv.Set(nil) + var tt *map[string]int + gm.Expect(tv.Get()).To(gm.Equal(tt)) + }) + + }) + + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go new file mode 100644 index 00000000..7dba847b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go @@ -0,0 +1,70 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + luaLib "github.com/aerospike/aerospike-client-go/v7/internal/lua/resources" + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + lua "github.com/yuin/gopher-lua" +) + +// SetPath sets the interpreter's current Lua Path +func SetPath(lpath string) { + lua.LuaPath = lpath +} + +// Path returns the interpreter's current Lua Path +func Path() string { + return lua.LuaPath +} + +// LuaPool is the global LState pool +var LuaPool = types.NewPool(64) + +func newInstance(params ...interface{}) interface{} { + L := lua.NewState() + + registerLuaAerospikeType(L) + registerLuaStreamType(L) + registerLuaListType(L) + registerLuaMapType(L) + + if err := L.DoString(luaLib.LibStreamOps); err != nil { + logger.Logger.Error(err.Error()) + return nil + } + + if err := L.DoString(luaLib.LibAerospike); err != nil { + logger.Logger.Error(err.Error()) + return nil + } + + return L +} + +func finalizeInstance(instance interface{}) { + if instance != nil { + instance.(*lua.LState).Close() + } +} + +func init() { + LuaPool.New = newInstance + LuaPool.Finalize = finalizeInstance +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go new file mode 100644 index 00000000..dabb4a95 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go @@ -0,0 +1,158 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + "fmt" + "reflect" + + lua "github.com/yuin/gopher-lua" +) + +// NewValue creates a value from interface{} in the interpreter +func NewValue(L *lua.LState, value interface{}) lua.LValue { + // Nils should return immediately + if value == nil { + return lua.LNil + } + + // if it is a LValue already, return it without delay + if lval, ok := value.(lua.LValue); ok { + return lval + } + + switch v := value.(type) { + case string: + return lua.LString(v) + case int: + return lua.LNumber(float64(v)) + case uint: + return lua.LNumber(float64(v)) + case int8: + return lua.LNumber(float64(v)) + case uint8: + return lua.LNumber(float64(v)) + case int16: + return lua.LNumber(float64(v)) + case uint16: + return lua.LNumber(float64(v)) + case int32: + return lua.LNumber(float64(v)) + case uint32: + return lua.LNumber(float64(v)) + case int64: + return lua.LNumber(float64(v)) + case uint64: + return lua.LNumber(float64(v)) + case float32: + return lua.LNumber(float64(v)) + case float64: + return lua.LNumber(v) + case bool: + return lua.LBool(v) + case map[interface{}]interface{}: + luaMap := &Map{m: v} + ud := L.NewUserData() + ud.Value = luaMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + return ud + + case []interface{}: + luaList := &List{l: v} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + return ud + } + + // check for array and map + rv := reflect.ValueOf(value) + switch rv.Kind() { + case reflect.Array, reflect.Slice: + l := rv.Len() + arr := make([]interface{}, l) + for i := 0; i < l; i++ { + arr[i] = rv.Index(i).Interface() + } + + return NewValue(L, arr) + case reflect.Map: + l := rv.Len() + amap := make(map[interface{}]interface{}, l) + for _, i := range rv.MapKeys() { + amap[i.Interface()] = rv.MapIndex(i).Interface() + } + + return NewValue(L, amap) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return NewValue(L, reflect.ValueOf(value).Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: + return NewValue(L, int64(reflect.ValueOf(value).Uint())) + case reflect.String: + return NewValue(L, rv.String()) + case reflect.Float32, reflect.Float64: + return NewValue(L, rv.Float()) + case reflect.Bool: + return NewValue(L, rv.Bool()) + } + + panic(fmt.Sprintf("unrecognized data type for lua: %#v\n", value)) +} + +// LValueToInterface converts a generic LValue to a native type +func LValueToInterface(val lua.LValue) interface{} { + switch val.Type() { + case lua.LTNil: + return nil + case lua.LTBool: + return lua.LVAsBool(val) + case lua.LTNumber: + return float64(lua.LVAsNumber(val)) + case lua.LTString: + return lua.LVAsString(val) + case lua.LTUserData: + ud := val.(*lua.LUserData).Value + switch v := ud.(type) { + case *Map: + return v.m + case *List: + return v.l + default: + return v + } + + case lua.LTTable: + t := val.(*lua.LTable) + m := make(map[interface{}]interface{}, t.Len()) + t.ForEach(func(k, v lua.LValue) { m[k] = v }) + return m + default: + panic(fmt.Sprintf("unrecognized data type %#v", val)) + } +} + +func allToString(L *lua.LState) int { + ud := L.CheckUserData(1) + value := ud.Value + if stringer, ok := value.(fmt.Stringer); ok { + L.Push(lua.LString(stringer.String())) + } else { + L.Push(lua.LString(fmt.Sprintf("%v", value))) + } + return 1 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go new file mode 100644 index 00000000..8ccb6973 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go @@ -0,0 +1,64 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + "github.com/aerospike/aerospike-client-go/v7/logger" + lua "github.com/yuin/gopher-lua" +) + +const luaLuaAerospikeTypeName = "LuaAerospike" + +// Registers my luaAerospike type to given L. +func registerLuaAerospikeType(L *lua.LState) { + mt := L.NewTypeMetatable(luaLuaAerospikeTypeName) + + L.SetGlobal("aerospike", mt) + + // static attributes + L.SetField(mt, "log", L.NewFunction(luaAerospikeLog)) + + L.SetMetatable(mt, mt) +} + +func luaAerospikeLog(L *lua.LState) int { + if L.GetTop() < 2 || L.GetTop() > 3 { + L.ArgError(1, "2 arguments are expected for aerospike:log method") + return 0 + } + + // account for calling it on a table + paramIdx := 1 + if L.GetTop() == 3 { + paramIdx = 2 + } + + level := L.CheckInt(paramIdx) + str := L.CheckString(paramIdx + 1) + + switch level { + case 1: + logger.Logger.Warn(str) + case 2: + logger.Logger.Info(str) + case 3, 4: + logger.Logger.Debug(str) + } + + return 0 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go new file mode 100644 index 00000000..db052b9e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go @@ -0,0 +1,56 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua_test + +import ( + lua "github.com/yuin/gopher-lua" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" +) + +var _ = gg.Describe("Lua Aerospike API Test", func() { + + // code vs result + testMatrix := map[string]interface{}{ + "aerospike.log(1, 'Warn')": nil, + "warn('Warn %d', 1)": nil, + + "aerospike.log(2, 'Info')": nil, + "info('Info %d', 2)": nil, + + "aerospike.log(3, 'Debug')": nil, + "trace('Trace %d', 3)": nil, + + "aerospike.log(4, 'Debug')": nil, + "debug('Debug %d', 4)": nil, + } + + gg.It("must run all code blocks", func() { + instance := ilua.LuaPool.Get().(*lua.LState) + defer instance.Close() + for source := range testMatrix { + err := instance.DoString(source) + gm.Expect(err).NotTo(gm.HaveOccurred()) + } + + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go new file mode 100644 index 00000000..2a1f939b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go @@ -0,0 +1,404 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + "fmt" + + lua "github.com/yuin/gopher-lua" +) + +// List is the list data type to be used with a Lua instance +type List struct { + l []interface{} +} + +const luaLuaListTypeName = "LuaList" + +// Registers my luaList type to given L. +func registerLuaListType(L *lua.LState) { + mt := L.NewTypeMetatable(luaLuaListTypeName) + + // List package + L.SetGlobal("List", mt) + + // static attributes + + L.SetMetatable(mt, mt) + + // list package + mt = L.NewTypeMetatable(luaLuaListTypeName) + L.SetGlobal("list", mt) + + // static attributes + L.SetField(mt, "__call", L.NewFunction(newLuaList)) + L.SetField(mt, "create", L.NewFunction(createLuaList)) + + L.SetField(mt, "size", L.NewFunction(luaListSize)) + L.SetField(mt, "insert", L.NewFunction(luaListInsert)) + L.SetField(mt, "append", L.NewFunction(luaListAppend)) + L.SetField(mt, "prepend", L.NewFunction(luaListPrepend)) + L.SetField(mt, "take", L.NewFunction(luaListTake)) + L.SetField(mt, "remove", L.NewFunction(luaListRemove)) + L.SetField(mt, "drop", L.NewFunction(luaListDrop)) + L.SetField(mt, "trim", L.NewFunction(luaListTrim)) + L.SetField(mt, "clone", L.NewFunction(luaListClone)) + L.SetField(mt, "concat", L.NewFunction(luaListConcat)) + L.SetField(mt, "merge", L.NewFunction(luaListMerge)) + L.SetField(mt, "iterator", L.NewFunction(luaListIterator)) + + // methods + L.SetFuncs(mt, map[string]lua.LGFunction{ + "__index": luaListIndex, + "__newindex": luaListNewIndex, + "__len": luaListLen, + "__tostring": luaListToString, + }) + + L.SetMetatable(mt, mt) +} + +// Constructor +func createLuaList(L *lua.LState) int { + if L.GetTop() == 0 { + luaList := &List{l: []interface{}{}} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 + } else if L.GetTop() == 1 || L.GetTop() == 2 { + cp := L.CheckInt(1) + l := make([]interface{}, 0, cp) + + luaList := &List{l: l} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 + } + L.ArgError(1, "Only one argument expected for list#create method") + return 0 +} + +// Constructor +func newLuaList(L *lua.LState) int { + if L.GetTop() == 1 { + luaList := &List{l: []interface{}{}} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 + } else if L.GetTop() == 2 { + t := L.CheckTable(2) + l := make([]interface{}, t.Len()) + for i := 1; i <= t.Len(); i++ { + l[i-1] = LValueToInterface(t.RawGetInt(i)) + } + + luaList := &List{l: l} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 + } + L.ArgError(1, "Only one argument expected for list#create method") + return 0 +} + +// Checks whether the first lua argument is a *LUserData with *LuaList and returns this *LuaList. +func checkLuaList(L *lua.LState, arg int) *List { + ud := L.CheckUserData(arg) + if v, ok := ud.Value.(*List); ok { + return v + } + L.ArgError(1, "luaList expected") + return nil +} + +func luaListRemove(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for remove method") + return 0 + } + index := L.CheckInt(2) - 1 + + if index < 0 || index >= len(p.l) { + L.ArgError(1, "index out of range for list#remove") + return 0 + } + + for i := index; i < len(p.l)-1; i++ { + p.l[i] = p.l[i+1] + } + p.l = p.l[:len(p.l)-1] + + return 0 +} + +func luaListInsert(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 3 { + L.ArgError(1, "Only two arguments expected for insert method") + return 0 + } + index := L.CheckInt(2) + value := LValueToInterface(L.CheckAny(3)) + + if cap(p.l) > len(p.l) { + for i := len(p.l); i >= index; i-- { + p.l[i] = p.l[i-1] + } + p.l[index-1] = value + } else { + ln := len(p.l) * 2 + if ln > 256 { + ln = 256 + } + newList := make([]interface{}, len(p.l)+1, ln) + + copy(newList, p.l[:index-1]) + newList[index-1] = value + copy(newList[index:], p.l[index-1:len(p.l)]) + p.l = newList + } + + return 0 +} + +func luaListAppend(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for append method") + return 0 + } + value := LValueToInterface(L.CheckAny(2)) + p.l = append(p.l, value) + + return 0 +} + +func luaListPrepend(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for append method") + return 0 + } + value := LValueToInterface(L.CheckAny(2)) + + if cap(p.l) > len(p.l) { + p.l = append(p.l, nil) + for i := len(p.l) - 1; i > 0; i-- { + p.l[i] = p.l[i-1] + } + p.l[0] = value + } else { + ln := len(p.l) * 2 + if ln > 256 { + ln = 256 + } + newList := make([]interface{}, len(p.l)+1, ln) + + copy(newList[1:], p.l) + newList[0] = value + p.l = newList + } + + return 0 +} + +func luaListTake(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for take method") + return 0 + } + + count := L.CheckInt(2) + items := p.l + if count <= len(p.l) { + items = p.l[:count] + } + + luaList := &List{l: items} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 +} + +func luaListDrop(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for take method") + return 0 + } + + count := L.CheckInt(2) + var items []interface{} + if count < len(p.l) { + items = p.l[count:] + } else { + items = []interface{}{} + } + + luaList := &List{l: items} + ud := L.NewUserData() + ud.Value = luaList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 +} + +func luaListTrim(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for list#trim method") + return 0 + } + + count := L.CheckInt(2) + p.l = p.l[:count-1] + + return 0 +} + +func luaListConcat(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for list#concat method") + return 0 + } + + sp := checkLuaList(L, 2) + p.l = append(p.l, sp.l...) + return 0 +} + +// LuaList#clone() +func luaListClone(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "only one argument expected for list#clone method") + return 0 + } + + newList := &List{l: make([]interface{}, len(p.l))} + copy(newList.l, p.l) + + ud := L.NewUserData() + ud.Value = newList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + return 1 +} + +// LuaList#merge() +func luaListMerge(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for merge method") + return 0 + } + + sp := checkLuaList(L, 2) + + newList := &List{l: make([]interface{}, 0, len(p.l)+len(sp.l))} + newList.l = append(newList.l, p.l...) + newList.l = append(newList.l, sp.l...) + + ud := L.NewUserData() + ud.Value = newList + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) + L.Push(ud) + + return 1 +} + +func luaListToString(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for tostring method") + return 0 + } + + L.Push(lua.LString(fmt.Sprintf("%v", p.l))) + return 1 +} + +func luaListSize(L *lua.LState) int { + p := checkLuaList(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for __size method") + return 0 + } + L.Push(lua.LNumber(len(p.l))) + return 1 +} + +func luaListIndex(L *lua.LState) int { + ref := checkLuaList(L, 1) + index := L.CheckInt(2) + + if index <= 0 || index > len(ref.l) { + L.Push(lua.LNil) + return 1 + } + + item := ref.l[index-1] + L.Push(NewValue(L, item)) + return 1 +} + +func luaListNewIndex(L *lua.LState) int { + ref := checkLuaList(L, 1) + index := L.CheckInt(2) + value := L.CheckAny(3) + + ref.l[index-1] = LValueToInterface(value) + return 0 +} + +func luaListLen(L *lua.LState) int { + ref := checkLuaList(L, 1) + L.Push(lua.LNumber(len(ref.l))) + return 1 +} + +func luaListIterator(L *lua.LState) int { + ref := checkLuaList(L, 1) + + // make an iterator + idx := 0 + llen := len(ref.l) + fn := func(L *lua.LState) int { + if idx < llen { + L.Push(NewValue(L, ref.l[idx])) + idx++ + return 1 + } + return 0 + } + L.Push(L.NewFunction(fn)) + return 1 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go new file mode 100644 index 00000000..da097b83 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go @@ -0,0 +1,124 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua_test + +import ( + lua "github.com/yuin/gopher-lua" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" +) + +var _ = gg.Describe("Lua List API Test", func() { + + // code vs result + testMatrix := map[string]interface{}{ + "l = List()\n return l": []interface{}{}, + "l = List.create()\n return l": []interface{}{}, + "l = List.create(100)\n return l": make([]interface{}, 0, 100), + + "l = list()\n return l": []interface{}{}, + "l = list.create()\n return l": []interface{}{}, + "l = list.create(100)\n return l": make([]interface{}, 0, 100), + "l = list({1,2})\n return l": []interface{}{float64(1), float64(2)}, + + "l = list({1,2})\n l[1] = 5\n return l": []interface{}{float64(5), float64(2)}, + "l = list({1,2})\n return l[1]": float64(1), + + "l = list()\n return list.size(l)": float64(0), + "l = list.create()\n return list.size(l)": float64(0), + "l = list.create(100)\n return list.size(l)": float64(0), + "l = list({1,2})\n return list.size(l)": float64(2), + + "l = list{1,2}\n list.insert(l, 1, 0)\n return l": []interface{}{float64(0), float64(1), float64(2)}, + "l = list{1,2}\n list.insert(l, 2, 0)\n return l": []interface{}{float64(1), float64(0), float64(2)}, + "l = list{1,2}\n list.insert(l, 3, 0)\n return l": []interface{}{float64(1), float64(2), float64(0)}, + + "l = list{1,2}\n list.append(l, 3)\n return l": []interface{}{float64(1), float64(2), float64(3)}, + "l = list{1,2}\n list.append(l, 3)\nlist.append(l, 4)\n return l": []interface{}{float64(1), float64(2), float64(3), float64(4)}, + + "l = list{1,2}\n list.prepend(l, 0)\n return l": []interface{}{float64(0), float64(1), float64(2)}, + "l = list{1,2}\n list.prepend(l, 3)\nlist.prepend(l, 4)\n return l": []interface{}{float64(4), float64(3), float64(1), float64(2)}, + + "l = list{1,2}\n return list.take(l, 1)": []interface{}{float64(1)}, + "l = list{1,2}\n return list.take(l, 2)": []interface{}{float64(1), float64(2)}, + "l = list{1,2}\n return list.take(l, 3)": []interface{}{float64(1), float64(2)}, + "l = list{1,2}\n list.take(l, 1)\nlist.take(l, 2)\n return l": []interface{}{float64(1), float64(2)}, + + "l = list{1,2}\n list.remove(l, 1)\n return l": []interface{}{float64(2)}, + "l = list{1,2}\n list.remove(l, 2)\n return l": []interface{}{float64(1)}, + "l = list{1,2}\n list.remove(l, 1)\nlist.remove(l, 1)\n return l": []interface{}{}, + + "l = list{1,2}\n list.drop(l, 1)\n return l": []interface{}{float64(1), float64(2)}, + "l = list{1,2}\n return list.drop(l, 1)": []interface{}{float64(2)}, + "l = list{1,2}\n return list.drop(l, 2)": []interface{}{}, + "l = list{1,2}\n return list.drop(l, 5)": []interface{}{}, + "l = list{1,2}\n list.drop(l, 1)\nreturn list.drop(l, 1)": []interface{}{float64(2)}, + + "l = list{1,2}\n list.trim(l, 1)\n return l": []interface{}{}, + "l = list{1,2}\n list.trim(l, 2)\n return l": []interface{}{float64(1)}, + + "l = list{1,2}\n return list.clone(l)": []interface{}{float64(1), float64(2)}, + + "l1 = list{1,2}\n l2 = list{3,4}\n list.concat(l1, l2)\n return l1": []interface{}{float64(1), float64(2), float64(3), float64(4)}, + "l1 = list{3,4}\n l2 = list{1,2}\n list.concat(l1, l2)\n return l1": []interface{}{float64(3), float64(4), float64(1), float64(2)}, + + "l1 = list{1,2}\n l2 = list{3,4}\n return list.merge(l1, l2)": []interface{}{float64(1), float64(2), float64(3), float64(4)}, + "l1 = list{3,4}\n l2 = list{1,2}\n return list.merge(l1, l2)": []interface{}{float64(3), float64(4), float64(1), float64(2)}, + + "l = list{1,2,3,4,5}\n cnt = 0\nfor value in list.iterator(l) do\n\t cnt = cnt + value\n end\n return cnt": float64(15), + + "l = list{1,2,3,4,5}\n return tostring(l)": "[1 2 3 4 5]", + } + + // following expressions should return an error + errMatrix := []string{ + "l = list{1,2}\n list.remove(l, 3)", + } + + gg.It("must run all code blocks", func() { + instance := ilua.LuaPool.Get().(*lua.LState) + defer instance.Close() + for source, expected := range testMatrix { + + err := instance.DoString(source) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + gg.By(source) + gm.Expect(ilua.LValueToInterface(instance.CheckAny(-1))).To(gm.Equal(expected)) + instance.Pop(1) // remove received value + } + + }) + + gg.It("must fail all code blocks", func() { + instance := ilua.LuaPool.Get().(*lua.LState) + defer instance.Close() + for _, source := range errMatrix { + gg.By(source) + + err := instance.DoString(source) + gm.Expect(err).To(gm.HaveOccurred()) + + } + + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go new file mode 100644 index 00000000..1ff1c474 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go @@ -0,0 +1,393 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + "fmt" + + lua "github.com/yuin/gopher-lua" +) + +// Map is used internally for the Lua instance +type Map struct { + m map[interface{}]interface{} +} + +const luaLuaMapTypeName = "LuaMap" + +func registerLuaMapType(L *lua.LState) { + // Map package + mt := L.NewTypeMetatable(luaLuaMapTypeName) + + L.SetGlobal("Map", mt) + + // static attributes + L.SetField(mt, "__call", L.NewFunction(newLuaMap)) + + L.SetField(mt, "create", L.NewFunction(luaMapCreate)) + + // methods + L.SetMetatable(mt, mt) + + // map package + mt = L.NewTypeMetatable(luaLuaMapTypeName) + + L.SetGlobal("map", mt) + + // static attributes + L.SetField(mt, "__call", L.NewFunction(newLuaMap)) + + L.SetField(mt, "create", L.NewFunction(luaMapCreate)) + + L.SetField(mt, "pairs", L.NewFunction(luaMapPairs)) + L.SetField(mt, "size", L.NewFunction(luaMapSize)) + L.SetField(mt, "keys", L.NewFunction(luaMapKeys)) + L.SetField(mt, "values", L.NewFunction(luaMapValues)) + L.SetField(mt, "remove", L.NewFunction(luaMapRemove)) + L.SetField(mt, "clone", L.NewFunction(luaMapClone)) + L.SetField(mt, "merge", L.NewFunction(luaMapMerge)) + L.SetField(mt, "diff", L.NewFunction(luaMapDiff)) + + // methods + L.SetFuncs(mt, map[string]lua.LGFunction{ + "__index": luaMapIndex, + "__newindex": luaMapNewIndex, + "__len": luaMapSize, + "__tostring": luaMapToString, + }) + + L.SetMetatable(mt, mt) +} + +// Constructor +func luaMapCreate(L *lua.LState) int { + if L.GetTop() == 1 { + luaMap := &Map{m: map[interface{}]interface{}{}} + ud := L.NewUserData() + ud.Value = luaMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + return 1 + } else if L.GetTop() == 2 { + L.CheckTable(1) + sz := L.CheckInt(2) + luaMap := &Map{m: make(map[interface{}]interface{}, sz)} + ud := L.NewUserData() + ud.Value = luaMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + return 1 + } + L.ArgError(1, "Only one argument expected for map create method") + return 0 +} + +func newLuaMap(L *lua.LState) int { + if L.GetTop() == 1 { + luaMap := &Map{m: make(map[interface{}]interface{}, 4)} + ud := L.NewUserData() + ud.Value = luaMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + return 1 + } else if L.GetTop() == 2 { + L.CheckTable(1) + t := L.CheckTable(2) + m := make(map[interface{}]interface{}, t.Len()) + t.ForEach(func(k, v lua.LValue) { m[LValueToInterface(k)] = LValueToInterface(v) }) + + luaMap := &Map{m: m} + ud := L.NewUserData() + ud.Value = luaMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + return 1 + } + L.ArgError(1, "Only one argument expected for map create method") + return 0 +} + +// Checks whether the first lua argument is a *LUserData with *LuaMap and returns this *LuaMap. +func checkLuaMap(L *lua.LState, arg int) *Map { + ud := L.CheckUserData(arg) + if v, ok := ud.Value.(*Map); ok { + return v + } + L.ArgError(1, "luaMap expected") + return nil +} + +func luaMapRemove(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for remove method") + return 0 + } + key := L.CheckAny(2) + + delete(p.m, LValueToInterface(key)) + return 0 +} + +func luaMapClone(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for clone method") + return 0 + } + + newMap := &Map{m: make(map[interface{}]interface{}, len(p.m))} + for k, v := range p.m { + newMap.m[k] = v + } + + ud := L.NewUserData() + ud.Value = newMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + return 1 +} + +func luaMapMerge(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() < 2 || L.GetTop() > 3 { + L.ArgError(1, "Only 2 or 3 argument expected for merge method") + return 0 + } + + if L.GetTop() == 2 { + sp := checkLuaMap(L, 2) + + newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} + for k, v := range p.m { + newMap.m[k] = v + } + + for k, v := range sp.m { + newMap.m[k] = v + } + + ud := L.NewUserData() + ud.Value = newMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + } else { + sp := checkLuaMap(L, 2) + fn := L.CheckFunction(3) + + newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} + for k, v := range p.m { + if v2, exists := sp.m[k]; exists { + L.CallByParam(lua.P{Fn: fn, NRet: 1, Protect: true, Handler: nil}, NewValue(L, v), NewValue(L, v2)) + ret := L.CheckAny(-1) + L.Pop(1) // remove received value + newMap.m[k] = LValueToInterface(ret) + } else { + newMap.m[k] = v + } + } + + for k, v := range sp.m { + // only add keys that haven't been processed already + if _, exists := newMap.m[k]; !exists { + newMap.m[k] = v + } + } + + ud := L.NewUserData() + ud.Value = newMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + } + + return 1 +} + +func luaMapDiff(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for diff method") + return 0 + } + + sp := checkLuaMap(L, 2) + + newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} + + for k, v := range p.m { + if _, exists := sp.m[k]; !exists { + newMap.m[k] = v + } + } + + for k, v := range sp.m { + if _, exists := p.m[k]; !exists { + newMap.m[k] = v + } + } + + ud := L.NewUserData() + ud.Value = newMap + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) + L.Push(ud) + + return 1 +} + +func luaMapToString(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for tostring method") + return 0 + } + L.Push(lua.LString(fmt.Sprintf("%v", p.m))) + return 1 +} + +func luaMapSize(L *lua.LState) int { + p := checkLuaMap(L, 1) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for __size method") + return 0 + } + L.Push(lua.LNumber(len(p.m))) + return 1 +} + +func luaMapIndex(L *lua.LState) int { + ref := checkMap(L) + key := LValueToInterface(L.CheckAny(2)) + + v := ref.m[key] + if v == nil { + v = lua.LNil + } + + L.Push(NewValue(L, v)) + return 1 +} + +func luaMapNewIndex(L *lua.LState) int { + ref := checkMap(L) + key := LValueToInterface(L.CheckAny(2)) + value := LValueToInterface(L.CheckAny(3)) + + ref.m[key] = value + return 0 +} + +func luaMapLen(L *lua.LState) int { + ref := checkMap(L) + L.Push(lua.LNumber(len(ref.m))) + return 1 +} + +func luaMapPairs(L *lua.LState) int { + ref := checkMap(L) + + // make an iterator + iter := make(chan *struct{ k, v interface{} }) + + go func() { + for k, v := range ref.m { + iter <- &struct{ k, v interface{} }{k, v} + } + close(iter) + }() + + fn := func(L *lua.LState) int { + tuple := <-iter + if tuple == nil { + return 0 + } + + L.Push(NewValue(L, tuple.k)) + L.Push(NewValue(L, tuple.v)) + return 2 + } + L.Push(L.NewFunction(fn)) + return 1 +} + +func luaMapKeys(L *lua.LState) int { + ref := checkMap(L) + + // make an iterator + iter := make(chan interface{}) + + go func() { + for k := range ref.m { + iter <- k + } + close(iter) + }() + + fn := func(L *lua.LState) int { + tuple := <-iter + if tuple == nil { + return 0 + } + + L.Push(NewValue(L, tuple)) + return 1 + } + L.Push(L.NewFunction(fn)) + return 1 +} + +func luaMapValues(L *lua.LState) int { + ref := checkMap(L) + + // make an iterator + iter := make(chan interface{}) + + go func() { + for _, v := range ref.m { + iter <- v + } + close(iter) + }() + + fn := func(L *lua.LState) int { + tuple := <-iter + if tuple == nil { + return 0 + } + + L.Push(NewValue(L, tuple)) + return 1 + } + L.Push(L.NewFunction(fn)) + return 1 +} + +func luaMapEq(L *lua.LState) int { + map1 := checkMap(L) + map2 := checkMap(L) + L.Push(lua.LBool(map1 == map2)) + return 1 +} + +func checkMap(L *lua.LState) *Map { + ud := L.CheckUserData(1) + if v, ok := ud.Value.(*Map); ok { + return v + } + L.ArgError(1, "luaMap expected") + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go new file mode 100644 index 00000000..d73529e4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go @@ -0,0 +1,77 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua_test + +import ( + lua "github.com/yuin/gopher-lua" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" +) + +var _ = gg.Describe("Lua Map API Test", func() { + + // code vs result + testMatrix := map[string]interface{}{ + "m = Map()\n return m": map[interface{}]interface{}{}, + + "m = map()\n return m": map[interface{}]interface{}{}, + "m = map{x = 1, y = 2}\n return m": map[interface{}]interface{}{"x": float64(1), "y": float64(2)}, + "m = map.create(100)\n return m": make(map[interface{}]interface{}, 100), + + "m = map({x=1,y=2})\n return m['x']": float64(1), + "m = map({x=1,y=2})\n m['x'] = 5\n return m": map[interface{}]interface{}{"x": float64(5), "y": float64(2)}, + + "m = map()\n return map.size(m)": float64(0), + "m = map.create(100)\n return map.size(m)": float64(0), + "m = map({x=1,y=2})\n return map.size(m)": float64(2), + + "m = map{x=1,y=2,z=3}\n cnt = 0\nfor k, v in map.pairs(m) do\n\t cnt = cnt + v\n end\n return cnt": float64(6), + + "m = map{x=1,y=2,z=3}\n str = ''\nfor k in map.keys(m) do\n\t str = str .. k\n end\n return string.len(str)": float64(3), + "m = map{x=1,y=2,z=3}\n cnt = 0\nfor v in map.values(m) do\n\t cnt = cnt + v\n end\n return cnt": float64(6), + + "m = map{x=1,y=2}\n map.remove(m, 'x')\n return m": map[interface{}]interface{}{"y": float64(2)}, + "m = map{x=1,y=2}\n map.remove(m, 'y')\n return m": map[interface{}]interface{}{"x": float64(1)}, + "m = map{x=1,y=2}\n map.remove(m, 'x')\nmap.remove(m, 'y')\n return m": map[interface{}]interface{}{}, + "m = map{x=1,y=2}\n map.remove(m, 'z')\nmap.remove(m, 't')\n return m": map[interface{}]interface{}{"x": float64(1), "y": float64(2)}, + + "m1 = map({x=1,y=2})\n m2 = map.clone(m1)\n return map.size(m2)": float64(2), + + "m1 = map{x=1,y=2}\n m2 = map{a=3,b=4}\n return map.merge(m1, m2)": map[interface{}]interface{}{"x": float64(1), "y": float64(2), "a": float64(3), "b": float64(4)}, + "m1 = map{x=1,y=2}\n m2 = map{x=3,y=4}\n return map.merge(m1, m2, function(v1, v2)\n return v1 + v2\n end)": map[interface{}]interface{}{"x": float64(4), "y": float64(6)}, + } + + gg.It("must run all code blocks", func() { + instance := ilua.LuaPool.Get().(*lua.LState) + defer instance.Close() + for source, expected := range testMatrix { + + err := instance.DoString(source) + gm.Expect(err).NotTo(gm.HaveOccurred()) + + gg.By(source) + gm.Expect(ilua.LValueToInterface(instance.CheckAny(-1))).To(gm.Equal(expected)) + instance.Pop(1) // remove received value + } + + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go new file mode 100644 index 00000000..7a21c747 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go @@ -0,0 +1,132 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua + +import ( + "fmt" + + lua "github.com/yuin/gopher-lua" +) + +// Stream is the data type used as a stream by the lua instances +type Stream struct { + s chan interface{} +} + +const luaLuaStreamTypeName = "LuaStream" + +// Registers my luaStream type to given L. +func registerLuaStreamType(L *lua.LState) { + mt := L.NewTypeMetatable(luaLuaStreamTypeName) + + L.SetGlobal("stream", mt) + + // static attributes + L.SetField(mt, "__call", L.NewFunction(newStream)) + L.SetField(mt, "read", L.NewFunction(luaStreamRead)) + L.SetField(mt, "write", L.NewFunction(luaStreamWrite)) + L.SetField(mt, "readable", L.NewFunction(luaStreamReadable)) + L.SetField(mt, "writeable", L.NewFunction(luaStreamWriteable)) + + // methods + L.SetFuncs(mt, map[string]lua.LGFunction{ + "__tostring": luaStreamToString, + }) + + L.SetMetatable(mt, mt) +} + +// NewStream creates a LuaStream +func NewStream(L *lua.LState, stream chan interface{}) *lua.LUserData { + luaStream := &Stream{s: stream} + ud := L.NewUserData() + ud.Value = luaStream + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaStreamTypeName)) + return ud +} + +func newStream(L *lua.LState) int { + luaStream := &Stream{s: make(chan interface{}, 64)} + ud := L.NewUserData() + ud.Value = luaStream + L.SetMetatable(ud, L.GetTypeMetatable(luaLuaStreamTypeName)) + L.Push(ud) + return 1 +} + +// Checks whether the first lua argument is a *LUserData with *LuaStream and returns this *LuaStream. +func checkLuaStream(L *lua.LState) *Stream { + ud := L.CheckUserData(1) + if v, ok := ud.Value.(*Stream); ok { + return v + } + L.ArgError(1, "luaSteam expected") + return nil +} + +func luaStreamToString(L *lua.LState) int { + p := checkLuaStream(L) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for tostring method") + return 0 + } + L.Push(lua.LString(fmt.Sprintf("%v", p.s))) + return 1 +} + +func luaStreamRead(L *lua.LState) int { + p := checkLuaStream(L) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for stream:read method") + return 0 + } + + L.Push(NewValue(L, <-p.s)) + return 1 +} + +func luaStreamWrite(L *lua.LState) int { + p := checkLuaStream(L) + if L.GetTop() != 2 { + L.ArgError(1, "Only one argument expected for stream:write method") + return 0 + } + + p.s <- LValueToInterface(L.CheckAny(2)) + return 1 +} + +func luaStreamReadable(L *lua.LState) int { + checkLuaStream(L) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for readable method") + return 0 + } + L.Push(lua.LBool(true)) + return 1 +} + +func luaStreamWriteable(L *lua.LState) int { + checkLuaStream(L) + if L.GetTop() != 1 { + L.ArgError(1, "No arguments expected for writeable method") + return 0 + } + L.Push(lua.LBool(true)) + return 1 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go new file mode 100644 index 00000000..26db9346 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go @@ -0,0 +1,30 @@ +//go:build !app_engine +// +build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package lua_test + +import ( + "testing" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func TestLua(t *testing.T) { + gm.RegisterFailHandler(gg.Fail) + gg.RunSpecs(t, "Lua Libs Test") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go new file mode 100644 index 00000000..0440db57 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go @@ -0,0 +1,205 @@ +//go:build !app_engine +// +build !app_engine + +package luaLib + +// LibAerospike is the source code for the Aerospike library in the lua instance +const LibAerospike = ` + +-- The Lua Interface to Aerospike +-- +-- ====================================================================== +-- Copyright [2014] Aerospike, Inc.. Portions may be licensed +-- to Aerospike, Inc. under one or more contributor license agreements. +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- ====================================================================== + +-- A table to track whether we had sandboxed a function +sandboxed = {} + +ldebug = debug; + +-- ############################################################################ +-- +-- LOG FUNCTIONS +-- +-- ############################################################################ + +function trace(m, ...) + return aerospike:log(4, string.format(m, ...)) +end + +function debug(m, ...) + return aerospike:log(3, string.format(m, ...)) +end + +function info(m, ...) + return aerospike:log(2, string.format(m, ...)) +end + +function warn(m, ...) + return aerospike:log(1, string.format(m, ...)) +end + +-- ############################################################################ +-- +-- APPLY FUNCTIONS +-- +-- ############################################################################ + +-- +-- Creates a new environment for use in apply_record functions +-- +function env_record() + return { + + -- aerospike types + ["record"] = record, + ["iterator"] = iterator, + ["list"] = list, + ["map"] = map, + ["bytes"] = bytes, + ["aerospike"] = aerospike, + + ["putX"] = putX, + + -- logging functions + ["trace"] = trace, + ["debug"] = debug, + ["info"] = info, + ["warn"] = warn, + + -- standard lua functions + ["collectgarbage"] = collectgarbage, + ["error"] = error, + ["getmetatable"] = getmetatable, + ["ipairs"] = ipairs, + ["load"] = loadstring, + ["module"] = module, + ["next"] = next, + ["pairs"] = pairs, + ["print"] = print, + ["pcall"] = pcall, + ["rawequal"] = rawequal, + ["rawget"] = rawget, + ["rawset"] = rawset, + ["require"] = require, + ["require"] = require, + ["select"] = select, + ["setmetatable"] = setmetatable, + ["setfenv"] = setfenv, + ["tonumber"] = tonumber, + ["tostring"] = tostring, + ["type"] = type, + ["unpack"] = unpack, + ["xpcall"] = xpcall, + + -- standard lua objects + ["math"] = math, + ["io"] = io, + ["os"] = { + ['clock'] = os.clock, + ['date'] = os.date, + ['difftime'] = os.difftime, + ['getenv'] = os.getenv, + ['setlocale'] = os.setlocale, + ['time'] = os.time, + ['tmpname'] = os.tmpname + }, + ["package"] = package, + ["string"] = string, + ["table"] = table, + + -- standard lua variables + ["_G"] = {} + } +end + +-- +-- Apply function to a record and arguments. +-- +-- @param f the fully-qualified name of the function. +-- @param r the record to be applied to the function. +-- @param ... additional arguments to be applied to the function. +-- @return result of the called function or nil. +-- +function apply_record(f, r, ...) + + if f == nil then + error("function not found", 2) + end + + if not sandboxed[f] then + setfenv(f,env_record()) + sandboxed[f] = true + end + + success, result = pcall(f, r, ...) + if success then + return result + else + error(result, 2) + return nil + end +end + +-- +-- Apply function to an iterator and arguments. +-- +-- @param f the fully-qualified name of the function. +-- @param s the iterator to be applied to the function. +-- @param ... additional arguments to be applied to the function. +-- @return 0 on success, otherwise failure. +-- +function apply_stream(f, scope, istream, ostream, ...) + + if f == nil then + error("function not found", 2) + return 2 + end + + --require("stream_ops") + + if not sandboxed[f] then + setfenv(f,env_record()) + sandboxed[f] = true + end + + local stream_ops = StreamOps_create(); + success, result = pcall(f, stream_ops, ...) + + -- info("apply_stream: success=%s, result=%s", tostring(success), tostring(result)) + + if success then + local ops = StreamOps_select(result.ops, scope); + + -- Apply server operations to the stream + -- result => a stream_ops object + local values = StreamOps_apply(stream_iterator(istream), ops); + + -- Iterate the stream of values from the computation + -- then pipe it to the ostream + for value in values do + -- info("value = %s", tostring(value)) + stream.write(ostream, value) + end + + -- 0 is success + return 0 + else + error(result, 2) + return 2 + end +end +` diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go new file mode 100644 index 00000000..c7d447a3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go @@ -0,0 +1,362 @@ +//go:build !app_engine +// +build !app_engine + +package luaLib + +// LibStreamOps is the source code for the stream library in the lua instance +const LibStreamOps = ` +-- Lua Interface for Aerospike Record Stream Support +-- +-- ====================================================================== +-- Copyright [2014] Aerospike, Inc.. Portions may be licensed +-- to Aerospike, Inc. under one or more contributor license agreements. +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- ====================================================================== + +local function check_limit(v) + return type(v) == 'number' and v >= 1000 +end + +-- +-- clone a table. creates a shallow copy of the table. +-- +local function clone_table(t) + local out = {} + for k,v in pairs(t) do + out[k] = v + end + return out +end + +-- +-- Clone a value. +-- +local function clone(v) + + local t = type(v) + + if t == 'number' then + return v + elseif t == 'string' then + return v + elseif t == 'boolean' then + return v + elseif t == 'table' then + return clone_table(v) + elseif t == 'userdata' then + if v.__index == Map then + return map.clone(v) + elseif v.__index == List then + return list.clone(v) + end + return nil + end + + return v +end + +-- +-- Filter values +-- @param next - a generator that produces the next value from a stream +-- @param f - the function to transform each value +-- +function filter( next, p ) + -- done indicates if we exhausted the 'next' stream + local done = false + + -- return a closure which the caller can use to get the next value + return function() + + -- we bail if we already exhausted the stream + if done then return nil end + + -- find the first value which satisfies the predicate + for a in next do + if p(a) then + return a + end + end + + done = true + + return nil + end +end + +-- +-- Transform values +-- @param next - a generator that produces the next value from a stream +-- @param f - the tranfomation operation +-- +function transform( next, f ) + -- done indicates if we exhausted the 'next' stream + local done = false + + -- return a closure which the caller can use to get the next value + return function() + + -- we bail if we already exhausted the stream + if done then return nil end + + -- get the first value + local a = next() + + -- apply the transformation + if a ~= nil then + return f(a) + end + + done = true; + + return nil + end +end + +-- +-- Combines two values from an istream into a single value. +-- @param next - a generator that produces the next value from a stream +-- @param f - the reduction operation +-- +function reduce( next, f ) + -- done indicates if we exhausted the 'next' stream + local done = false + + -- return a closure which the caller can use to get the next value + return function() + + + -- we bail if we already exhausted the stream + if done then return nil end + + -- get the first value + local a = next() + + if a ~= nil then + -- get each subsequent value and reduce them + for b in next do + a = f(a,b) + end + end + + -- we are done! + done = true + + return a + end +end + +-- +-- Aggregate values into a single value. +-- @param next - a generator that produces the next value from a stream +-- @param f - the aggregation operation +-- +function aggregate( next, init, f ) + -- done indicates if we exhausted the 'next' stream + local done = false + + -- return a closure which the caller can use to get the next value + return function() + + -- we bail if we already exhausted the stream + if done then return nil end + + -- get the initial value + local a = clone(init) + + -- get each subsequent value and aggregate them + for b in next do + a = f(a,b) + + -- check the size limit, if it is exceeded, + -- then return the value + if check_limit(a) then + return a + end + end + + -- we are done! + done = true + + return a + end +end + +-- +-- as_stream iterator +-- +function stream_iterator(s) + local done = false + return function() + if done then return nil end + local v = stream.read(s) + if v == nil then + done = true + end + return v; + end +end + + + +-- ###################################################################################### +-- +-- StreamOps +-- Builds a sequence of operations to be applied to a stream of values. +-- +-- ###################################################################################### + +StreamOps = {} +StreamOps_mt = { __index = StreamOps } + +-- Op only executes on server +local SCOPE_SERVER = 1 + +-- Op only executes on client +local SCOPE_CLIENT = 2 + +-- Op can execute on either client or server +local SCOPE_EITHER = 3 + +-- Op executes on both client and server +local SCOPE_BOTH = 4 + +-- +-- Creates a new StreamOps using an array of ops +-- +-- @param ops an array of operations +-- +function StreamOps_create() + local self = {} + setmetatable(self, StreamOps_mt) + self.ops = {} + return self +end + +function StreamOps_apply(stream, ops, i, n) + + -- if nil, then use default values + i = i or 1 + n = n or #ops + + -- if index in list > size of list, then return the stream + if i > n then return stream end + + -- get the current operation + local op = ops[i] + + -- apply the operation and get a stream or use provided stream + local s = op.func(stream, unpack(op.args)) or stream + + -- move to the next operation + return StreamOps_apply(s, ops, i + 1, n) +end + + +-- +-- This selects the operations appropriate for a given scope. +-- For the SERVER scope, it will select the first n ops until one of the ops +-- is a CLIENT scope op. +-- For the CLIENT scope, it will skip the first n ops that are SERVER scope +-- ops, then it will take the remaining ops, including SERVER scoped ops. +-- +function StreamOps_select(stream_ops, scope) + local server_ops = {} + local client_ops = {} + + local phase = SCOPE_SERVER + for i,op in ipairs(stream_ops) do + if phase == SCOPE_SERVER then + if op.scope == SCOPE_SERVER then + table.insert(server_ops, op) + elseif op.scope == SCOPE_EITHER then + table.insert(server_ops, op) + elseif op.scope == SCOPE_BOTH then + table.insert(server_ops, op) + table.insert(client_ops, op) + phase = SCOPE_CLIENT + end + elseif phase == SCOPE_CLIENT then + table.insert(client_ops, op) + end + end + + if scope == SCOPE_CLIENT then + return client_ops + else + return server_ops + end +end + + + +-- +-- OPS: [ OP, ... ] +-- OP: {scope=SCOPE, name=NAME, func=FUNC, args=ARGS} +-- SCOPE: ANY(0) | SERVER(1) | CLIENT(2) | +-- NAME: FUNCTION NAME +-- FUNC: FUNCTION POINTER +-- ARGS: ARRAY OF ARGUMENTS +-- + + +function StreamOps:aggregate(...) + table.insert(self.ops, { scope = SCOPE_SERVER, name = "aggregate", func = aggregate, args = {...}}) + return self +end + +function StreamOps:reduce(...) + table.insert(self.ops, { scope = SCOPE_BOTH, name = "reduce", func = reduce, args = {...}}) + return self +end + +function StreamOps:map(...) + table.insert(self.ops, { scope = SCOPE_EITHER, name = "map", func = transform, args = {...}}) + return self +end + +function StreamOps:filter(...) + table.insert(self.ops, { scope = SCOPE_EITHER, name = "filter", func = filter, args = {...}}) + return self +end + +-- stream : group(f) +-- +-- Group By will return a Map of keys to a list of values. The key is determined by applying the +-- function 'f' to each element in the stream. +-- +function StreamOps:groupby(f) + + local function _aggregate(m, v) + local k = f and f(v) or nil; + local l = m[k] or list() + list.append(l, v) + m[k] = l; + return m; + end + + local function _merge(l1, l2) + local l = list.clone(l1) + for v in list.iterator(l2) do + list.append(l, v) + end + return l + end + + function _reduce(m1, m2) + return map.merge(m1, m2, _merge) + end + + return self : aggregate(map(), _aggregate) : reduce(_reduce) +end +` diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go b/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go new file mode 100644 index 00000000..a04100e4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go @@ -0,0 +1,82 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package seq + +import ( + "errors" + "sync" +) + +var Break = errors.New("Break") + +func Do[T any](seq []T, f func(T) error) { + for i := range seq { + if err := f(seq[i]); err == Break { + break + } + } +} + +func ParDo[T any](seq []T, f func(T)) { + if len(seq) == 0 { + return + } + + wg := new(sync.WaitGroup) + wg.Add(len(seq)) + for i := range seq { + go func(t T) { + defer wg.Done() + f(t) + }(seq[i]) + } + wg.Wait() +} + +func Any[T any](seq []T, f func(T) bool) bool { + for i := range seq { + if f(seq[i]) { + return true + } + } + return false +} + +func All[T any](seq []T, f func(T) bool) bool { + if len(seq) == 0 { + return false + } + + for i := range seq { + if !f(seq[i]) { + return false + } + } + return true +} + +func Clone[T any](seq []T) []T { + if seq == nil { + return nil + } + + if len(seq) == 0 { + return []T{} + } + + res := make([]T, len(seq)) + copy(res, seq) + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/key.go b/aerospike-tls/vendor-aerospike-client-go/key.go new file mode 100644 index 00000000..3b62bf0d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/key.go @@ -0,0 +1,166 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// Key is the unique record identifier. Records can be identified using a specified namespace, +// an optional set name, and a user defined key which must be unique within a set. +// Records can also be identified by namespace/digest which is the combination used +// on the server. +type Key struct { + // namespace. Equivalent to database name. + namespace string + + // Optional set name. Equivalent to database table. + setName string + + // Unique server hash value generated from set name and user key. + digest [20]byte + + // Original user key. This key is immediately converted to a hash digest. + // This key is not used or returned by the server by default. If the user key needs + // to persist on the server, use one of the following methods: + // + // Set "WritePolicy.sendKey" to true. In this case, the key will be sent to the server for storage on writes + // and retrieved on multi-record scans and queries. + // Explicitly store and retrieve the key in a bin. + userKey Value + + keyWriter keyWriter +} + +// Namespace returns key's namespace. +func (ky *Key) Namespace() string { + return ky.namespace +} + +// SetName returns key's set name. +func (ky *Key) SetName() string { + return ky.setName +} + +// Value returns key's value. +func (ky *Key) Value() Value { + return ky.userKey +} + +// SetValue sets the Key's value and recompute's its digest without allocating new memory. +// This allows the keys to be reusable. +func (ky *Key) SetValue(val Value) Error { + ky.userKey = val + return ky.computeDigest() +} + +// Digest returns key digest. +func (ky *Key) Digest() []byte { + return ky.digest[:] +} + +// Equals uses key digests to compare key equality. +func (ky *Key) Equals(other *Key) bool { + return bytes.Equal(ky.digest[:], other.digest[:]) +} + +// String implements Stringer interface and returns string representation of key. +func (ky *Key) String() string { + if ky == nil { + return "" + } + + if ky.userKey != nil { + return fmt.Sprintf("%s:%s:%s:%v", ky.namespace, ky.setName, ky.userKey.String(), fmt.Sprintf("% 02x", ky.digest[:])) + } + return fmt.Sprintf("%s:%s::%v", ky.namespace, ky.setName, fmt.Sprintf("% 02x", ky.digest[:])) +} + +// NewKey initializes a key from namespace, optional set name and user key. +// The set name and user defined key are converted to a digest before sending to the server. +// The server handles record identifiers by digest only. +func NewKey(namespace string, setName string, key interface{}) (*Key, Error) { + newKey := &Key{ + namespace: namespace, + setName: setName, + userKey: NewValue(key), + } + + if err := newKey.computeDigest(); err != nil { + return nil, err + } + + return newKey, nil +} + +// NewKeyWithDigest initializes a key from namespace, optional set name and user key. +// The server handles record identifiers by digest only. +func NewKeyWithDigest(namespace string, setName string, key interface{}, digest []byte) (*Key, Error) { + newKey := &Key{ + namespace: namespace, + setName: setName, + userKey: NewValue(key), + } + + if err := newKey.SetDigest(digest); err != nil { + return nil, err + } + return newKey, nil +} + +// SetDigest sets a custom hash +func (ky *Key) SetDigest(digest []byte) Error { + if len(digest) != 20 { + return newError(types.PARAMETER_ERROR, "Invalid digest: Digest is required to be exactly 20 bytes.") + } + copy(ky.digest[:], digest) + return nil +} + +// Generate unique server hash value from set name, key type and user defined key. +// The hash function is RIPEMD-160 (a 160 bit hash). +func (ky *Key) computeDigest() Error { + // With custom changes to the ripemd160 package, + // now the following line does not allocate on the heap anymore/. + ky.keyWriter.hash.Reset() + + if _, err := ky.keyWriter.Write([]byte(ky.setName)); err != nil { + return err + } + + if _, err := ky.keyWriter.Write([]byte{byte(ky.userKey.GetType())}); err != nil { + return err + } + + if err := ky.keyWriter.writeKey(ky.userKey); err != nil { + return err + } + + // With custom changes to the ripemd160 package, + // the following line does not allocate on he heap anymore. + ky.keyWriter.hash.Sum(ky.digest[:]) + return nil +} + +// PartitionId returns the partition that the key belongs to. +func (ky *Key) PartitionId() int { + // CAN'T USE MOD directly - mod will give negative numbers. + // First AND makes positive and negative correctly, then mod. + return int(Buffer.LittleBytesToInt32(ky.digest[:], 0)&0xFFFF) & (_PARTITIONS - 1) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go b/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go new file mode 100644 index 00000000..5c9b183b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go @@ -0,0 +1,167 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + "strings" + "testing" + + "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" +) + +var res = make([]byte, 20) + +func doTheHash(buf []byte, b *testing.B) { + hash := ripemd160.New() + for i := 0; i < b.N; i++ { + hash.Reset() + hash.Write(buf) + hash.Sum(res) + } +} + +func Benchmark_Key_Hash_S_______1(b *testing.B) { + buffer := []byte(strings.Repeat("s", 1)) + doTheHash(buffer, b) +} + +func Benchmark_Key_Hash_S______10(b *testing.B) { + buffer := []byte(strings.Repeat("s", 10)) + doTheHash(buffer, b) +} + +func Benchmark_Key_Hash_S_____100(b *testing.B) { + buffer := []byte(strings.Repeat("s", 100)) + doTheHash(buffer, b) +} + +func Benchmark_Key_Hash_S____1000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 1000)) + doTheHash(buffer, b) +} + +func Benchmark_Key_Hash_S__10_000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 10000)) + doTheHash(buffer, b) +} + +func Benchmark_Key_Hash_S_100_000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 100000)) + doTheHash(buffer, b) +} + +var _key *Key + +func makeKeys(val interface{}, b *testing.B) { + var err error + for i := 0; i < b.N; i++ { + _key, err = NewKey("ns", "set", val) + if err != nil { + panic(err) + } + } +} + +func Benchmark_NewKey_String______1(b *testing.B) { + buffer := strings.Repeat("s", 1) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_String_____10(b *testing.B) { + buffer := strings.Repeat("s", 10) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_String____100(b *testing.B) { + buffer := strings.Repeat("s", 100) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_String___1000(b *testing.B) { + buffer := strings.Repeat("s", 1000) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_String__10000(b *testing.B) { + buffer := strings.Repeat("s", 10000) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_String_100000(b *testing.B) { + buffer := strings.Repeat("s", 100000) + makeKeys(buffer, b) +} +func Benchmark_NewKey_Byte______1(b *testing.B) { + buffer := []byte(strings.Repeat("s", 1)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_Byte_____10(b *testing.B) { + buffer := []byte(strings.Repeat("s", 10)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_Byte____100(b *testing.B) { + buffer := []byte(strings.Repeat("s", 100)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_Byte___1000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 1000)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_Byte__10000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 10000)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_Byte_100000(b *testing.B) { + buffer := []byte(strings.Repeat("s", 100000)) + makeKeys(buffer, b) +} + +func Benchmark_NewKey_________Int(b *testing.B) { + makeKeys(rand.Int63(), b) +} + +func Benchmark_NewKey_____Float64(b *testing.B) { + makeKeys(rand.Float64(), b) +} + +func Benchmark_NewKey_List_No_Reflect(b *testing.B) { + list := []interface{}{ + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + } + makeKeys(list, b) +} + +func Benchmark_NewKey_List_With_Reflect(b *testing.B) { + list := []string{ + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + strings.Repeat("s", 1e3), + } + makeKeys(list, b) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_helper.go b/aerospike-tls/vendor-aerospike-client-go/key_helper.go new file mode 100644 index 00000000..f237fc89 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/key_helper.go @@ -0,0 +1,155 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "encoding/binary" + "math" + + "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type keyWriter struct { + buffer [8]byte + hash ripemd160.Digest +} + +// WriteInt64 writes a int64 to the key +func (vb *keyWriter) WriteInt64(num int64) int { + return vb.WriteUint64(uint64(num)) +} + +// WriteUint64 writes a uint64 to the key +func (vb *keyWriter) WriteUint64(num uint64) int { + binary.BigEndian.PutUint64(vb.buffer[:8], num) + vb.hash.Write(vb.buffer[:8]) + return 8 +} + +// WriteInt32 writes a int32 to the key +func (vb *keyWriter) WriteInt32(num int32) int { + return vb.WriteUint32(uint32(num)) +} + +// WriteUint32 writes a uint32 to the key +func (vb *keyWriter) WriteUint32(num uint32) int { + binary.BigEndian.PutUint32(vb.buffer[:4], num) + vb.hash.Write(vb.buffer[:4]) + return 4 +} + +// WriteInt16 writes a int16 to the key +func (vb *keyWriter) WriteInt16(num int16) int { + return vb.WriteUint16(uint16(num)) +} + +// WriteUint16 writes a uint16 to the key +func (vb *keyWriter) WriteUint16(num uint16) int { + binary.BigEndian.PutUint16(vb.buffer[:2], num) + vb.hash.Write(vb.buffer[:2]) + return 2 +} + +// WriteFloat32 writes a float32 to the key +func (vb *keyWriter) WriteFloat32(float float32) int { + bits := math.Float32bits(float) + binary.BigEndian.PutUint32(vb.buffer[:4], bits) + vb.hash.Write(vb.buffer[:4]) + return 4 +} + +// WriteFloat64 writes a float64 to the key +func (vb *keyWriter) WriteFloat64(float float64) int { + bits := math.Float64bits(float) + binary.BigEndian.PutUint64(vb.buffer[:8], bits) + vb.hash.Write(vb.buffer[:8]) + return 8 +} + +// WriteBool writes a bool to the key +func (vb *keyWriter) WriteBool(b bool) int { + if b { + vb.hash.Write([]byte{1}) + } else { + vb.hash.Write([]byte{0}) + } + return 1 +} + +// WriteByte writes a byte to the key +func (vb *keyWriter) WriteByte(b byte) { + vb.hash.Write([]byte{b}) +} + +// WriteString writes a string to the key +func (vb *keyWriter) WriteString(s string) (int, Error) { + // To avoid allocating memory, write the strings in small chunks + l := len(s) + const size = 128 + b := [size]byte{} + cnt := 0 + sz := 0 + for i := 0; i < l; i++ { + b[cnt] = s[i] + cnt++ + + if cnt == size { + n, err := vb.Write(b[:]) + if err != nil { + return sz + n, err + } + sz += n + cnt = 0 + } + } + + if cnt > 0 { + n, err := vb.Write(b[:cnt]) + if err != nil { + return sz + n, err + } + } + + return len(s), nil +} + +func (vb *keyWriter) Write(b []byte) (int, Error) { + n, err := vb.hash.Write(b) + if err != nil { + return n, newCommonError(err) + } + return n, nil +} + +func (vb *keyWriter) writeKey(val Value) Error { + switch v := val.(type) { + case IntegerValue: + vb.WriteInt64(int64(v)) + return nil + case LongValue: + vb.WriteInt64(int64(v)) + return nil + case StringValue: + vb.WriteString(string(v)) + return nil + case BytesValue: + vb.Write(v) + return nil + } + + // TODO: Replace the error message with fmt.Sprintf("Key Generation Error. Value type not supported: %T", val) + return newError(types.PARAMETER_ERROR, "Key Generation Error. Value not supported: "+val.String()) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go new file mode 100644 index 00000000..87e0d40f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go @@ -0,0 +1,41 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + gg "github.com/onsi/ginkgo/v2" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Key Test Reflection", func() { + + // gg.Context("Digests should be the same", func() { + + // gg.It("for Arrays", func() { + + // // The following two cases should be in exact order + // key, _ := as.NewKey("namespace", "set", []int{1, 2, 3}) + // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("a8b63a8208ebebb49d027d51899121fd0d03d2f7")) + + // keyInterfaceArrayOfTheSameValues, _ := as.NewKey("namespace", "set", []interface{}{1, 2, 3}) + // gm.Expect(hex.EncodeToString(keyInterfaceArrayOfTheSameValues.Digest())).To(gm.Equal(hex.EncodeToString(key.Digest()))) + + // }) + + // }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/key_test.go b/aerospike-tls/vendor-aerospike-client-go/key_test.go new file mode 100644 index 00000000..541e80e5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/key_test.go @@ -0,0 +1,141 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "encoding/hex" + "math" + "strings" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Key Test", func() { + + gg.Context("Digests should be the same", func() { + + gg.It("for Integers", func() { + + key, _ := as.NewKey("namespace", "set", math.MinInt64) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("7185c2a47fb02c996daed26b4e01b83240aee9d4")) + + key, _ = as.NewKey("namespace", "set", math.MaxInt64) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("1698328974afa62c8e069860c1516f780d63dbb8")) + + key, _ = as.NewKey("namespace", "set", math.MinInt32) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("d635a867b755f8f54cdc6275e6fb437df82a728c")) + + key, _ = as.NewKey("namespace", "set", math.MaxInt32) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("fa8c47b8b898af1bbcb20af0d729ca68359a2645")) + + key, _ = as.NewKey("namespace", "set", math.MinInt16) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("7f41e9dd1f3fe3694be0430e04c8bfc7d51ec2af")) + + key, _ = as.NewKey("namespace", "set", math.MaxInt16) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("309fc9c2619c4f65ff7f4cd82085c3ee7a31fc7c")) + + key, _ = as.NewKey("namespace", "set", math.MinInt8) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("93191e549f8f3548d7e2cfc958ddc8c65bcbe4c6")) + + key, _ = as.NewKey("namespace", "set", math.MaxInt8) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("a58f7d98bf60e10fe369c82030b1c9dee053def9")) + + key, _ = as.NewKey("namespace", "set", -1) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("22116d253745e29fc63fdf760b6e26f7e197e01d")) + + key, _ = as.NewKey("namespace", "set", 0) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("93d943aae37b017ad7e011b0c1d2e2143c2fb37d")) + + }) + + gg.It("for Strings", func() { + + key, _ := as.NewKey("namespace", "set", "") + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2819b1ff6e346a43b4f5f6b77a88bc3eaac22a83")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("s", 1)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("607cddba7cd111745ef0a3d783d57f0e83c8f311")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("a", 10)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("5979fb32a80da070ff356f7695455592272e36c2")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("m", 100)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("f00ad7dbcb4bd8122d9681bca49b8c2ffd4beeed")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("t", 1000)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("07ac412d4c33b8628ab147b8db244ce44ae527f8")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("-", 10000)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("b42e64afbfccb05912a609179228d9249ea1c1a0")) + + key, _ = as.NewKey("namespace", "set", strings.Repeat("+", 100000)) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("0a3e888c20bb8958537ddd4ba835e4070bd51740")) + + }) + + gg.It("for []byte", func() { + + key, _ := as.NewKey("namespace", "set", []byte{}) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("327e2877b8815c7aeede0d5a8620d4ef8df4a4b4")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("s", 1))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("ca2d96dc9a184d15a7fa2927565e844e9254e001")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("a", 10))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("d10982327b2b04c7360579f252e164a75f83cd99")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("m", 100))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("475786aa4ee664532a7d1ea69cb02e4695fcdeed")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("t", 1000))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("5a32b507518a49bf47fdaa3deca53803f5b2e8c3")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("-", 10000))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("ed65c63f7a1f8c6697eb3894b6409a95461fd982")) + + key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("+", 100000))) + gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("fe19770c371774ba1a1532438d4851b8a773a9e6")) + + }) + + // gg.It("for Arrays", func() { + + // key, _ := as.NewKey("namespace", "set", []interface{}{}) + // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2af0111192df4ca297232d1641ff52c2ce51ce2d")) + + // key, _ = as.NewKey("namespace", "set", []interface{}{1, []byte{1, 17}, "str"}) + // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("8f5129e079cf66333a8372192d93072a4c661be2")) + + // }) + + gg.It("for custom digest", func() { + // key, _ := as.NewKey("namespace", "set", []interface{}{}) + // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2af0111192df4ca297232d1641ff52c2ce51ce2d")) + key, _ := as.NewKey("namespace", "set", 1) + err := key.SetDigest([]byte("01234567890123456789")) + gm.Expect(err, nil) + gm.Expect(key.Digest()).To(gm.Equal([]byte("01234567890123456789"))) + + key, _ = as.NewKeyWithDigest("namespace", "set", []interface{}{}, []byte("01234567890123456789")) + gm.Expect(key.Digest()).To(gm.Equal([]byte("01234567890123456789"))) + }) + + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/language.go b/aerospike-tls/vendor-aerospike-client-go/language.go new file mode 100644 index 00000000..b1bbfaa7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/language.go @@ -0,0 +1,24 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// Language specifies User defined function languages. +type Language string + +const ( + + // LUA embedded programming language. + LUA Language = "LUA" +) diff --git a/aerospike-tls/vendor-aerospike-client-go/load_test.go b/aerospike-tls/vendor-aerospike-client-go/load_test.go new file mode 100644 index 00000000..a79b126e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/load_test.go @@ -0,0 +1,91 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math/rand" + "runtime" + "sync" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func init() { + // load test require actual parallelism + runtime.GOMAXPROCS(runtime.NumCPU()) +} + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike load tests", func() { + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + gg.Describe("Single long random string test", func() { + var ns = *namespace + var set = "load" + var wpolicy = as.NewWritePolicy(0, 0) + var rpolicy = as.NewPolicy() + rpolicy.TotalTimeout = 200 * time.Millisecond + if *useReplicas { + rpolicy.ReplicaPolicy = as.MASTER_PROLES + } + + bname1 := randString(14) + bname2 := randString(14) + + gg.Context("Concurrent Load", func() { + + gg.It("must save and then retrieve an INT and STRING bin with random key", func() { + const Concurrency = 10 + const IterationPerWorker = 10 + + var wg sync.WaitGroup + wg.Add(Concurrency) + + for j := 0; j < Concurrency; j++ { + go func() { + defer gg.GinkgoRecover() + defer wg.Done() + for i := 0; i < IterationPerWorker; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin1 := as.NewBin(bname1, randString(10)) + bin2 := as.NewBin(bname2, rand.Int()) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + rec, err := client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + } + }() + } + + // wait until everything is written + wg.Wait() + }) // it + + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/logger/logger.go b/aerospike-tls/vendor-aerospike-client-go/logger/logger.go new file mode 100644 index 00000000..028fe5e6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/logger/logger.go @@ -0,0 +1,131 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package logger + +import ( + "fmt" + "log" + "os" +) + +// LogPriority specifies the logging level for the client +type LogPriority int + +const ( + // DEBUG log level + DEBUG LogPriority = iota - 1 + // INFO log level + INFO + // WARNING log level + WARNING + // ERR log level + ERR + // OFF log level + OFF LogPriority = 999 +) + +type genericLogger interface { + Printf(format string, v ...interface{}) +} + +type logger struct { + Logger genericLogger + + level LogPriority +} + +// Logger is the default logger instance +var Logger = newLogger() + +func newLogger() *logger { + // TODO: Replace with slog + return &logger{ + Logger: log.New(os.Stdout, "", log.LstdFlags), + level: OFF, + } +} + +// SetLogger sets the *log.Logger object where log messages should be sent to. +// This method is not goroutine-safe, and is not designed to be accessed +// from multiple goroutines. +func (lgr *logger) SetLogger(l genericLogger) { + lgr.Logger = l +} + +// SetLevel sets logging level. Default is ERR. +// This method is not goroutine-safe, and is not designed to be accessed +// from multiple goroutines. +func (lgr *logger) SetLevel(level LogPriority) { + lgr.level = level +} + +// LogAtLevel will logs a message at the level requested. +func (lgr *logger) LogAtLevel(level LogPriority, format string, v ...interface{}) { + switch level { + case DEBUG: + lgr.Debug(format, v...) + case INFO: + lgr.Info(format, v...) + case WARNING: + lgr.Warn(format, v...) + case ERR: + lgr.Error(format, v...) + case OFF: + } +} + +// Debug logs a message if log level allows to do so. +func (lgr *logger) Debug(format string, v ...interface{}) { + if lgr.level <= DEBUG { + if l, ok := lgr.Logger.(*log.Logger); ok { + l.Output(2, fmt.Sprintf(format, v...)) + } else { + lgr.Logger.Printf(format, v...) + } + } +} + +// Info logs a message if log level allows to do so. +func (lgr *logger) Info(format string, v ...interface{}) { + if lgr.level <= INFO { + if l, ok := lgr.Logger.(*log.Logger); ok { + l.Output(2, fmt.Sprintf(format, v...)) + } else { + lgr.Logger.Printf(format, v...) + } + } +} + +// Warn logs a message if log level allows to do so. +func (lgr *logger) Warn(format string, v ...interface{}) { + if lgr.level <= WARNING { + if l, ok := lgr.Logger.(*log.Logger); ok { + l.Output(2, fmt.Sprintf(format, v...)) + } else { + lgr.Logger.Printf(format, v...) + } + } +} + +// Error logs a message if log level allows to do so. +func (lgr *logger) Error(format string, v ...interface{}) { + if lgr.level <= ERR { + if l, ok := lgr.Logger.(*log.Logger); ok { + l.Output(2, fmt.Sprintf(format, v...)) + } else { + lgr.Logger.Printf(format, v...) + } + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/login_command.go b/aerospike-tls/vendor-aerospike-client-go/login_command.go new file mode 100644 index 00000000..159cb9d2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/login_command.go @@ -0,0 +1,207 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use acmd file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type sessionInfo struct { + token []byte + expiration time.Time +} + +func (si *sessionInfo) isValid() bool { + if si == nil || si.token == nil || si.expiration.IsZero() || time.Now().After(si.expiration) { + return false + } + + return true +} + +// Login command authenticates to the server. +// If the authentication is external, Session Information will be returned. +type loginCommand struct { + AdminCommand + + // SessionToken for the current session on the external authentication server. + SessionToken []byte + + // SessionExpiration for the current session on the external authentication server. + SessionExpiration time.Time +} + +func newLoginCommand(buf []byte) *loginCommand { + return &loginCommand{ + AdminCommand: *NewAdminCommand(buf), + } +} + +func (lcmd *loginCommand) sessionInfo() *sessionInfo { + if lcmd.SessionToken != nil { + return &sessionInfo{token: lcmd.SessionToken, expiration: lcmd.SessionExpiration} + } + return &sessionInfo{} +} + +// Login tries to authenticate to the aerospike server. Depending on the server configuration and ClientPolicy, +// the session information will be returned. +func (lcmd *loginCommand) Login(policy *ClientPolicy, conn *Connection) Error { + hashedPass, err := hashPassword(policy.Password) + if err != nil { + return err + } + + return lcmd.login(policy, conn, hashedPass) +} + +// Login tries to authenticate to the aerospike server. Depending on the server configuration and ClientPolicy, +// the session information will be returned. +func (lcmd *loginCommand) login(policy *ClientPolicy, conn *Connection, hashedPass []byte) Error { + switch policy.AuthMode { + case AuthModeExternal: + lcmd.writeHeader(_LOGIN, 3) + lcmd.writeFieldStr(_USER, policy.User) + lcmd.writeFieldBytes(_CREDENTIAL, hashedPass) + lcmd.writeFieldStr(_CLEAR_PASSWORD, policy.Password) + case AuthModeInternal: + lcmd.writeHeader(_LOGIN, 2) + lcmd.writeFieldStr(_USER, policy.User) + lcmd.writeFieldBytes(_CREDENTIAL, hashedPass) + case AuthModePKI: + lcmd.writeHeader(_LOGIN, 0) + default: + return newError(types.ResultCode(types.INVALID_COMMAND), "Invalid ClientPolicy.AuthMode.") + } + + lcmd.writeSize() + + var deadline time.Time + if policy.LoginTimeout > 0 { + deadline = time.Now().Add(policy.Timeout) + } + conn.SetTimeout(deadline, policy.LoginTimeout) + + if _, err := conn.Write(lcmd.dataBuffer[:lcmd.dataOffset]); err != nil { + return err + } + + if _, err := conn.Read(lcmd.dataBuffer, _HEADER_SIZE); err != nil { + return err + } + + result := lcmd.dataBuffer[_RESULT_CODE] & 0xFF + if result != 0 { + if int(result) == int(types.SECURITY_NOT_ENABLED) { + // Server does not require login. + return nil + } + + return newError(types.ResultCode(result)) + } + + // Read session token. + sz := Buffer.BytesToInt64(lcmd.dataBuffer, 0) + receiveSize := int((sz & 0xFFFFFFFFFFFF) - int64(_HEADER_REMAINING)) + fieldCount := int(lcmd.dataBuffer[11] & 0xFF) + + if receiveSize <= 0 || receiveSize > len(lcmd.dataBuffer) || fieldCount <= 0 { + return newError(types.ResultCode(result), "Node failed to retrieve session token") + } + + if len(lcmd.dataBuffer) < receiveSize { + lcmd.dataBuffer = make([]byte, receiveSize) + } + + _, err := conn.Read(lcmd.dataBuffer, receiveSize) + if err != nil { + logger.Logger.Debug("Error reading data from connection for login command: %s", err.Error()) + return err + } + + lcmd.dataOffset = 0 + for i := 0; i < fieldCount; i++ { + mlen := int(Buffer.BytesToUint32(lcmd.dataBuffer, lcmd.dataOffset)) + lcmd.dataOffset += 4 + id := lcmd.dataBuffer[lcmd.dataOffset] + lcmd.dataOffset++ + mlen-- + + switch id { + case _SESSION_TOKEN: + // copy the contents of the buffer into a new byte slice + lcmd.SessionToken = make([]byte, mlen) + copy(lcmd.SessionToken, lcmd.dataBuffer[lcmd.dataOffset:lcmd.dataOffset+mlen]) + case _SESSION_TTL: + // Subtract 60 seconds from TTL so client session expires before server session. + seconds := int(Buffer.BytesToUint32(lcmd.dataBuffer, lcmd.dataOffset) - 60) + + if seconds > 0 { + lcmd.SessionExpiration = time.Now().Add(time.Duration(seconds) * time.Second) + } else { + logger.Logger.Warn("Invalid session TTL: %d", seconds) + } + } + + lcmd.dataOffset += mlen + } + + if lcmd.SessionToken == nil { + return newError(types.ResultCode(result), "Node failed to retrieve session token") + } + return nil +} + +func (lcmd *loginCommand) authenticateViaToken(policy *ClientPolicy, conn *Connection, sessionToken []byte) Error { + lcmd.setAuthenticate(policy, sessionToken) + + if _, err := conn.Write(lcmd.dataBuffer[:lcmd.dataOffset]); err != nil { + return err + } + + if _, err := conn.Read(lcmd.dataBuffer, _HEADER_SIZE); err != nil { + return err + } + + result := lcmd.dataBuffer[_RESULT_CODE] & 0xFF + if result != 0 && int(result) != int(types.SECURITY_NOT_ENABLED) { + return newError(types.ResultCode(result), "Authentication failed") + } + + return nil +} + +func (lcmd *loginCommand) setAuthenticate(policy *ClientPolicy, sessionToken []byte) Error { + if policy.AuthMode != AuthModePKI { + lcmd.writeHeader(_AUTHENTICATE, 2) + lcmd.writeFieldStr(_USER, policy.User) + } else { + lcmd.writeHeader(_AUTHENTICATE, 1) + } + + if sessionToken != nil { + // New authentication. + lcmd.writeFieldBytes(_SESSION_TOKEN, sessionToken) + } + + lcmd.writeSize() + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/marshal.go b/aerospike-tls/vendor-aerospike-client-go/marshal.go new file mode 100644 index 00000000..e7f23d11 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/marshal.go @@ -0,0 +1,362 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "reflect" + "strings" + "sync" + "time" +) + +// UseNativeBoolTypeInReflection determines if Boolean values should be directly translated to native Boolean type in reflection API +// introduced in server version 5.6+. By default it keeps the old behavior, but can be set to true to opt in. +// +// Deprecated: Will be removed in the next major version. +var UseNativeBoolTypeInReflection = false + +var aerospikeTag = "as" + +const ( + aerospikeMetaTag = "asm" + aerospikeMetaTagGen = "gen" + aerospikeMetaTagTTL = "ttl" +) + +// This method is copied verbatim from https://golang.org/src/encoding/json/encode.go +// to ensure compatibility with the json package. +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + + return false +} + +// SetAerospikeTag sets the bin tag to the specified tag. +// This will be useful for when a user wants to use the same tag name for two different concerns. +// For example, one will be able to use the same tag name for both json and aerospike bin name. +func SetAerospikeTag(tag string) { + aerospikeTag = tag +} + +func valueToInterface(f reflect.Value) interface{} { + // get to the core value + for f.Kind() == reflect.Ptr { + if f.IsNil() { + return nil + } + f = reflect.Indirect(f) + } + + switch f.Kind() { + case reflect.Int, reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8: + return IntegerValue(f.Int()) + case reflect.Uint64, reflect.Uint, reflect.Uint8, reflect.Uint32, reflect.Uint16: + return int64(f.Uint()) + case reflect.Float64, reflect.Float32: + return FloatValue(f.Float()) + + case reflect.Struct: + if f.Type().PkgPath() == "time" && f.Type().Name() == "Time" { + return f.Interface().(time.Time).UTC().UnixNano() + } + return structToMap(f) + case reflect.Bool: + if UseNativeBoolTypeInReflection { + return BoolValue(f.Bool()) + } + + if f.Bool() { + return IntegerValue(1) + } + return IntegerValue(0) + case reflect.Map: + if f.IsNil() { + return nil + } + + newMap := make(map[interface{}]interface{}, f.Len()) + for _, mk := range f.MapKeys() { + newMap[valueToInterface(mk)] = valueToInterface(f.MapIndex(mk)) + } + + return newMap + case reflect.Slice, reflect.Array: + if f.Kind() == reflect.Slice && f.IsNil() { + return nil + } + if f.Kind() == reflect.Slice && reflect.TypeOf(f.Interface()).Elem().Kind() == reflect.Uint8 { + // handle blobs + return f.Bytes() + } + // convert to primitives recursively + newSlice := make([]interface{}, f.Len(), f.Cap()) + for i := 0; i < len(newSlice); i++ { + newSlice[i] = valueToInterface(f.Index(i)) + } + return newSlice + case reflect.Interface: + if f.IsNil() { + return nullValue + } + return f.Interface() + default: + return f.Interface() + } +} + +func fieldIsMetadata(f reflect.StructField) bool { + meta := f.Tag.Get(aerospikeMetaTag) + return strings.Trim(meta, " ") != "" +} + +func fieldIsOmitOnEmpty(f reflect.StructField) bool { + tag := f.Tag.Get(aerospikeTag) + return strings.Contains(tag, ",omitempty") +} + +func stripOptions(tag string) string { + i := strings.Index(tag, ",") + if i < 0 { + return tag + } + return string(tag[:i]) +} + +func fieldAlias(f reflect.StructField) string { + alias := strings.Trim(stripOptions(f.Tag.Get(aerospikeTag)), " ") + if alias != "" { + // if tag is -, the field should not be persisted + if alias == "-" { + return "" + } + return alias + } + return f.Name +} + +func setBinMap(s reflect.Value, typeOfT reflect.Type, binMap BinMap, index []int) { + numFields := typeOfT.NumField() + var fld reflect.StructField + for i := 0; i < numFields; i++ { + fld = typeOfT.Field(i) + + fldIndex := append(index, fld.Index...) + + if fld.Anonymous && fld.Type.Kind() == reflect.Struct { + setBinMap(s, fld.Type, binMap, fldIndex) + continue + } + + // skip unexported fields + if fld.PkgPath != "" && !fld.Anonymous { + continue + } + + if fieldIsMetadata(fld) { + continue + } + + // skip transient fields tagged `-` + alias := fieldAlias(fld) + if alias == "" { + continue + } + + value := s.FieldByIndex(fldIndex) + if fieldIsOmitOnEmpty(fld) && isEmptyValue(value) { + continue + } + + binValue := valueToInterface(value) + + if _, ok := binMap[alias]; ok { + panic(fmt.Sprintf("ambiguous fields with the same name or alias: %s", alias)) + } + binMap[alias] = binValue + } +} + +func structToMap(s reflect.Value) BinMap { + if !s.IsValid() { + return nil + } + + binMap := make(BinMap, s.NumField()) + + setBinMap(s, s.Type(), binMap, nil) + + return binMap +} + +func marshal(v interface{}) BinMap { + s := indirect(reflect.ValueOf(v)) + return structToMap(s) +} + +type syncMap struct { + objectMappings map[reflect.Type]map[string][]int + objectFields map[reflect.Type][]string + objectTTLs map[reflect.Type][][]int + objectGen map[reflect.Type][][]int + mutex sync.RWMutex +} + +func (sm *syncMap) setMapping(objType reflect.Type, mapping map[string][]int, fields []string, ttl, gen [][]int) { + sm.mutex.Lock() + sm.objectMappings[objType] = mapping + sm.objectFields[objType] = fields + sm.objectTTLs[objType] = ttl + sm.objectGen[objType] = gen + sm.mutex.Unlock() +} + +func indirect(obj reflect.Value) reflect.Value { + for obj.Kind() == reflect.Ptr { + if obj.IsNil() { + return obj + } + obj = obj.Elem() + } + return obj +} + +func indirectT(objType reflect.Type) reflect.Type { + for objType.Kind() == reflect.Ptr { + objType = objType.Elem() + } + return objType +} + +func (sm *syncMap) mappingExists(objType reflect.Type) (map[string][]int, bool) { + sm.mutex.RLock() + mapping, exists := sm.objectMappings[objType] + sm.mutex.RUnlock() + return mapping, exists +} + +func (sm *syncMap) getMapping(objType reflect.Type) map[string][]int { + objType = indirectT(objType) + mapping, exists := sm.mappingExists(objType) + if !exists { + cacheObjectTags(objType) + mapping, _ = sm.mappingExists(objType) + } + + return mapping +} + +func (sm *syncMap) getMetaMappings(objType reflect.Type) (ttl, gen [][]int) { + objType = indirectT(objType) + if _, exists := sm.mappingExists(objType); !exists { + cacheObjectTags(objType) + } + + sm.mutex.RLock() + ttl = sm.objectTTLs[objType] + gen = sm.objectGen[objType] + sm.mutex.RUnlock() + return ttl, gen +} + +func (sm *syncMap) fieldsExists(objType reflect.Type) ([]string, bool) { + sm.mutex.RLock() + mapping, exists := sm.objectFields[objType] + sm.mutex.RUnlock() + return mapping, exists +} + +func (sm *syncMap) getFields(objType reflect.Type) []string { + objType = indirectT(objType) + fields, exists := sm.fieldsExists(objType) + if !exists { + cacheObjectTags(objType) + fields, _ = sm.fieldsExists(objType) + } + + return fields +} + +var objectMappings = &syncMap{ + objectMappings: map[reflect.Type]map[string][]int{}, + objectFields: map[reflect.Type][]string{}, + objectTTLs: map[reflect.Type][][]int{}, + objectGen: map[reflect.Type][][]int{}, +} + +func fillMapping(objType reflect.Type, mapping map[string][]int, fields []string, ttl, gen [][]int, index []int) ([]string, [][]int, [][]int) { + numFields := objType.NumField() + for i := 0; i < numFields; i++ { + f := objType.Field(i) + fIndex := append(index, f.Index...) + if f.Anonymous && f.Type.Kind() == reflect.Struct { + fields, ttl, gen = fillMapping(f.Type, mapping, fields, ttl, gen, fIndex) + continue + } + + // skip unexported fields + if f.PkgPath != "" && !f.Anonymous { + continue + } + + tag := strings.Trim(stripOptions(f.Tag.Get(aerospikeTag)), " ") + tagM := strings.Trim(f.Tag.Get(aerospikeMetaTag), " ") + + if tag != "" && tagM != "" { + panic(fmt.Sprintf("Cannot accept both data and metadata tags on the same attribute on struct: %s.%s", objType.Name(), f.Name)) + } + + if tag != "-" && tagM == "" { + if tag == "" { + tag = f.Name + } + if _, ok := mapping[tag]; ok { + panic(fmt.Sprintf("ambiguous fields with the same name or alias: %s", tag)) + } + mapping[tag] = fIndex + fields = append(fields, tag) + } + + if tagM == aerospikeMetaTagTTL { + ttl = append(ttl, fIndex) + } else if tagM == aerospikeMetaTagGen { + gen = append(gen, fIndex) + } else if tagM != "" { + panic(fmt.Sprintf("Invalid metadata tag `%s` on struct attribute: %s.%s", tagM, objType.Name(), f.Name)) + } + } + return fields, ttl, gen +} + +func cacheObjectTags(objType reflect.Type) { + mapping := map[string][]int{} + fields, ttl, gen := fillMapping(objType, mapping, []string{}, nil, nil, nil) + objectMappings.setMapping(objType, mapping, fields, ttl, gen) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go b/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go new file mode 100644 index 00000000..f53165f2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go @@ -0,0 +1,61 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types/histogram" +) + +// MetricsPolicy specifies client periodic metrics configuration. +type MetricsPolicy struct { + // Histogram type specifies if the histogram should be [histogram.Linear] or [histogram.Logarithmic]. + // + // Default: [histogram.Logarithmic] + HistogramType histogram.Type + + // LatencyColumns defines the number of elapsed time range buckets in latency histograms. + // + // Default: 24 + LatencyColumns int //= 24; + + // Depending on the type of histogram: + // + // For logarithmic histograms, the buckets are: =base^(columns-1) + // + // // LatencyColumns=5 latencyBase=8 + // <8µs <64µs <512µs <4096µs >=4096 + // + // // LatencyColumns=7 LatencyBase=4 + // <4µs <16µs <64µs <256µs <1024µs <4096 >=4096µs + // + // For linear histograms, the buckets are: =base*(column-1) + // + // // LatencyColumns=5 latencyBase=15 + // <15µs <30µs <45µs <60µs >=60µs + // + // // LatencyColumns=7 LatencyBase=5 + // <5µs <10µs <15µs <20µs <25µs <30µs >=30µs + // + // Default: 2 + LatencyBase int //= 2; +} + +func DefaultMetricsPolicy() *MetricsPolicy { + return &MetricsPolicy{ + HistogramType: histogram.Logarithmic, + LatencyColumns: 24, + LatencyBase: 2, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/multi_command.go b/aerospike-tls/vendor-aerospike-client-go/multi_command.go new file mode 100644 index 00000000..ae23b137 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/multi_command.go @@ -0,0 +1,430 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "math/rand" + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type baseMultiCommand struct { + baseCommand + + rawCDT bool + + namespace string + recordset *Recordset + + isOperation bool + + // Used in correct Scans/Queries + tracker *partitionTracker + nodePartitions *nodePartitions + + terminationErrorType types.ResultCode + + resObjType reflect.Type + resObjMappings map[string][]int + selectCases []reflect.SelectCase + + bc bufferedConn + grpcEOS bool +} + +var multiObjectParser func( + cmd *baseMultiCommand, + obj reflect.Value, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error + +var prepareReflectionData func(cmd *baseMultiCommand) + +func newMultiCommand(node *Node, recordset *Recordset, isOperation bool) *baseMultiCommand { + cmd := &baseMultiCommand{ + baseCommand: baseCommand{ + node: node, + }, + recordset: recordset, + isOperation: isOperation, + } + + if prepareReflectionData != nil { + prepareReflectionData(cmd) + } + return cmd +} + +func newStreamingMultiCommand(node *Node, recordset *Recordset, namespace string, isOperation bool) *baseMultiCommand { + cmd := &baseMultiCommand{ + baseCommand: baseCommand{ + node: node, + oneShot: true, + }, + namespace: namespace, + recordset: recordset, + isOperation: isOperation, + } + + if prepareReflectionData != nil { + prepareReflectionData(cmd) + } + return cmd +} + +func newCorrectStreamingMultiCommand(recordset *Recordset, namespace string) *baseMultiCommand { + cmd := &baseMultiCommand{ + baseCommand: baseCommand{ + oneShot: true, + }, + namespace: namespace, + recordset: recordset, + } + + if prepareReflectionData != nil { + prepareReflectionData(cmd) + } + return cmd +} + +func (cmd *baseMultiCommand) getNode(ifc command) (*Node, Error) { + return cmd.node, nil +} + +func (cmd *baseMultiCommand) prepareRetry(ifc command, isTimeout bool) bool { + return false +} + +func (cmd *baseMultiCommand) getConnection(policy Policy) (*Connection, Error) { + return cmd.node.getConnectionWithHint(policy.GetBasePolicy().deadline(), policy.GetBasePolicy().socketTimeout(), byte(rand.Int63()&0xff)) +} + +func (cmd *baseMultiCommand) putConnection(conn *Connection) { + cmd.node.putConnectionWithHint(conn, byte(rand.Int63()&0xff)) +} + +func (cmd *baseMultiCommand) parseResult(ifc command, conn *Connection) Error { + // Read socket into receive buffer one record at a time. Do not read entire receive size + // because the receive buffer would be too big. + status := true + + var err Error + + cmd.bc = newBufferedConn(conn, 0) + for status { + if err = cmd.conn.initInflater(false, 0); err != nil { + return newError(types.PARSE_ERROR, "Error setting up zlib inflater:", err.Error()).setNode(cmd.node) + } + cmd.bc.reset(8) + + // Read header. + if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { + return err + } + + proto := Buffer.BytesToInt64(cmd.dataBuffer, 0) + receiveSize := int(proto & 0xFFFFFFFFFFFF) + if receiveSize <= 0 { + continue + } + + if compressedSize := cmd.compressedSize(); compressedSize > 0 { + cmd.bc.reset(8) + // Read header. + if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { + return err + } + + receiveSize = int(Buffer.BytesToInt64(cmd.dataBuffer, 0)) - 8 + if err = cmd.conn.initInflater(true, compressedSize-8); err != nil { + return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize-8, err.Error())).setNode(cmd.node) + } + + // read the first 8 bytes + cmd.bc.reset(8) + if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { + return err + } + } + + // Validate header to make sure we are at the beginning of a message + proto = Buffer.BytesToInt64(cmd.dataBuffer, 0) + if err = cmd.validateHeader(proto); err != nil { + return err + } + + if receiveSize > 0 { + cmd.bc.reset(receiveSize) + + status, err = ifc.parseRecordResults(ifc, receiveSize) + if err != nil { + cmd.bc.drainConn() + return err + } + } else { + status = false + } + } + + // if the buffer has been resized, put it back so that it will be reassigned to the connection. + cmd.dataBuffer = cmd.bc.buf() + + return nil +} + +func (cmd *baseMultiCommand) parseKey(fieldCount int, bval *int64) (*Key, Error) { + var digest [20]byte + var namespace, setName string + var userKey Value + var err Error + + for i := 0; i < fieldCount; i++ { + if err = cmd.readBytes(4); err != nil { + return nil, err + } + + fieldlen := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + if err = cmd.readBytes(fieldlen); err != nil { + return nil, err + } + + fieldtype := FieldType(cmd.dataBuffer[0]) + size := fieldlen - 1 + + switch fieldtype { + case DIGEST_RIPE: + copy(digest[:], cmd.dataBuffer[1:size+1]) + case NAMESPACE: + namespace = string(cmd.dataBuffer[1 : size+1]) + case TABLE: + setName = string(cmd.dataBuffer[1 : size+1]) + case KEY: + if userKey, err = bytesToKeyValue(int(cmd.dataBuffer[1]), cmd.dataBuffer, 2, size-1); err != nil { + return nil, err.setNode(cmd.node) + } + case BVAL_ARRAY: + if bval != nil { + v := Buffer.LittleBytesToInt64(cmd.dataBuffer, 1) + *bval = v + } + } + } + + return &Key{namespace: namespace, setName: setName, digest: digest, userKey: userKey}, nil +} + +func (cmd *baseMultiCommand) skipKey(fieldCount int) (err Error) { + for i := 0; i < fieldCount; i++ { + if err = cmd.readBytes(4); err != nil { + return err + } + + fieldlen := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + if err = cmd.readBytes(fieldlen); err != nil { + return err + } + } + + return nil +} + +func (cmd *baseMultiCommand) readBytes(length int) (err Error) { + // Corrupted data streams can result in a huge length. + // Do a sanity check here. + if length > MaxBufferSize || length < 0 { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid readBytes length: %d", length)).setNode(cmd.node) + } + + cmd.dataBuffer, err = cmd.bc.read(length) + if err != nil { + return err + } + cmd.dataOffset += length + + return nil +} + +func (cmd *baseMultiCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + // Read/parse remaining message bytes one record at a time. + cmd.dataOffset = 0 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + err = newNodeError(cmd.node, err) + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + if resultCode != 0 && resultCode != types.PARTITION_UNAVAILABLE { + if resultCode == types.KEY_NOT_FOUND_ERROR || resultCode == types.FILTERED_OUT { + return false, nil + } + err := newError(resultCode) + err = newNodeError(cmd.node, err) + return false, err + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + + var bval int64 + key, err := cmd.parseKey(fieldCount, &bval) + if err != nil { + err = newNodeError(cmd.node, err) + return false, err + } + + // Partition is done, don't go further + if (info3 & _INFO3_PARTITION_DONE) != 0 { + // When an error code is received, mark partition as unavailable + // for the current round. Unavailable partitions will be retried + // in the next round. Generation is overloaded as partitionId. + if resultCode != 0 && cmd.tracker != nil { + cmd.tracker.partitionUnavailable(cmd.nodePartitions, int(generation)) + } + continue + } + + // if there is a recordset, process the record traditionally + // otherwise, it is supposed to be a record channel + if cmd.selectCases == nil { + // Parse bins. + var bins BinMap + + for i := 0; i < opCount; i++ { + if err = cmd.readBytes(8); err != nil { + return false, newNodeError(cmd.node, err) + } + + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err = cmd.readBytes(nameSize); err != nil { + return false, newNodeError(cmd.node, err) + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err = cmd.readBytes(particleBytesSize); err != nil { + return false, newNodeError(cmd.node, err) + } + value, err := bytesToParticleRaw(particleType, cmd.dataBuffer, 0, particleBytesSize, cmd.rawCDT) + if err != nil { + return false, newNodeError(cmd.node, err) + } + + if bins == nil { + bins = make(BinMap, opCount) + } + + if cmd.isOperation { + if prev, ok := bins[name]; ok { + if prev2, ok := prev.(OpResults); ok { + bins[name] = append(prev2, value) + } else { + bins[name] = OpResults{prev, value} + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + if cmd.grpcEOS || !cmd.tracker.allowRecord(cmd.nodePartitions) { + continue + } + + // If the channel is full and it blocks, we don't want this command to + // block forever, or panic in case the channel is closed in the meantime. + select { + // send back the result on the async channel + case cmd.recordset.records <- &Result{Record: newRecord(cmd.node, key, bins, generation, expiration), Err: nil, BVal: &bval}: + case <-cmd.recordset.cancelled: + switch cmd.terminationErrorType { + case types.SCAN_TERMINATED: + return false, ErrScanTerminated.err().setNode(cmd.node) + case types.QUERY_TERMINATED: + return false, ErrQueryTerminated.err().setNode(cmd.node) + default: + return false, newError(cmd.terminationErrorType).setNode(cmd.node) + } + } + } else if multiObjectParser != nil { + obj := reflect.New(cmd.resObjType) + if err := multiObjectParser(cmd, obj, opCount, fieldCount, generation, expiration); err != nil { + err = newNodeError(cmd.node, err) + return false, err + } + + if cmd.grpcEOS || !cmd.tracker.allowRecord(cmd.nodePartitions) { + continue + } + + // set the object to send + cmd.selectCases[0].Send = obj + + chosen, _, _ := reflect.Select(cmd.selectCases) + switch chosen { + case 0: // object sent + case 1: // cancel channel is closed + return false, newError(cmd.terminationErrorType).setNode(cmd.node) + } + } + + if fieldCount > 0 && cmd.tracker != nil { + // only if there is key returned. Commands like QueryAggregate do not return keys + if cmd.terminationErrorType == types.SCAN_TERMINATED { + cmd.tracker.setDigest(cmd.nodePartitions, key) + } else { + cmd.tracker.setLast(cmd.nodePartitions, key, &bval) + } + } + } + + return true, nil +} + +func (cmd *baseMultiCommand) canPutConnBack() bool { + return false +} + +func (cmd *baseMultiCommand) execute(ifc command) Error { + + /*************************************************************************** + IMPORTANT: No need to send the error here to the recordset.Error channel. + It is being sent from the downstream command from the result + returned from the function. + ****************************************************************************/ + + return cmd.baseCommand.execute(ifc) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/multi_policy.go b/aerospike-tls/vendor-aerospike-client-go/multi_policy.go new file mode 100644 index 00000000..35d86ffa --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/multi_policy.go @@ -0,0 +1,88 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "time" + +// MultiPolicy contains parameters for policy attributes used in +// query and scan operations. +type MultiPolicy struct { + BasePolicy + + // Maximum number of concurrent requests to server nodes at any point in time. + // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries + // will be made to 8 nodes in parallel. When a query completes, a new query will + // be issued until all 16 nodes have been queried. + // Default (0) is to issue requests to all server nodes in parallel. + // 1 will to issue requests to server nodes one by one avoiding parallel queries. + MaxConcurrentNodes int + + // MaxRecords approximates the number of records to return to the client. This number is divided by the + // number of nodes involved in the query. The actual number of records returned + // may be less than MaxRecords if node record counts are small and unbalanced across + // nodes. + // + // This field is supported on server versions >= 4.9. + // + // Default: 0 (do not limit record count) + MaxRecords int64 + + // RecordsPerSecond limits returned records per second (rps) rate for each server. + // Will not apply rps limit if recordsPerSecond is zero (default). + // Currently only applicable to a query without a defined filter. + RecordsPerSecond int + + // Number of records to place in queue before blocking. + // Records received from multiple server nodes will be placed in a queue. + // A separate goroutine consumes these records in parallel. + // If the queue is full, the producer goroutines will block until records are consumed. + RecordQueueSize int //= 50 + + // Indicates if bin data is retrieved. If false, only record digests are retrieved. + IncludeBinData bool //= true; + + // RawCDT specifies that the value of the CDT fields (Maps and Lists) should not be unpacked/decoded. + // This is only used internally by Aerospike for Backup purposes and should not be used by 3rd parties. + RawCDT bool +} + +// NewMultiPolicy initializes a MultiPolicy instance with default values. +// It disables TotalTimeout and sets MaxRetries. +// Set MaxRetries for non-aggregation queries with a nil filter on +// server versions >= 4.9. All other queries are not retried. +// +// The latest servers support retries on individual data partitions. +// This feature is useful when a cluster is migrating and partition(s) +// are missed or incomplete on the first query attempt. +// +// If the first query attempt misses 2 of 4096 partitions, then only +// those 2 partitions are retried in the next query attempt from the +// last key digest received for each respective partition. A higher +// default MaxRetries is used because it's wasteful to invalidate +// all query results because a single partition was missed. +func NewMultiPolicy() *MultiPolicy { + bp := *NewPolicy() + bp.TotalTimeout = 0 * time.Second + bp.SocketTimeout = 30 * time.Second + bp.MaxRetries = 5 + + return &MultiPolicy{ + BasePolicy: bp, + MaxConcurrentNodes: 0, + RecordsPerSecond: 0, + RecordQueueSize: 50, + IncludeBinData: true, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/node.go b/aerospike-tls/vendor-aerospike-client-go/node.go new file mode 100644 index 00000000..6dc85ddc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/node.go @@ -0,0 +1,963 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bufio" + "errors" + "io" + "strconv" + "strings" + "time" + + "golang.org/x/sync/errgroup" + + iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const ( + _PARTITIONS = 4096 +) + +const ( + _SUPPORTS_PARTITION_SCAN = 1 << iota + _SUPPORTS_QUERY_SHOW + _SUPPORTS_BATCH_ANY + _SUPPORTS_PARTITION_QUERY +) + +// Node represents an Aerospike Database Server Node +type Node struct { + cluster *Cluster + name string + host *Host + aliases iatomic.TypedVal[[]*Host] + stats nodeStats + sessionInfo iatomic.TypedVal[*sessionInfo] + + racks iatomic.TypedVal[map[string]int] + + // tendConn reserves a connection for tend so that it won't have to + // wait in queue for connections, since that will cause starvation + // and the node being dropped under load. + tendConn iatomic.Guard[Connection] + + peersGeneration iatomic.Int + peersCount iatomic.Int + + connections connectionHeap + connectionCount iatomic.Int + + partitionGeneration iatomic.Int + referenceCount iatomic.Int + failures iatomic.Int + partitionChanged iatomic.Bool + errorCount iatomic.Int + rebalanceGeneration iatomic.Int + + features int + + active iatomic.Bool +} + +// NewNode initializes a server node with connection parameters. +func newNode(cluster *Cluster, nv *nodeValidator) *Node { + newNode := &Node{ + cluster: cluster, + name: nv.name, + host: nv.primaryHost, + + features: nv.features, + + stats: *newNodeStats(cluster.MetricsPolicy()), + + // Assign host to first IP alias because the server identifies nodes + // by IP address (not hostname). + connections: *newConnectionHeap(cluster.clientPolicy.MinConnectionsPerNode, cluster.clientPolicy.ConnectionQueueSize), + connectionCount: *iatomic.NewInt(0), + peersGeneration: *iatomic.NewInt(-1), + partitionGeneration: *iatomic.NewInt(-2), + referenceCount: *iatomic.NewInt(0), + failures: *iatomic.NewInt(0), + active: *iatomic.NewBool(true), + partitionChanged: *iatomic.NewBool(false), + errorCount: *iatomic.NewInt(0), + rebalanceGeneration: *iatomic.NewInt(-1), + } + + newNode.aliases.Set(nv.aliases) + newNode.sessionInfo.Set(nv.sessionInfo) + newNode.racks.Set(make(map[string]int)) + + // this will reset to zero on first aggregation on the cluster, + // therefore will only be counted once. + newNode.stats.NodeAdded.IncrementAndGet() + + return newNode +} + +// SupportsBatchAny returns true if the node supports the feature. +func (nd *Node) SupportsBatchAny() bool { + return (nd.features & _SUPPORTS_BATCH_ANY) != 0 +} + +// SupportsQueryShow returns true if the node supports the feature. +func (nd *Node) SupportsQueryShow() bool { + return (nd.features & _SUPPORTS_QUERY_SHOW) != 0 +} + +// SupportsPartitionQuery returns true if the node supports the feature. +func (nd *Node) SupportsPartitionQuery() bool { + return (nd.features & _SUPPORTS_PARTITION_QUERY) != 0 +} + +// Refresh requests current status from server node, and updates node with the result. +func (nd *Node) Refresh(peers *peers) Error { + if !nd.active.Get() { + return nil + } + + nd.stats.TendsTotal.IncrementAndGet() + + // Close idleConnections + defer nd.dropIdleConnections() + + // Clear node reference counts. + nd.referenceCount.Set(0) + nd.partitionChanged.Set(false) + + var infoMap map[string]string + commands := []string{"node", "peers-generation", "partition-generation"} + if nd.cluster.clientPolicy.RackAware { + commands = append(commands, "racks:") + } + + infoMap, err := nd.RequestInfo(&nd.cluster.infoPolicy, commands...) + if err != nil { + nd.refreshFailed(err) + return err + } + + if err = nd.verifyNodeName(infoMap); err != nil { + nd.refreshFailed(err) + return err + } + + if err = nd.verifyPeersGeneration(infoMap, peers); err != nil { + nd.refreshFailed(err) + return err + } + + if err = nd.verifyPartitionGeneration(infoMap); err != nil { + nd.refreshFailed(err) + return err + } + + if err = nd.updateRackInfo(infoMap); err != nil { + // Update rack info should fail if the feature is not supported on the server + if err.Matches(types.UNSUPPORTED_FEATURE) { + nd.refreshFailed(err) + return err + } + // Should not fail in other cases + logger.Logger.Warn("Updating node rack info failed with error: %s (racks: `%s`)", err, infoMap["racks:"]) + } + + nd.failures.Set(0) + peers.refreshCount.IncrementAndGet() + nd.referenceCount.IncrementAndGet() + nd.stats.TendsSuccessful.IncrementAndGet() + + if err = nd.refreshSessionToken(); err != nil { + logger.Logger.Error("Error refreshing session token: %s", err.Error()) + } + + if _, err = nd.fillMinConns(); err != nil { + logger.Logger.Error("Error filling up the connection queue to the minimum required") + } + + return nil +} + +// refreshSessionToken refreshes the session token if it has been expired +func (nd *Node) refreshSessionToken() (err Error) { + // no session token to refresh + if !nd.cluster.clientPolicy.RequiresAuthentication() { + return nil + } + + st := nd.sessionInfo.Get() + + // Consider when the next tend will be in this calculation. If the next tend will be too late, + // refresh the sessionInfo now. + if st.expiration.IsZero() || time.Now().Before(st.expiration.Add(-nd.cluster.clientPolicy.TendInterval)) { + return nil + } + + nd.usingTendConn(nd.cluster.clientPolicy.LoginTimeout, func(conn *Connection) { + command := newLoginCommand(conn.dataBuffer) + if err = command.login(&nd.cluster.clientPolicy, conn, nd.cluster.Password()); err != nil { + // force new connections to use default creds until a new valid session token is acquired + nd.resetSessionInfo() + // Socket not authenticated. Do not put back into pool. + conn.Close() + } else { + nd.sessionInfo.Set(command.sessionInfo()) + } + }) + + return err +} + +func (nd *Node) updateRackInfo(infoMap map[string]string) Error { + if !nd.cluster.clientPolicy.RackAware { + return nil + } + + // Do not raise an error if the server does not support rackaware + if strings.HasPrefix(strings.ToUpper(infoMap["racks:"]), "ERROR") { + return newError(types.UNSUPPORTED_FEATURE, "You have set the ClientPolicy.RackAware = true, but the server does not support this feature.") + } + + ss := strings.Split(infoMap["racks:"], ";") + racks := map[string]int{} + for _, s := range ss { + in := bufio.NewReader(strings.NewReader(s)) + _, err := in.ReadString('=') + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + ns, err := in.ReadString(':') + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + for { + _, err = in.ReadString('_') + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + rackStr, err := in.ReadString('=') + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + rack, err := strconv.Atoi(rackStr[:len(rackStr)-1]) + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + nodesList, err := in.ReadString(':') + if err != nil && err != io.EOF { + return newErrorAndWrap(err, types.PARSE_ERROR) + } + + nodes := strings.Split(strings.Trim(nodesList, ":"), ",") + for i := range nodes { + if nodes[i] == nd.name { + racks[ns[:len(ns)-1]] = rack + } + } + + if err == io.EOF { + break + } + } + } + + nd.racks.Set(racks) + + return nil +} + +func (nd *Node) verifyNodeName(infoMap map[string]string) Error { + infoName, exists := infoMap["node"] + + if !exists || len(infoName) == 0 { + return newError(types.INVALID_NODE_ERROR, "Node name is empty") + } + + if !(nd.name == infoName) { + // Set node to inactive immediately. + nd.active.Set(false) + return newError(types.INVALID_NODE_ERROR, "Node name has changed. Old="+nd.name+" New="+infoName) + } + return nil +} + +func (nd *Node) verifyPeersGeneration(infoMap map[string]string, peers *peers) Error { + genString := infoMap["peers-generation"] + if len(genString) == 0 { + return newError(types.PARSE_ERROR, "peers-generation is empty") + } + + gen, err := strconv.Atoi(genString) + if err != nil { + return newError(types.PARSE_ERROR, "peers-generation is not a number: "+genString) + } + + peers.genChanged.Or(nd.peersGeneration.Get() != gen) + return nil +} + +func (nd *Node) verifyPartitionGeneration(infoMap map[string]string) Error { + genString := infoMap["partition-generation"] + + if len(genString) == 0 { + return newError(types.PARSE_ERROR, "partition-generation is empty") + } + + gen, err := strconv.Atoi(genString) + if err != nil { + return newError(types.PARSE_ERROR, "partition-generation is not a number:"+genString) + } + + if nd.partitionGeneration.Get() != gen { + nd.partitionChanged.Set(true) + } + return nil +} + +func (nd *Node) refreshPeers(peers *peers) { + // Do not refresh peers when node connection has already failed during this cluster tend iteration. + if nd.failures.Get() > 0 || !nd.active.Get() { + return + } + + peerParser, err := parsePeers(nd.cluster, nd) + if err != nil { + logger.Logger.Debug("Parsing peers failed: %s", err) + nd.refreshFailed(err) + return + } + + peers.appendPeers(peerParser.peers) + nd.peersGeneration.Set(int(peerParser.generation())) + nd.peersCount.Set(len(peers.peers())) + peers.refreshCount.IncrementAndGet() +} + +func (nd *Node) refreshPartitions(peers *peers, partitions partitionMap, freshlyAdded bool) { + // Do not refresh peers when node connection has already failed during this cluster tend iteration. + // Also, avoid "split cluster" case where this node thinks it's a 1-node cluster. + // Unchecked, such a node can dominate the partition map and cause all other + // nodes to be dropped. + if !freshlyAdded { + if nd.failures.Get() > 0 || !nd.active.Get() || (nd.peersCount.Get() == 0 && peers.refreshCount.Get() > 1) { + return + } + } + + parser, err := newPartitionParser(nd, partitions, _PARTITIONS) + if err != nil { + nd.refreshFailed(err) + return + } + + if parser.generation != nd.partitionGeneration.Get() { + logger.Logger.Info("Node %s partition generation changed from %d to %d", nd.host.String(), nd.partitionGeneration.Get(), parser.getGeneration()) + nd.partitionChanged.Set(true) + nd.partitionGeneration.Set(parser.getGeneration()) + nd.stats.PartitionMapUpdates.IncrementAndGet() + } +} + +func (nd *Node) refreshFailed(e Error) { + nd.peersGeneration.Set(-1) + nd.partitionGeneration.Set(-1) + + if nd.cluster.clientPolicy.RackAware { + nd.rebalanceGeneration.Set(-1) + } + + nd.failures.IncrementAndGet() + nd.stats.TendsFailed.IncrementAndGet() + + // Only log message if cluster is still active. + if nd.cluster.IsConnected() { + logger.Logger.Warn("Node `%s` refresh failed: `%s`", nd, e) + } +} + +// dropIdleConnections picks a connection from the head of the connection pool queue +// if that connection is idle, it drops it and takes the next one until it picks +// a fresh connection or exhaust the queue. +func (nd *Node) dropIdleConnections() { + nd.connections.DropIdle() +} + +// GetConnection gets a connection to the node. +// If no pooled connection is available, a new connection will be created, unless +// ClientPolicy.MaxQueueSize number of connections are already created. +// This method will retry to retrieve a connection in case the connection pool +// is empty, until timeout is reached. +func (nd *Node) GetConnection(timeout time.Duration) (conn *Connection, err Error) { + if timeout <= 0 { + timeout = _DEFAULT_TIMEOUT + } + deadline := time.Now().Add(timeout) + + for time.Now().Before(deadline) { + conn, err = nd.getConnection(deadline, timeout) + if err == nil && conn != nil { + return conn, nil + } + + if errors.Is(err, ErrServerNotAvailable) { + return nil, err + } + + time.Sleep(5 * time.Millisecond) + } + + // in case the block didn't run at all + if err == nil { + err = ErrConnectionPoolEmpty.err() + } + + return nil, err +} + +// getConnection gets a connection to the node. +// If no pooled connection is available, a new connection will be created. +func (nd *Node) getConnection(deadline time.Time, timeout time.Duration) (conn *Connection, err Error) { + return nd.getConnectionWithHint(deadline, timeout, 0) +} + +// newConnectionAllowed will tentatively check if the client is allowed to make a new connection +// based on the ClientPolicy passed to it. +// This is more or less a copy of the logic in the beginning of newConnection function. +func (nd *Node) newConnectionAllowed() Error { + if !nd.active.Get() { + return ErrServerNotAvailable.err() + } + + // if connection count is limited and enough connections are already created, don't create a new one + cc := nd.connectionCount.IncrementAndGet() + defer nd.connectionCount.DecrementAndGet() + if nd.cluster.clientPolicy.LimitConnectionsToQueueSize && cc > nd.cluster.clientPolicy.ConnectionQueueSize { + return ErrTooManyConnectionsForNode.err() + } + + // Check for opening connection threshold + if nd.cluster.clientPolicy.OpeningConnectionThreshold > 0 { + ct := nd.cluster.connectionThreshold.IncrementAndGet() + defer nd.cluster.connectionThreshold.DecrementAndGet() + if ct > nd.cluster.clientPolicy.OpeningConnectionThreshold { + return ErrTooManyOpeningConnections.err() + } + } + + return nil +} + +// newConnection will make a new connection for the node. +func (nd *Node) newConnection(overrideThreshold bool) (*Connection, Error) { + if !nd.active.Get() { + return nil, ErrServerNotAvailable.err() + } + + // if connection count is limited and enough connections are already created, don't create a new one + cc := nd.connectionCount.IncrementAndGet() + if nd.cluster.clientPolicy.LimitConnectionsToQueueSize && cc > nd.cluster.clientPolicy.ConnectionQueueSize { + nd.connectionCount.DecrementAndGet() + nd.stats.ConnectionsPoolEmpty.IncrementAndGet() + + return nil, ErrTooManyConnectionsForNode.err() + } + + // Check for opening connection threshold + if !overrideThreshold && nd.cluster.clientPolicy.OpeningConnectionThreshold > 0 { + ct := nd.cluster.connectionThreshold.IncrementAndGet() + if ct > nd.cluster.clientPolicy.OpeningConnectionThreshold { + nd.cluster.connectionThreshold.DecrementAndGet() + nd.connectionCount.DecrementAndGet() + + return nil, ErrTooManyOpeningConnections.err() + } + + defer nd.cluster.connectionThreshold.DecrementAndGet() + } + + nd.stats.ConnectionsAttempts.IncrementAndGet() + conn, err := NewConnection(&nd.cluster.clientPolicy, nd.host) + if err != nil { + nd.incrErrorCount() + nd.connectionCount.DecrementAndGet() + nd.stats.ConnectionsFailed.IncrementAndGet() + return nil, err + } + conn.node = nd + + sessionInfo := nd.sessionInfo.Get() + // need to authenticate + if err = conn.login(&nd.cluster.clientPolicy, nd.cluster.Password(), sessionInfo); err != nil { + // increment node errors if authentication hit a network error + if networkError(err) { + nd.incrErrorCount() + } + nd.stats.ConnectionsFailed.IncrementAndGet() + + // Socket not authenticated. Do not put back into pool. + conn.Close() + return nil, err + } + + nd.stats.ConnectionsSuccessful.IncrementAndGet() + conn.setIdleTimeout(nd.cluster.clientPolicy.IdleTimeout) + + return conn, nil +} + +// makeConnectionForPool will try to open a connection until deadline. +// if no deadline is defined, it will only try for _DEFAULT_TIMEOUT. +func (nd *Node) makeConnectionForPool(hint byte) { + conn, err := nd.newConnection(false) + if err != nil { + logger.Logger.Debug("Error trying to make a connection to the node %s: %s", nd.String(), err.Error()) + return + } + + nd.putConnectionWithHint(conn, hint) +} + +// getConnectionWithHint gets a connection to the node. +// If no pooled connection is available, a new connection will be created. +func (nd *Node) getConnectionWithHint(deadline time.Time, timeout time.Duration, hint byte) (conn *Connection, err Error) { + if !nd.active.Get() { + return nil, ErrServerNotAvailable.err() + } + + // try to get a valid connection from the connection pool + for conn = nd.connections.Poll(hint); conn != nil; conn = nd.connections.Poll(hint) { + if conn.IsConnected() { + break + } + conn.Close() + conn = nil + } + + if conn == nil { + // tentatively check if a connection is allowed to avoid launching too many goroutines. + err = nd.newConnectionAllowed() + if err == nil { + go nd.makeConnectionForPool(hint) + } else if errors.Is(err, ErrTooManyConnectionsForNode) { + return nil, ErrConnectionPoolExhausted.err() + } + return nil, ErrConnectionPoolEmpty.err() + } + + if err = conn.SetTimeout(deadline, timeout); err != nil { + nd.stats.ConnectionsFailed.IncrementAndGet() + + // Do not put back into pool. + conn.Close() + return nil, err + } + + conn.refresh() + + return conn, nil +} + +// PutConnection puts back a connection to the pool. +// If connection pool is full, the connection will be +// closed and discarded. +func (nd *Node) putConnectionWithHint(conn *Connection, hint byte) bool { + conn.refresh() + if !nd.active.Get() || !nd.connections.Offer(conn, hint) { + nd.stats.ConnectionsPoolOverflow.IncrementAndGet() + conn.Close() + return false + } + return true +} + +// PutConnection puts back a connection to the pool. +// If connection pool is full, the connection will be +// closed and discarded. +func (nd *Node) PutConnection(conn *Connection) { + nd.putConnectionWithHint(conn, 0) +} + +// InvalidateConnection closes and discards a connection from the pool. +func (nd *Node) InvalidateConnection(conn *Connection) { + conn.Close() +} + +// GetHost retrieves host for the node. +func (nd *Node) GetHost() *Host { + return nd.host +} + +// IsActive Checks if the node is active. +func (nd *Node) IsActive() bool { + return nd != nil && nd.active.Get() && nd.partitionGeneration.Get() >= -1 +} + +// GetName returns node name. +func (nd *Node) GetName() string { + return nd.name +} + +// GetAliases returns node aliases. +func (nd *Node) GetAliases() []*Host { + return nd.aliases.Get() +} + +// Sets node aliases +func (nd *Node) setAliases(aliases []*Host) { + nd.aliases.Set(aliases) +} + +// AddAlias adds an alias for the node +func (nd *Node) addAlias(aliasToAdd *Host) { + // Aliases are only referenced in the cluster tend goroutine, + // so synchronization is not necessary. + aliases := nd.GetAliases() + if aliases == nil { + aliases = []*Host{} + } + + aliases = append(aliases, aliasToAdd) + nd.setAliases(aliases) +} + +// Close marks node as inactive and closes all of its pooled connections. +func (nd *Node) Close() { + if nd.active.Get() { + nd.active.Set(false) + nd.stats.NodeRemoved.IncrementAndGet() + } + nd.closeConnections() + nd.connections.cleanup() +} + +// String implements stringer interface +func (nd *Node) String() string { + if nd != nil { + return nd.name + " " + nd.host.String() + } + return "" +} + +func (nd *Node) closeConnections() { + for conn := nd.connections.Poll(0); conn != nil; conn = nd.connections.Poll(0) { + conn.Close() + } + + // close the tend connection + nd.tendConn.Do(func(conn *Connection) { + if conn != nil { + conn.Close() + } + }) +} + +// Equals compares equality of two nodes based on their names. +func (nd *Node) Equals(other *Node) bool { + return nd != nil && other != nil && (nd == other || nd.name == other.name) +} + +// MigrationInProgress determines if the node is participating in a data migration +func (nd *Node) MigrationInProgress() (bool, Error) { + values, err := nd.RequestStats(&nd.cluster.infoPolicy) + if err != nil { + return false, err + } + + // if the migrate_partitions_remaining exists and is not `0`, then migration is in progress + if migration, exists := values["migrate_partitions_remaining"]; exists && migration != "0" { + return true, nil + } + + // migration not in progress + return false, nil +} + +// WaitUntillMigrationIsFinished will block until migration operations are finished. +func (nd *Node) WaitUntillMigrationIsFinished(timeout time.Duration) Error { + if timeout <= 0 { + timeout = _NO_TIMEOUT + } + done := make(chan Error) + + go func() { + // this function is guaranteed to return after timeout + // no go routines will be leaked + for { + if res, err := nd.MigrationInProgress(); err != nil || !res { + done <- err + return + } + } + }() + + dealine := time.After(timeout) + select { + case <-dealine: + return newError(types.TIMEOUT) + case err := <-done: + return err + } +} + +// usingTendConn allows the tend connection to be used in a monitor without race conditions. +// If the connection is not valid, it establishes a valid connection first. +func (nd *Node) usingTendConn(timeout time.Duration, f func(conn *Connection)) (err Error) { + nd.tendConn.Update(func(conn **Connection) { + if timeout <= 0 { + timeout = _DEFAULT_TIMEOUT + } + deadline := time.Now().Add(timeout) + + // if the tend connection is invalid, establish a new connection first + if *conn == nil || !(*conn).IsConnected() { + if nd.connectionCount.Get() == 0 { + // if there are no connections in the pool, create a new connection synchronously. + // this will make sure the initial tend will get a connection without multiple retries. + *conn, err = nd.newConnection(true) + } else { + *conn, err = nd.GetConnection(timeout) + } + + // if no connection could be established, exit fast + if err != nil { + return + } + } + + // Set timeout for tend conn + if err = (*conn).SetTimeout(deadline, timeout); err != nil { + return + } + + // if all went well, call the closure + f(*conn) + }) + return err +} + +// requestInfoWithRetry gets info values by name from the specified database server node. +// It will try at least N times before returning an error. +func (nd *Node) requestInfoWithRetry(policy *InfoPolicy, n int, name ...string) (res map[string]string, err Error) { + for i := 0; i < n; i++ { + if res, err = nd.requestInfo(policy.Timeout, name...); err == nil { + return res, nil + } + + logger.Logger.Error("Error occurred while fetching info from the server node %s: %s", nd.host.String(), err.Error()) + time.Sleep(100 * time.Millisecond) + } + + // return the last error + return nil, err +} + +// RequestInfo gets info values by name from the specified database server node. +func (nd *Node) RequestInfo(policy *InfoPolicy, name ...string) (map[string]string, Error) { + return nd.requestInfo(policy.Timeout, name...) +} + +// RequestInfo gets info values by name from the specified database server node. +func (nd *Node) requestInfo(timeout time.Duration, name ...string) (response map[string]string, err Error) { + nd.usingTendConn(timeout, func(conn *Connection) { + response, err = conn.RequestInfo(name...) + if err != nil { + conn.Close() + } + }) + + return response, err +} + +// requestRawInfo gets info values by name from the specified database server node. +// It won't parse the results. +func (nd *Node) requestRawInfo(policy *InfoPolicy, name ...string) (response *info, err Error) { + nd.usingTendConn(policy.Timeout, func(conn *Connection) { + response, err = newInfo(conn, name...) + if err != nil { + conn.Close() + } + }) + return response, nil +} + +// RequestStats returns statistics for the specified node as a map +func (nd *Node) RequestStats(policy *InfoPolicy) (map[string]string, Error) { + infoMap, err := nd.RequestInfo(policy, "statistics") + if err != nil { + return nil, err + } + + res := map[string]string{} + + v, exists := infoMap["statistics"] + if !exists { + return res, nil + } + + values := strings.Split(v, ";") + for i := range values { + kv := strings.Split(values[i], "=") + if len(kv) > 1 { + res[kv[0]] = kv[1] + } + } + + return res, nil +} + +// resetSessionInfo resets the sessionInfo after an +// unsuccessful authentication with token +func (nd *Node) resetSessionInfo() { + si := &sessionInfo{} + nd.sessionInfo.Set(si) +} + +// sessionToken returns the session token for the node. +// It will return nil if the session has expired. +func (nd *Node) sessionToken() []byte { + si := nd.sessionInfo.Get() + if !si.isValid() { + return nil + } + + return si.token +} + +// Rack returns the rack number for the namespace. +func (nd *Node) Rack(namespace string) (int, Error) { + racks := nd.racks.Get() + v, exists := racks[namespace] + + if exists { + return v, nil + } + + return -1, newCustomNodeError(nd, types.RACK_NOT_DEFINED) +} + +// Rack returns the rack number for the namespace. +func (nd *Node) hasRack(namespace string, rack int) bool { + racks := nd.racks.Get() + v, exists := racks[namespace] + + if !exists { + return false + } + + return v == rack +} + +// WarmUp fills the node's connection pool with connections. +// This is necessary on startup for high traffic programs. +// If the count is <= 0, the connection queue will be filled. +// If the count is more than the size of the pool, the pool will be filled. +// Note: One connection per node is reserved for tend operations and is not used for transactions. +func (nd *Node) WarmUp(count int) (int, Error) { + var g errgroup.Group + cnt := iatomic.NewInt(0) + + toAlloc := nd.connections.Cap() - nd.connectionCount.Get() + if count < toAlloc && count > 0 { + toAlloc = count + } + + for i := 0; i < toAlloc; i++ { + g.Go(func() error { + conn, err := nd.newConnection(true) + if err != nil { + if errors.Is(err, ErrTooManyConnectionsForNode) { + return nil + } + return err + } + + if nd.putConnectionWithHint(conn, 0) { + cnt.IncrementAndGet() + } else { + conn.Close() + } + + return nil + }) + } + + err := g.Wait() + if err != nil { + return cnt.Get(), err.(Error) + } + return cnt.Get(), nil +} + +// fillMinCounts will fill the connection pool to the minimum required +// by the ClientPolicy.MinConnectionsPerNode +func (nd *Node) fillMinConns() (int, Error) { + if nd.cluster.clientPolicy.MinConnectionsPerNode > 0 { + toFill := nd.cluster.clientPolicy.MinConnectionsPerNode - nd.connectionCount.Get() + if toFill > 0 { + return nd.WarmUp(toFill) + } + } + return 0, nil +} + +// Increments error count for the node. If errorCount goes above the threshold, +// the node will not accept any more requests until the next window. +func (nd *Node) incrErrorCount() { + if nd.cluster.clientPolicy.MaxErrorRate > 0 { + nd.errorCount.GetAndIncrement() + } +} + +// Resets the error count +func (nd *Node) resetErrorCount() { + nd.errorCount.Set(0) +} + +// checks if the errorCount is within set limits +func (nd *Node) errorCountWithinLimit() bool { + return nd.cluster.clientPolicy.MaxErrorRate <= 0 || nd.errorCount.Get() <= nd.cluster.clientPolicy.MaxErrorRate +} + +// returns error if errorCount has gone above the threshold set in the policy +func (nd *Node) validateErrorCount() Error { + if !nd.errorCountWithinLimit() { + nd.stats.CircuitBreakerHits.IncrementAndGet() + return newError(types.MAX_ERROR_RATE) + } + return nil +} + +// PeersGeneration returns node's Peers Generation +func (nd *Node) PeersGeneration() int { + return nd.peersGeneration.Get() +} + +// PartitionGeneration returns node's Partition Generation +func (nd *Node) PartitionGeneration() int { + return nd.partitionGeneration.Get() +} + +// RebalanceGeneration returns node's Rebalance Generation +func (nd *Node) RebalanceGeneration() int { + return nd.rebalanceGeneration.Get() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/node_stats.go b/aerospike-tls/vendor-aerospike-client-go/node_stats.go new file mode 100644 index 00000000..a4218c93 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/node_stats.go @@ -0,0 +1,400 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "encoding/json" + "sync" + + iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + hist "github.com/aerospike/aerospike-client-go/v7/types/histogram" +) + +// nodeStats keeps track of client's internal node statistics +// These statistics are aggregated once per tend in the cluster object +// and then are served to the end-user. +type nodeStats struct { + m sync.Mutex + // Attempts to open a connection (failed + successful) + ConnectionsAttempts iatomic.Int `json:"connections-attempts"` + // Successful attempts to open a connection + ConnectionsSuccessful iatomic.Int `json:"connections-successful"` + // Failed attempts to use a connection (includes all errors) + ConnectionsFailed iatomic.Int `json:"connections-failed"` + // Connection Timeout errors + ConnectionsTimeoutErrors iatomic.Int `json:"connections-error-timeout"` + // Connection errors other than timeouts + ConnectionsOtherErrors iatomic.Int `json:"connections-error-other"` + // Number of times circuit breaker was hit + CircuitBreakerHits iatomic.Int `json:"circuit-breaker-hits"` + // The command polled the connection pool, but no connections were in the pool + ConnectionsPoolEmpty iatomic.Int `json:"connections-pool-empty"` + // The command offered the connection to the pool, but the pool was full and the connection was closed + ConnectionsPoolOverflow iatomic.Int `json:"connections-pool-overflow"` + // The connection was idle and was dropped + ConnectionsIdleDropped iatomic.Int `json:"connections-idle-dropped"` + // Number of open connections at a given time + ConnectionsOpen iatomic.Int `json:"open-connections"` + // Number of connections that were closed, for any reason (idled out, errored out, etc) + ConnectionsClosed iatomic.Int `json:"closed-connections"` + // Total number of attempted tends (failed + success) + TendsTotal iatomic.Int `json:"tends-total"` + // Total number of successful tends + TendsSuccessful iatomic.Int `json:"tends-successful"` + // Total number of failed tends + TendsFailed iatomic.Int `json:"tends-failed"` + // Total number of partition map updates + PartitionMapUpdates iatomic.Int `json:"partition-map-updates"` + // Total number of times nodes were added to the client (not the same as actual nodes added. Network disruptions between client and server may cause a node being dropped and re-added client-side) + NodeAdded iatomic.Int `json:"node-added-count"` + // Total number of times nodes were removed from the client (not the same as actual nodes removed. Network disruptions between client and server may cause a node being dropped client-side) + NodeRemoved iatomic.Int `json:"node-removed-count"` + + // Total number of transaction retries + TransactionRetryCount iatomic.Int `json:"transaction-retry-count"` + // Total number of transaction errors + TransactionErrorCount iatomic.Int `json:"transaction-error-count"` + + // Metrics for Get commands + GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` + // Metrics for GetHeader commands + GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` + // Metrics for Exists commands + ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` + // Metrics for Put commands + PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` + // Metrics for Delete commands + DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` + // Metrics for Operate commands + OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` + // Metrics for Query commands + QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` + // Metrics for Scan commands + ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` + // Metrics for UDFMetrics commands + UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` + // Metrics for Read only Batch commands + BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` + // Metrics for Batch commands containing writes + BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` +} + +func newNodeStats(policy *MetricsPolicy) *nodeStats { + if policy == nil { + policy = DefaultMetricsPolicy() + } + + return &nodeStats{ + GetMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + GetHeaderMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + ExistsMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + PutMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + DeleteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + OperateMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + QueryMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + ScanMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + UDFMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + BatchReadMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + BatchWriteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), + } +} + +// latest returns the latest values to be used in aggregation and then resets the values +func (ns *nodeStats) getAndReset() *nodeStats { + ns.m.Lock() + + res := &nodeStats{ + ConnectionsAttempts: ns.ConnectionsAttempts.CloneAndSet(0), + ConnectionsSuccessful: ns.ConnectionsSuccessful.CloneAndSet(0), + ConnectionsFailed: ns.ConnectionsFailed.CloneAndSet(0), + ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.CloneAndSet(0), + ConnectionsOtherErrors: ns.ConnectionsOtherErrors.CloneAndSet(0), + CircuitBreakerHits: ns.CircuitBreakerHits.CloneAndSet(0), + ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.CloneAndSet(0), + ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.CloneAndSet(0), + ConnectionsIdleDropped: ns.ConnectionsIdleDropped.CloneAndSet(0), + ConnectionsOpen: ns.ConnectionsOpen.CloneAndSet(0), + ConnectionsClosed: ns.ConnectionsClosed.CloneAndSet(0), + TendsTotal: ns.TendsTotal.CloneAndSet(0), + TendsSuccessful: ns.TendsSuccessful.CloneAndSet(0), + TendsFailed: ns.TendsFailed.CloneAndSet(0), + PartitionMapUpdates: ns.PartitionMapUpdates.CloneAndSet(0), + NodeAdded: ns.NodeAdded.CloneAndSet(0), + NodeRemoved: ns.NodeRemoved.CloneAndSet(0), + + TransactionRetryCount: ns.TransactionRetryCount.CloneAndSet(0), + TransactionErrorCount: ns.TransactionErrorCount.CloneAndSet(0), + + GetMetrics: *ns.GetMetrics.CloneAndReset(), + GetHeaderMetrics: *ns.GetHeaderMetrics.CloneAndReset(), + ExistsMetrics: *ns.ExistsMetrics.CloneAndReset(), + PutMetrics: *ns.PutMetrics.CloneAndReset(), + DeleteMetrics: *ns.DeleteMetrics.CloneAndReset(), + OperateMetrics: *ns.OperateMetrics.CloneAndReset(), + QueryMetrics: *ns.QueryMetrics.CloneAndReset(), + ScanMetrics: *ns.ScanMetrics.CloneAndReset(), + UDFMetrics: *ns.UDFMetrics.CloneAndReset(), + BatchReadMetrics: *ns.BatchReadMetrics.CloneAndReset(), + BatchWriteMetrics: *ns.BatchWriteMetrics.CloneAndReset(), + } + + ns.m.Unlock() + return res +} + +func (ns *nodeStats) clone() nodeStats { + ns.m.Lock() + + res := nodeStats{ + ConnectionsAttempts: ns.ConnectionsAttempts.Clone(), + ConnectionsSuccessful: ns.ConnectionsSuccessful.Clone(), + ConnectionsFailed: ns.ConnectionsFailed.Clone(), + ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.Clone(), + ConnectionsOtherErrors: ns.ConnectionsOtherErrors.Clone(), + CircuitBreakerHits: ns.CircuitBreakerHits.Clone(), + ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.Clone(), + ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.Clone(), + ConnectionsIdleDropped: ns.ConnectionsIdleDropped.Clone(), + ConnectionsOpen: ns.ConnectionsOpen.Clone(), + ConnectionsClosed: ns.ConnectionsClosed.Clone(), + TendsTotal: ns.TendsTotal.Clone(), + TendsSuccessful: ns.TendsSuccessful.Clone(), + TendsFailed: ns.TendsFailed.Clone(), + PartitionMapUpdates: ns.PartitionMapUpdates.Clone(), + NodeAdded: ns.NodeAdded.Clone(), + NodeRemoved: ns.NodeRemoved.Clone(), + + TransactionRetryCount: ns.TransactionRetryCount.Clone(), + TransactionErrorCount: ns.TransactionErrorCount.Clone(), + + GetMetrics: *ns.GetMetrics.Clone(), + GetHeaderMetrics: *ns.GetHeaderMetrics.Clone(), + ExistsMetrics: *ns.ExistsMetrics.Clone(), + PutMetrics: *ns.PutMetrics.Clone(), + DeleteMetrics: *ns.DeleteMetrics.Clone(), + OperateMetrics: *ns.OperateMetrics.Clone(), + QueryMetrics: *ns.QueryMetrics.Clone(), + ScanMetrics: *ns.ScanMetrics.Clone(), + UDFMetrics: *ns.UDFMetrics.Clone(), + BatchReadMetrics: *ns.BatchReadMetrics.Clone(), + BatchWriteMetrics: *ns.BatchWriteMetrics.Clone(), + } + + ns.m.Unlock() + return res +} + +func (ns *nodeStats) reshape(policy *MetricsPolicy) { + ns.m.Lock() + ns.GetMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.GetHeaderMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.ExistsMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.PutMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.DeleteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.OperateMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.QueryMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.ScanMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.UDFMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.BatchReadMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.BatchWriteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) + ns.m.Unlock() +} + +func (ns *nodeStats) aggregate(newStats *nodeStats) { + ns.m.Lock() + newStats.m.Lock() + + ns.ConnectionsAttempts.AddAndGet(newStats.ConnectionsAttempts.Get()) + ns.ConnectionsSuccessful.AddAndGet(newStats.ConnectionsSuccessful.Get()) + ns.ConnectionsFailed.AddAndGet(newStats.ConnectionsFailed.Get()) + ns.ConnectionsTimeoutErrors.AddAndGet(newStats.ConnectionsTimeoutErrors.Get()) + ns.ConnectionsOtherErrors.AddAndGet(newStats.ConnectionsOtherErrors.Get()) + ns.CircuitBreakerHits.AddAndGet(newStats.CircuitBreakerHits.Get()) + ns.ConnectionsPoolEmpty.AddAndGet(newStats.ConnectionsPoolEmpty.Get()) + ns.ConnectionsPoolOverflow.AddAndGet(newStats.ConnectionsPoolOverflow.Get()) + ns.ConnectionsIdleDropped.AddAndGet(newStats.ConnectionsIdleDropped.Get()) + ns.ConnectionsOpen.AddAndGet(newStats.ConnectionsOpen.Get()) + ns.ConnectionsClosed.AddAndGet(newStats.ConnectionsClosed.Get()) + ns.TendsTotal.AddAndGet(newStats.TendsTotal.Get()) + ns.TendsSuccessful.AddAndGet(newStats.TendsSuccessful.Get()) + ns.TendsFailed.AddAndGet(newStats.TendsFailed.Get()) + ns.PartitionMapUpdates.AddAndGet(newStats.PartitionMapUpdates.Get()) + ns.NodeAdded.AddAndGet(newStats.NodeAdded.Get()) + ns.NodeRemoved.AddAndGet(newStats.NodeRemoved.Get()) + + ns.TransactionRetryCount.AddAndGet(newStats.TransactionRetryCount.Get()) + ns.TransactionErrorCount.AddAndGet(newStats.TransactionErrorCount.Get()) + + ns.GetMetrics.Merge(&newStats.GetMetrics) + ns.GetHeaderMetrics.Merge(&newStats.GetHeaderMetrics) + ns.ExistsMetrics.Merge(&newStats.ExistsMetrics) + ns.PutMetrics.Merge(&newStats.PutMetrics) + ns.DeleteMetrics.Merge(&newStats.DeleteMetrics) + ns.OperateMetrics.Merge(&newStats.OperateMetrics) + ns.QueryMetrics.Merge(&newStats.QueryMetrics) + ns.ScanMetrics.Merge(&newStats.ScanMetrics) + ns.UDFMetrics.Merge(&newStats.UDFMetrics) + ns.BatchReadMetrics.Merge(&newStats.BatchReadMetrics) + ns.BatchWriteMetrics.Merge(&newStats.BatchWriteMetrics) + + newStats.m.Unlock() + ns.m.Unlock() +} + +func (ns nodeStats) MarshalJSON() ([]byte, error) { + return json.Marshal(&struct { + ConnectionsAttempts int `json:"connections-attempts"` + ConnectionsSuccessful int `json:"connections-successful"` + ConnectionsFailed int `json:"connections-failed"` + ConnectionsTimeoutErrors int `json:"connections-error-timeout"` + ConnectionsOtherErrors int `json:"connections-error-other"` + CircuitBreakerHits int `json:"circuit-breaker-hits"` + ConnectionsPoolEmpty int `json:"connections-pool-empty"` + ConnectionsPoolOverflow int `json:"connections-pool-overflow"` + ConnectionsIdleDropped int `json:"connections-idle-dropped"` + ConnectionsOpen int `json:"open-connections"` + ConnectionsClosed int `json:"closed-connections"` + TendsTotal int `json:"tends-total"` + TendsSuccessful int `json:"tends-successful"` + TendsFailed int `json:"tends-failed"` + PartitionMapUpdates int `json:"partition-map-updates"` + NodeAdded int `json:"node-added-count"` + NodeRemoved int `json:"node-removed-count"` + + RetryCount int `json:"transaction-retry-count"` + ErrorCount int `json:"transaction-error-count"` + + GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` + GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` + ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` + PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` + DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` + OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` + QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` + ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` + UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` + BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` + BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` + }{ + ns.ConnectionsAttempts.Get(), + ns.ConnectionsSuccessful.Get(), + ns.ConnectionsFailed.Get(), + ns.ConnectionsTimeoutErrors.Get(), + ns.ConnectionsOtherErrors.Get(), + ns.CircuitBreakerHits.Get(), + ns.ConnectionsPoolEmpty.Get(), + ns.ConnectionsPoolOverflow.Get(), + ns.ConnectionsIdleDropped.Get(), + ns.ConnectionsOpen.Get(), + ns.ConnectionsClosed.Get(), + ns.TendsTotal.Get(), + ns.TendsSuccessful.Get(), + ns.TendsFailed.Get(), + ns.PartitionMapUpdates.Get(), + ns.NodeAdded.Get(), + ns.NodeRemoved.Get(), + + ns.TransactionRetryCount.Get(), + ns.TransactionErrorCount.Get(), + + ns.GetMetrics, + ns.GetHeaderMetrics, + ns.ExistsMetrics, + ns.PutMetrics, + ns.DeleteMetrics, + ns.OperateMetrics, + ns.QueryMetrics, + ns.ScanMetrics, + ns.UDFMetrics, + ns.BatchReadMetrics, + ns.BatchWriteMetrics, + }) +} + +func (ns *nodeStats) UnmarshalJSON(data []byte) error { + aux := struct { + ConnectionsAttempts int `json:"connections-attempts"` + ConnectionsSuccessful int `json:"connections-successful"` + ConnectionsFailed int `json:"connections-failed"` + ConnectionsTimeoutErrors int `json:"connections-error-timeout"` + ConnectionsOtherErrors int `json:"connections-error-other"` + CircuitBreakerHits int `json:"circuit-breaker-hits"` + ConnectionsPoolEmpty int `json:"connections-pool-empty"` + ConnectionsPoolOverflow int `json:"connections-pool-overflow"` + ConnectionsIdleDropped int `json:"connections-idle-dropped"` + ConnectionsOpen int `json:"open-connections"` + ConnectionsClosed int `json:"closed-connections"` + TendsTotal int `json:"tends-total"` + TendsSuccessful int `json:"tends-successful"` + TendsFailed int `json:"tends-failed"` + PartitionMapUpdates int `json:"partition-map-updates"` + NodeAdded int `json:"node-added-count"` + NodeRemoved int `json:"node-removed-count"` + + RetryCount int `json:"transaction-retry-count"` + ErrorCount int `json:"transaction-error-count"` + + GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` + GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` + ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` + PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` + DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` + OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` + QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` + ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` + UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` + BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` + BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` + }{} + + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + + ns.ConnectionsAttempts.Set(aux.ConnectionsAttempts) + ns.ConnectionsSuccessful.Set(aux.ConnectionsSuccessful) + ns.ConnectionsFailed.Set(aux.ConnectionsFailed) + ns.ConnectionsTimeoutErrors.Set(aux.ConnectionsTimeoutErrors) + ns.ConnectionsOtherErrors.Set(aux.ConnectionsOtherErrors) + ns.CircuitBreakerHits.Set(aux.CircuitBreakerHits) + ns.ConnectionsPoolEmpty.Set(aux.ConnectionsPoolEmpty) + ns.ConnectionsPoolOverflow.Set(aux.ConnectionsPoolOverflow) + ns.ConnectionsIdleDropped.Set(aux.ConnectionsIdleDropped) + ns.ConnectionsOpen.Set(aux.ConnectionsOpen) + ns.ConnectionsClosed.Set(aux.ConnectionsClosed) + ns.TendsTotal.Set(aux.TendsTotal) + ns.TendsSuccessful.Set(aux.TendsSuccessful) + ns.TendsFailed.Set(aux.TendsFailed) + ns.PartitionMapUpdates.Set(aux.PartitionMapUpdates) + ns.NodeAdded.Set(aux.NodeAdded) + ns.NodeRemoved.Set(aux.NodeRemoved) + + ns.TransactionRetryCount.Set(aux.RetryCount) + ns.TransactionErrorCount.Set(aux.ErrorCount) + + ns.GetMetrics = aux.GetMetrics + ns.GetHeaderMetrics = aux.GetHeaderMetrics + ns.ExistsMetrics = aux.ExistsMetrics + ns.PutMetrics = aux.PutMetrics + ns.DeleteMetrics = aux.DeleteMetrics + ns.OperateMetrics = aux.OperateMetrics + ns.QueryMetrics = aux.QueryMetrics + ns.ScanMetrics = aux.ScanMetrics + ns.UDFMetrics = aux.UDFMetrics + ns.BatchReadMetrics = aux.BatchReadMetrics + ns.BatchWriteMetrics = aux.BatchWriteMetrics + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/node_test.go b/aerospike-tls/vendor-aerospike-client-go/node_test.go new file mode 100644 index 00000000..1b2067dc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/node_test.go @@ -0,0 +1,364 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "errors" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike Node Tests", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + }) + + gg.Describe("Node Connection Pool", func() { + // connection data + var err error + var client *as.Client + + dbHost := as.NewHost(*host, *port) + dbHost.TLSName = *nodeTLSName + + gg.BeforeEach(func() { + // use the same client for all + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.Context("When Authentication is Used", func() { + + if *user != "" { + + gg.It("must return error if it fails to authenticate", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.User = "non_existent_user" + clientPolicy.Password = "non_existent_user" + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).To(gm.HaveOccurred()) + }) + + } + + }) + + gg.Context("When No Connection Count Limit Is Set", func() { + + gg.It("must return a new connection on every poll", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.LimitConnectionsToQueueSize = false + clientPolicy.ConnectionQueueSize = 4 + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + for _, node := range client.GetNodes() { + for i := 0; i < 20; i++ { + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + + node.InvalidateConnection(c) + } + } + + }) + + }) + + gg.Context("When A Connection Count Limit Is Set", func() { + + gg.Context("When ExitFastOnExhaustedConnectionPool is set", func() { + + gg.It("must return appropriate error when pool is exhausted", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.LimitConnectionsToQueueSize = true + clientPolicy.ConnectionQueueSize = 4 + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + for _, node := range client.GetNodes() { + for i := 0; i < clientPolicy.ConnectionQueueSize-1; i++ { + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + + defer node.InvalidateConnection(c) + } + + // pool exhausted + c, err := node.GetConnection(0) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(errors.Is(err, as.ErrConnectionPoolExhausted)).To(gm.BeTrue()) + gm.Expect(c).To(gm.BeNil()) + } + + // same error on a command + p := as.NewPolicy() + p.ExitFastOnExhaustedConnectionPool = true + p.MaxRetries = 5 + + key, _ := as.NewKey(*namespace, randString(50), 5) + _, err := client.Get(p, key) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(errors.Is(err, as.ErrConnectionPoolExhausted)).To(gm.BeTrue()) + + ae := new(as.AerospikeError) + res := errors.As(err, &ae) + gm.Expect(res).To(gm.BeTrue()) + gm.Expect(ae.Iteration).To(gm.Equal(0)) + gm.Expect(ae.Node).ToNot(gm.BeNil()) + }) + + }) + + gg.It("must return an error when maximum number of connections are polled", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.LimitConnectionsToQueueSize = true + clientPolicy.ConnectionQueueSize = 4 + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + node := client.GetNodes()[0] + + cList := []*as.Connection{} + + // 4-1 is because we reserve a connection for tend + for i := 0; i < 4-1; i++ { + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + + // don't call invalidate here; we are testing node's connection queue behaviour + // if there are connections which are not invalidated. + // Don't call close as well, since it automatically reduces the total conn count. + // c.Close() + // append the connections to the list to prevent the invalidator closing them + cList = append(cList, c) + } + + // 4-1 is because we reserve a connection for tend + for i := 0; i < 4-1; i++ { + _, err := node.GetConnection(0) + gm.Expect(err).To(gm.HaveOccurred()) + } + + // prevent the optimizer optimizing the cList and it's contents out, since that would trigger the connection finzalizer + for _, c := range cList { + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + } + }) + + }) + + gg.Context("When Idle Timeout Is Used", func() { + + gg.It("must reuse connections before they become idle", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.IdleTimeout = 1000 * time.Millisecond + // clientPolicy.TendInterval = time.Hour + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + node := client.GetNodes()[0] + + // get a few connections at once + var conns []*as.Connection + for i := 0; i < 4; i++ { + // gg.By(fmt.Sprintf("Retrieving conns i=%d", i)) + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + + conns = append(conns, c) + } + + // return them to the pool + for _, c := range conns { + node.PutConnection(c) + } + + start := time.Now() + estimatedDeadline := start.Add(clientPolicy.IdleTimeout) + deadlineThreshold := clientPolicy.IdleTimeout / 10 + + // make sure the same connections are all retrieved again + checkCount := 0 + for time.Until(estimatedDeadline) > deadlineThreshold { + checkCount++ + // gg.By(fmt.Sprintf("Retrieving conns2 checkCount=%d", checkCount)) + var conns2 []*as.Connection + for i := 0; i < len(conns); i++ { + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + gm.Expect(conns).To(gm.ContainElement(c)) + gm.Expect(conns2).NotTo(gm.ContainElement(c)) + + conns2 = append(conns2, c) + } + + // just put them in the pool + for _, c := range conns2 { + node.PutConnection(c) + } + + time.Sleep(time.Millisecond) + } + + // we should be called lots of times + gm.Expect(checkCount).To(gm.BeNumerically(">", 500)) + + // sleep again until all connections are all idle + <-time.After(2 * clientPolicy.IdleTimeout) + + // get connections again, making sure they are all new + var conns3 []*as.Connection + for i := 0; i < len(conns); i++ { + // gg.By(fmt.Sprintf("Retrieving conns3 i=%d", i)) + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + + gm.Expect(conns).NotTo(gm.ContainElement(c)) + gm.Expect(conns3).NotTo(gm.ContainElement(c)) + + conns3 = append(conns3, c) + } + + // refresh and return them to the pool + for _, c := range conns { + gm.Expect(c.IsConnected()).To(gm.BeFalse()) + } + + // don't forget to close connections + for _, c := range conns3 { + c.Close() + } + }) + + gg.It("must maintain a minimum number of connections per client policy even if idle", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.IdleTimeout = 2000 * time.Millisecond + clientPolicy.MinConnectionsPerNode = 5 + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + client.WarmUp(10) + + node := client.GetNodes()[0] + + gm.Expect(node.ConnsCount()).To(gm.BeNumerically(">=", 10)) + + // sleep again until all connections are all idle + <-time.After(2 * clientPolicy.IdleTimeout) + gm.Expect(node.ConnsCount()).To(gm.Equal(clientPolicy.MinConnectionsPerNode + 1)) // min + 1 reserved for tend + }) + + gg.It("must delay the connection from becoming idle if it is put back in the queue", func() { + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.IdleTimeout = 1000 * time.Millisecond + clientPolicy.User = *user + clientPolicy.Password = *password + + client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer client.Close() + + node := client.GetNodes()[0] + + deadlineThreshold := clientPolicy.IdleTimeout / 10 + + // gg.By("Retrieving c") + c, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c).NotTo(gm.BeNil()) + gm.Expect(c.IsConnected()).To(gm.BeTrue()) + node.PutConnection(c) + + // continuously refresh the connection just before it goes idle + for i := 0; i < 5; i++ { + time.Sleep(clientPolicy.IdleTimeout - deadlineThreshold) + // gg.By(fmt.Sprintf("Retrieving c2 i=%d", i)) + + c2, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c2).NotTo(gm.BeNil()) + gm.Expect(c2).To(gm.Equal(c)) + gm.Expect(c2.IsConnected()).To(gm.BeTrue()) + + node.PutConnection(c2) + } + + // wait about the required time to become idle + <-time.After(2 * clientPolicy.IdleTimeout) + + // we should get a new connection + c3, err := node.GetConnection(0) + gm.Expect(err).NotTo(gm.HaveOccurred()) + gm.Expect(c3).NotTo(gm.BeNil()) + defer node.InvalidateConnection(c3) + gm.Expect(c3).ToNot(gm.Equal(c)) + gm.Expect(c3.IsConnected()).To(gm.BeTrue()) + + // the original connection should be closed + gm.Expect(c.IsConnected()).To(gm.BeFalse()) + }) + + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/node_validator.go b/aerospike-tls/vendor-aerospike-client-go/node_validator.go new file mode 100644 index 00000000..03874211 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/node_validator.go @@ -0,0 +1,316 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "fmt" + "net" + "strconv" + "strings" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type nodesToAddT map[string]*Node + +func (nta nodesToAddT) addNodeIfNotExists(ndv *nodeValidator, cluster *Cluster) bool { + _, exists := nta[ndv.name] + if !exists { + // found a new node + node := cluster.createNode(ndv) + nta[ndv.name] = node + } + return exists +} + +// Validates a Database server node +type nodeValidator struct { + name string + aliases []*Host + primaryHost *Host + + seedOnlyCluster bool + detectLoadBalancer bool + + sessionInfo *sessionInfo + + features int +} + +func (ndv *nodeValidator) seedNodes(cluster *Cluster, host *Host, nodesToAdd nodesToAddT) Error { + if err := ndv.setAliases(host); err != nil { + return err + } + + found := false + var resultErr Error + for _, alias := range ndv.aliases { + if resultErr = ndv.validateAlias(cluster, alias); resultErr != nil { + logger.Logger.Debug("Alias %s failed: %s", alias, resultErr) + continue + } + + found = true + nodesToAdd.addNodeIfNotExists(ndv, cluster) + } + + if !found { + return resultErr + } + return nil +} + +func (ndv *nodeValidator) validateNode(cluster *Cluster, host *Host) Error { + if clusterNodes := cluster.GetNodes(); cluster.clientPolicy.IgnoreOtherSubnetAliases && len(clusterNodes) > 0 { + masterHostname := clusterNodes[0].host.Name + ip, ipnet, err := net.ParseCIDR(masterHostname + "/24") + if err != nil { + logger.Logger.Error(err.Error()) + return newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Failed parsing hostname...") + } + + stop := ip.Mask(ipnet.Mask) + stop[3] += 255 + if bytes.Compare(net.ParseIP(host.Name).To4(), ip.Mask(ipnet.Mask).To4()) >= 0 && bytes.Compare(net.ParseIP(host.Name).To4(), stop.To4()) >= 0 { + return newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Ignored hostname from other subnet...") + } + } + + if err := ndv.setAliases(host); err != nil { + return err + } + + var resultErr Error + for _, alias := range ndv.aliases { + if err := ndv.validateAlias(cluster, alias); err != nil { + resultErr = chainErrors(err, resultErr) + logger.Logger.Debug("Aliases %s failed: %s", alias, err) + continue + } + return nil + } + + return resultErr +} + +func (ndv *nodeValidator) setAliases(host *Host) Error { + ndv.detectLoadBalancer = !ndv.seedOnlyCluster + + // IP addresses do not need a lookup + ip := net.ParseIP(host.Name) + if ip != nil { + // avoid detecting load balancer on localhost + ndv.detectLoadBalancer = ndv.detectLoadBalancer && !ip.IsLoopback() + + aliases := make([]*Host, 1) + aliases[0] = NewHost(host.Name, host.Port) + aliases[0].TLSName = host.TLSName + ndv.aliases = aliases + } else { + addresses, err := net.LookupHost(host.Name) + if err != nil { + logger.Logger.Error("Host lookup failed with error: %s", err.Error()) + return errToAerospikeErr(nil, err) + } + aliases := make([]*Host, len(addresses)) + for idx, addr := range addresses { + aliases[idx] = NewHost(addr, host.Port) + aliases[idx].TLSName = host.TLSName + + // avoid detecting load balancer on localhost + if ip := net.ParseIP(host.Name); ip != nil && ip.IsLoopback() { + ndv.detectLoadBalancer = false + } + } + ndv.aliases = aliases + } + logger.Logger.Debug("Node Validator has %d nodes and they are: %v", len(ndv.aliases), ndv.aliases) + return nil +} + +func (ndv *nodeValidator) validateAlias(cluster *Cluster, alias *Host) Error { + clientPolicy := cluster.clientPolicy + clientPolicy.Timeout /= 2 + + conn, err := NewConnection(&clientPolicy, alias) + if err != nil { + return err + } + defer conn.Close() + + if clientPolicy.RequiresAuthentication() { + // need to authenticate + acmd := newLoginCommand(conn.dataBuffer) + err = acmd.login(&clientPolicy, conn, cluster.Password()) + if err != nil { + return err + } + + ndv.sessionInfo = acmd.sessionInfo() + } + + // check to make sure we have actually connected + info, err := conn.RequestInfo("build") + if err != nil { + return err + } + + if _, exists := info["ERROR:80:not authenticated"]; exists { + return ErrNotAuthenticated.err() + } + + hasClusterName := len(clientPolicy.ClusterName) > 0 + + infoKeys := []string{"node", "partition-generation", "features"} + if hasClusterName { + infoKeys = append(infoKeys, "cluster-name") + } + + addressCommand := clientPolicy.serviceString() + if ndv.detectLoadBalancer && !ndv.seedOnlyCluster { + infoKeys = append(infoKeys, addressCommand) + } + + infoMap, err := conn.RequestInfo(infoKeys...) + if err != nil { + return err + } + + nodeName, exists := infoMap["node"] + if !exists { + return newError(types.INVALID_NODE_ERROR, "Invalid node alias:"+alias.String()) + } + + genStr, exists := infoMap["partition-generation"] + if !exists { + return newError(types.INVALID_NODE_ERROR, "Invalid partition-generation for node:"+alias.String()) + } + + gen, nerr := strconv.Atoi(genStr) + if nerr != nil { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid partition-generation for Node %s (%s), value: %s", nodeName, alias.String(), genStr)) + } + + if gen == -1 { + return newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Node %s (%s) is not yet fully initialized", nodeName, alias.String())) + } + + if hasClusterName { + id := infoMap["cluster-name"] + + if len(id) == 0 || id != clientPolicy.ClusterName { + return newError(types.CLUSTER_NAME_MISMATCH_ERROR, fmt.Sprintf("Node %s (%s) expected cluster name `%s` but received `%s`", nodeName, alias.String(), clientPolicy.ClusterName, id)) + } + } + + // set features + if features, exists := infoMap["features"]; exists { + ndv.setFeatures(features) + } + + // This client requires partition scan support. Partition scans were first + // supported in server version 4.9. Do not allow any server node into the + // cluster that is running server version < 4.9. + if (ndv.features & _SUPPORTS_PARTITION_SCAN) == 0 { + return newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Node %s (%s) is version < 4.9. This client supports server versions >= 4.9", nodeName, alias.String())) + } + + // check if the host is a load-balancer + if peersStr, exists := infoMap[addressCommand]; exists { + var hostAddress []*Host + peerParser := peerListParser{buf: []byte("[" + peersStr + "]")} + if hostAddress, err = peerParser.readHosts(alias.TLSName); err != nil { + logger.Logger.Error("Failed to parse `%s` results... err: %s", alias.String(), err.Error()) + } + + if len(hostAddress) > 0 { + isLoadBalancer := true + LOAD_BALANCER: + for _, h := range hostAddress { + for _, a := range ndv.aliases { + if h.equals(a) { + // one of the aliases were the same as an advertised service + // no need to replace the seed host with the alias + isLoadBalancer = false + break LOAD_BALANCER + } + } + } + + if isLoadBalancer && ndv.detectLoadBalancer { + aliasFound := false + + // take the seed out of the aliases if it is load balancer + logger.Logger.Info("Host `%s` seems to be a load balancer. It is going to be replace by `%v`", alias.String(), hostAddress[0]) + // try to connect to the aliases, and coose the first one that connects + for _, h := range hostAddress { + hconn, err := NewConnection(&clientPolicy, h) + if err != nil { + continue + } + defer hconn.Close() + + if clientPolicy.RequiresAuthentication() { + // need to authenticate + acmd := newLoginCommand(hconn.dataBuffer) + err = acmd.login(&clientPolicy, hconn, cluster.Password()) + if err != nil { + continue + } + + ndv.sessionInfo = acmd.sessionInfo() + } + + alias = h + ndv.aliases = hostAddress + aliasFound = true + + // found one, no need to try the rest + break + } + + // Failed to find a valid address to connect. IP Address is probably internal on the cloud + // because the server access-address is not configured. Log warning and continue + // with original seed. + if !aliasFound { + logger.Logger.Info("Inaccessible address `%s` as cluster seed. access-address is probably not configured on server.", alias.String()) + } + } + } + } + + ndv.name = nodeName + ndv.primaryHost = alias + + return nil +} + +func (ndv *nodeValidator) setFeatures(features string) { + featureList := strings.Split(features, ";") + for i := range featureList { + switch featureList[i] { + case "pscans": + ndv.features |= _SUPPORTS_PARTITION_SCAN + case "query-show": + ndv.features |= _SUPPORTS_QUERY_SHOW + case "batch-any": + ndv.features |= _SUPPORTS_BATCH_ANY + case "pquery": + ndv.features |= _SUPPORTS_PARTITION_QUERY + } + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/operate_args.go b/aerospike-tls/vendor-aerospike-client-go/operate_args.go new file mode 100644 index 00000000..2afe5365 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/operate_args.go @@ -0,0 +1,100 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type operateArgs struct { + writePolicy *WritePolicy + operations []*Operation + partition *Partition + readAttr int + writeAttr int + hasWrite bool +} + +func newOperateArgs( + cluster *Cluster, + policy *WritePolicy, + key *Key, + operations []*Operation, +) (res operateArgs, err Error) { + res = operateArgs{ + operations: operations, + writePolicy: policy, + } + + rattr := 0 + wattr := 0 + write := false + readBin := false + readHeader := false + respondAllOps := false + + for _, operation := range operations { + switch operation.opType { + case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ: + // Map operations require respondAllOps to be true. + respondAllOps = true + // Fall through to read. + fallthrough + case _CDT_READ, _READ: + rattr |= _INFO1_READ + + // Read all bins if no bin is specified. + if len(operation.binName) == 0 { + rattr |= _INFO1_GET_ALL + } + readBin = true + case _READ_HEADER: + rattr |= _INFO1_READ + readHeader = true + case _BIT_MODIFY, _EXP_MODIFY, _HLL_MODIFY, _MAP_MODIFY: + // Map operations require respondAllOps to be true. + respondAllOps = true + // Fall through to write. + fallthrough + default: + wattr = _INFO2_WRITE + write = true + } + + } + res.hasWrite = write + + if readHeader && !readBin { + rattr |= _INFO1_NOBINDATA + } + res.readAttr = rattr + + // When GET_ALL is specified, RESPOND_ALL_OPS must be disabled. + if (respondAllOps || res.writePolicy.RespondPerEachOp) && (rattr&_INFO1_GET_ALL) == 0 { + wattr |= _INFO2_RESPOND_ALL_OPS + } + res.writeAttr = wattr + + if cluster != nil { + if write { + res.partition, err = PartitionForWrite(cluster, &res.writePolicy.BasePolicy, key) + if err != nil { + return operateArgs{}, err + } + } else { + res.partition, err = PartitionForRead(cluster, &res.writePolicy.BasePolicy, key) + if err != nil { + return operateArgs{}, err + } + } + } + return res, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/operate_command.go b/aerospike-tls/vendor-aerospike-client-go/operate_command.go new file mode 100644 index 00000000..d29f9a3b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/operate_command.go @@ -0,0 +1,71 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type operateCommand struct { + readCommand + + policy *WritePolicy + args operateArgs + useOpResults bool +} + +func newOperateCommand(cluster *Cluster, policy *WritePolicy, key *Key, args operateArgs, useOpResults bool) (operateCommand, Error) { + rdCommand, err := newReadCommand(cluster, &policy.BasePolicy, key, nil, args.partition) + if err != nil { + return operateCommand{}, err + } + + return operateCommand{ + readCommand: rdCommand, + policy: policy, + args: args, + useOpResults: useOpResults, + }, nil +} + +func (cmd *operateCommand) writeBuffer(ifc command) (err Error) { + return cmd.setOperate(cmd.policy, cmd.key, &cmd.args) +} + +func (cmd *operateCommand) getNode(ifc command) (*Node, Error) { + if cmd.args.hasWrite { + return cmd.partition.GetNodeWrite(cmd.cluster) + } + + // this may be affected by Rackaware + return cmd.partition.GetNodeRead(cmd.cluster) +} + +func (cmd *operateCommand) prepareRetry(ifc command, isTimeout bool) bool { + if cmd.args.hasWrite { + cmd.partition.PrepareRetryWrite(isTimeout) + } else { + cmd.partition.PrepareRetryRead(isTimeout) + } + return true +} + +func (cmd *operateCommand) isRead() bool { + return !cmd.args.hasWrite +} + +func (cmd *operateCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *operateCommand) transactionType() transactionType { + return ttOperate +} diff --git a/aerospike-tls/vendor-aerospike-client-go/operation.go b/aerospike-tls/vendor-aerospike-client-go/operation.go new file mode 100644 index 00000000..fc0221ed --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/operation.go @@ -0,0 +1,137 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// OperationType determines operation type +type OperationType struct { + op byte + isWrite bool + enumDist byte // make the values like enum to distinguish them from each other +} + +type operationSubType *int + +// Valid OperationType values that can be used to create custom Operations. +// The names are self-explanatory. +var ( + _READ = OperationType{1, false, 0} + _READ_HEADER = OperationType{1, false, 1} + _WRITE = OperationType{2, true, 2} + _CDT_READ = OperationType{3, false, 3} + _CDT_MODIFY = OperationType{4, true, 4} + _MAP_READ = OperationType{3, false, 5} + _MAP_MODIFY = OperationType{4, true, 6} + _ADD = OperationType{5, true, 7} + _EXP_READ = OperationType{7, false, 8} + _EXP_MODIFY = OperationType{8, true, 9} + _APPEND = OperationType{9, true, 10} + _PREPEND = OperationType{10, true, 11} + _TOUCH = OperationType{11, true, 12} + _BIT_READ = OperationType{12, false, 13} + _BIT_MODIFY = OperationType{13, true, 14} + _DELETE = OperationType{14, true, 15} + _HLL_READ = OperationType{15, false, 16} + _HLL_MODIFY = OperationType{16, true, 17} +) + +// Operation contains operation definition. +// This struct is used in client's operate() method. +type Operation struct { + + // OpType determines type of operation. + opType OperationType + // used in CDT commands + opSubType operationSubType + // CDT context for nested types + ctx []*CDTContext + + encoder func(*Operation, BufferEx) (int, Error) + + // binName (Optional) determines the name of bin used in operation. + binName string + + // binValue (Optional) determines bin value used in operation. + binValue Value +} + +// size returns the size of the operation on the wire protocol. +func (op *Operation) size() (int, Error) { + size := len(op.binName) + + // Simple case + if op.encoder == nil { + valueLength, err := op.binValue.EstimateSize() + if err != nil { + return -1, err + } + + size += valueLength + 8 + return size, nil + } + + // Complex case, for CDTs + valueLength, err := op.encoder(op, nil) + if err != nil { + return -1, err + } + + size += valueLength + 8 + return size, nil +} + +// GetBinOp creates read bin database operation. +func GetBinOp(binName string) *Operation { + return &Operation{opType: _READ, binName: binName, binValue: NewNullValue()} +} + +// GetOp creates read all record bins database operation. +func GetOp() *Operation { + return &Operation{opType: _READ, binValue: NewNullValue()} +} + +// GetHeaderOp creates read record header database operation. +func GetHeaderOp() *Operation { + return &Operation{opType: _READ_HEADER, binValue: NewNullValue()} +} + +// PutOp creates set database operation. +func PutOp(bin *Bin) *Operation { + return &Operation{opType: _WRITE, binName: bin.Name, binValue: bin.Value} +} + +// AppendOp creates string append database operation. +func AppendOp(bin *Bin) *Operation { + return &Operation{opType: _APPEND, binName: bin.Name, binValue: bin.Value} +} + +// PrependOp creates string prepend database operation. +func PrependOp(bin *Bin) *Operation { + return &Operation{opType: _PREPEND, binName: bin.Name, binValue: bin.Value} +} + +// AddOp creates integer add database operation. +func AddOp(bin *Bin) *Operation { + return &Operation{opType: _ADD, binName: bin.Name, binValue: bin.Value} +} + +// TouchOp creates touch record database operation. +func TouchOp() *Operation { + return &Operation{opType: _TOUCH, binValue: NewNullValue()} +} + +// DeleteOp creates delete record database operation. +func DeleteOp() *Operation { + return &Operation{opType: _DELETE, binValue: NewNullValue()} +} diff --git a/aerospike-tls/vendor-aerospike-client-go/packer.go b/aerospike-tls/vendor-aerospike-client-go/packer.go new file mode 100644 index 00000000..4f588c01 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/packer.go @@ -0,0 +1,681 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "encoding/binary" + "fmt" + "math" + "reflect" + "time" + + "github.com/aerospike/aerospike-client-go/v7/types" + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +var packObjectReflect func(BufferEx, interface{}, bool) (int, Error) + +func packIfcList(cmd BufferEx, list []interface{}) (int, Error) { + size := 0 + n, err := packArrayBegin(cmd, len(list)) + if err != nil { + return n, err + } + size += n + + for i := range list { + n, err = packObject(cmd, list[i], false) + if err != nil { + return 0, err + } + size += n + } + + return size, err +} + +// PackList packs any slice that implement the ListIter interface +func PackList(cmd BufferEx, list ListIter) (int, Error) { + return packList(cmd, list) +} + +func packList(cmd BufferEx, list ListIter) (int, Error) { + size := 0 + n, err := packArrayBegin(cmd, list.Len()) + if err != nil { + return n, err + } + size += n + + n, nerr := list.PackList(cmd) + if nerr != nil { + return size + n, newErrorAndWrap(nerr, types.SERIALIZE_ERROR) + } + return size + n, nil +} + +func packValueArray(cmd BufferEx, list ValueArray) (int, Error) { + size := 0 + n, err := packArrayBegin(cmd, len(list)) + if err != nil { + return n, err + } + size += n + + for i := range list { + n, err = list[i].pack(cmd) + if err != nil { + return 0, err + } + size += n + } + + return size, err +} + +func packArrayBegin(cmd BufferEx, size int) (int, Error) { + if size < 16 { + return packAByte(cmd, 0x90|byte(size)) + } else if size <= math.MaxUint16 { + return packShort(cmd, 0xdc, int16(size)) + } else { + return packInt(cmd, 0xdd, int32(size)) + } +} + +func packIfcMap(cmd BufferEx, theMap map[interface{}]interface{}) (int, Error) { + size := 0 + n, err := packMapBegin(cmd, len(theMap)) + if err != nil { + return n, err + } + size += n + + for k, v := range theMap { + n, err = packObject(cmd, k, true) + if err != nil { + return 0, err + } + size += n + n, err = packObject(cmd, v, false) + if err != nil { + return 0, err + } + size += n + } + + return size, err +} + +// PackJson packs json data +func PackJson(cmd BufferEx, theMap map[string]interface{}) (int, Error) { + return packJsonMap(cmd, theMap) +} + +func packJsonMap(cmd BufferEx, theMap map[string]interface{}) (int, Error) { + size := 0 + n, err := packMapBegin(cmd, len(theMap)) + if err != nil { + return n, err + } + size += n + + for k, v := range theMap { + n, err = packString(cmd, k) + if err != nil { + return 0, err + } + size += n + n, err = packObject(cmd, v, false) + if err != nil { + return 0, err + } + size += n + } + + return size, err +} + +// PackMap packs any map that implements the MapIter interface +func PackMap(cmd BufferEx, theMap MapIter) (int, Error) { + return packMap(cmd, theMap) +} + +func packMap(cmd BufferEx, theMap MapIter) (int, Error) { + size := 0 + n, err := packMapBegin(cmd, theMap.Len()) + if err != nil { + return n, err + } + size += n + + n, nerr := theMap.PackMap(cmd) + if nerr != nil { + return size + n, newErrorAndWrap(nerr, types.SERIALIZE_ERROR) + } + return size + n, nil +} + +func packMapBegin(cmd BufferEx, size int) (int, Error) { + if size < 16 { + return packAByte(cmd, 0x80|byte(size)) + } else if size <= math.MaxUint16 { + return packShort(cmd, 0xde, int16(size)) + } else { + return packInt(cmd, 0xdf, int32(size)) + } +} + +// PackBytes backs a byte array +func PackBytes(cmd BufferEx, b []byte) (int, Error) { + return packBytes(cmd, b) +} + +func packBytes(cmd BufferEx, b []byte) (int, Error) { + size := 0 + n, err := packByteArrayBegin(cmd, len(b)+1) + if err != nil { + return n, err + } + size += n + + n, err = packAByte(cmd, ParticleType.BLOB) + if err != nil { + return size + n, err + } + size += n + + n, err = packByteArray(cmd, b) + if err != nil { + return size + n, err + } + size += n + + return size, nil +} + +func packByteArrayBegin(cmd BufferEx, length int) (int, Error) { + // Use string header codes for byte arrays. + return packStringBegin(cmd, length) +} + +func packObject(cmd BufferEx, obj interface{}, mapKey bool) (int, Error) { + switch v := obj.(type) { + case Value: + return v.pack(cmd) + case []Value: + return ValueArray(v).pack(cmd) + case string: + return packString(cmd, v) + case []byte: + return packBytes(cmd, obj.([]byte)) + case int8: + return packAInt(cmd, int(v)) + case uint8: + return packAInt(cmd, int(v)) + case int16: + return packAInt(cmd, int(v)) + case uint16: + return packAInt(cmd, int(v)) + case int32: + return packAInt(cmd, int(v)) + case uint32: + return packAInt(cmd, int(v)) + case int: + if Buffer.Arch32Bits { + return packAInt(cmd, v) + } + return packAInt64(cmd, int64(v)) + case uint: + if Buffer.Arch32Bits { + return packAInt(cmd, int(v)) + } + return packAUInt64(cmd, uint64(v)) + case int64: + return packAInt64(cmd, v) + case uint64: + return packAUInt64(cmd, v) + case time.Time: + return packAInt64(cmd, v.UnixNano()) + case nil: + return packNil(cmd) + case bool: + return packBool(cmd, v) + case float32: + return packFloat32(cmd, v) + case float64: + return packFloat64(cmd, v) + case struct{}: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) + } + return packIfcMap(cmd, map[interface{}]interface{}{}) + case []interface{}: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) + } + return packIfcList(cmd, v) + case map[interface{}]interface{}: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) + } + return packIfcMap(cmd, v) + case ListIter: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) + } + return packList(cmd, obj.(ListIter)) + case MapIter: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) + } + return packMap(cmd, obj.(MapIter)) + } + + // try to see if the object is convertible to a concrete value. + // This will be faster and much more memory efficient than reflection. + if v := tryConcreteValue(obj); v != nil { + return v.pack(cmd) + } + + if packObjectReflect != nil { + return packObjectReflect(cmd, obj, mapKey) + } + + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Type `%v (%s)` not supported to pack. ", obj, reflect.TypeOf(obj).String())) +} + +func packAUInt64(cmd BufferEx, val uint64) (int, Error) { + return packUInt64(cmd, val) +} + +func packAInt64(cmd BufferEx, val int64) (int, Error) { + if val >= 0 { + if val < 128 { + return packAByte(cmd, byte(val)) + } + + if val <= math.MaxUint8 { + return packByte(cmd, 0xcc, byte(val)) + } + + if val <= math.MaxUint16 { + return packShort(cmd, 0xcd, int16(val)) + } + + if val <= math.MaxUint32 { + return packInt(cmd, 0xce, int32(val)) + } + return packInt64(cmd, 0xd3, val) + } + + if val >= -32 { + return packAByte(cmd, 0xe0|(byte(val)+32)) + } + + if val >= math.MinInt8 { + return packByte(cmd, 0xd0, byte(val)) + } + + if val >= math.MinInt16 { + return packShort(cmd, 0xd1, int16(val)) + } + + if val >= math.MinInt32 { + return packInt(cmd, 0xd2, int32(val)) + } + return packInt64(cmd, 0xd3, val) +} + +// PackInt64 packs an int64 +func PackInt64(cmd BufferEx, val int64) (int, Error) { + return packAInt64(cmd, val) +} + +func packAInt(cmd BufferEx, val int) (int, Error) { + return packAInt64(cmd, int64(val)) +} + +// PackString packs a string +func PackString(cmd BufferEx, val string) (int, Error) { + return packString(cmd, val) +} + +func packStringBegin(cmd BufferEx, size int) (int, Error) { + if size < 32 { + return packAByte(cmd, 0xa0|byte(size)) + } else if size < 256 { + return packByte(cmd, 0xd9, byte(size)) + } else if size < 65536 { + return packShort(cmd, 0xda, int16(size)) + } + return packInt(cmd, 0xdb, int32(size)) +} + +func packString(cmd BufferEx, val string) (int, Error) { + size := 0 + slen := len(val) + 1 + n, err := packStringBegin(cmd, slen) + if err != nil { + return n, err + } + size += n + + if cmd != nil { + cmd.WriteByte(byte(ParticleType.STRING)) + size++ + + n, err = cmd.WriteString(val) + if err != nil { + return size + n, err + } + size += n + } else { + size += 1 + len(val) + } + + return size, nil +} + +func packRawString(cmd BufferEx, val string) (int, Error) { + size := 0 + slen := len(val) + n, err := packStringBegin(cmd, slen) + if err != nil { + return n, err + } + size += n + + if cmd != nil { + n, err = cmd.WriteString(val) + if err != nil { + return size + n, err + } + size += n + } else { + size += len(val) + } + + return size, nil +} + +func packGeoJson(cmd BufferEx, val string) (int, Error) { + size := 0 + slen := len(val) + 1 + n, err := packByteArrayBegin(cmd, slen) + if err != nil { + return n, err + } + size += n + + if cmd != nil { + cmd.WriteByte(byte(ParticleType.GEOJSON)) + size++ + + n, err = cmd.WriteString(val) + if err != nil { + return size + n, err + } + size += n + } else { + size += 1 + len(val) + } + + return size, nil +} + +func packByteArray(cmd BufferEx, src []byte) (int, Error) { + if cmd != nil { + return cmd.Write(src) + } + return len(src), nil +} + +func packInt64(cmd BufferEx, valType int, val int64) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(valType)) + cmd.WriteInt64(val) + } + return 1 + 8, nil +} + +// PackUInt64 packs a uint64 +func PackUInt64(cmd BufferEx, val uint64) (int, Error) { + return packUInt64(cmd, val) +} + +func packUInt64(cmd BufferEx, val uint64) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(0xcf)) + cmd.WriteInt64(int64(val)) + } + return 1 + 8, nil +} + +func packInt(cmd BufferEx, valType int, val int32) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(valType)) + cmd.WriteInt32(val) + } + return 1 + 4, nil +} + +func packShort(cmd BufferEx, valType int, val int16) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(valType)) + cmd.WriteInt16(val) + } + return 1 + 2, nil +} + +// This method is not compatible with MsgPack specs and is only used by aerospike client<->server +// for wire transfer only +func packShortRaw(cmd BufferEx, val int16) (int, Error) { + if cmd != nil { + cmd.WriteInt16(val) + } + return 2, nil +} + +func packInfinity(cmd BufferEx) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(0xd4)) + cmd.WriteByte(0xff) + cmd.WriteByte(0x01) + } + return 3, nil +} + +func packWildCard(cmd BufferEx) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(0xd4)) + cmd.WriteByte(0xff) + cmd.WriteByte(0x00) + } + return 3, nil +} + +func packByte(cmd BufferEx, valType int, val byte) (int, Error) { + if cmd != nil { + cmd.WriteByte(byte(valType)) + cmd.WriteByte(val) + } + return 1 + 1, nil +} + +// PackNil packs a nil value +func PackNil(cmd BufferEx) (int, Error) { + return packNil(cmd) +} + +func packNil(cmd BufferEx) (int, Error) { + if cmd != nil { + cmd.WriteByte(0xc0) + } + return 1, nil +} + +// PackBool packs a bool value +func PackBool(cmd BufferEx, val bool) (int, Error) { + return packBool(cmd, val) +} + +func packBool(cmd BufferEx, val bool) (int, Error) { + if cmd != nil { + if val { + cmd.WriteByte(0xc3) + } else { + cmd.WriteByte(0xc2) + } + } + return 1, nil +} + +// PackFloat32 packs float32 value +func PackFloat32(cmd BufferEx, val float32) (int, Error) { + return packFloat32(cmd, val) +} + +func packFloat32(cmd BufferEx, val float32) (int, Error) { + if cmd != nil { + cmd.WriteByte(0xca) + cmd.WriteFloat32(val) + } + return 1 + 4, nil +} + +// PackFloat64 packs float64 value +func PackFloat64(cmd BufferEx, val float64) (int, Error) { + return packFloat64(cmd, val) +} + +func packFloat64(cmd BufferEx, val float64) (int, Error) { + if cmd != nil { + cmd.WriteByte(0xcb) + cmd.WriteFloat64(val) + } + return 1 + 8, nil +} + +func packAByte(cmd BufferEx, val byte) (int, Error) { + if cmd != nil { + cmd.WriteByte(val) + } + return 1, nil +} + +/*************************************************************************** + + packer + +***************************************************************************/ + +// packer implements a buffered packer +type packer struct { + bytes.Buffer + tempBuffer [8]byte +} + +func newPacker() *packer { + return &packer{} +} + +// WriteInt64 writes an int64 to the buffer +func (vb *packer) WriteInt64(num int64) int { + return vb.WriteUint64(uint64(num)) +} + +// WriteUint64 writes an uint64 to the buffer +func (vb *packer) WriteUint64(num uint64) int { + binary.BigEndian.PutUint64(vb.tempBuffer[:8], num) + n, _ := vb.Write(vb.tempBuffer[:8]) + return n +} + +// WriteInt32 writes an int32 to the buffer +func (vb *packer) WriteInt32(num int32) int { + return vb.WriteUint32(uint32(num)) +} + +// WriteUint32 writes an uint32 to the buffer +func (vb *packer) WriteUint32(num uint32) int { + binary.BigEndian.PutUint32(vb.tempBuffer[:4], num) + n, _ := vb.Write(vb.tempBuffer[:4]) + return n +} + +// WriteInt16 writes an int16 to the buffer +func (vb *packer) WriteInt16(num int16) int { + return vb.WriteUint16(uint16(num)) +} + +// WriteUint16 writes an uint16 to the buffer +func (vb *packer) WriteUint16(num uint16) int { + binary.BigEndian.PutUint16(vb.tempBuffer[:2], num) + n, _ := vb.Write(vb.tempBuffer[:2]) + return n +} + +// WriteFloat32 writes an float32 to the buffer +func (vb *packer) WriteFloat32(float float32) int { + bits := math.Float32bits(float) + binary.BigEndian.PutUint32(vb.tempBuffer[:4], bits) + n, _ := vb.Write(vb.tempBuffer[:4]) + return n +} + +// WriteFloat64 writes an float64 to the buffer +func (vb *packer) WriteFloat64(float float64) int { + bits := math.Float64bits(float) + binary.BigEndian.PutUint64(vb.tempBuffer[:8], bits) + n, _ := vb.Write(vb.tempBuffer[:8]) + return n +} + +// WriteBool writes a bool to the buffer +func (vb *packer) WriteBool(b bool) int { + if b { + vb.WriteByte(1) + } else { + vb.WriteByte(0) + } + return 1 +} + +// WriteBytes writes a byte to the buffer +func (vb *packer) WriteByte(b byte) { + vb.Write([]byte{b}) +} + +// Write writes a byte slice to the buffer +func (vb *packer) Write(b []byte) (int, Error) { + n, err := vb.Buffer.Write(b) + if err != nil { + return n, newCommonError(err) + } + return n, nil +} + +// WriteString writes a string to the buffer +func (vb *packer) WriteString(s string) (int, Error) { + n, err := vb.Buffer.WriteString(s) + if err != nil { + return n, newCommonError(err) + } + return n, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go b/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go new file mode 100644 index 00000000..5898cad4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go @@ -0,0 +1,77 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +func init() { + packObjectReflect = concretePackObjectReflect +} + +func concretePackObjectReflect(cmd BufferEx, obj interface{}, mapKey bool) (int, Error) { + // check for array and map + rv := reflect.ValueOf(obj) + switch reflect.TypeOf(obj).Kind() { + case reflect.Array, reflect.Slice: + if mapKey && reflect.TypeOf(obj).Kind() == reflect.Slice { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", obj)) + } + // pack bounded array of bytes differently + if reflect.TypeOf(obj).Kind() == reflect.Array && reflect.TypeOf(obj).Elem().Kind() == reflect.Uint8 { + l := rv.Len() + arr := make([]byte, l) + for i := 0; i < l; i++ { + arr[i] = rv.Index(i).Interface().(uint8) + } + return packBytes(cmd, arr) + } + + l := rv.Len() + arr := make([]interface{}, l) + for i := 0; i < l; i++ { + arr[i] = rv.Index(i).Interface() + } + return packIfcList(cmd, arr) + case reflect.Map: + if mapKey { + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", obj)) + } + l := rv.Len() + amap := make(map[interface{}]interface{}, l) + for _, i := range rv.MapKeys() { + amap[i.Interface()] = rv.MapIndex(i).Interface() + } + return packIfcMap(cmd, amap) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return packObject(cmd, rv.Int(), false) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return packObject(cmd, rv.Uint(), false) + case reflect.Bool: + return packObject(cmd, rv.Bool(), false) + case reflect.String: + return packObject(cmd, rv.String(), false) + case reflect.Float32, reflect.Float64: + return packObject(cmd, rv.Float(), false) + } + + return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Type `%#v` not supported to pack.", obj)) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/packing_test.go b/aerospike-tls/vendor-aerospike-client-go/packing_test.go new file mode 100644 index 00000000..fd485d7c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/packing_test.go @@ -0,0 +1,408 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// import ( +// "math" +// "strings" + +// gg "github.com/onsi/ginkgo/v2" +// gm "github.com/onsi/gomega" +// ) + +// func testPackingFor(v interface{}) interface{} { +// packer := newPacker() + +// err := packer.PackObject(v) +// gm.Expect(err).ToNot(gm.HaveOccurred()) + +// unpacker := newUnpacker(packer.buffer.Bytes(), 0, len(packer.buffer.Bytes())) +// unpackedValue, err := unpacker.unpackObject(false) +// gm.Expect(err).ToNot(gm.HaveOccurred()) + +// return unpackedValue +// } + +// var _ = gg.Describe("Packing Test", func() { + +// gg.Context("Simple Value Types", func() { + +// gg.It("should pack and unpack nil values", func() { +// gm.Expect(testPackingFor(nil)).To(gm.BeNil()) +// }) + +// gg.It("should pack and unpack -32 < int8 < 32 values", func() { +// v := int8(31) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) + +// v = int8(-32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack int8 values", func() { +// v := int8(math.MaxInt8) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) + +// v = int8(math.MinInt8) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack uint8 values", func() { +// v := uint8(math.MaxUint8) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack int16 values", func() { +// v := int16(math.MaxInt16) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) + +// v = int16(math.MinInt16) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack uint16 values", func() { +// v := uint16(math.MaxUint16) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack int32 values", func() { +// v := int32(math.MaxInt32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) + +// v = int32(math.MinInt32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack uint32 values", func() { +// v := uint32(math.MaxUint32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack int64 values", func() { +// v := int64(math.MaxInt64) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) + +// v = int64(math.MinInt64) +// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) +// }) + +// gg.It("should pack and unpack uint64 values", func() { +// v := uint64(math.MaxUint64) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack string values", func() { +// v := "string123456789\n" +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack string values of size 32911 for sign bit check", func() { +// v := strings.Repeat("s", 32911) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack boolean: true values", func() { +// v := true +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack boolean: false values", func() { +// v := false +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack float32 values", func() { +// v := float32(math.MaxFloat32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) + +// v = float32(-math.MaxFloat32) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) + +// gg.It("should pack and unpack float64 values", func() { +// v := float64(math.MaxFloat64) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) + +// v = float64(-math.MaxFloat64) +// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) +// }) +// }) + +// gg.Context("Array Value Types", func() { + +// gg.It("should pack and unpack empty array of int8", func() { +// v := []int8{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of int8", func() { +// v := []int8{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of uint8", func() { +// // Note: An array of uint8 ends up as being a ByteArrayValue +// v := []uint8{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]byte{})) +// }) + +// gg.It("should pack and unpack an array of uint8", func() { +// // Note: An array of uint8 ends up as being a ByteArrayValue +// v := []uint8{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]byte{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of int16", func() { +// v := []int16{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of int16", func() { +// v := []int16{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of uint16", func() { +// v := []uint16{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of uint16", func() { +// v := []uint16{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of int32", func() { +// v := []int32{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of int32", func() { +// v := []int32{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of uint32", func() { +// v := []uint32{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of uint32", func() { +// v := []uint32{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of int64", func() { +// v := []int64{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of int64", func() { +// v := []int64{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) +// }) + +// gg.It("should pack and unpack empty array of uint64", func() { +// v := []uint64{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of uint64", func() { +// v := []uint64{1, 2, 3} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{uint64(1), uint64(2), uint64(3)})) +// }) + +// gg.It("should pack and unpack empty array of string", func() { +// v := []string{} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) +// }) + +// gg.It("should pack and unpack an array of string", func() { +// v := []string{"this", "is", "an", "array", "of", "strings", strings.Repeat("s", 32911)} +// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{"this", "is", "an", "array", "of", "strings", strings.Repeat("s", 32911)})) +// }) + +// }) + +// gg.Context("Map Value Types", func() { + +// gg.It("should pack and unpack empty map", func() { +// v := map[interface{}]interface{}{} +// gm.Expect(testPackingFor(v)).To(gm.Equal(map[interface{}]interface{}{})) +// }) + +// gg.It("should pack and unpack a complex map", func() { +// v := map[interface{}]interface{}{ +// "uint8": uint8(math.MaxUint8), +// "int8": int8(math.MaxInt8), +// "mint8": int8(math.MinInt8), +// "uint16": uint16(math.MaxUint16), +// "int16": int16(math.MaxInt16), +// "mint16": int16(math.MinInt16), +// "uint32": uint32(math.MaxUint32), +// "int32": int32(math.MaxInt32), +// "mint32": int32(math.MinInt32), +// "uint": uint64(math.MaxUint64), +// "int": int64(math.MaxInt64), +// "mint": int64(math.MinInt64), +// "uint64": uint64(math.MaxUint64), +// "int64": int64(math.MaxInt64), +// "mint64": int64(math.MinInt64), +// "maxFloat32": float32(math.MaxFloat32), +// "minFloat32": float32(-math.MaxFloat32), +// "maxFloat64": float64(math.MaxFloat64), +// "minFloat64": float64(-math.MaxFloat64), +// "str": "this is a string", +// "strbitsign": strings.Repeat("s", 32911), +// "nil": nil, +// "true": true, +// "false": false, +// } + +// vRes := map[interface{}]interface{}{ +// "uint8": int(math.MaxUint8), +// "int8": int(math.MaxInt8), +// "mint8": int(math.MinInt8), +// "uint16": int(math.MaxUint16), +// "int16": int(math.MaxInt16), +// "mint16": int(math.MinInt16), +// "uint32": int(math.MaxUint32), +// "int32": int(math.MaxInt32), +// "mint32": int(math.MinInt32), +// "uint": uint64(math.MaxUint64), +// "int": int(math.MaxInt64), +// "mint": int(math.MinInt64), +// "uint64": uint64(math.MaxUint64), +// "int64": int(math.MaxInt64), +// "mint64": int(math.MinInt64), +// "maxFloat32": float32(math.MaxFloat32), +// "minFloat32": float32(-math.MaxFloat32), +// "maxFloat64": float64(math.MaxFloat64), +// "minFloat64": float64(-math.MaxFloat64), +// "str": "this is a string", +// "strbitsign": strings.Repeat("s", 32911), +// "nil": nil, +// "true": true, +// "false": false, +// } + +// gm.Expect(testPackingFor(v)).To(gm.Equal(vRes)) +// }) + +// gg.It("should pack and unpack map with varying key types", func() { +// // Test Values +// vUint8 := map[uint8]interface{}{ +// uint8(math.MaxUint8): "v", +// } + +// vInt8 := map[int8]interface{}{ +// int8(math.MaxInt8): "v", +// } + +// vUint16 := map[uint16]interface{}{ +// uint16(math.MaxUint16): "v", +// } + +// vInt16 := map[int16]interface{}{ +// int16(math.MaxInt16): "v", +// } + +// vUint32 := map[uint32]interface{}{ +// uint32(math.MaxUint32): "v", +// } + +// vInt32 := map[int32]interface{}{ +// int32(math.MaxInt32): "v", +// } + +// vUint64 := map[uint64]interface{}{ +// uint64(math.MaxUint64): "v", +// } + +// vInt64 := map[int64]interface{}{ +// int64(math.MaxInt64): "v", +// } + +// vFloat32 := map[float32]interface{}{ +// float32(math.MaxFloat32): "v", +// } + +// vFloat64 := map[float64]interface{}{ +// float64(math.MaxFloat64): "v", +// } + +// vStr := map[string]interface{}{ +// "string key": "v", +// } + +// // gm.Expected Values +// retUint8 := map[interface{}]interface{}{ +// int(math.MaxUint8): "v", +// } + +// retInt8 := map[interface{}]interface{}{ +// int(math.MaxInt8): "v", +// } + +// retUint16 := map[interface{}]interface{}{ +// int(math.MaxUint16): "v", +// } + +// retInt16 := map[interface{}]interface{}{ +// int(math.MaxInt16): "v", +// } + +// retUint32 := map[interface{}]interface{}{ +// int(math.MaxUint32): "v", +// } + +// retInt32 := map[interface{}]interface{}{ +// int(math.MaxInt32): "v", +// } + +// retUint64 := map[interface{}]interface{}{ +// uint64(math.MaxUint64): "v", +// } + +// retInt64 := map[interface{}]interface{}{ +// int(math.MaxInt64): "v", +// } + +// retFloat32 := map[interface{}]interface{}{ +// float32(math.MaxFloat32): "v", +// } + +// retFloat64 := map[interface{}]interface{}{ +// float64(math.MaxFloat64): "v", +// } + +// retStr := map[interface{}]interface{}{ +// "string key": "v", +// } + +// gm.Expect(testPackingFor(vUint8)).To(gm.Equal(retUint8)) +// gm.Expect(testPackingFor(vInt8)).To(gm.Equal(retInt8)) +// gm.Expect(testPackingFor(vUint16)).To(gm.Equal(retUint16)) +// gm.Expect(testPackingFor(vInt16)).To(gm.Equal(retInt16)) +// gm.Expect(testPackingFor(vUint32)).To(gm.Equal(retUint32)) +// gm.Expect(testPackingFor(vInt32)).To(gm.Equal(retInt32)) +// gm.Expect(testPackingFor(vUint64)).To(gm.Equal(retUint64)) +// gm.Expect(testPackingFor(vInt64)).To(gm.Equal(retInt64)) +// gm.Expect(testPackingFor(vFloat32)).To(gm.Equal(retFloat32)) +// gm.Expect(testPackingFor(vFloat64)).To(gm.Equal(retFloat64)) +// gm.Expect(testPackingFor(vStr)).To(gm.Equal(retStr)) +// }) +// }) +// }) diff --git a/aerospike-tls/vendor-aerospike-client-go/partition.go b/aerospike-tls/vendor-aerospike-client-go/partition.go new file mode 100644 index 00000000..38b63633 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partition.go @@ -0,0 +1,329 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Partition encapsulates partition information. +type Partition struct { + // Namespace of the partition + Namespace string + // PartitionId of the partition + PartitionId int + partitions *Partitions + replica ReplicaPolicy + prevNode *Node + sequence int + linearize bool +} + +// NewPartition returns a partition representation +func NewPartition(partitions *Partitions, key *Key, replica ReplicaPolicy, prevNode *Node, linearize bool) *Partition { + return &Partition{ + partitions: partitions, + Namespace: key.Namespace(), + replica: replica, + prevNode: prevNode, + linearize: linearize, + PartitionId: key.PartitionId(), + } +} + +// NewPartitionForReplicaPolicy returns a partition for the stated replica policy +func NewPartitionForReplicaPolicy(namespace string, replica ReplicaPolicy) *Partition { + return &Partition{ + Namespace: namespace, + replica: replica, + linearize: false, + } +} + +// PartitionForWrite returns a partition for write purposes +func PartitionForWrite(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, Error) { + // Must copy hashmap reference for copy on write semantics to work. + pmap := cluster.getPartitions() + partitions := pmap[key.namespace] + + if partitions == nil { + return nil, newInvalidNamespaceError(key.namespace, len(pmap)) + } + + return NewPartition(partitions, key, policy.ReplicaPolicy, nil, false), nil +} + +// PartitionForRead returns a partition for read purposes +func PartitionForRead(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, Error) { + // Must copy hashmap reference for copy on write semantics to work. + pmap := cluster.getPartitions() + partitions := pmap[key.namespace] + + if partitions == nil { + return nil, newInvalidNamespaceError(key.namespace, len(pmap)) + } + + var replica ReplicaPolicy + var linearize bool + + if partitions.SCMode { + switch policy.ReadModeSC { + case ReadModeSCSession: + replica = MASTER + linearize = false + + case ReadModeSCLinearize: + replica = policy.ReplicaPolicy + if policy.ReplicaPolicy == PREFER_RACK { + replica = SEQUENCE + } + linearize = true + + default: + replica = policy.ReplicaPolicy + linearize = false + } + } else { + replica = policy.ReplicaPolicy + linearize = false + } + return NewPartition(partitions, key, replica, nil, linearize), nil +} + +// GetReplicaPolicySC returns a ReplicaPolicy based on different variables in SC mode +func GetReplicaPolicySC(policy *BasePolicy) ReplicaPolicy { + switch policy.ReadModeSC { + case ReadModeSCSession: + return MASTER + + case ReadModeSCLinearize: + if policy.ReplicaPolicy == PREFER_RACK { + return SEQUENCE + } + return policy.ReplicaPolicy + + default: + return policy.ReplicaPolicy + } +} + +// GetNodeBatchRead returns a node for batch reads +func GetNodeBatchRead(cluster *Cluster, key *Key, replica ReplicaPolicy, replicaSC ReplicaPolicy, prevNode *Node, sequence int, sequenceSC int) (*Node, Error) { + // Must copy hashmap reference for copy on write semantics to work. + pmap := cluster.getPartitions() + partitions := pmap[key.namespace] + + if partitions == nil { + return nil, newInvalidNamespaceError(key.namespace, len(pmap)) + } + + if partitions.SCMode { + replica = replicaSC + sequence = sequenceSC + } + + p := NewPartition(partitions, key, replica, prevNode, false) + p.sequence = sequence + return p.GetNodeRead(cluster) +} + +// GetNodeBatchWrite returns a node for batch Writes +func GetNodeBatchWrite(cluster *Cluster, key *Key, replica ReplicaPolicy, prevNode *Node, sequence int) (*Node, Error) { + // Must copy hashmap reference for copy on write semantics to work. + pmap := cluster.getPartitions() + partitions := pmap[key.namespace] + + if partitions == nil { + return nil, newInvalidNamespaceError(key.namespace, len(pmap)) + } + + p := NewPartition(partitions, key, replica, prevNode, false) + p.prevNode = prevNode + p.sequence = sequence + return p.GetNodeWrite(cluster) +} + +// GetNodeRead returns a node for read operations +func (ptn *Partition) GetNodeRead(cluster *Cluster) (*Node, Error) { + switch ptn.replica { + default: + fallthrough + case SEQUENCE: + return ptn.getSequenceNode(cluster) + + case PREFER_RACK: + return ptn.getRackNode(cluster) + + case MASTER: + return ptn.getMasterNode(cluster) + + case MASTER_PROLES: + return ptn.getMasterProlesNode(cluster) + + case RANDOM: + return cluster.GetRandomNode() + } +} + +// GetNodeWrite returns a node for write operations +func (ptn *Partition) GetNodeWrite(cluster *Cluster) (*Node, Error) { + switch ptn.replica { + default: + fallthrough + case SEQUENCE: + fallthrough + case PREFER_RACK: + return ptn.getSequenceNode(cluster) + + case MASTER: + fallthrough + case MASTER_PROLES: + fallthrough + case RANDOM: + return ptn.getMasterNode(cluster) + } +} + +func (ptn *Partition) GetNodeQuery(cluster *Cluster, partitions *Partitions, ps *PartitionStatus) (*Node, Error) { + ptn.partitions = partitions + ptn.PartitionId = ps.Id + ptn.sequence = ps.sequence + ptn.prevNode = ps.node + + node, err := ptn.GetNodeRead(cluster) + if err != nil { + return nil, err + } + + ps.node = node + ps.sequence = ptn.sequence + ps.Retry = false + + return node, nil +} + +// PrepareRetryRead increases sequence number before read retries +func (ptn *Partition) PrepareRetryRead(isClientTimeout bool) { + if !isClientTimeout || !ptn.linearize { + ptn.sequence++ + } +} + +// PrepareRetryWrite increases sequence number before write retries +func (ptn *Partition) PrepareRetryWrite(isClientTimeout bool) { + if !isClientTimeout { + ptn.sequence++ + } +} + +func (ptn *Partition) getSequenceNode(cluster *Cluster) (*Node, Error) { + replicas := ptn.partitions.Replicas + + for range replicas { + index := ptn.sequence % len(replicas) + node := replicas[index][ptn.PartitionId] + + if node != nil && node.IsActive() { + return node, nil + } + ptn.sequence++ + } + nodeArray := cluster.GetNodes() + return nil, newInvalidNodeError(len(nodeArray), ptn) +} + +func (ptn *Partition) getRackNode(cluster *Cluster) (*Node, Error) { + replicas := ptn.partitions.Replicas + + // Try to find a node on the same rack first: + for _, rackId := range cluster.clientPolicy.RackIds { + seq := ptn.sequence + for range replicas { + index := seq % len(replicas) + node := replicas[index][ptn.PartitionId] + + if node != nil && node != ptn.prevNode && node.hasRack(ptn.Namespace, rackId) && node.IsActive() { + ptn.prevNode = node + ptn.sequence = seq + 1 // start from the next node and save a comparison + return node, nil + } + seq++ + } + } + + // A node on the same Rack was not found, so try other options. + // Same node as the previous will be the last option, + // since it is the least desirable. + for range replicas { + index := ptn.sequence % len(replicas) + node := replicas[index][ptn.PartitionId] + + if node != nil && node.IsActive() { + ptn.prevNode = node + return node, nil + } + ptn.sequence++ + } + + nodeArray := cluster.GetNodes() + return nil, newInvalidNodeError(len(nodeArray), ptn) +} + +func (ptn *Partition) getMasterNode(cluster *Cluster) (*Node, Error) { + node := ptn.partitions.Replicas[0][ptn.PartitionId] + + if node != nil && node.IsActive() { + return node, nil + } + nodeArray := cluster.GetNodes() + return nil, newInvalidNodeError(len(nodeArray), ptn) +} + +func (ptn *Partition) getMasterProlesNode(cluster *Cluster) (*Node, Error) { + replicas := ptn.partitions.Replicas + + for range replicas { + index := cluster.replicaIndex.IncrementAndGet() % len(replicas) + node := replicas[index][ptn.PartitionId] + + if node != nil && node.IsActive() { + return node, nil + } + } + nodeArray := cluster.GetNodes() + return nil, newInvalidNodeError(len(nodeArray), ptn) +} + +// String implements the Stringer interface. +func (ptn *Partition) String() string { + return fmt.Sprintf("%s:%d", ptn.Namespace, ptn.PartitionId) +} + +// Equals checks equality of two partitions. +func (ptn *Partition) Equals(other *Partition) bool { + return ptn.PartitionId == other.PartitionId && ptn.Namespace == other.Namespace +} + +// newnewInvalidNamespaceError creates an AerospikeError with Resultcode INVALID_NAMESPACE +// and a corresponding message. +func newInvalidNamespaceError(ns string, mapSize int) Error { + s := "Partition map empty" + if mapSize != 0 { + s = "Namespace not found in partition map: " + ns + } + return newError(types.INVALID_NAMESPACE, s) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_filter.go b/aerospike-tls/vendor-aerospike-client-go/partition_filter.go new file mode 100644 index 00000000..5dd37755 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partition_filter.go @@ -0,0 +1,107 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import ( + "bytes" + "encoding/gob" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// PartitionFilter is used in scan/queries. This filter is also used as a cursor. +// +// If a previous scan/query returned all records specified by a PartitionFilter instance, a +// future scan/query using the same PartitionFilter instance will only return new records added +// after the last record read (in digest order) in each partition in the previous scan/query. +type PartitionFilter struct { + Begin int + Count int + Digest []byte + // Partitions encapsulates the cursor for the progress of the scan/query to be used for pagination. + Partitions []*PartitionStatus + Done bool + Retry bool +} + +// NewPartitionFilterAll creates a partition filter that +// reads all the partitions. +func NewPartitionFilterAll() *PartitionFilter { + return newPartitionFilter(0, _PARTITIONS) +} + +// NewPartitionFilterById creates a partition filter by partition id. +// Partition id is between 0 - 4095 +func NewPartitionFilterById(partitionId int) *PartitionFilter { + return newPartitionFilter(partitionId, 1) +} + +// NewPartitionFilterByRange creates a partition filter by partition range. +// begin partition id is between 0 - 4095 +// count is the number of partitions, in the range of 1 - 4096 inclusive. +func NewPartitionFilterByRange(begin, count int) *PartitionFilter { + return newPartitionFilter(begin, count) +} + +// NewPartitionFilterByKey returns records after the key's digest in the partition containing the digest. +// Records in all other partitions are not included. The digest is used to determine +// order and this is not the same as userKey order. +// +// This method only works for scan or query with nil filter (primary index query). +// This method does not work for a secondary index query because the digest alone +// is not sufficient to determine a cursor in a secondary index query. +func NewPartitionFilterByKey(key *Key) *PartitionFilter { + return &PartitionFilter{Begin: key.PartitionId(), Count: 1, Digest: key.Digest()} +} + +func newPartitionFilter(begin, count int) *PartitionFilter { + return &PartitionFilter{Begin: begin, Count: count} +} + +// IsDone returns - if using ScanPolicy.MaxRecords or QueryPolicy,MaxRecords - +// if the previous paginated scans with this partition filter instance return all records? +// This method is not synchronized and is not meant to be called while the Scan/Query is +// ongoing. It should be called after all the records are received from the recordset. +func (pf *PartitionFilter) IsDone() bool { + return pf.Done +} + +// EncodeCursor encodes and returns the cursor for the partition filter. +// This cursor can be persisted and reused later for pagination via PartitionFilter.DecodeCursor. +func (pf *PartitionFilter) EncodeCursor() ([]byte, Error) { + var buf bytes.Buffer + enc := gob.NewEncoder(&buf) + err := enc.Encode(pf.Partitions) + if err != nil { + return nil, newError(types.PARAMETER_ERROR, err.Error()) + } + + return buf.Bytes(), nil +} + +// Decodes and sets the cursor for the partition filter using the output of PartitionFilter.EncodeCursor. +func (pf *PartitionFilter) DecodeCursor(b []byte) Error { + buf := bytes.NewBuffer(b) + dec := gob.NewDecoder(buf) + + var parts []*PartitionStatus + if err := dec.Decode(&parts); err != nil { + return newError(types.PARSE_ERROR, err.Error()) + } + + pf.Partitions = parts + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_parser.go b/aerospike-tls/vendor-aerospike-client-go/partition_parser.go new file mode 100644 index 00000000..7d769ffc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partition_parser.go @@ -0,0 +1,279 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +import ( + "encoding/base64" + "fmt" + "strconv" + "sync" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const ( + _PartitionGeneration = "partition-generation" + _Replicas = "replicas" +) + +var partitionMapLock sync.Mutex + +// Parse node's master (and optionally prole) partitions. +type partitionParser struct { + pmap partitionMap + buffer []byte + partitionCount int + generation int + length int + offset int + + regimeError bool +} + +func newPartitionParser(node *Node, partitions partitionMap, partitionCount int) (*partitionParser, Error) { + newPartitionParser := &partitionParser{ + partitionCount: partitionCount, + } + + // Send format 1: partition-generation\nreplicas\n + // Send format 2: partition-generation\nreplicas-all\n + command := _Replicas + + info, err := node.requestRawInfo(&node.cluster.infoPolicy, _PartitionGeneration, command) + if err != nil { + return nil, err + } + + newPartitionParser.buffer = info.msg.Data + newPartitionParser.length = len(info.msg.Data) + if newPartitionParser.length == 0 { + return nil, newError(types.PARSE_ERROR, "Partition info is empty") + } + + newPartitionParser.generation, err = newPartitionParser.parseGeneration() + if err != nil { + return nil, err + } + + newPartitionParser.pmap = partitions + + partitionMapLock.Lock() + defer partitionMapLock.Unlock() + + err = newPartitionParser.parseReplicasAll(node, command) + if err != nil { + return nil, err + } + + return newPartitionParser, nil +} + +func (pp *partitionParser) getGeneration() int { + return pp.generation +} + +func (pp *partitionParser) parseGeneration() (int, Error) { + if err := pp.expectName(_PartitionGeneration); err != nil { + return -1, err + } + + begin := pp.offset + for pp.offset < pp.length { + if pp.buffer[pp.offset] == '\n' { + s := string(pp.buffer[begin:pp.offset]) + pp.offset++ + v, err := strconv.Atoi(s) + if err != nil { + return -1, newError(types.PARSE_ERROR, "Failed to find partition-generation value") + } + return v, nil + } + pp.offset++ + } + return -1, newError(types.PARSE_ERROR, "Failed to find partition-generation value") +} + +func (pp *partitionParser) parseReplicasAll(node *Node, command string) Error { + // Use low-level info methods and parse byte array directly for maximum performance. + // Receive format: replicas-all\t + // :[regime],,,...; + // :[regime],,,...;\n + if err := pp.expectName(command); err != nil { + return err + } + + begin := pp.offset + regime := 0 + + for pp.offset < pp.length { + if pp.buffer[pp.offset] == ':' { + // Parse namespace. + namespace := string(pp.buffer[begin:pp.offset]) + + if len(namespace) <= 0 || len(namespace) >= 32 { + response := pp.getTruncatedResponse() + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid partition namespace `%s` response: `%s`", namespace, response)) + } + pp.offset++ + begin = pp.offset + + // Parse regime. + if command == _Replicas { + for pp.offset < pp.length { + b := pp.buffer[pp.offset] + + if b == ',' { + break + } + pp.offset++ + } + + var err error + regime, err = strconv.Atoi(string(pp.buffer[begin:pp.offset])) + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to parse regime value") + } + + pp.offset++ + begin = pp.offset + } + + // Parse replica count. + for pp.offset < pp.length { + b := pp.buffer[pp.offset] + + if b == ',' { + break + } + pp.offset++ + } + + replicaCount, err := strconv.Atoi(string(pp.buffer[begin:pp.offset])) + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to find replica count value") + } + + partitions := pp.pmap[namespace] + if partitions == nil { + // Create new replica array. + partitions = newPartitions(pp.partitionCount, replicaCount, regime != 0) + pp.pmap[namespace] = partitions + } else if len(partitions.Replicas) != replicaCount { + // Ensure replicaArray is correct size. + logger.Logger.Info("Namespace `%s` replication factor changed from `%d` to `%d` ", namespace, len(partitions.Replicas), replicaCount) + + partitions.setReplicaCount(replicaCount) //= clonePartitions(partitions, replicaCount) + pp.pmap[namespace] = partitions + } + + // Parse partition bitmaps. + for i := 0; i < replicaCount; i++ { + pp.offset++ + begin = pp.offset + + // Find bitmap endpoint + for pp.offset < pp.length { + b := pp.buffer[pp.offset] + + if b == ',' || b == ';' { + break + } + pp.offset++ + } + + if pp.offset == begin { + response := pp.getTruncatedResponse() + return newError(types.PARSE_ERROR, fmt.Sprintf("Empty partition id for namespace `%s` response: `%s`", namespace, response)) + } + + if err := pp.decodeBitmap(node, partitions, i, regime, begin); err != nil { + return err + } + } + pp.offset++ + begin = pp.offset + } else { + pp.offset++ + } + } + + return nil +} + +func (pp *partitionParser) decodeBitmap(node *Node, partitions *Partitions, replica int, regime int, begin int) Error { + restoreBuffer, err := base64.StdEncoding.DecodeString(string(pp.buffer[begin:pp.offset])) + if err != nil { + return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to decode partition bitmap value") + } + + for partition := 0; partition < pp.partitionCount; partition++ { + nodeOld := partitions.Replicas[replica][partition] + + if (restoreBuffer[partition>>3] & (0x80 >> uint(partition&7))) != 0 { + // Node owns this partition. + regimeOld := partitions.regimes[partition] + + if regime == 0 || regime >= regimeOld { + if regime > regimeOld { + partitions.regimes[partition] = regime + } + + if nodeOld != nil && nodeOld != node { + // Force previously mapped node to refresh it's partition map on next cluster tend. + nodeOld.partitionGeneration.Set(-1) + } + + partitions.Replicas[replica][partition] = node + } else { + if !pp.regimeError { + logger.Logger.Info("%s regime(%d) < old regime(%d)", node.String(), regime, regimeOld) + pp.regimeError = true + } + } + } + } + + return nil +} + +func (pp *partitionParser) expectName(name string) Error { + begin := pp.offset + + for pp.offset < pp.length { + if pp.buffer[pp.offset] == '\t' { + s := string(pp.buffer[begin:pp.offset]) + if name == s { + pp.offset++ + return nil + } + break + } + pp.offset++ + } + + return newError(types.PARSE_ERROR, fmt.Sprintf("Failed to find `%s`", name)) +} + +func (pp *partitionParser) getTruncatedResponse() string { + max := pp.length + if max > 200 { + max = 200 + } + return string(pp.buffer[0:max]) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_status.go b/aerospike-tls/vendor-aerospike-client-go/partition_status.go new file mode 100644 index 00000000..7f541aa8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partition_status.go @@ -0,0 +1,49 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import ( + "fmt" +) + +// PartitionStatus encapsulates the pagination status in partitions. +type PartitionStatus struct { + // BVal + BVal int64 + // Id shows the partition Id. + Id int + // Retry signifies if the partition requires a retry. + Retry bool + // Digest records the digest of the last key digest received from the server + // for this partition. + Digest []byte + + // the following fields are transient + node *Node + sequence int +} + +func newPartitionStatus(id int) *PartitionStatus { + return &PartitionStatus{Id: id, Retry: true} +} + +func (ps *PartitionStatus) String() string { + r := 'F' + if ps.Retry { + r = 'T' + } + return fmt.Sprintf("%04d:%c", ps.Id, r) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go b/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go new file mode 100644 index 00000000..8e6f80c4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go @@ -0,0 +1,498 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import ( + "fmt" + "strings" + "time" + + atmc "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type partitionTracker struct { + partitions []*PartitionStatus + partitionsCapacity int + partitionBegin int + nodeCapacity int + nodeFilter *Node + partitionFilter *PartitionFilter + replica ReplicaPolicy + nodePartitionsList []*nodePartitions + recordCount *atmc.Int + maxRecords int64 + sleepBetweenRetries time.Duration + socketTimeout time.Duration + totalTimeout time.Duration + iteration int //= 1 + deadline time.Time +} + +func newPartitionTrackerForNodes(policy *MultiPolicy, nodes []*Node) *partitionTracker { + // Create initial partition capacity for each node as average + 25%. + ppn := _PARTITIONS / len(nodes) + ppn += ppn / 4 + + pt := partitionTracker{ + partitionBegin: 0, + nodeCapacity: len(nodes), + nodeFilter: nil, + replica: policy.ReplicaPolicy, + partitionsCapacity: ppn, + maxRecords: policy.MaxRecords, + iteration: 1, + } + + pt.partitions = pt.initPartitions(policy, _PARTITIONS, nil) + pt.init(policy) + return &pt +} + +func newPartitionTrackerForNode(policy *MultiPolicy, nodeFilter *Node) *partitionTracker { + pt := partitionTracker{ + partitionBegin: 0, + nodeCapacity: 1, + nodeFilter: nodeFilter, + replica: policy.ReplicaPolicy, + partitionsCapacity: _PARTITIONS, + maxRecords: policy.MaxRecords, + iteration: 1, + } + + pt.partitions = pt.initPartitions(policy, _PARTITIONS, nil) + pt.init(policy) + return &pt +} + +func newPartitionTracker(policy *MultiPolicy, filter *PartitionFilter, nodes []*Node) *partitionTracker { + // Validate here instead of initial PartitionFilter constructor because total number of + // cluster partitions may change on the server and PartitionFilter will never have access + // to Cluster instance. Use fixed number of partitions for now. + if !(filter.Begin >= 0 && filter.Begin < _PARTITIONS) { + panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition begin %d . Valid range: 0-%d", filter.Begin, + (_PARTITIONS-1)))) + } + + if filter.Count <= 0 { + panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition count %d", filter.Count))) + } + + if filter.Begin+filter.Count > _PARTITIONS { + panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition range (%d,%d)", filter.Begin, filter.Begin+filter.Count))) + } + + // This is required for proxy server since there are no nodes represented there + nodeCapacity := len(nodes) + if nodeCapacity <= 0 { + nodeCapacity = 1 + } + + pt := &partitionTracker{ + partitionBegin: filter.Begin, + nodeCapacity: nodeCapacity, + nodeFilter: nil, + replica: policy.ReplicaPolicy, + partitionsCapacity: filter.Count, + maxRecords: policy.MaxRecords, + iteration: 1, + } + + if len(filter.Partitions) == 0 { + filter.Partitions = pt.initPartitions(policy, filter.Count, filter.Digest) + filter.Retry = true + } else { + // Retry all partitions when maxRecords not specified. + if policy.MaxRecords <= 0 { + filter.Retry = true + } + + // Reset replica sequence and last node used. + for _, part := range filter.Partitions { + part.sequence = 0 + part.node = nil + } + } + + pt.partitions = filter.Partitions + pt.partitionFilter = filter + pt.init(policy) + return pt +} + +func (pt *partitionTracker) init(policy *MultiPolicy) { + pt.sleepBetweenRetries = policy.SleepBetweenRetries + pt.socketTimeout = policy.SocketTimeout + pt.totalTimeout = policy.TotalTimeout + + if pt.totalTimeout > 0 { + pt.deadline = time.Now().Add(pt.totalTimeout) + if pt.socketTimeout == 0 || pt.socketTimeout > pt.totalTimeout { + pt.socketTimeout = pt.totalTimeout + } + } + + if pt.replica == RANDOM { + panic(newError(types.PARAMETER_ERROR, "Invalid replica: RANDOM")) + } +} + +func (pt *partitionTracker) initPartitions(policy *MultiPolicy, partitionCount int, digest []byte) []*PartitionStatus { + partsAll := make([]*PartitionStatus, partitionCount) + + for i := 0; i < partitionCount; i++ { + partsAll[i] = newPartitionStatus(pt.partitionBegin + i) + } + + if digest != nil { + partsAll[0].Digest = digest + } + + return partsAll +} + +func (pt *partitionTracker) SetSleepBetweenRetries(sleepBetweenRetries time.Duration) { + pt.sleepBetweenRetries = sleepBetweenRetries +} + +func (pt *partitionTracker) assignPartitionsToNodes(cluster *Cluster, namespace string) ([]*nodePartitions, Error) { + list := make([]*nodePartitions, 0, pt.nodeCapacity) + + pMap := cluster.getPartitions() + parts := pMap[namespace] + + if parts == nil { + return nil, newError(types.INVALID_NAMESPACE, fmt.Sprintf("Invalid Partition Map for namespace `%s` in Partition Scan", namespace)) + } + + p := NewPartitionForReplicaPolicy(namespace, pt.replica) + retry := (pt.partitionFilter == nil || pt.partitionFilter.Retry) && (pt.iteration == 1) + + for _, part := range pt.partitions { + if retry || part.Retry { + node, err := p.GetNodeQuery(cluster, parts, part) + if err != nil { + return nil, err + } + + // Use node name to check for single node equality because + // partition map may be in transitional state between + // the old and new node with the same name. + if pt.nodeFilter != nil && pt.nodeFilter.GetName() != node.GetName() { + continue + } + + np := pt.findNode(list, node) + + if np == nil { + // If the partition map is in a transitional state, multiple + // nodePartitions instances (each with different partitions) + // may be created for a single node. + np = newNodePartitions(node, pt.partitionsCapacity) + list = append(list, np) + } + np.addPartition(part) + } + } + + nodeSize := len(list) + if nodeSize <= 0 { + return nil, newError(types.INVALID_NODE_ERROR, "No nodes were assigned") + } + + // Set global retry to true because scan/query may terminate early and all partitions + // will need to be retried if the PartitionFilter instance is reused in a new scan/query. + // Global retry will be set to false if the scan/query completes normally and maxRecords + // is specified. + if pt.partitionFilter != nil { + pt.partitionFilter.Retry = true + } + + pt.recordCount = nil + + if pt.maxRecords > 0 { + if pt.maxRecords >= int64(nodeSize) { + // Distribute maxRecords across nodes. + max := pt.maxRecords / int64(nodeSize) + rem := pt.maxRecords - (max * int64(nodeSize)) + + for i, np := range list { + if int64(i) < rem { + np.recordMax = max + 1 + } else { + np.recordMax = max + } + } + } else { + // If maxRecords < nodeSize, the retry = true, ensure each node receives at least one max record + // allocation and filter out excess records when receiving records from the server. + for _, np := range list { + np.recordMax = 1 + } + + // Track records returned for this iteration. + pt.recordCount = atmc.NewInt(0) + } + } + + pt.nodePartitionsList = list + return list, nil +} + +func (pt *partitionTracker) findNode(list []*nodePartitions, node *Node) *nodePartitions { + for _, nodePartition := range list { + // Use pointer equality for performance. + if nodePartition.node == node { + return nodePartition + } + } + return nil +} + +func (pt *partitionTracker) partitionUnavailable(nodePartitions *nodePartitions, partitionId int) { + ps := pt.partitions[partitionId-pt.partitionBegin] + ps.Retry = true + ps.sequence++ + nodePartitions.partsUnavailable++ +} + +func (pt *partitionTracker) setDigest(nodePartitions *nodePartitions, key *Key) { + partitionId := key.PartitionId() + pt.partitions[partitionId-pt.partitionBegin].Digest = key.Digest() + + // nodePartitions is nil in Proxy client + if nodePartitions != nil { + nodePartitions.recordCount++ + } +} + +func (pt *partitionTracker) setLast(nodePartitions *nodePartitions, key *Key, bval *int64) { + partitionId := key.PartitionId() + if partitionId-pt.partitionBegin < 0 { + panic(fmt.Sprintf("Partition mismatch: key.partitionId: %d, partitionBegin: %d", partitionId, pt.partitionBegin)) + } + ps := pt.partitions[partitionId-pt.partitionBegin] + ps.Digest = key.digest[:] + if bval != nil { + ps.BVal = *bval + } + + // nodePartitions is nil in Proxy client + if nodePartitions != nil { + nodePartitions.recordCount++ + } +} + +func (pt *partitionTracker) allowRecord(np *nodePartitions) bool { + if pt.recordCount == nil || int64(pt.recordCount.AddAndGet(1)) <= pt.maxRecords { + return true + } + + // Record was returned, but would exceed maxRecords. + // Discard record and increment disallowedCount. + np.disallowedCount++ + return false +} + +func (pt *partitionTracker) isClusterComplete(cluster *Cluster, policy *BasePolicy) (bool, Error) { + return pt.isComplete(cluster.supportsPartitionQuery.Get(), policy, pt.nodePartitionsList) +} + +func (pt *partitionTracker) isComplete(hasPartitionQuery bool, policy *BasePolicy, nodePartitionsList []*nodePartitions) (bool, Error) { + recordCount := int64(0) + partsUnavailable := 0 + + for _, np := range nodePartitionsList { + recordCount += np.recordCount + partsUnavailable += np.partsUnavailable + } + + if partsUnavailable == 0 { + if pt.maxRecords <= 0 { + if pt.partitionFilter != nil { + pt.partitionFilter.Retry = false + pt.partitionFilter.Done = true + } + } else if pt.iteration > 1 { + if pt.partitionFilter != nil { + // If errors occurred on a node, only that node's partitions are retried in the + // next iteration. If that node finally succeeds, the other original nodes still + // need to be retried if partition state is reused in the next scan/query command. + // Force retry on all node partitions. + pt.partitionFilter.Retry = true + pt.partitionFilter.Done = false + } + } else { + // Cluster will be nil for the Proxy client + if hasPartitionQuery { + // Server version >= 6.0 will return all records for each node up to + // that node's max. If node's record count reached max, there still + // may be records available for that node. + done := true + + for _, np := range nodePartitionsList { + if np.recordCount+np.disallowedCount >= np.recordMax { + pt.markRetry(np) + done = false + } + } + + if pt.partitionFilter != nil { + pt.partitionFilter.Retry = false + pt.partitionFilter.Done = done + } + } else { + // Servers version < 6.0 can return less records than max and still + // have more records for each node, so the node is only done if no + // records were retrieved for that node. + for _, np := range nodePartitionsList { + if np.recordCount+np.disallowedCount > 0 { + pt.markRetry(np) + } + } + + if pt.partitionFilter != nil { + pt.partitionFilter.Retry = false + pt.partitionFilter.Done = (recordCount == 0) + } + } + } + return true, nil + } + + if pt.maxRecords > 0 && recordCount >= pt.maxRecords { + return true, nil + } + + // Check if limits have been reached. + if pt.iteration > policy.MaxRetries { + return false, newError(types.MAX_RETRIES_EXCEEDED, fmt.Sprintf("Max retries exceeded: %d", policy.MaxRetries)) + } + + if policy.TotalTimeout > 0 { + // Check for total timeout. + remaining := time.Until(pt.deadline) - pt.sleepBetweenRetries + + if remaining <= 0 { + return false, ErrTimeout.err() + } + + if remaining < pt.totalTimeout { + pt.totalTimeout = remaining + + if pt.socketTimeout > pt.totalTimeout { + pt.socketTimeout = pt.totalTimeout + } + } + } + + // Prepare for next iteration. + if pt.maxRecords > 0 { + pt.maxRecords -= recordCount + } + + pt.iteration++ + return false, nil +} + +func (pt *partitionTracker) shouldRetry(nodePartitions *nodePartitions, e Error) bool { + res := e.Matches( + types.TIMEOUT, + types.NETWORK_ERROR, + types.SERVER_NOT_AVAILABLE, + types.INDEX_NOTFOUND, + types.INDEX_NOTREADABLE, + ) + if res { + pt.markRetrySequence(nodePartitions) + nodePartitions.partsUnavailable = len(nodePartitions.partsFull) + len(nodePartitions.partsPartial) + } + return res +} + +func (pt *partitionTracker) markRetrySequence(nodePartitions *nodePartitions) { + // Mark retry for next replica. + for _, ps := range nodePartitions.partsFull { + ps.Retry = true + ps.sequence++ + } + + for _, ps := range nodePartitions.partsPartial { + ps.Retry = true + ps.sequence++ + } +} + +func (pt *partitionTracker) markRetry(nodePartitions *nodePartitions) { + // Mark retry for same replica. + for _, ps := range nodePartitions.partsFull { + ps.Retry = true + } + + for _, ps := range nodePartitions.partsPartial { + ps.Retry = true + } +} + +func (pt *partitionTracker) partitionError() { + // Mark all partitions for retry on fatal errors. + if pt.partitionFilter != nil { + pt.partitionFilter.Retry = true + } +} + +func (pt *partitionTracker) String() string { + var sb strings.Builder + for i, ps := range pt.partitions { + sb.WriteString(ps.String()) + if (i+1)%16 == 0 { + sb.WriteString("\n") + } else { + sb.WriteString("\t") + } + } + return sb.String() +} + +type nodePartitions struct { + node *Node + partsFull []*PartitionStatus + partsPartial []*PartitionStatus + recordCount int64 + recordMax int64 + disallowedCount int64 + partsUnavailable int +} + +func newNodePartitions(node *Node, capacity int) *nodePartitions { + return &nodePartitions{ + node: node, + partsFull: make([]*PartitionStatus, 0, capacity), + partsPartial: make([]*PartitionStatus, 0, capacity), + } +} + +func (np *nodePartitions) String() string { + return fmt.Sprintf("Node %s: full: %d, partial: %d", np.node.String(), len(np.partsFull), len(np.partsPartial)) +} + +func (np *nodePartitions) addPartition(part *PartitionStatus) { + if part.Digest == nil { + np.partsFull = append(np.partsFull, part) + } else { + np.partsPartial = append(np.partsPartial, part) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/partitions.go b/aerospike-tls/vendor-aerospike-client-go/partitions.go new file mode 100644 index 00000000..18d8b3f5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/partitions.go @@ -0,0 +1,188 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "bytes" + "fmt" + "strconv" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Partitions represents a list of partitions +type Partitions struct { + Replicas [][]*Node + SCMode bool + regimes []int +} + +func newPartitions(partitionCount int, replicaCount int, cpMode bool) *Partitions { + replicas := make([][]*Node, replicaCount) + for i := range replicas { + replicas[i] = make([]*Node, partitionCount) + } + + return &Partitions{ + Replicas: replicas, + SCMode: cpMode, + regimes: make([]int, partitionCount), + } +} + +func (p *Partitions) setReplicaCount(replicaCount int) { + if len(p.Replicas) < replicaCount { + i := len(p.Replicas) + + // Extend the size + for ; i < replicaCount; i++ { + p.Replicas = append(p.Replicas, make([]*Node, _PARTITIONS)) + } + } else { + // Reduce the size + p.Replicas = p.Replicas[:replicaCount] + } +} + +// Copy partition map while reserving space for a new replica count. +func (p *Partitions) clone() *Partitions { + replicas := make([][]*Node, len(p.Replicas)) + + for i := range p.Replicas { + r := make([]*Node, len(p.Replicas[i])) + copy(r, p.Replicas[i]) + replicas[i] = r + } + + regimes := make([]int, len(p.regimes)) + copy(regimes, p.regimes) + + return &Partitions{ + Replicas: replicas, + SCMode: p.SCMode, + regimes: regimes, + } +} + +/* + + partitionMap + +*/ + +type partitionMap map[string]*Partitions + +// cleanup removes all the references stored in the lists +// to help the GC identify the unused pointers. +func (pm partitionMap) cleanup() { + for ns, partitions := range pm { + for i := range partitions.Replicas { + for j := range partitions.Replicas[i] { + partitions.Replicas[i][j] = nil + } + partitions.Replicas[i] = nil + } + + partitions.Replicas = nil + partitions.regimes = nil + + delete(pm, ns) + } +} + +// String implements stringer interface for partitionMap +func (pm partitionMap) clone() partitionMap { + // Make deep copy of map. + pmap := make(partitionMap, len(pm)) + for ns := range pm { + pmap[ns] = pm[ns].clone() + } + return pmap +} + +// String implements stringer interface for partitionMap +func (pm partitionMap) String() string { + res := bytes.Buffer{} + for ns, partitions := range pm { + res.WriteString("-----------------------------------------------------------------------\n") + res.WriteString("Namespace: " + ns + "\n") + res.WriteString(fmt.Sprintf("Regimes: %v\n", partitions.regimes)) + res.WriteString(fmt.Sprintf("SCMode: %v\n", partitions.SCMode)) + replicaArray := partitions.Replicas + for i, nodeArray := range replicaArray { + if i == 0 { + res.WriteString("\nMASTER:") + } else { + res.WriteString(fmt.Sprintf("\nReplica %d: ", i)) + } + for partitionID, node := range nodeArray { + res.WriteString(strconv.Itoa(partitionID) + "/") + if node != nil { + res.WriteString(node.host.String()) + res.WriteString(", ") + } else { + res.WriteString("nil, ") + } + } + res.WriteString("\n") + } + } + res.WriteString("\n") + return res.String() +} + +// naively validates the partition map +func (pm partitionMap) validate() Error { + masterNodePartitionNotDefined := map[string][]int{} + replicaNodePartitionNotDefined := map[string][]int{} + var errs Error + + for nsName, partition := range pm { + if len(partition.regimes) != _PARTITIONS { + errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Wrong number of regimes for namespace `%s`. Must be %d, but found %d.", nsName, _PARTITIONS, len(partition.regimes))), errs) + } + + for replica, partitionNodes := range partition.Replicas { + if len(partitionNodes) != _PARTITIONS { + errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Wrong number of partitions for namespace `%s`, replica `%d`. Must be %d, but found %d.", nsName, replica, _PARTITIONS, len(partitionNodes))), errs) + } + + for pIndex, node := range partitionNodes { + if node == nil { + if replica == 0 { + masterNodePartitionNotDefined[nsName] = append(masterNodePartitionNotDefined[nsName], pIndex) + } else { + replicaNodePartitionNotDefined[nsName] = append(replicaNodePartitionNotDefined[nsName], pIndex) + } + } + } + } + } + + if errs != nil || len(masterNodePartitionNotDefined) > 0 || len(replicaNodePartitionNotDefined) > 0 { + for nsName, partitionList := range masterNodePartitionNotDefined { + errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Master partition nodes not defined for namespace `%s`: %d out of %d", nsName, len(partitionList), _PARTITIONS)), errs) + } + + for nsName, partitionList := range replicaNodePartitionNotDefined { + errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Replica partition nodes not defined for namespace `%s`: %d", nsName, len(partitionList))), errs) + } + + errs = chainErrors(ErrInvalidPartitionMap.err(), errs) + return errs + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/peers.go b/aerospike-tls/vendor-aerospike-client-go/peers.go new file mode 100644 index 00000000..1dfae9bd --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/peers.go @@ -0,0 +1,98 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "sync" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" +) + +type peers struct { + _peers map[string]*peer + _hosts map[Host]struct{} + _nodes map[string]*Node + refreshCount atomic.Int + genChanged atomic.Bool + + mutex sync.RWMutex +} + +func newPeers(peerCapacity int, addCapacity int) *peers { + return &peers{ + _peers: make(map[string]*peer, peerCapacity), + _hosts: make(map[Host]struct{}, addCapacity), + _nodes: make(map[string]*Node, addCapacity), + genChanged: *atomic.NewBool(true), + } +} + +func (ps *peers) hostExists(host Host) bool { + ps.mutex.RLock() + defer ps.mutex.RUnlock() + _, exists := ps._hosts[host] + return exists +} + +func (ps *peers) addHost(host Host) { + ps.mutex.Lock() + defer ps.mutex.Unlock() + ps._hosts[host] = struct{}{} +} + +func (ps *peers) addNode(name string, node *Node) { + ps.mutex.Lock() + defer ps.mutex.Unlock() + ps._nodes[name] = node +} + +func (ps *peers) nodeByName(name string) *Node { + ps.mutex.RLock() + defer ps.mutex.RUnlock() + return ps._nodes[name] +} + +func (ps *peers) appendPeers(peers []*peer) { + ps.mutex.Lock() + defer ps.mutex.Unlock() + + for _, peer := range peers { + ps._peers[peer.nodeName] = peer + } + +} + +func (ps *peers) peers() []*peer { + ps.mutex.RLock() + defer ps.mutex.RUnlock() + + res := make([]*peer, 0, len(ps._peers)) + for _, peer := range ps._peers { + res = append(res, peer) + } + return res +} + +func (ps *peers) nodes() map[string]*Node { + ps.mutex.RLock() + defer ps.mutex.RUnlock() + return ps._nodes +} + +type peer struct { + nodeName string + tlsName string + hosts []*Host +} diff --git a/aerospike-tls/vendor-aerospike-client-go/peers_parser.go b/aerospike-tls/vendor-aerospike-client-go/peers_parser.go new file mode 100644 index 00000000..2ef89c5d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/peers_parser.go @@ -0,0 +1,322 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + // "github.com/aerospike/aerospike-client-go/v7/logger" + + "io" + "strconv" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +var aeroerr = newError(types.PARSE_ERROR, "Error parsing peers list.") + +func parsePeers(cluster *Cluster, node *Node) (*peerListParser, Error) { + cmd := cluster.clientPolicy.peersString() + + info, err := node.RequestInfo(&cluster.infoPolicy, cmd) + if err != nil { + return nil, err + } + + peersStr, exists := info[cmd] + if !exists { + return nil, newError(types.PARSE_ERROR, "Info Command response was empty.") + } + + p := peerListParser{buf: []byte(peersStr)} + if err := p.Parse(); err != nil { + return nil, err + } + + return &p, nil +} + +type peerListParser struct { + buf []byte + pos int + + defPort *int64 + gen *int64 + peers []*peer +} + +func (p *peerListParser) generation() int64 { + if p.gen != nil { + return *p.gen + } + return 0 +} + +func (p *peerListParser) Expect(ch byte) bool { + if p.pos == len(p.buf) { + return false + } + + if p.buf[p.pos] == ch { + p.pos++ + return true + } + return false +} + +func (p *peerListParser) readByte() *byte { + if p.pos == len(p.buf) { + return nil + } + + ch := p.buf[p.pos] + p.pos++ + return &ch +} + +func (p *peerListParser) PeekByte() *byte { + if p.pos == len(p.buf) { + return nil + } + + ch := p.buf[p.pos] + return &ch +} + +func (p *peerListParser) readInt64() (*int64, Error) { + if p.pos == len(p.buf) { + return nil, newErrorAndWrap(io.EOF, types.PARSE_ERROR, "Error Parsing the peers list") + } + + if p.buf[p.pos] == ',' { + return nil, nil + } + + begin := p.pos + for p.pos < len(p.buf) { + ch := p.buf[p.pos] + if ch == ',' { + break + } + p.pos++ + } + + num, err := strconv.ParseInt(string(p.buf[begin:p.pos]), 10, 64) + if err != nil { + return nil, newErrorAndWrap(err, types.PARSE_ERROR, "Error Parsing the peers list") + } + return &num, nil +} + +func (p *peerListParser) readString() (string, Error) { + if p.pos == len(p.buf) { + return "", newErrorAndWrap(io.EOF, types.PARSE_ERROR, "Error Parsing the peers list") + } + + if p.buf[p.pos] == ',' { + return "", nil + } + + begin := p.pos + bracket := p.buf[p.pos] == '[' + for p.pos < len(p.buf) { + ch := p.buf[p.pos] + if ch == ',' { + break + } + + if ch == ']' { + if !bracket { + break + } + bracket = false + } + p.pos++ + } + + return string(p.buf[begin:p.pos]), nil +} + +func (p *peerListParser) ParseHost(host string) (*Host, Error) { + ppos := -1 + bpos := -1 + for i := 0; i < len(host); i++ { + switch host[i] { + case ':': + ppos = i + case ']': + ppos = -1 + bpos = i + } + } + + port := 0 + if p.defPort != nil { + port = int(*p.defPort) + } + var err error + if ppos >= 0 { + portStr := host[ppos+1:] + port, err = strconv.Atoi(portStr) + if err != nil { + return nil, newErrorAndWrap(err, types.PARSE_ERROR, "Error Parsing the peers list") + } + } + + var addr string + if bpos >= 0 { + addr = host[1:bpos] + } else { + if ppos >= 0 { + addr = host[:ppos] + } else { + addr = host + } + } + + return NewHost(addr, port), nil +} + +func (p *peerListParser) readHosts(tlsName string) ([]*Host, Error) { + if !p.Expect('[') { + return nil, aeroerr + } + + hostList := []*Host{} + for { + hostStr, err := p.readString() + if err != nil { + return nil, err + } + + if hostStr == "" { + break + } + + host, err := p.ParseHost(hostStr) + if err != nil { + return nil, aeroerr + } + + host.TLSName = tlsName + hostList = append(hostList, host) + + if !p.Expect(',') { + break + } + } + + if !p.Expect(']') { + return nil, aeroerr + } + + return hostList, nil +} + +func (p *peerListParser) readPeer() (*peer, Error) { + if !p.Expect('[') { + return nil, nil + } + + nodeName, err := p.readString() + if err != nil { + return nil, err + } + + if !p.Expect(',') { + return nil, aeroerr + } + tlsName, err := p.readString() + if err != nil { + return nil, err + } + + if !p.Expect(',') { + return nil, aeroerr + } + + hostList, err := p.readHosts(tlsName) + if err != nil { + return nil, err + } + + if !p.Expect(']') { + return nil, aeroerr + } + + nodeData := &peer{nodeName: nodeName, tlsName: tlsName, hosts: hostList} + return nodeData, nil +} + +func (p *peerListParser) readNodeList() ([]*peer, Error) { + ch := p.readByte() + if ch == nil { + return nil, nil + } + + if *ch != '[' { + return nil, aeroerr + } + + nodeList := []*peer{} + for { + node, err := p.readPeer() + if err != nil { + return nil, err + } + + if node == nil { + break + } + + nodeList = append(nodeList, node) + + if !p.Expect(',') { + break + } + } + + if !p.Expect(']') { + return nil, aeroerr + } + + return nodeList, nil +} + +func (p *peerListParser) Parse() Error { + var err Error + p.gen, err = p.readInt64() + if err != nil { + return err + } + + if !p.Expect(',') { + return aeroerr + } + + p.defPort, err = p.readInt64() + if err != nil { + return err + } + + if !p.Expect(',') { + return aeroerr + } + + p.peers, err = p.readNodeList() + if err != nil { + return err + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore new file mode 100644 index 00000000..c1e1c062 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore @@ -0,0 +1,5 @@ +6.out +*.6 +_obj +_test +_testmain.go diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE new file mode 100644 index 00000000..555bb71c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE @@ -0,0 +1,29 @@ +Copyright (c) 2011 James Keane . All rights reserved. +Copyright (c) 2006 Damien Miller . +Copyright (c) 2011 ZooWar.com, All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of weekendlogic nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README new file mode 100644 index 00000000..a4d638ab --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README @@ -0,0 +1,46 @@ +Installation: + goinstall github.com/jameskeane/bcrypt + +Example use: + package main + + import ( + "fmt" + "github.com/jameskeane/bcrypt" + ) + + var password = "WyWihatdyd?frub1" + var bad_password = "just a wild guess" + + func main() { + // generate a random salt with default rounds of complexity + salt, _ := bcrypt.Salt() + + // generate a random salt with 10 rounds of complexity + salt, _ = bcrypt.Salt(10) + + // hash and verify a password with random salt + hash, _ := bcrypt.Hash(password) + if bcrypt.Match(password, hash) { + fmt.Println("They match") + } + + // hash and verify a password with a static salt + hash, _ = bcrypt.Hash(password, salt) + if bcrypt.Match(password, hash) { + fmt.Println("They match") + } + + // verify a random password fails to match the hashed password + if !bcrypt.Match(bad_password, hash) { + fmt.Println("They don't match") + } + } + +Todo: + grep 'TODO' * -r + +Notes: + * This library is derived from jBcrypt by Damien Miller + * bcrypt_test.go is from ZooWar.com + diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go new file mode 100644 index 00000000..f544ecd3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go @@ -0,0 +1,190 @@ +package bcrypt + +import ( + "bytes" + "crypto/rand" + "crypto/subtle" + "encoding/base64" + "errors" + "strconv" + "strings" +) + +var ( + InvalidRounds = errors.New("bcrypt: Invalid rounds parameter") + InvalidSalt = errors.New("bcrypt: Invalid salt supplied") +) + +const ( + MaxRounds = 31 + MinRounds = 4 + DefaultRounds = 12 + SaltLen = 16 + BlowfishRounds = 16 +) + +var enc = base64.NewEncoding("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") + +// Helper function to build the bcrypt hash string +// payload takes : +// - []byte -> which it base64 encodes it (trims padding "=") and writes it to the buffer +// - string -> which it writes straight to the buffer +func build_bcrypt_str(minor byte, rounds uint, payload ...interface{}) []byte { + rs := bytes.NewBuffer(make([]byte, 0, 61)) + rs.WriteString("$2") + if minor >= 'a' { + rs.WriteByte(minor) + } + + rs.WriteByte('$') + if rounds < 10 { + rs.WriteByte('0') + } + + rs.WriteString(strconv.FormatUint(uint64(rounds), 10)) + rs.WriteByte('$') + for _, p := range payload { + if pb, ok := p.([]byte); ok { + rs.WriteString(strings.TrimRight(enc.EncodeToString(pb), "=")) + } else if ps, ok := p.(string); ok { + rs.WriteString(ps) + } + } + return rs.Bytes() +} + +// Salt generation +func Salt(rounds ...int) (string, error) { + rb, err := SaltBytes(rounds...) + return string(rb), err +} + +func SaltBytes(rounds ...int) (salt []byte, err error) { + r := DefaultRounds + if len(rounds) > 0 { + r = rounds[0] + if r < MinRounds || r > MaxRounds { + return nil, InvalidRounds + } + } + + rnd := make([]byte, SaltLen) + read, err := rand.Read(rnd) + if read != SaltLen || err != nil { + return nil, err + } + + return build_bcrypt_str('a', uint(r), rnd), nil +} + +func consume(r *bytes.Buffer, b byte) bool { + got, err := r.ReadByte() + if err != nil { + return false + } + if got != b { + r.UnreadByte() + return false + } + + return true +} + +func Hash(password string, salt ...string) (ps string, err error) { + var s []byte + var pb []byte + + if len(salt) == 0 { + s, err = SaltBytes() + if err != nil { + return + } + } else if len(salt) > 0 { + s = []byte(salt[0]) + } + + pb, err = HashBytes([]byte(password), s) + return string(pb), err +} + +func HashBytes(password []byte, salt ...[]byte) (hash []byte, err error) { + var s []byte + + if len(salt) == 0 { + s, err = SaltBytes() + if err != nil { + return + } + } else if len(salt) > 0 { + s = salt[0] + } + + // TODO: use a regex? I hear go has bad regex performance a simple FSM seems faster + // "^\\$2([a-z]?)\\$([0-3][0-9])\\$([\\./A-Za-z0-9]{22}+)" + + // Ok, extract the required information + minor := byte(0) + sr := bytes.NewBuffer(s) + + if !consume(sr, '$') || !consume(sr, '2') { + return nil, InvalidSalt + } + + if !consume(sr, '$') { + minor, _ = sr.ReadByte() + if minor != 'a' || !consume(sr, '$') { + return nil, InvalidSalt + } + } + + rounds_bytes := make([]byte, 2) + read, err := sr.Read(rounds_bytes) + if err != nil || read != 2 { + return nil, InvalidSalt + } + + if !consume(sr, '$') { + return nil, InvalidSalt + } + + var rounds64 uint64 + rounds64, err = strconv.ParseUint(string(rounds_bytes), 10, 0) + if err != nil { + return nil, InvalidSalt + } + + rounds := uint(rounds64) + + // TODO: can't we use base64.NewDecoder(enc, sr) ? + salt_bytes := make([]byte, 22) + read, err = sr.Read(salt_bytes) + if err != nil || read != 22 { + return nil, InvalidSalt + } + + var saltb []byte + // encoding/base64 expects 4 byte blocks padded, since bcrypt uses only 22 bytes we need to go up + saltb, err = enc.DecodeString(string(salt_bytes) + "==") + if err != nil { + return nil, err + } + + // cipher expects null terminated input (go initializes everything with zero values so this works) + password_term := make([]byte, len(password)+1) + copy(password_term, password) + + hashed := crypt_raw(password_term, saltb[:SaltLen], rounds) + return build_bcrypt_str(minor, rounds, string(salt_bytes), hashed[:len(bf_crypt_ciphertext)*4-1]), nil +} + +func Match(password, hash string) bool { + return MatchBytes([]byte(password), []byte(hash)) +} + +func MatchBytes(password []byte, hash []byte) bool { + h, err := HashBytes(password, hash) + if err != nil { + return false + } + return subtle.ConstantTimeCompare(h, hash) == 1 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go new file mode 100644 index 00000000..aff6d9df --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go @@ -0,0 +1,415 @@ +package bcrypt + +var p_orig = [18]uint{ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, + 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, + 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b, +} + +var s_orig = [1024]uint{ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, +} + +var bf_crypt_ciphertext = [6]uint{ + 0x4f727068, 0x65616e42, 0x65686f6c, + 0x64657253, 0x63727944, 0x6f756274, +} + +type cipher struct { + P [18]uint + S [1024]uint + data [6]uint +} + +func (c *cipher) encipher(lr []uint, off int) { + l := lr[off] ^ c.P[0] + r := lr[off+1] + + for i := 0; i <= BlowfishRounds-2; i += 2 { + // Feistel substitution on left and right word respectively + r ^= (((c.S[(l>>24)&0xff] + c.S[0x100|((l>>16)&0xff)]) ^ c.S[0x200|((l>>8)&0xff)]) + c.S[0x300|(l&0xff)]) ^ c.P[i+1] + l ^= (((c.S[(r>>24)&0xff] + c.S[0x100|((r>>16)&0xff)]) ^ c.S[0x200|((r>>8)&0xff)]) + c.S[0x300|(r&0xff)]) ^ c.P[i+2] + } + + lr[off] = r ^ c.P[BlowfishRounds+1] + lr[off+1] = l +} + +/** + * Cycically extract a word of key material + * @param data the string to extract the data from + * @param off the current offset into the data + * @return the next word of material from data and the next offset into the data + */ +func streamtoword(data []byte, off int) (uint, int) { + var word uint + for i := 0; i < 4; i++ { + word = (word << 8) | uint(data[off]&0xff) + off = (off + 1) % len(data) + } + + return word, off +} + +/** + * Key the Blowfish cipher + * @param key an array containing the key + */ +func (c *cipher) key(key []byte) { + var word uint + off := 0 + lr := []uint{0, 0} + plen := len(c.P) + slen := len(c.S) + + for i := 0; i < plen; i++ { + word, off = streamtoword(key, off) + c.P[i] = c.P[i] ^ word + } + + for i := 0; i < plen; i += 2 { + c.encipher(lr, 0) + c.P[i] = lr[0] + c.P[i+1] = lr[1] + } + + for i := 0; i < slen; i += 2 { + c.encipher(lr, 0) + c.S[i] = lr[0] + c.S[i+1] = lr[1] + } +} + +/** + * Perform the "enhanced key schedule" step described by + * Provos and Mazieres in "A Future-Adaptable Password Scheme" + * http://www.openbsd.org/papers/bcrypt-paper.ps + * @param data salt information + * @param key password information + */ +func (c *cipher) ekskey(data []byte, key []byte) { + var word uint + koff := 0 + doff := 0 + lr := []uint{0, 0} + plen := len(c.P) + slen := len(c.S) + + for i := 0; i < plen; i++ { + word, koff = streamtoword(key, koff) + c.P[i] = c.P[i] ^ word + } + + for i := 0; i < plen; i += 2 { + word, doff = streamtoword(data, doff) + lr[0] ^= word + word, doff = streamtoword(data, doff) + lr[1] ^= word + c.encipher(lr, 0) + c.P[i] = lr[0] + c.P[i+1] = lr[1] + } + + for i := 0; i < slen; i += 2 { + word, doff = streamtoword(data, doff) + lr[0] ^= word + word, doff = streamtoword(data, doff) + lr[1] ^= word + c.encipher(lr, 0) + c.S[i] = lr[0] + c.S[i+1] = lr[1] + } +} + +/** + * Perform the central password hashing step in the + * bcrypt scheme + * @param password the password to hash + * @param salt the binary salt to hash with the password + * @param log_rounds the binary logarithm of the number + * of rounds of hashing to apply + * @return an array containing the binary hashed password + */ +func crypt_raw(password []byte, salt []byte, log_rounds uint) []byte { + c := &cipher{P: p_orig, S: s_orig, data: bf_crypt_ciphertext} + + rounds := 1 << log_rounds + c.ekskey(salt, password) + for i := 0; i < rounds; i++ { + c.key(password) + c.key(salt) + } + + for i := 0; i < 64; i++ { + for j := 0; j < (6 >> 1); j++ { + c.encipher(c.data[:], j<<1) + } + } + + ret := make([]byte, 24) + for i := 0; i < 6; i++ { + k := i << 2 + ret[k] = (byte)((c.data[i] >> 24) & 0xff) + ret[k+1] = (byte)((c.data[i] >> 16) & 0xff) + ret[k+2] = (byte)((c.data[i] >> 8) & 0xff) + ret[k+3] = (byte)(c.data[i] & 0xff) + } + return ret +} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go new file mode 100644 index 00000000..ccb09c62 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go @@ -0,0 +1,121 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package ripemd160 implements the RIPEMD-160 hash algorithm. +package ripemd160 + +import "hash" + +// RIPEMD-160 is designed by by Hans Dobbertin, Antoon Bosselaers, and Bart +// Preneel with specifications available at: +// http://homes.esat.kuleuven.be/~cosicart/pdf/AB-9601/AB-9601.pdf. + +// func init() { +// crypto.RegisterHash(crypto.RIPEMD160, New) +// } + +// The size of the checksum in bytes. +const Size = 20 + +// The block size of the hash algorithm in bytes. +const BlockSize = 64 + +const ( + _s0 = 0x67452301 + _s1 = 0xefcdab89 + _s2 = 0x98badcfe + _s3 = 0x10325476 + _s4 = 0xc3d2e1f0 +) + +// Digest represents the partial evaluation of a checksum. +type Digest struct { + s [5]uint32 // running context + x [BlockSize]byte // temporary buffer + nx int // index into x + tc uint64 // total count of bytes processed +} + +func (d *Digest) Reset() { + d.s[0], d.s[1], d.s[2], d.s[3], d.s[4] = _s0, _s1, _s2, _s3, _s4 + d.nx = 0 + d.tc = 0 +} + +// New returns a new hash.Hash computing the checksum. +func New() hash.Hash { + result := Digest{} + result.Reset() + return &result +} + +func (d *Digest) Size() int { return Size } + +func (d *Digest) BlockSize() int { return BlockSize } + +func (d *Digest) Write(p []byte) (nn int, err error) { + nn = len(p) + d.tc += uint64(nn) + if d.nx > 0 { + n := len(p) + if n > BlockSize-d.nx { + n = BlockSize - d.nx + } + for i := 0; i < n; i++ { + d.x[d.nx+i] = p[i] + } + d.nx += n + if d.nx == BlockSize { + _Block(d, d.x[0:]) + d.nx = 0 + } + p = p[n:] + } + n := _Block(d, p) + p = p[n:] + if len(p) > 0 { + d.nx = copy(d.x[:], p) + } + return +} + +func (d *Digest) Sum(res []byte) []byte { + // Make a copy of d0 so that caller can keep writing and summing. + // d := *d0 + + // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. + tc := d.tc + var tmp [64]byte + tmp[0] = 0x80 + if tc%64 < 56 { + d.Write(tmp[0 : 56-tc%64]) + } else { + d.Write(tmp[0 : 64+56-tc%64]) + } + + // Length in bits. + tc <<= 3 + for i := uint(0); i < 8; i++ { + tmp[i] = byte(tc >> (8 * i)) + } + d.Write(tmp[0:8]) + + if d.nx != 0 { + panic("d.nx != 0") + } + + var Digest [Size]byte + for i, s := range d.s { + Digest[i*4] = byte(s) + Digest[i*4+1] = byte(s >> 8) + Digest[i*4+2] = byte(s >> 16) + Digest[i*4+3] = byte(s >> 24) + } + + if res != nil { + copy(res, Digest[:]) + return nil + } + return append(res, Digest[:]...) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go new file mode 100644 index 00000000..42d27762 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go @@ -0,0 +1,64 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ripemd160 + +// Test vectors are from: +// http://homes.esat.kuleuven.be/~bosselae/ripemd160.html + +import ( + "fmt" + "io" + "testing" +) + +type mdTest struct { + out string + in string +} + +var vectors = [...]mdTest{ + {"9c1185a5c5e9fc54612808977ee8f548b2258d31", ""}, + {"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", "a"}, + {"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", "abc"}, + {"5d0689ef49d2fae572b881b123a85ffa21595f36", "message digest"}, + {"f71c27109c692c1b56bbdceb5b9d2865b3708dbc", "abcdefghijklmnopqrstuvwxyz"}, + {"12a053384a9c0c88e405a06c27dcf49ada62eb2b", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}, + {"b0e20b6e3116640286ed3a87a5713079b21f5189", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"}, + {"9b752e45573d4b39f4dbd3323cab82bf63326bfb", "12345678901234567890123456789012345678901234567890123456789012345678901234567890"}, +} + +func TestVectors(t *testing.T) { + for i := 0; i < len(vectors); i++ { + tv := vectors[i] + md := New() + for j := 0; j < 3; j++ { + if j < 2 { + io.WriteString(md, tv.in) + } else { + io.WriteString(md, tv.in[0:len(tv.in)/2]) + // md.Sum(nil) // removed due to our changes in the code; we use only one Sum() and then reset + io.WriteString(md, tv.in[len(tv.in)/2:]) + } + s := fmt.Sprintf("%x", md.Sum(nil)) + if s != tv.out { + t.Fatalf("RIPEMD-160[%d](%s) = %s, expected %s", j, tv.in, s, tv.out) + } + md.Reset() + } + } +} + +func TestMillionA(t *testing.T) { + md := New() + for i := 0; i < 100000; i++ { + io.WriteString(md, "aaaaaaaaaa") + } + out := "52783243c1697bdbe16d37f97f68f08325dc1528" + s := fmt.Sprintf("%x", md.Sum(nil)) + if s != out { + t.Fatalf("RIPEMD-160 (1 million 'a') = %s, expected %s", s, out) + } + md.Reset() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go new file mode 100644 index 00000000..bb7fe7d2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go @@ -0,0 +1,161 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// RIPEMD-160 block step. +// In its own file so that a faster assembly or C version +// can be substituted easily. + +package ripemd160 + +// work buffer indices and roll amounts for one line +var _n = [80]uint{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, +} + +var _r = [80]uint{ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, +} + +// same for the other parallel one +var n_ = [80]uint{ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, +} + +var r_ = [80]uint{ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11, +} + +func _Block(md *Digest, p []byte) int { + n := 0 + var x [16]uint32 + var alpha, beta uint32 + for len(p) >= BlockSize { + a, b, c, d, e := md.s[0], md.s[1], md.s[2], md.s[3], md.s[4] + aa, bb, cc, dd, ee := a, b, c, d, e + j := 0 + for i := 0; i < 16; i++ { + x[i] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24 + j += 4 + } + + // round 1 + i := 0 + for i < 16 { + alpha = a + (b ^ c ^ d) + x[_n[i]] + s := _r[i] + alpha = (alpha<>(32-s)) + e + beta = c<<10 | c>>22 + a, b, c, d, e = e, alpha, b, beta, d + + // parallel line + alpha = aa + (bb ^ (cc | ^dd)) + x[n_[i]] + 0x50a28be6 + s = r_[i] + alpha = (alpha<>(32-s)) + ee + beta = cc<<10 | cc>>22 + aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd + + i++ + } + + // round 2 + for i < 32 { + alpha = a + (b&c | ^b&d) + x[_n[i]] + 0x5a827999 + s := _r[i] + alpha = (alpha<>(32-s)) + e + beta = c<<10 | c>>22 + a, b, c, d, e = e, alpha, b, beta, d + + // parallel line + alpha = aa + (bb&dd | cc&^dd) + x[n_[i]] + 0x5c4dd124 + s = r_[i] + alpha = (alpha<>(32-s)) + ee + beta = cc<<10 | cc>>22 + aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd + + i++ + } + + // round 3 + for i < 48 { + alpha = a + (b | ^c ^ d) + x[_n[i]] + 0x6ed9eba1 + s := _r[i] + alpha = (alpha<>(32-s)) + e + beta = c<<10 | c>>22 + a, b, c, d, e = e, alpha, b, beta, d + + // parallel line + alpha = aa + (bb | ^cc ^ dd) + x[n_[i]] + 0x6d703ef3 + s = r_[i] + alpha = (alpha<>(32-s)) + ee + beta = cc<<10 | cc>>22 + aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd + + i++ + } + + // round 4 + for i < 64 { + alpha = a + (b&d | c&^d) + x[_n[i]] + 0x8f1bbcdc + s := _r[i] + alpha = (alpha<>(32-s)) + e + beta = c<<10 | c>>22 + a, b, c, d, e = e, alpha, b, beta, d + + // parallel line + alpha = aa + (bb&cc | ^bb&dd) + x[n_[i]] + 0x7a6d76e9 + s = r_[i] + alpha = (alpha<>(32-s)) + ee + beta = cc<<10 | cc>>22 + aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd + + i++ + } + + // round 5 + for i < 80 { + alpha = a + (b ^ (c | ^d)) + x[_n[i]] + 0xa953fd4e + s := _r[i] + alpha = (alpha<>(32-s)) + e + beta = c<<10 | c>>22 + a, b, c, d, e = e, alpha, b, beta, d + + // parallel line + alpha = aa + (bb ^ cc ^ dd) + x[n_[i]] + s = r_[i] + alpha = (alpha<>(32-s)) + ee + beta = cc<<10 | cc>>22 + aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd + + i++ + } + + // combine results + dd += c + md.s[1] + md.s[1] = md.s[2] + d + ee + md.s[2] = md.s[3] + e + aa + md.s[3] = md.s[4] + a + bb + md.s[4] = md.s[0] + b + cc + md.s[0] = dd + + p = p[BlockSize:] + n += BlockSize + } + return n +} diff --git a/aerospike-tls/vendor-aerospike-client-go/policy.go b/aerospike-tls/vendor-aerospike-client-go/policy.go new file mode 100644 index 00000000..cbfd4ff4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/policy.go @@ -0,0 +1,241 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +// Policy Interface +type Policy interface { + // Retrieves BasePolicy + GetBasePolicy() *BasePolicy + + // determines if the command should be compressed + compress() bool +} + +// enforce the interface +var _ Policy = &BasePolicy{} + +// BasePolicy encapsulates parameters for transaction policy attributes +// used in all database operation calls. +type BasePolicy struct { + // FilterExpression is the optional Filter Expression. Supported on Server v5.2+ + FilterExpression *Expression + + // ReadModeAP indicates read policy for AP (availability) namespaces. + ReadModeAP ReadModeAP //= ONE + + // ReadModeSC indicates read policy for SC (strong consistency) namespaces. + ReadModeSC ReadModeSC //= SESSION; + + // TotalTimeout specifies total transaction timeout. + // + // The TotalTimeout is tracked on the client and also sent to the server along + // with the transaction in the wire protocol. The client will most likely + // timeout first, but the server has the capability to Timeout the transaction. + // + // If TotalTimeout is not zero and TotalTimeout is reached before the transaction + // completes, the transaction will abort with TotalTimeout error. + // + // If TotalTimeout is zero, there will be no time limit and the transaction will retry + // on network timeouts/errors until MaxRetries is exceeded. If MaxRetries is exceeded, the + // transaction also aborts with Timeout error. + // + // Default for scan/query: 0 (no time limit and rely on MaxRetries) + // + // Default for all other commands: 1000ms + TotalTimeout time.Duration + + // SocketTimeout determines network timeout for each attempt. + // + // If SocketTimeout is not zero and SocketTimeout is reached before an attempt completes, + // the Timeout above is checked. If Timeout is not exceeded, the transaction + // is retried. If both SocketTimeout and Timeout are non-zero, SocketTimeout must be less + // than or equal to Timeout, otherwise Timeout will also be used for SocketTimeout. + // + // Default: 30s + SocketTimeout time.Duration + + // MaxRetries determines the maximum number of retries before aborting the current transaction. + // The initial attempt is not counted as a retry. + // + // If MaxRetries is exceeded, the transaction will abort with an error. + // + // WARNING: Database writes that are not idempotent (such as AddOp) + // should not be retried because the write operation may be performed + // multiple times if the client timed out previous transaction attempts. + // It's important to use a distinct WritePolicy for non-idempotent + // writes which sets maxRetries = 0; + // + // Default for read: 2 (initial attempt + 2 retries = 3 attempts) + // + // Default for write: 0 (no retries) + // + // Default for partition scan or query with nil filter: 5 + // (6 attempts. See ScanPolicy comments.) + MaxRetries int //= 2; + + // ReadTouchTTLPercent determines how record TTL (time to live) is affected on reads. When enabled, the server can + // efficiently operate as a read-based LRU cache where the least recently used records are expired. + // The value is expressed as a percentage of the TTL sent on the most recent write such that a read + // within this interval of the record’s end of life will generate a touch. + // + // For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to + // 80, the next read within 8 hours of the record's end of life (equivalent to 2 hours after the most + // recent write) will result in a touch, resetting the TTL to another 10 hours. + // + // Values: + // + // 0 : Use server config default-read-touch-ttl-pct for the record's namespace/set. + // -1 : Do not reset record TTL on reads. + // 1 - 100 : Reset record TTL on reads when within this percentage of the most recent write TTL. + // Default: 0 + ReadTouchTTLPercent int32 + + // SleepBetweenRtries determines the duration to sleep between retries. Enter zero to skip sleep. + // This field is ignored when maxRetries is zero. + // This field is also ignored in async mode. + // + // The sleep only occurs on connection errors and server timeouts + // which suggest a node is down and the cluster is reforming. + // The sleep does not occur when the client's socketTimeout expires. + // + // Reads do not have to sleep when a node goes down because the cluster + // does not shut out reads during cluster reformation. The default for + // reads is zero. + // + // The default for writes is also zero because writes are not retried by default. + // Writes need to wait for the cluster to reform when a node goes down. + // Immediate write retries on node failure have been shown to consistently + // result in errors. If maxRetries is greater than zero on a write, then + // sleepBetweenRetries should be set high enough to allow the cluster to + // reform (>= 500ms). + SleepBetweenRetries time.Duration //= 1ms; + + // SleepMultiplier specifies the multiplying factor to be used for exponential backoff during retries. + // Default to (1.0); Only values greater than 1 are valid. + SleepMultiplier float64 //= 1.0; + + // ExitFastOnExhaustedConnectionPool determines if a command that tries to get a + // connection from the connection pool will wait and retry in case the pool is + // exhausted until a connection becomes available (or the TotalTimeout is reached). + // If set to true, an error will be return immediately. + // If set to false, getting a connection will be retried. + // This only applies if LimitConnectionsToQueueSize is set to true and the number of open connections to a node has reached ConnectionQueueSize. + // The default is false + ExitFastOnExhaustedConnectionPool bool // false + + // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + // + // If the key is sent on a read, the server will generate the hash digest from + // the key and validate that digest with the digest sent by the client. Unless + // this is the explicit intent of the developer, avoid sending the key on reads. + // The default is to not send the user defined key. + SendKey bool // = false + + // UseCompression uses zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + // + // Default: false + UseCompression bool // = false + + // ReplicaPolicy specifies the algorithm used to determine the target node for a partition derived from a key + // or requested in a scan/query. + // Write commands are not affected by this setting, because all writes are directed + // to the node containing the key's master partition. + // Default to sending read commands to the node containing the key's master partition. + ReplicaPolicy ReplicaPolicy +} + +// NewPolicy generates a new BasePolicy instance with default values. +func NewPolicy() *BasePolicy { + return &BasePolicy{ + ReadModeAP: ReadModeAPOne, + ReadModeSC: ReadModeSCSession, + TotalTimeout: 1000 * time.Millisecond, + SocketTimeout: 30 * time.Second, + MaxRetries: 2, + SleepBetweenRetries: 1 * time.Millisecond, + SleepMultiplier: 1.0, + ReplicaPolicy: SEQUENCE, + SendKey: false, + UseCompression: false, + } +} + +var _ Policy = &BasePolicy{} + +// GetBasePolicy returns embedded BasePolicy in all types that embed this struct. +func (p *BasePolicy) GetBasePolicy() *BasePolicy { return p } + +// socketTimeout validates and then calculates the timeout to be used for the socket +// based on Timeout and SocketTimeout values. +func (p *BasePolicy) socketTimeout() time.Duration { + if p.TotalTimeout == 0 && p.SocketTimeout == 0 { + return 0 + } else if p.TotalTimeout > 0 && p.SocketTimeout == 0 { + return p.TotalTimeout + } else if p.TotalTimeout == 0 && p.SocketTimeout > 0 { + return p.SocketTimeout + } else if p.TotalTimeout > 0 && p.SocketTimeout > 0 { + if p.SocketTimeout < p.TotalTimeout { + return p.SocketTimeout + } + } + return p.TotalTimeout +} + +func (p *BasePolicy) timeout() time.Duration { + if p.TotalTimeout == 0 && p.SocketTimeout == 0 { + return 0 + } else if p.TotalTimeout > 0 && p.SocketTimeout == 0 { + return p.TotalTimeout + } else if p.TotalTimeout == 0 && p.SocketTimeout > 0 { + return p.SocketTimeout + } else if p.TotalTimeout > 0 && p.SocketTimeout > 0 { + if p.SocketTimeout < p.TotalTimeout { + return p.SocketTimeout + } + } + return p.TotalTimeout +} + +func (p *BasePolicy) deadline() time.Time { + var deadline time.Time + if p != nil { + if p.TotalTimeout > 0 { + deadline = time.Now().Add(p.TotalTimeout) + } else if p.SocketTimeout > 0 { + if p.MaxRetries > 0 { + deadline = time.Now().Add(time.Duration(p.MaxRetries) * p.SocketTimeout) + } else { + deadline = time.Now().Add(p.SocketTimeout) + } + } + } + + return deadline +} + +func (p *BasePolicy) compress() bool { + return p.UseCompression +} diff --git a/aerospike-tls/vendor-aerospike-client-go/privilege.go b/aerospike-tls/vendor-aerospike-client-go/privilege.go new file mode 100644 index 00000000..8a99fb06 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/privilege.go @@ -0,0 +1,146 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +import "fmt" + +type privilegeCode string + +// Privilege determines user access granularity. +type Privilege struct { + // Role + Code privilegeCode + + // Namespace determines namespace scope. Apply permission to this namespace only. + // If namespace is zero value, the privilege applies to all namespaces. + Namespace string + + // Set name scope. Apply permission to this set within namespace only. + // If set is zero value, the privilege applies to all sets within namespace. + SetName string +} + +func (p *Privilege) code() int { + switch p.Code { + // User can edit/remove other users. Global scope only. + case UserAdmin: + return 0 + + // User can perform systems administration functions on a database that do not involve user + // administration. Examples include server configuration. + // Global scope only. + case SysAdmin: + return 1 + + // User can perform UDF and SINDEX administration actions. Global scope only. + case DataAdmin: + return 2 + + // User can perform user defined function(UDF) administration actions. + // Examples include create/drop UDF. Global scope only. + // Requires server version 6+ + case UDFAdmin: + return 3 + + // User can perform secondary index administration actions. + // Examples include create/drop index. Global scope only. + // Requires server version 6+ + case SIndexAdmin: + return 4 + + // User can read data only. + case Read: + return 10 + + // User can read and write data. + case ReadWrite: + return 11 + + // User can read and write data through user defined functions. + case ReadWriteUDF: + return 12 + + // User can read and write data through user defined functions. + case Write: + return 13 + + // User can truncate data only. + // Requires server version 6+ + case Truncate: + return 14 + } + + panic("invalid role: " + p.Code) +} + +func privilegeFrom(code uint8) privilegeCode { + switch code { + // User can edit/remove other users. Global scope only. + case 0: + return UserAdmin + + // User can perform systems administration functions on a database that do not involve user + // administration. Examples include server configuration. + // Global scope only. + case 1: + return SysAdmin + + // User can perform data administration functions on a database that do not involve user + // administration. Examples include index and user defined function management. + // Global scope only. + case 2: + return DataAdmin + + // User can perform user defined function(UDF) administration actions. + // Examples include create/drop UDF. Global scope only. + // Requires server version 6+ + case 3: + return UDFAdmin + + // User can perform secondary index administration actions. + // Examples include create/drop index. Global scope only. + // Requires server version 6+ + case 4: + return SIndexAdmin + + // User can read data. + case 10: + return Read + + // User can read and write data. + case 11: + return ReadWrite + + // User can read and write data through user defined functions. + case 12: + return ReadWriteUDF + + // User can only write data. + case 13: + return Write + + // User can truncate data only. + // Requires server version 6+ + case 14: + return Truncate + } + + panic(fmt.Sprintf("invalid privilege code: %v", code)) +} + +func (p *Privilege) canScope() bool { + return p.code() >= 10 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go new file mode 100644 index 00000000..c472fc1c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go @@ -0,0 +1,230 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v5.27.1 +// source: aerospike_proxy_auth.proto + +package auth + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// An auth request to get an access token to perform operations on Aerospike +// database. +type AerospikeAuthRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *AerospikeAuthRequest) Reset() { + *x = AerospikeAuthRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_auth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AerospikeAuthRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AerospikeAuthRequest) ProtoMessage() {} + +func (x *AerospikeAuthRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_auth_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AerospikeAuthRequest.ProtoReflect.Descriptor instead. +func (*AerospikeAuthRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_auth_proto_rawDescGZIP(), []int{0} +} + +func (x *AerospikeAuthRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *AerospikeAuthRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +// An auth token to perform operations on Aerospike database. +type AerospikeAuthResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *AerospikeAuthResponse) Reset() { + *x = AerospikeAuthResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_auth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AerospikeAuthResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AerospikeAuthResponse) ProtoMessage() {} + +func (x *AerospikeAuthResponse) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_auth_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AerospikeAuthResponse.ProtoReflect.Descriptor instead. +func (*AerospikeAuthResponse) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_auth_proto_rawDescGZIP(), []int{1} +} + +func (x *AerospikeAuthResponse) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_aerospike_proxy_auth_proto protoreflect.FileDescriptor + +var file_aerospike_proxy_auth_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2d, 0x0a, 0x15, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x45, 0x0a, 0x0b, 0x41, + 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, + 0x74, 0x12, 0x15, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x59, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, + 0x69, 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x65, 0x72, + 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, + 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x37, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aerospike_proxy_auth_proto_rawDescOnce sync.Once + file_aerospike_proxy_auth_proto_rawDescData = file_aerospike_proxy_auth_proto_rawDesc +) + +func file_aerospike_proxy_auth_proto_rawDescGZIP() []byte { + file_aerospike_proxy_auth_proto_rawDescOnce.Do(func() { + file_aerospike_proxy_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_aerospike_proxy_auth_proto_rawDescData) + }) + return file_aerospike_proxy_auth_proto_rawDescData +} + +var file_aerospike_proxy_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_aerospike_proxy_auth_proto_goTypes = []interface{}{ + (*AerospikeAuthRequest)(nil), // 0: AerospikeAuthRequest + (*AerospikeAuthResponse)(nil), // 1: AerospikeAuthResponse +} +var file_aerospike_proxy_auth_proto_depIdxs = []int32{ + 0, // 0: AuthService.Get:input_type -> AerospikeAuthRequest + 1, // 1: AuthService.Get:output_type -> AerospikeAuthResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_aerospike_proxy_auth_proto_init() } +func file_aerospike_proxy_auth_proto_init() { + if File_aerospike_proxy_auth_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_aerospike_proxy_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AerospikeAuthRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AerospikeAuthResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aerospike_proxy_auth_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_aerospike_proxy_auth_proto_goTypes, + DependencyIndexes: file_aerospike_proxy_auth_proto_depIdxs, + MessageInfos: file_aerospike_proxy_auth_proto_msgTypes, + }.Build() + File_aerospike_proxy_auth_proto = out.File + file_aerospike_proxy_auth_proto_rawDesc = nil + file_aerospike_proxy_auth_proto_goTypes = nil + file_aerospike_proxy_auth_proto_depIdxs = nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto new file mode 100644 index 00000000..4a56bf80 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +option go_package = "github.com/aerospike/aerospike-client-go/v7/proto/auth;auth"; +option java_package = "com.aerospike.proxy.client"; + +// Proxy auth service +service AuthService { + rpc Get(AerospikeAuthRequest) returns (AerospikeAuthResponse) {} +} + +// An auth request to get an access token to perform operations on Aerospike +// database. +message AerospikeAuthRequest { + string username = 1; + string password = 2; +} + +// An auth token to perform operations on Aerospike database. +message AerospikeAuthResponse { + string token = 1; +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go new file mode 100644 index 00000000..766bb0ba --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.1 +// source: proto/auth/aerospike_proxy_auth.proto + +package auth + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AuthService_Get_FullMethodName = "/AuthService/Get" +) + +// AuthServiceClient is the client API for AuthService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AuthServiceClient interface { + Get(ctx context.Context, in *AerospikeAuthRequest, opts ...grpc.CallOption) (*AerospikeAuthResponse, error) +} + +type authServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { + return &authServiceClient{cc} +} + +func (c *authServiceClient) Get(ctx context.Context, in *AerospikeAuthRequest, opts ...grpc.CallOption) (*AerospikeAuthResponse, error) { + out := new(AerospikeAuthResponse) + err := c.cc.Invoke(ctx, AuthService_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AuthServiceServer is the server API for AuthService service. +// All implementations must embed UnimplementedAuthServiceServer +// for forward compatibility +type AuthServiceServer interface { + Get(context.Context, *AerospikeAuthRequest) (*AerospikeAuthResponse, error) + mustEmbedUnimplementedAuthServiceServer() +} + +// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAuthServiceServer struct { +} + +func (UnimplementedAuthServiceServer) Get(context.Context, *AerospikeAuthRequest) (*AerospikeAuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} + +// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AuthServiceServer will +// result in compilation errors. +type UnsafeAuthServiceServer interface { + mustEmbedUnimplementedAuthServiceServer() +} + +func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { + s.RegisterService(&AuthService_ServiceDesc, srv) +} + +func _AuthService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).Get(ctx, req.(*AerospikeAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "AuthService", + HandlerType: (*AuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _AuthService_Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/auth/aerospike_proxy_auth.proto", +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go new file mode 100644 index 00000000..97b82117 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go @@ -0,0 +1,3616 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v5.27.1 +// source: aerospike_proxy_kv.proto + +package kvs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Read policy for AP (availability) namespaces. +// How duplicates should be consulted in a read operation. +// Only makes a difference during migrations and only applicable in AP mode. +type ReadModeAP int32 + +const ( + // Involve single node in the read operation. + ReadModeAP_ONE ReadModeAP = 0 + // Involve all duplicates in the read operation. + ReadModeAP_ALL ReadModeAP = 1 +) + +// Enum value maps for ReadModeAP. +var ( + ReadModeAP_name = map[int32]string{ + 0: "ONE", + 1: "ALL", + } + ReadModeAP_value = map[string]int32{ + "ONE": 0, + "ALL": 1, + } +) + +func (x ReadModeAP) Enum() *ReadModeAP { + p := new(ReadModeAP) + *p = x + return p +} + +func (x ReadModeAP) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ReadModeAP) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[0].Descriptor() +} + +func (ReadModeAP) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[0] +} + +func (x ReadModeAP) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ReadModeAP.Descriptor instead. +func (ReadModeAP) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{0} +} + +// Read policy for SC (strong consistency) namespaces. +// Determines SC read consistency options. +type ReadModeSC int32 + +const ( + // Ensures this client will only see an increasing sequence of record versions. + // Server only reads from master. This is the default. + ReadModeSC_SESSION ReadModeSC = 0 + // Ensures ALL clients will only see an increasing sequence of record versions. + // Server only reads from master. + ReadModeSC_LINEARIZE ReadModeSC = 1 + // Server may read from master or any full (non-migrating) replica. + // Increasing sequence of record versions is not guaranteed. + ReadModeSC_ALLOW_REPLICA ReadModeSC = 2 + // Server may read from master or any full (non-migrating) replica or from unavailable + // partitions. Increasing sequence of record versions is not guaranteed. + ReadModeSC_ALLOW_UNAVAILABLE ReadModeSC = 3 +) + +// Enum value maps for ReadModeSC. +var ( + ReadModeSC_name = map[int32]string{ + 0: "SESSION", + 1: "LINEARIZE", + 2: "ALLOW_REPLICA", + 3: "ALLOW_UNAVAILABLE", + } + ReadModeSC_value = map[string]int32{ + "SESSION": 0, + "LINEARIZE": 1, + "ALLOW_REPLICA": 2, + "ALLOW_UNAVAILABLE": 3, + } +) + +func (x ReadModeSC) Enum() *ReadModeSC { + p := new(ReadModeSC) + *p = x + return p +} + +func (x ReadModeSC) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ReadModeSC) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[1].Descriptor() +} + +func (ReadModeSC) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[1] +} + +func (x ReadModeSC) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ReadModeSC.Descriptor instead. +func (ReadModeSC) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{1} +} + +// Defines algorithm used to determine the target node for a command. +// Scan and query are not affected by replica algorithm. +// +// Note: The enum ordinals do not match the Aerospike Client ordinals because +// the default has to be ordinal zero in protobuf. +type Replica int32 + +const ( + // Try node containing master partition first. + // If connection fails, all commands try nodes containing replicated partitions. + // If socketTimeout is reached, reads also try nodes containing replicated partitions, + // but writes remain on master node. + Replica_SEQUENCE Replica = 0 + // Use node containing key's master partition. + Replica_MASTER Replica = 1 + // Distribute reads across nodes containing key's master and replicated partitions + // in round-robin fashion. Writes always use node containing key's master partition. + Replica_MASTER_PROLES Replica = 2 + // Try node on the same rack as the client first. If timeout or there are no nodes on the + // same rack, use SEQUENCE instead. + Replica_PREFER_RACK Replica = 3 + // Distribute reads across all nodes in cluster in round-robin fashion. + // Writes always use node containing key's master partition. + // This option is useful when the replication factor equals the number + // of nodes in the cluster and the overhead of requesting proles is not desired. + Replica_RANDOM Replica = 4 +) + +// Enum value maps for Replica. +var ( + Replica_name = map[int32]string{ + 0: "SEQUENCE", + 1: "MASTER", + 2: "MASTER_PROLES", + 3: "PREFER_RACK", + 4: "RANDOM", + } + Replica_value = map[string]int32{ + "SEQUENCE": 0, + "MASTER": 1, + "MASTER_PROLES": 2, + "PREFER_RACK": 3, + "RANDOM": 4, + } +) + +func (x Replica) Enum() *Replica { + p := new(Replica) + *p = x + return p +} + +func (x Replica) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Replica) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[2].Descriptor() +} + +func (Replica) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[2] +} + +func (x Replica) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Replica.Descriptor instead. +func (Replica) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{2} +} + +type QueryDuration int32 + +const ( + // The query is expected to return more than 100 records per node. The server optimizes for a large record set. + QueryDuration_LONG QueryDuration = 0 + // The query is expected to return less than 100 records per node. The server optimizes for a small record set. + QueryDuration_SHORT QueryDuration = 1 + // Treat query as a LONG query, but relax read consistency for AP namespaces. + // This value is treated exactly like LONG for server versions < 7.1. + QueryDuration_LONG_RELAX_AP QueryDuration = 2 +) + +// Enum value maps for QueryDuration. +var ( + QueryDuration_name = map[int32]string{ + 0: "LONG", + 1: "SHORT", + 2: "LONG_RELAX_AP", + } + QueryDuration_value = map[string]int32{ + "LONG": 0, + "SHORT": 1, + "LONG_RELAX_AP": 2, + } +) + +func (x QueryDuration) Enum() *QueryDuration { + p := new(QueryDuration) + *p = x + return p +} + +func (x QueryDuration) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (QueryDuration) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[3].Descriptor() +} + +func (QueryDuration) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[3] +} + +func (x QueryDuration) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use QueryDuration.Descriptor instead. +func (QueryDuration) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{3} +} + +// Secondary index collection type. +type IndexCollectionType int32 + +const ( + // Normal scalar index. + IndexCollectionType_DEFAULT IndexCollectionType = 0 + // Index list elements. + IndexCollectionType_LIST IndexCollectionType = 1 + // Index map keys. + IndexCollectionType_MAPKEYS IndexCollectionType = 2 + // Index map values. + IndexCollectionType_MAPVALUES IndexCollectionType = 3 +) + +// Enum value maps for IndexCollectionType. +var ( + IndexCollectionType_name = map[int32]string{ + 0: "DEFAULT", + 1: "LIST", + 2: "MAPKEYS", + 3: "MAPVALUES", + } + IndexCollectionType_value = map[string]int32{ + "DEFAULT": 0, + "LIST": 1, + "MAPKEYS": 2, + "MAPVALUES": 3, + } +) + +func (x IndexCollectionType) Enum() *IndexCollectionType { + p := new(IndexCollectionType) + *p = x + return p +} + +func (x IndexCollectionType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IndexCollectionType) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[4].Descriptor() +} + +func (IndexCollectionType) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[4] +} + +func (x IndexCollectionType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IndexCollectionType.Descriptor instead. +func (IndexCollectionType) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{4} +} + +type OperationType int32 + +const ( + OperationType_READ OperationType = 0 + OperationType_READ_HEADER OperationType = 1 + OperationType_WRITE OperationType = 2 + OperationType_CDT_READ OperationType = 3 + OperationType_CDT_MODIFY OperationType = 4 + OperationType_MAP_READ OperationType = 5 + OperationType_MAP_MODIFY OperationType = 6 + OperationType_ADD OperationType = 7 + OperationType_EXP_READ OperationType = 8 + OperationType_EXP_MODIFY OperationType = 9 + OperationType_APPEND OperationType = 10 + OperationType_PREPEND OperationType = 11 + OperationType_TOUCH OperationType = 12 + OperationType_BIT_READ OperationType = 13 + OperationType_BIT_MODIFY OperationType = 14 + OperationType_DELETE OperationType = 15 + OperationType_HLL_READ OperationType = 16 + OperationType_HLL_MODIFY OperationType = 17 +) + +// Enum value maps for OperationType. +var ( + OperationType_name = map[int32]string{ + 0: "READ", + 1: "READ_HEADER", + 2: "WRITE", + 3: "CDT_READ", + 4: "CDT_MODIFY", + 5: "MAP_READ", + 6: "MAP_MODIFY", + 7: "ADD", + 8: "EXP_READ", + 9: "EXP_MODIFY", + 10: "APPEND", + 11: "PREPEND", + 12: "TOUCH", + 13: "BIT_READ", + 14: "BIT_MODIFY", + 15: "DELETE", + 16: "HLL_READ", + 17: "HLL_MODIFY", + } + OperationType_value = map[string]int32{ + "READ": 0, + "READ_HEADER": 1, + "WRITE": 2, + "CDT_READ": 3, + "CDT_MODIFY": 4, + "MAP_READ": 5, + "MAP_MODIFY": 6, + "ADD": 7, + "EXP_READ": 8, + "EXP_MODIFY": 9, + "APPEND": 10, + "PREPEND": 11, + "TOUCH": 12, + "BIT_READ": 13, + "BIT_MODIFY": 14, + "DELETE": 15, + "HLL_READ": 16, + "HLL_MODIFY": 17, + } +) + +func (x OperationType) Enum() *OperationType { + p := new(OperationType) + *p = x + return p +} + +func (x OperationType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OperationType) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[5].Descriptor() +} + +func (OperationType) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[5] +} + +func (x OperationType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OperationType.Descriptor instead. +func (OperationType) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{5} +} + +type RecordExistsAction int32 + +const ( + // Create or update record. + // Merge write command bins with existing bins. + RecordExistsAction_UPDATE RecordExistsAction = 0 + // Update record only. Fail if record does not exist. + // Merge write command bins with existing bins. + RecordExistsAction_UPDATE_ONLY RecordExistsAction = 1 + // Create or replace record. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike server versions >= 3.1.6. + RecordExistsAction_REPLACE RecordExistsAction = 2 + // Replace record only. Fail if record does not exist. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike server versions >= 3.1.6. + RecordExistsAction_REPLACE_ONLY RecordExistsAction = 3 + // Create only. Fail if record exists. + RecordExistsAction_CREATE_ONLY RecordExistsAction = 4 +) + +// Enum value maps for RecordExistsAction. +var ( + RecordExistsAction_name = map[int32]string{ + 0: "UPDATE", + 1: "UPDATE_ONLY", + 2: "REPLACE", + 3: "REPLACE_ONLY", + 4: "CREATE_ONLY", + } + RecordExistsAction_value = map[string]int32{ + "UPDATE": 0, + "UPDATE_ONLY": 1, + "REPLACE": 2, + "REPLACE_ONLY": 3, + "CREATE_ONLY": 4, + } +) + +func (x RecordExistsAction) Enum() *RecordExistsAction { + p := new(RecordExistsAction) + *p = x + return p +} + +func (x RecordExistsAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RecordExistsAction) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[6].Descriptor() +} + +func (RecordExistsAction) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[6] +} + +func (x RecordExistsAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RecordExistsAction.Descriptor instead. +func (RecordExistsAction) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{6} +} + +type GenerationPolicy int32 + +const ( + // Do not use record generation to restrict writes. + GenerationPolicy_NONE GenerationPolicy = 0 + // Update/delete record if expected generation is equal to server generation. Otherwise, fail. + GenerationPolicy_EXPECT_GEN_EQUAL GenerationPolicy = 1 + // Update/delete record if expected generation greater than the server generation. Otherwise, fail. + // This is useful for restore after backup. + GenerationPolicy_EXPECT_GEN_GT GenerationPolicy = 2 +) + +// Enum value maps for GenerationPolicy. +var ( + GenerationPolicy_name = map[int32]string{ + 0: "NONE", + 1: "EXPECT_GEN_EQUAL", + 2: "EXPECT_GEN_GT", + } + GenerationPolicy_value = map[string]int32{ + "NONE": 0, + "EXPECT_GEN_EQUAL": 1, + "EXPECT_GEN_GT": 2, + } +) + +func (x GenerationPolicy) Enum() *GenerationPolicy { + p := new(GenerationPolicy) + *p = x + return p +} + +func (x GenerationPolicy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GenerationPolicy) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[7].Descriptor() +} + +func (GenerationPolicy) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[7] +} + +func (x GenerationPolicy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GenerationPolicy.Descriptor instead. +func (GenerationPolicy) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{7} +} + +type CommitLevel int32 + +const ( + // Server should wait until successfully committing master and all replicas. + CommitLevel_COMMIT_ALL CommitLevel = 0 + // Server should wait until successfully committing master only. + CommitLevel_COMMIT_MASTER CommitLevel = 1 +) + +// Enum value maps for CommitLevel. +var ( + CommitLevel_name = map[int32]string{ + 0: "COMMIT_ALL", + 1: "COMMIT_MASTER", + } + CommitLevel_value = map[string]int32{ + "COMMIT_ALL": 0, + "COMMIT_MASTER": 1, + } +) + +func (x CommitLevel) Enum() *CommitLevel { + p := new(CommitLevel) + *p = x + return p +} + +func (x CommitLevel) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommitLevel) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[8].Descriptor() +} + +func (CommitLevel) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[8] +} + +func (x CommitLevel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CommitLevel.Descriptor instead. +func (CommitLevel) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{8} +} + +type BackgroundTaskStatus int32 + +const ( + // Task not found. + BackgroundTaskStatus_NOT_FOUND BackgroundTaskStatus = 0 + // Task in progress. + BackgroundTaskStatus_IN_PROGRESS BackgroundTaskStatus = 1 + // Task completed. + BackgroundTaskStatus_COMPLETE BackgroundTaskStatus = 2 +) + +// Enum value maps for BackgroundTaskStatus. +var ( + BackgroundTaskStatus_name = map[int32]string{ + 0: "NOT_FOUND", + 1: "IN_PROGRESS", + 2: "COMPLETE", + } + BackgroundTaskStatus_value = map[string]int32{ + "NOT_FOUND": 0, + "IN_PROGRESS": 1, + "COMPLETE": 2, + } +) + +func (x BackgroundTaskStatus) Enum() *BackgroundTaskStatus { + p := new(BackgroundTaskStatus) + *p = x + return p +} + +func (x BackgroundTaskStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BackgroundTaskStatus) Descriptor() protoreflect.EnumDescriptor { + return file_aerospike_proxy_kv_proto_enumTypes[9].Descriptor() +} + +func (BackgroundTaskStatus) Type() protoreflect.EnumType { + return &file_aerospike_proxy_kv_proto_enumTypes[9] +} + +func (x BackgroundTaskStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BackgroundTaskStatus.Descriptor instead. +func (BackgroundTaskStatus) EnumDescriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{9} +} + +// The about request message. +type AboutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AboutRequest) Reset() { + *x = AboutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AboutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AboutRequest) ProtoMessage() {} + +func (x *AboutRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AboutRequest.ProtoReflect.Descriptor instead. +func (*AboutRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{0} +} + +// The about response message. +type AboutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Proxy server version. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *AboutResponse) Reset() { + *x = AboutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AboutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AboutResponse) ProtoMessage() {} + +func (x *AboutResponse) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AboutResponse.ProtoReflect.Descriptor instead. +func (*AboutResponse) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{1} +} + +func (x *AboutResponse) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Read policy attributes used in read database commands that are not part of +// the wire protocol. +type ReadPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Read policy for AP (availability) namespaces. + Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` + // Read policy for SC (strong consistency) namespaces. + ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` +} + +func (x *ReadPolicy) Reset() { + *x = ReadPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadPolicy) ProtoMessage() {} + +func (x *ReadPolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadPolicy.ProtoReflect.Descriptor instead. +func (*ReadPolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{2} +} + +func (x *ReadPolicy) GetReplica() Replica { + if x != nil { + return x.Replica + } + return Replica_SEQUENCE +} + +func (x *ReadPolicy) GetReadModeAP() ReadModeAP { + if x != nil { + return x.ReadModeAP + } + return ReadModeAP_ONE +} + +func (x *ReadPolicy) GetReadModeSC() ReadModeSC { + if x != nil { + return x.ReadModeSC + } + return ReadModeSC_SESSION +} + +// Write policy attributes used in write database commands that are not part of +// the wire protocol. +type WritePolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Read policy for AP (availability) namespaces. + Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` + // Read policy for SC (strong consistency) namespaces. + ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` +} + +func (x *WritePolicy) Reset() { + *x = WritePolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WritePolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WritePolicy) ProtoMessage() {} + +func (x *WritePolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WritePolicy.ProtoReflect.Descriptor instead. +func (*WritePolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{3} +} + +func (x *WritePolicy) GetReplica() Replica { + if x != nil { + return x.Replica + } + return Replica_SEQUENCE +} + +func (x *WritePolicy) GetReadModeAP() ReadModeAP { + if x != nil { + return x.ReadModeAP + } + return ReadModeAP_ONE +} + +func (x *WritePolicy) GetReadModeSC() ReadModeSC { + if x != nil { + return x.ReadModeSC + } + return ReadModeSC_SESSION +} + +// The request message containing the user's name. +type AerospikeRequestPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique identifier of the request in the stream. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Client iteration number starting at 1. On first attempt iteration should + // be 1. On first retry iteration should be 2, on second retry iteration + // should be 3, and so on. + Iteration uint32 `protobuf:"varint,2,opt,name=iteration,proto3" json:"iteration,omitempty"` + // Aerospike wire format request payload. + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + // Read policy for read requests. + ReadPolicy *ReadPolicy `protobuf:"bytes,4,opt,name=readPolicy,proto3,oneof" json:"readPolicy,omitempty"` + // Write policy for write requests. + WritePolicy *WritePolicy `protobuf:"bytes,5,opt,name=writePolicy,proto3,oneof" json:"writePolicy,omitempty"` + // Scan request for scan. + ScanRequest *ScanRequest `protobuf:"bytes,6,opt,name=scanRequest,proto3,oneof" json:"scanRequest,omitempty"` + // Request for running a query. + QueryRequest *QueryRequest `protobuf:"bytes,7,opt,name=queryRequest,proto3,oneof" json:"queryRequest,omitempty"` + // Abort a scan/query on application error. + AbortRequest *AbortRequest `protobuf:"bytes,8,opt,name=abortRequest,proto3,oneof" json:"abortRequest,omitempty"` + // Request for executing operations background on matching records. + BackgroundExecuteRequest *BackgroundExecuteRequest `protobuf:"bytes,9,opt,name=backgroundExecuteRequest,proto3,oneof" json:"backgroundExecuteRequest,omitempty"` + // Request for getting background task status. + BackgroundTaskStatusRequest *BackgroundTaskStatusRequest `protobuf:"bytes,10,opt,name=backgroundTaskStatusRequest,proto3,oneof" json:"backgroundTaskStatusRequest,omitempty"` + // Info request + InfoRequest *InfoRequest `protobuf:"bytes,11,opt,name=infoRequest,proto3,oneof" json:"infoRequest,omitempty"` +} + +func (x *AerospikeRequestPayload) Reset() { + *x = AerospikeRequestPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AerospikeRequestPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AerospikeRequestPayload) ProtoMessage() {} + +func (x *AerospikeRequestPayload) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AerospikeRequestPayload.ProtoReflect.Descriptor instead. +func (*AerospikeRequestPayload) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{4} +} + +func (x *AerospikeRequestPayload) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AerospikeRequestPayload) GetIteration() uint32 { + if x != nil { + return x.Iteration + } + return 0 +} + +func (x *AerospikeRequestPayload) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *AerospikeRequestPayload) GetReadPolicy() *ReadPolicy { + if x != nil { + return x.ReadPolicy + } + return nil +} + +func (x *AerospikeRequestPayload) GetWritePolicy() *WritePolicy { + if x != nil { + return x.WritePolicy + } + return nil +} + +func (x *AerospikeRequestPayload) GetScanRequest() *ScanRequest { + if x != nil { + return x.ScanRequest + } + return nil +} + +func (x *AerospikeRequestPayload) GetQueryRequest() *QueryRequest { + if x != nil { + return x.QueryRequest + } + return nil +} + +func (x *AerospikeRequestPayload) GetAbortRequest() *AbortRequest { + if x != nil { + return x.AbortRequest + } + return nil +} + +func (x *AerospikeRequestPayload) GetBackgroundExecuteRequest() *BackgroundExecuteRequest { + if x != nil { + return x.BackgroundExecuteRequest + } + return nil +} + +func (x *AerospikeRequestPayload) GetBackgroundTaskStatusRequest() *BackgroundTaskStatusRequest { + if x != nil { + return x.BackgroundTaskStatusRequest + } + return nil +} + +func (x *AerospikeRequestPayload) GetInfoRequest() *InfoRequest { + if x != nil { + return x.InfoRequest + } + return nil +} + +// The request message containing the user's name. +type AerospikeResponsePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique identifier of the corresponding request in the stream. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Status of the corresponding request. + // + // if status equals 0 + // The proxy received a valid response from Aerospike. The payload's + // result code should be used as the client result code. + // else + // The request failed at the proxy. This status should be used + // as the client result code. + Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` + // This flag indicates that the write transaction may have completed, + // even though the client sees an error. + InDoubt bool `protobuf:"varint,3,opt,name=inDoubt,proto3" json:"inDoubt,omitempty"` + // Aerospike wire format request payload. + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` + // For requests with multiple responses like batch and queries, + // hasNext flag indicates if there are more responses to follow this + // response or if this is the last response for this request. + HasNext bool `protobuf:"varint,5,opt,name=hasNext,proto3" json:"hasNext,omitempty"` + // Background task status, populated for background task request. + BackgroundTaskStatus *BackgroundTaskStatus `protobuf:"varint,6,opt,name=backgroundTaskStatus,proto3,enum=BackgroundTaskStatus,oneof" json:"backgroundTaskStatus,omitempty"` +} + +func (x *AerospikeResponsePayload) Reset() { + *x = AerospikeResponsePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AerospikeResponsePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AerospikeResponsePayload) ProtoMessage() {} + +func (x *AerospikeResponsePayload) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AerospikeResponsePayload.ProtoReflect.Descriptor instead. +func (*AerospikeResponsePayload) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{5} +} + +func (x *AerospikeResponsePayload) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *AerospikeResponsePayload) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *AerospikeResponsePayload) GetInDoubt() bool { + if x != nil { + return x.InDoubt + } + return false +} + +func (x *AerospikeResponsePayload) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *AerospikeResponsePayload) GetHasNext() bool { + if x != nil { + return x.HasNext + } + return false +} + +func (x *AerospikeResponsePayload) GetBackgroundTaskStatus() BackgroundTaskStatus { + if x != nil && x.BackgroundTaskStatus != nil { + return *x.BackgroundTaskStatus + } + return BackgroundTaskStatus_NOT_FOUND +} + +// Scan policy attributes used by queries. +// Scan requests are send completely using proto buffers and hence include all policy attributes. +type ScanPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Read policy for AP (availability) namespaces. + Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` + // Read policy for SC (strong consistency) namespaces. + ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and scan are not affected by replica algorithms. + ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + Compress bool `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"` + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + Expression []byte `protobuf:"bytes,5,opt,name=expression,proto3,oneof" json:"expression,omitempty"` + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + TotalTimeout *uint32 `protobuf:"varint,6,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` + // Approximate number of records to return to client. This number is divided by the + // number of nodes involved in the scan. The actual number of records returned + // may be less than maxRecords if node record counts are small and unbalanced across + // nodes. + // Default: 0 (do not limit record count) + MaxRecords *uint64 `protobuf:"varint,7,opt,name=maxRecords,proto3,oneof" json:"maxRecords,omitempty"` + // Limit returned records per second (rps) rate for each server. + // Do not apply rps limit if recordsPerSecond is zero. + // Default: 0 + RecordsPerSecond *uint32 `protobuf:"varint,8,opt,name=recordsPerSecond,proto3,oneof" json:"recordsPerSecond,omitempty"` + // Should scan requests be issued in parallel. + // Default: true + ConcurrentNodes *bool `protobuf:"varint,9,opt,name=concurrentNodes,proto3,oneof" json:"concurrentNodes,omitempty"` + // Maximum number of concurrent requests to server nodes at any point in time. + // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries + // will be made to 8 nodes in parallel. When a scan completes, a new scan will + // be issued until all 16 nodes have been queried. + // Default: 0 (issue requests to all server nodes in parallel) + MaxConcurrentNodes *uint32 `protobuf:"varint,10,opt,name=maxConcurrentNodes,proto3,oneof" json:"maxConcurrentNodes,omitempty"` + // Should bin data be retrieved. If false, only record digests (and user keys + // if stored on the server) are retrieved. + // Default: true + IncludeBinData *bool `protobuf:"varint,11,opt,name=includeBinData,proto3,oneof" json:"includeBinData,omitempty"` +} + +func (x *ScanPolicy) Reset() { + *x = ScanPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScanPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScanPolicy) ProtoMessage() {} + +func (x *ScanPolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScanPolicy.ProtoReflect.Descriptor instead. +func (*ScanPolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{6} +} + +func (x *ScanPolicy) GetReplica() Replica { + if x != nil { + return x.Replica + } + return Replica_SEQUENCE +} + +func (x *ScanPolicy) GetReadModeAP() ReadModeAP { + if x != nil { + return x.ReadModeAP + } + return ReadModeAP_ONE +} + +func (x *ScanPolicy) GetReadModeSC() ReadModeSC { + if x != nil { + return x.ReadModeSC + } + return ReadModeSC_SESSION +} + +func (x *ScanPolicy) GetCompress() bool { + if x != nil { + return x.Compress + } + return false +} + +func (x *ScanPolicy) GetExpression() []byte { + if x != nil { + return x.Expression + } + return nil +} + +func (x *ScanPolicy) GetTotalTimeout() uint32 { + if x != nil && x.TotalTimeout != nil { + return *x.TotalTimeout + } + return 0 +} + +func (x *ScanPolicy) GetMaxRecords() uint64 { + if x != nil && x.MaxRecords != nil { + return *x.MaxRecords + } + return 0 +} + +func (x *ScanPolicy) GetRecordsPerSecond() uint32 { + if x != nil && x.RecordsPerSecond != nil { + return *x.RecordsPerSecond + } + return 0 +} + +func (x *ScanPolicy) GetConcurrentNodes() bool { + if x != nil && x.ConcurrentNodes != nil { + return *x.ConcurrentNodes + } + return false +} + +func (x *ScanPolicy) GetMaxConcurrentNodes() uint32 { + if x != nil && x.MaxConcurrentNodes != nil { + return *x.MaxConcurrentNodes + } + return 0 +} + +func (x *ScanPolicy) GetIncludeBinData() bool { + if x != nil && x.IncludeBinData != nil { + return *x.IncludeBinData + } + return false +} + +// Partition status used to perform partial scans on client side retries. +type PartitionStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The partition status. + Id *uint32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` + // Begin value to start scanning / querying after. + BVal *int64 `protobuf:"varint,2,opt,name=bVal,proto3,oneof" json:"bVal,omitempty"` + // Digest to start scanning / querying after. + Digest []byte `protobuf:"bytes,3,opt,name=digest,proto3,oneof" json:"digest,omitempty"` + // Indicates this partition should be tried. + // Should be set to true for the first attempt as well. + Retry bool `protobuf:"varint,5,opt,name=retry,proto3" json:"retry,omitempty"` +} + +func (x *PartitionStatus) Reset() { + *x = PartitionStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartitionStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartitionStatus) ProtoMessage() {} + +func (x *PartitionStatus) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartitionStatus.ProtoReflect.Descriptor instead. +func (*PartitionStatus) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{7} +} + +func (x *PartitionStatus) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *PartitionStatus) GetBVal() int64 { + if x != nil && x.BVal != nil { + return *x.BVal + } + return 0 +} + +func (x *PartitionStatus) GetDigest() []byte { + if x != nil { + return x.Digest + } + return nil +} + +func (x *PartitionStatus) GetRetry() bool { + if x != nil { + return x.Retry + } + return false +} + +// A partition filter for scans and queries. +type PartitionFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Start partition id. + // Not required if the digest to start scanning from is specified. + Begin *uint32 `protobuf:"varint,1,opt,name=begin,proto3,oneof" json:"begin,omitempty"` + // The number of records to scan. + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Optional digest to start scanning from. + Digest []byte `protobuf:"bytes,3,opt,name=digest,proto3,oneof" json:"digest,omitempty"` + // Optional partition statuses used on retries to restart + // from last known record for the partition. + PartitionStatuses []*PartitionStatus `protobuf:"bytes,4,rep,name=partitionStatuses,proto3" json:"partitionStatuses,omitempty"` + // Indicates if all partitions in this filter should + // be retried ignoring the partition status + Retry bool `protobuf:"varint,5,opt,name=retry,proto3" json:"retry,omitempty"` +} + +func (x *PartitionFilter) Reset() { + *x = PartitionFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PartitionFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PartitionFilter) ProtoMessage() {} + +func (x *PartitionFilter) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PartitionFilter.ProtoReflect.Descriptor instead. +func (*PartitionFilter) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{8} +} + +func (x *PartitionFilter) GetBegin() uint32 { + if x != nil && x.Begin != nil { + return *x.Begin + } + return 0 +} + +func (x *PartitionFilter) GetCount() uint32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *PartitionFilter) GetDigest() []byte { + if x != nil { + return x.Digest + } + return nil +} + +func (x *PartitionFilter) GetPartitionStatuses() []*PartitionStatus { + if x != nil { + return x.PartitionStatuses + } + return nil +} + +func (x *PartitionFilter) GetRetry() bool { + if x != nil { + return x.Retry + } + return false +} + +// A scan request. +type ScanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional scan policy. + ScanPolicy *ScanPolicy `protobuf:"bytes,1,opt,name=scanPolicy,proto3,oneof" json:"scanPolicy,omitempty"` + // The namespace to scan. + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + // Optional set name. + SetName *string `protobuf:"bytes,3,opt,name=setName,proto3,oneof" json:"setName,omitempty"` + // Optional bin to retrieve. All bins will be returned + // if not specified. + BinNames []string `protobuf:"bytes,4,rep,name=binNames,proto3" json:"binNames,omitempty"` + // Optional partition filter to selectively scan partitions. + PartitionFilter *PartitionFilter `protobuf:"bytes,5,opt,name=partitionFilter,proto3,oneof" json:"partitionFilter,omitempty"` +} + +func (x *ScanRequest) Reset() { + *x = ScanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ScanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScanRequest) ProtoMessage() {} + +func (x *ScanRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScanRequest.ProtoReflect.Descriptor instead. +func (*ScanRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{9} +} + +func (x *ScanRequest) GetScanPolicy() *ScanPolicy { + if x != nil { + return x.ScanPolicy + } + return nil +} + +func (x *ScanRequest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *ScanRequest) GetSetName() string { + if x != nil && x.SetName != nil { + return *x.SetName + } + return "" +} + +func (x *ScanRequest) GetBinNames() []string { + if x != nil { + return x.BinNames + } + return nil +} + +func (x *ScanRequest) GetPartitionFilter() *PartitionFilter { + if x != nil { + return x.PartitionFilter + } + return nil +} + +// Query policy attributes used by queries. +// Query requests are send completely using proto buffers and hence include all policy attributes. +type QueryPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Read policy for AP (availability) namespaces. + Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` + // Read policy for SC (strong consistency) namespaces. + ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` + // Send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + // Default: false (do not send the user defined key) + SendKey *bool `protobuf:"varint,4,opt,name=sendKey,proto3,oneof" json:"sendKey,omitempty"` + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + Compress bool `protobuf:"varint,5,opt,name=compress,proto3" json:"compress,omitempty"` + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + Expression []byte `protobuf:"bytes,6,opt,name=expression,proto3,oneof" json:"expression,omitempty"` + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + TotalTimeout *uint32 `protobuf:"varint,7,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` + // Maximum number of concurrent requests to server nodes at any point in time. + // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries + // will be made to 8 nodes in parallel. When a query completes, a new query will + // be issued until all 16 nodes have been queried. + // Default: 0 (issue requests to all server nodes in parallel) + MaxConcurrentNodes *uint32 `protobuf:"varint,8,opt,name=maxConcurrentNodes,proto3,oneof" json:"maxConcurrentNodes,omitempty"` + // Number of records to place in queue before blocking. + // Records received from multiple server nodes will be placed in a queue. + // A separate thread consumes these records in parallel. + // If the queue is full, the producer threads will block until records are consumed. + // Default: 5000 + RecordQueueSize *uint32 `protobuf:"varint,9,opt,name=recordQueueSize,proto3,oneof" json:"recordQueueSize,omitempty"` + // Should bin data be retrieved. If false, only record digests (and user keys + // if stored on the server) are retrieved. + // Default: true + IncludeBinData *bool `protobuf:"varint,10,opt,name=includeBinData,proto3,oneof" json:"includeBinData,omitempty"` + // Terminate query if cluster is in migration state. If the server supports partition + // queries or the query filter is null (scan), this field is ignored. + // Default: false + FailOnClusterChange *bool `protobuf:"varint,11,opt,name=failOnClusterChange,proto3,oneof" json:"failOnClusterChange,omitempty"` + // Deprecated, use expectedDuration instead. + // Is query expected to return less than 100 records per node. + // If true, the server will optimize the query for a small record set. + // This field is ignored for aggregation queries, background queries + // and server versions < 6.0. + // Default: false + ShortQuery *bool `protobuf:"varint,12,opt,name=shortQuery,proto3,oneof" json:"shortQuery,omitempty"` + // Timeout in milliseconds for "cluster-stable" info command that is run when + // failOnClusterChange is true and server version is less than 6.0. + // + // Default: 1000 + InfoTimeout *uint32 `protobuf:"varint,13,opt,name=infoTimeout,proto3,oneof" json:"infoTimeout,omitempty"` + // Expected query duration. The server treats the query in different ways depending on the expected duration. + // This field is ignored for aggregation queries, background queries and server versions less than 6.0. + // Default: QueryDuration.LONG + ExpectedDuration *QueryDuration `protobuf:"varint,14,opt,name=expectedDuration,proto3,enum=QueryDuration,oneof" json:"expectedDuration,omitempty"` +} + +func (x *QueryPolicy) Reset() { + *x = QueryPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPolicy) ProtoMessage() {} + +func (x *QueryPolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryPolicy.ProtoReflect.Descriptor instead. +func (*QueryPolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{10} +} + +func (x *QueryPolicy) GetReplica() Replica { + if x != nil { + return x.Replica + } + return Replica_SEQUENCE +} + +func (x *QueryPolicy) GetReadModeAP() ReadModeAP { + if x != nil { + return x.ReadModeAP + } + return ReadModeAP_ONE +} + +func (x *QueryPolicy) GetReadModeSC() ReadModeSC { + if x != nil { + return x.ReadModeSC + } + return ReadModeSC_SESSION +} + +func (x *QueryPolicy) GetSendKey() bool { + if x != nil && x.SendKey != nil { + return *x.SendKey + } + return false +} + +func (x *QueryPolicy) GetCompress() bool { + if x != nil { + return x.Compress + } + return false +} + +func (x *QueryPolicy) GetExpression() []byte { + if x != nil { + return x.Expression + } + return nil +} + +func (x *QueryPolicy) GetTotalTimeout() uint32 { + if x != nil && x.TotalTimeout != nil { + return *x.TotalTimeout + } + return 0 +} + +func (x *QueryPolicy) GetMaxConcurrentNodes() uint32 { + if x != nil && x.MaxConcurrentNodes != nil { + return *x.MaxConcurrentNodes + } + return 0 +} + +func (x *QueryPolicy) GetRecordQueueSize() uint32 { + if x != nil && x.RecordQueueSize != nil { + return *x.RecordQueueSize + } + return 0 +} + +func (x *QueryPolicy) GetIncludeBinData() bool { + if x != nil && x.IncludeBinData != nil { + return *x.IncludeBinData + } + return false +} + +func (x *QueryPolicy) GetFailOnClusterChange() bool { + if x != nil && x.FailOnClusterChange != nil { + return *x.FailOnClusterChange + } + return false +} + +func (x *QueryPolicy) GetShortQuery() bool { + if x != nil && x.ShortQuery != nil { + return *x.ShortQuery + } + return false +} + +func (x *QueryPolicy) GetInfoTimeout() uint32 { + if x != nil && x.InfoTimeout != nil { + return *x.InfoTimeout + } + return 0 +} + +func (x *QueryPolicy) GetExpectedDuration() QueryDuration { + if x != nil && x.ExpectedDuration != nil { + return *x.ExpectedDuration + } + return QueryDuration_LONG +} + +// Query statement filter +type Filter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the filter. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Secondary index collection type. + ColType IndexCollectionType `protobuf:"varint,2,opt,name=colType,proto3,enum=IndexCollectionType" json:"colType,omitempty"` + // Optional filter context packed in Aerospike format. + PackedCtx []byte `protobuf:"bytes,3,opt,name=packedCtx,proto3,oneof" json:"packedCtx,omitempty"` + // The queried column particle type. + ValType int32 `protobuf:"varint,4,opt,name=valType,proto3" json:"valType,omitempty"` + // The Aerospike encoded query start "Value" + Begin []byte `protobuf:"bytes,5,opt,name=begin,proto3,oneof" json:"begin,omitempty"` + // The Aerospike encoded query end "Value" + End []byte `protobuf:"bytes,6,opt,name=end,proto3,oneof" json:"end,omitempty"` +} + +func (x *Filter) Reset() { + *x = Filter{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Filter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Filter) ProtoMessage() {} + +func (x *Filter) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Filter.ProtoReflect.Descriptor instead. +func (*Filter) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{11} +} + +func (x *Filter) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Filter) GetColType() IndexCollectionType { + if x != nil { + return x.ColType + } + return IndexCollectionType_DEFAULT +} + +func (x *Filter) GetPackedCtx() []byte { + if x != nil { + return x.PackedCtx + } + return nil +} + +func (x *Filter) GetValType() int32 { + if x != nil { + return x.ValType + } + return 0 +} + +func (x *Filter) GetBegin() []byte { + if x != nil { + return x.Begin + } + return nil +} + +func (x *Filter) GetEnd() []byte { + if x != nil { + return x.End + } + return nil +} + +// Single record operation. +type Operation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The operation type. + Type OperationType `protobuf:"varint,1,opt,name=type,proto3,enum=OperationType" json:"type,omitempty"` + // Optional bin name. + BinName *string `protobuf:"bytes,2,opt,name=binName,proto3,oneof" json:"binName,omitempty"` + // Optional bin value. + Value []byte `protobuf:"bytes,3,opt,name=value,proto3,oneof" json:"value,omitempty"` +} + +func (x *Operation) Reset() { + *x = Operation{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Operation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Operation) ProtoMessage() {} + +func (x *Operation) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Operation.ProtoReflect.Descriptor instead. +func (*Operation) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{12} +} + +func (x *Operation) GetType() OperationType { + if x != nil { + return x.Type + } + return OperationType_READ +} + +func (x *Operation) GetBinName() string { + if x != nil && x.BinName != nil { + return *x.BinName + } + return "" +} + +func (x *Operation) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// Query statement. +type Statement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The namespace to query. + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + // Optional set name. + SetName *string `protobuf:"bytes,2,opt,name=setName,proto3,oneof" json:"setName,omitempty"` + // Optional index name. + IndexName *string `protobuf:"bytes,3,opt,name=indexName,proto3,oneof" json:"indexName,omitempty"` + // Optional bins names to return for each result record. + // If not specified all bins are returned. + BinNames []string `protobuf:"bytes,4,rep,name=binNames,proto3" json:"binNames,omitempty"` + // Optional Filter encoded in Aerospike wire format. + Filter *Filter `protobuf:"bytes,5,opt,name=filter,proto3,oneof" json:"filter,omitempty"` + // Aggregation file name. + PackageName string `protobuf:"bytes,6,opt,name=packageName,proto3" json:"packageName,omitempty"` + // Aggregation function name. + FunctionName string `protobuf:"bytes,7,opt,name=functionName,proto3" json:"functionName,omitempty"` + // Aggregation function arguments encoded as bytes using Aerospike wire format. + FunctionArgs [][]byte `protobuf:"bytes,8,rep,name=functionArgs,proto3" json:"functionArgs,omitempty"` + // Operations to be performed on query encoded as bytes using Aerospike wire format. + Operations []*Operation `protobuf:"bytes,9,rep,name=operations,proto3" json:"operations,omitempty"` + // Optional taskId. + TaskId *int64 `protobuf:"varint,10,opt,name=taskId,proto3,oneof" json:"taskId,omitempty"` + // Approximate number of records to return to client. This number is divided by the + // number of nodes involved in the scan. The actual number of records returned + // may be less than maxRecords if node record counts are small and unbalanced across + // nodes. + // Default: 0 (do not limit record count) + MaxRecords *uint64 `protobuf:"varint,11,opt,name=maxRecords,proto3,oneof" json:"maxRecords,omitempty"` + // Limit returned records per second (rps) rate for each server. + // Do not apply rps limit if recordsPerSecond is zero. + // Default: 0 + RecordsPerSecond *uint32 `protobuf:"varint,12,opt,name=recordsPerSecond,proto3,oneof" json:"recordsPerSecond,omitempty"` +} + +func (x *Statement) Reset() { + *x = Statement{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Statement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Statement) ProtoMessage() {} + +func (x *Statement) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Statement.ProtoReflect.Descriptor instead. +func (*Statement) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{13} +} + +func (x *Statement) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *Statement) GetSetName() string { + if x != nil && x.SetName != nil { + return *x.SetName + } + return "" +} + +func (x *Statement) GetIndexName() string { + if x != nil && x.IndexName != nil { + return *x.IndexName + } + return "" +} + +func (x *Statement) GetBinNames() []string { + if x != nil { + return x.BinNames + } + return nil +} + +func (x *Statement) GetFilter() *Filter { + if x != nil { + return x.Filter + } + return nil +} + +func (x *Statement) GetPackageName() string { + if x != nil { + return x.PackageName + } + return "" +} + +func (x *Statement) GetFunctionName() string { + if x != nil { + return x.FunctionName + } + return "" +} + +func (x *Statement) GetFunctionArgs() [][]byte { + if x != nil { + return x.FunctionArgs + } + return nil +} + +func (x *Statement) GetOperations() []*Operation { + if x != nil { + return x.Operations + } + return nil +} + +func (x *Statement) GetTaskId() int64 { + if x != nil && x.TaskId != nil { + return *x.TaskId + } + return 0 +} + +func (x *Statement) GetMaxRecords() uint64 { + if x != nil && x.MaxRecords != nil { + return *x.MaxRecords + } + return 0 +} + +func (x *Statement) GetRecordsPerSecond() uint32 { + if x != nil && x.RecordsPerSecond != nil { + return *x.RecordsPerSecond + } + return 0 +} + +// A query request. +type QueryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional query policy. + QueryPolicy *QueryPolicy `protobuf:"bytes,1,opt,name=queryPolicy,proto3,oneof" json:"queryPolicy,omitempty"` + // The query statement. + Statement *Statement `protobuf:"bytes,2,opt,name=statement,proto3" json:"statement,omitempty"` + // Set to true for background queries. + Background bool `protobuf:"varint,3,opt,name=background,proto3" json:"background,omitempty"` + // Optional partition filter to selectively query partitions. + PartitionFilter *PartitionFilter `protobuf:"bytes,4,opt,name=partitionFilter,proto3,oneof" json:"partitionFilter,omitempty"` +} + +func (x *QueryRequest) Reset() { + *x = QueryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRequest) ProtoMessage() {} + +func (x *QueryRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. +func (*QueryRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryRequest) GetQueryPolicy() *QueryPolicy { + if x != nil { + return x.QueryPolicy + } + return nil +} + +func (x *QueryRequest) GetStatement() *Statement { + if x != nil { + return x.Statement + } + return nil +} + +func (x *QueryRequest) GetBackground() bool { + if x != nil { + return x.Background + } + return false +} + +func (x *QueryRequest) GetPartitionFilter() *PartitionFilter { + if x != nil { + return x.PartitionFilter + } + return nil +} + +type BackgroundExecutePolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Read policy for AP (availability) namespaces. + Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` + // Read policy for SC (strong consistency) namespaces. + ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and scan are not affected by replica algorithms. + ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + Compress bool `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"` + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + Expression []byte `protobuf:"bytes,5,opt,name=expression,proto3,oneof" json:"expression,omitempty"` + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + TotalTimeout *uint32 `protobuf:"varint,6,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` + // Send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + //

+ // Default: false (do not send the user defined key) + SendKey *bool `protobuf:"varint,7,opt,name=sendKey,proto3,oneof" json:"sendKey,omitempty"` + // Qualify how to handle writes where the record already exists. + // + // Default: RecordExistsAction.UPDATE + RecordExistsAction *RecordExistsAction `protobuf:"varint,8,opt,name=recordExistsAction,proto3,enum=RecordExistsAction,oneof" json:"recordExistsAction,omitempty"` + // Qualify how to handle record writes based on record generation. The default (NONE) + // indicates that the generation is not used to restrict writes. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: GenerationPolicy.NONE + GenerationPolicy *GenerationPolicy `protobuf:"varint,9,opt,name=generationPolicy,proto3,enum=GenerationPolicy,oneof" json:"generationPolicy,omitempty"` + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + // + // Default: CommitLevel.COMMIT_ALL + CommitLevel *CommitLevel `protobuf:"varint,10,opt,name=commitLevel,proto3,enum=CommitLevel,oneof" json:"commitLevel,omitempty"` + // Expected generation. Generation is the number of times a record has been modified + // (including creation) on the server. If a write operation is creating a record, + // the expected generation would be 0. This field is only relevant when + // generationPolicy is not NONE. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: 0 + Generation *uint32 `protobuf:"varint,11,opt,name=generation,proto3,oneof" json:"generation,omitempty"` + // Record expiration. Also known as ttl (time to live). + // Seconds record will live before being removed by the server. + // + // Expiration values: + // + // - -2: Do not change ttl when record is updated. + // - -1: Never expire. + // - 0: Default to namespace configuration variable "default-ttl" on the server. + // - > 0: Actual ttl in seconds.
+ // + // Default: 0 + Expiration *uint32 `protobuf:"varint,12,opt,name=expiration,proto3,oneof" json:"expiration,omitempty"` + // For client operate(), return a result for every operation. + // + // Some operations do not return results by default (ListOperation.clear() for example). + // This can make it difficult to determine the desired result offset in the returned + // bin's result list. + // + // Setting respondAllOps to true makes it easier to identify the desired result offset + // (result offset equals bin's operate sequence). If there is a map operation in operate(), + // respondAllOps will be forced to true for that operate() call. + // + // Default: false + RespondAllOps *bool `protobuf:"varint,13,opt,name=respondAllOps,proto3,oneof" json:"respondAllOps,omitempty"` + // If the transaction results in a record deletion, leave a tombstone for the record. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition 3.10+ only. + // + // Default: false (do not tombstone deleted records). + DurableDelete *bool `protobuf:"varint,14,opt,name=durableDelete,proto3,oneof" json:"durableDelete,omitempty"` + // Operate in XDR mode. Some external connectors may need to emulate an XDR client. + // If enabled, an XDR bit is set for writes in the wire protocol. + // + // Default: false. + Xdr *bool `protobuf:"varint,15,opt,name=xdr,proto3,oneof" json:"xdr,omitempty"` +} + +func (x *BackgroundExecutePolicy) Reset() { + *x = BackgroundExecutePolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackgroundExecutePolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackgroundExecutePolicy) ProtoMessage() {} + +func (x *BackgroundExecutePolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackgroundExecutePolicy.ProtoReflect.Descriptor instead. +func (*BackgroundExecutePolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{15} +} + +func (x *BackgroundExecutePolicy) GetReplica() Replica { + if x != nil { + return x.Replica + } + return Replica_SEQUENCE +} + +func (x *BackgroundExecutePolicy) GetReadModeAP() ReadModeAP { + if x != nil { + return x.ReadModeAP + } + return ReadModeAP_ONE +} + +func (x *BackgroundExecutePolicy) GetReadModeSC() ReadModeSC { + if x != nil { + return x.ReadModeSC + } + return ReadModeSC_SESSION +} + +func (x *BackgroundExecutePolicy) GetCompress() bool { + if x != nil { + return x.Compress + } + return false +} + +func (x *BackgroundExecutePolicy) GetExpression() []byte { + if x != nil { + return x.Expression + } + return nil +} + +func (x *BackgroundExecutePolicy) GetTotalTimeout() uint32 { + if x != nil && x.TotalTimeout != nil { + return *x.TotalTimeout + } + return 0 +} + +func (x *BackgroundExecutePolicy) GetSendKey() bool { + if x != nil && x.SendKey != nil { + return *x.SendKey + } + return false +} + +func (x *BackgroundExecutePolicy) GetRecordExistsAction() RecordExistsAction { + if x != nil && x.RecordExistsAction != nil { + return *x.RecordExistsAction + } + return RecordExistsAction_UPDATE +} + +func (x *BackgroundExecutePolicy) GetGenerationPolicy() GenerationPolicy { + if x != nil && x.GenerationPolicy != nil { + return *x.GenerationPolicy + } + return GenerationPolicy_NONE +} + +func (x *BackgroundExecutePolicy) GetCommitLevel() CommitLevel { + if x != nil && x.CommitLevel != nil { + return *x.CommitLevel + } + return CommitLevel_COMMIT_ALL +} + +func (x *BackgroundExecutePolicy) GetGeneration() uint32 { + if x != nil && x.Generation != nil { + return *x.Generation + } + return 0 +} + +func (x *BackgroundExecutePolicy) GetExpiration() uint32 { + if x != nil && x.Expiration != nil { + return *x.Expiration + } + return 0 +} + +func (x *BackgroundExecutePolicy) GetRespondAllOps() bool { + if x != nil && x.RespondAllOps != nil { + return *x.RespondAllOps + } + return false +} + +func (x *BackgroundExecutePolicy) GetDurableDelete() bool { + if x != nil && x.DurableDelete != nil { + return *x.DurableDelete + } + return false +} + +func (x *BackgroundExecutePolicy) GetXdr() bool { + if x != nil && x.Xdr != nil { + return *x.Xdr + } + return false +} + +type BackgroundExecuteRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Background write policy + WritePolicy *BackgroundExecutePolicy `protobuf:"bytes,1,opt,name=writePolicy,proto3,oneof" json:"writePolicy,omitempty"` + // The statement containing the UDF function reference + // or the operations to be performed on matching record + Statement *Statement `protobuf:"bytes,2,opt,name=statement,proto3" json:"statement,omitempty"` +} + +func (x *BackgroundExecuteRequest) Reset() { + *x = BackgroundExecuteRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackgroundExecuteRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackgroundExecuteRequest) ProtoMessage() {} + +func (x *BackgroundExecuteRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackgroundExecuteRequest.ProtoReflect.Descriptor instead. +func (*BackgroundExecuteRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{16} +} + +func (x *BackgroundExecuteRequest) GetWritePolicy() *BackgroundExecutePolicy { + if x != nil { + return x.WritePolicy + } + return nil +} + +func (x *BackgroundExecuteRequest) GetStatement() *Statement { + if x != nil { + return x.Statement + } + return nil +} + +type BackgroundTaskStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The id of the task. + TaskId int64 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId,omitempty"` + // If true indicates the task is a scan task else task is a query + IsScan bool `protobuf:"varint,2,opt,name=isScan,proto3" json:"isScan,omitempty"` +} + +func (x *BackgroundTaskStatusRequest) Reset() { + *x = BackgroundTaskStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BackgroundTaskStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackgroundTaskStatusRequest) ProtoMessage() {} + +func (x *BackgroundTaskStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackgroundTaskStatusRequest.ProtoReflect.Descriptor instead. +func (*BackgroundTaskStatusRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{17} +} + +func (x *BackgroundTaskStatusRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *BackgroundTaskStatusRequest) GetIsScan() bool { + if x != nil { + return x.IsScan + } + return false +} + +// Abort a request identified by id in the stream. +type AbortRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Unique identifier of the corresponding request in the stream to abort. + // Not to be confused with the AbortRequest's id in the stream. + AbortId uint32 `protobuf:"varint,1,opt,name=abortId,proto3" json:"abortId,omitempty"` +} + +func (x *AbortRequest) Reset() { + *x = AbortRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AbortRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AbortRequest) ProtoMessage() {} + +func (x *AbortRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AbortRequest.ProtoReflect.Descriptor instead. +func (*AbortRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{18} +} + +func (x *AbortRequest) GetAbortId() uint32 { + if x != nil { + return x.AbortId + } + return 0 +} + +// Info policy for info request +type InfoPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Info command socket timeout in milliseconds. + // + // Default: 1000 + Timeout *uint32 `protobuf:"varint,1,opt,name=timeout,proto3,oneof" json:"timeout,omitempty"` +} + +func (x *InfoPolicy) Reset() { + *x = InfoPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoPolicy) ProtoMessage() {} + +func (x *InfoPolicy) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfoPolicy.ProtoReflect.Descriptor instead. +func (*InfoPolicy) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{19} +} + +func (x *InfoPolicy) GetTimeout() uint32 { + if x != nil && x.Timeout != nil { + return *x.Timeout + } + return 0 +} + +// Info request +type InfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InfoPolicy *InfoPolicy `protobuf:"bytes,1,opt,name=infoPolicy,proto3,oneof" json:"infoPolicy,omitempty"` + Commands []string `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` +} + +func (x *InfoRequest) Reset() { + *x = InfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aerospike_proxy_kv_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoRequest) ProtoMessage() {} + +func (x *InfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_aerospike_proxy_kv_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead. +func (*InfoRequest) Descriptor() ([]byte, []int) { + return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{20} +} + +func (x *InfoRequest) GetInfoPolicy() *InfoPolicy { + if x != nil { + return x.InfoPolicy + } + return nil +} + +func (x *InfoRequest) GetCommands() []string { + if x != nil { + return x.Commands + } + return nil +} + +var File_aerospike_proxy_kv_proto protoreflect.FileDescriptor + +var file_aerospike_proxy_kv_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x5f, 0x6b, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x41, 0x62, + 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x29, 0x0a, 0x0d, 0x41, 0x62, + 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, + 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, + 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, + 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, + 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, + 0x53, 0x43, 0x22, 0x8b, 0x01, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, + 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, + 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, + 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, + 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, + 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, + 0x22, 0x81, 0x06, 0x0a, 0x17, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x30, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x73, + 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x02, + 0x52, 0x0b, 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x36, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x03, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x0c, 0x61, 0x62, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x04, 0x52, + 0x0c, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, + 0x12, 0x5a, 0x0a, 0x18, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x05, 0x52, + 0x18, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x63, 0x0a, 0x1b, + 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, + 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x06, 0x52, 0x1b, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, + 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x07, 0x52, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x61, 0x62, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x62, 0x61, 0x63, 0x6b, + 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xf9, 0x01, 0x0a, 0x18, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x44, + 0x6f, 0x75, 0x62, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x6e, 0x44, 0x6f, + 0x75, 0x62, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x12, 0x4e, 0x0a, 0x14, 0x62, 0x61, 0x63, 0x6b, 0x67, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x14, + 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x62, 0x61, 0x63, 0x6b, + 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x22, 0xdd, 0x04, 0x0a, 0x0a, 0x53, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, + 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, + 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, + 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, + 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, + 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, + 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x48, 0x02, 0x52, 0x0a, 0x6d, + 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x10, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, + 0x0f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, + 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x43, + 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x06, 0x52, 0x0e, 0x69, 0x6e, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, + 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0d, + 0x0a, 0x0b, 0x5f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x13, 0x0a, + 0x11, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, 0x61, 0x78, 0x43, 0x6f, + 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x11, 0x0a, + 0x0f, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, + 0x22, 0x8d, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x56, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x04, 0x62, 0x56, 0x61, 0x6c, 0x88, + 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x02, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x14, 0x0a, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x72, 0x65, 0x74, 0x72, 0x79, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x62, 0x56, 0x61, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x88, + 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x65, 0x67, + 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x88, 0x02, + 0x0a, 0x0b, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, + 0x0a, 0x73, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, + 0x52, 0x0a, 0x73, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, + 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, + 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, + 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, + 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x63, + 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x9f, 0x06, 0x0a, 0x0b, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, + 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, + 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, + 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, + 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, + 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x02, 0x52, 0x0c, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x33, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, 0x12, 0x6d, + 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x51, 0x75, + 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x04, 0x52, + 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x51, 0x75, 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0e, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, + 0x12, 0x35, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x06, 0x52, + 0x13, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x48, 0x07, 0x52, 0x0a, 0x73, + 0x68, 0x6f, 0x72, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, + 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0d, 0x48, 0x08, 0x52, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x09, 0x52, + 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, + 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, + 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x51, 0x75, 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, + 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x42, 0x16, + 0x0a, 0x14, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xdb, 0x01, 0x0a, 0x06, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6c, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, + 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, + 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x88, 0x01, + 0x01, 0x12, 0x15, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x02, + 0x52, 0x03, 0x65, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x63, + 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x65, 0x67, 0x69, 0x6e, + 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x65, 0x6e, 0x64, 0x22, 0x7f, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x62, 0x69, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x62, 0x69, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x42, + 0x08, 0x0a, 0x06, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8a, 0x04, 0x0a, 0x09, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x66, + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x22, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, 0x73, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x72, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x1b, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, + 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x04, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x2f, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x05, 0x52, 0x10, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x88, + 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0c, + 0x0a, 0x0a, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, + 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x73, 0x6b, + 0x49, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x09, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0a, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x61, 0x63, 0x6b, + 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x48, 0x01, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xcc, 0x06, 0x0a, 0x17, + 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, + 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, + 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, + 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, + 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, + 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x0c, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, + 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, + 0x48, 0x02, 0x52, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x48, + 0x0a, 0x12, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x03, 0x52, 0x12, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x04, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x48, + 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x88, 0x01, + 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x06, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x07, 0x52, 0x0a, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4f, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, + 0x4f, 0x70, 0x73, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, + 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x48, 0x09, 0x52, + 0x0d, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x88, 0x01, + 0x01, 0x12, 0x15, 0x0a, 0x03, 0x78, 0x64, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0a, + 0x52, 0x03, 0x78, 0x64, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, + 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x6e, + 0x64, 0x4b, 0x65, 0x79, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, + 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, + 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4f, 0x70, 0x73, + 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x78, 0x64, 0x72, 0x22, 0x95, 0x01, 0x0a, 0x18, 0x42, + 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x42, + 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x22, 0x4d, 0x0a, 0x1b, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, + 0x63, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x63, 0x61, + 0x6e, 0x22, 0x28, 0x0a, 0x0c, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x07, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x0a, 0x49, + 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x0a, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x22, 0x6a, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x2a, 0x1e, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x07, + 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x01, + 0x2a, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, + 0x49, 0x4e, 0x45, 0x41, 0x52, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x10, 0x02, 0x12, 0x15, 0x0a, + 0x11, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, + 0x4c, 0x45, 0x10, 0x03, 0x2a, 0x53, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, + 0x0c, 0x0a, 0x08, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x4d, 0x41, 0x53, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x41, 0x53, + 0x54, 0x45, 0x52, 0x5f, 0x50, 0x52, 0x4f, 0x4c, 0x45, 0x53, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, + 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5f, 0x52, 0x41, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x0a, 0x0a, + 0x06, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x10, 0x04, 0x2a, 0x37, 0x0a, 0x0d, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, + 0x4e, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, + 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x4e, 0x47, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x58, 0x5f, 0x41, 0x50, + 0x10, 0x02, 0x2a, 0x48, 0x0a, 0x13, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, + 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x01, + 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x50, 0x4b, 0x45, 0x59, 0x53, 0x10, 0x02, 0x12, 0x0d, 0x0a, + 0x09, 0x4d, 0x41, 0x50, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x10, 0x03, 0x2a, 0x84, 0x02, 0x0a, + 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, + 0x0a, 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x41, 0x44, + 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x52, 0x49, + 0x54, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x44, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x44, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, + 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x05, + 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, 0x50, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x06, + 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, + 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x5f, 0x4d, + 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x09, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x50, 0x50, 0x45, 0x4e, + 0x44, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x10, 0x0b, + 0x12, 0x09, 0x0a, 0x05, 0x54, 0x4f, 0x55, 0x43, 0x48, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x42, + 0x49, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x0d, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x49, 0x54, + 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x0e, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, + 0x45, 0x54, 0x45, 0x10, 0x0f, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x4c, 0x4c, 0x5f, 0x52, 0x45, 0x41, + 0x44, 0x10, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x4c, 0x4c, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, + 0x59, 0x10, 0x11, 0x2a, 0x61, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, + 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, + 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, + 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x5f, 0x4f, + 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, + 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x2a, 0x45, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, + 0x4e, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x5f, 0x47, + 0x45, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x45, 0x58, + 0x50, 0x45, 0x43, 0x54, 0x5f, 0x47, 0x45, 0x4e, 0x5f, 0x47, 0x54, 0x10, 0x02, 0x2a, 0x30, 0x0a, + 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x0a, + 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x5f, 0x4d, 0x41, 0x53, 0x54, 0x45, 0x52, 0x10, 0x01, 0x2a, + 0x44, 0x0a, 0x14, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, + 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, + 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, + 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, 0x50, 0x4c, + 0x45, 0x54, 0x45, 0x10, 0x02, 0x32, 0x2f, 0x0a, 0x05, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x12, 0x26, + 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0d, 0x2e, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x9c, 0x0a, 0x0a, 0x03, 0x4b, 0x56, 0x53, 0x12, 0x3d, + 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4a, 0x0a, + 0x0d, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, + 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4f, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3f, + 0x0a, 0x06, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, + 0x4c, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, + 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3e, 0x0a, + 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4b, 0x0a, + 0x0e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, + 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, + 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, + 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0f, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, + 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x05, 0x54, 0x6f, 0x75, + 0x63, 0x68, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, + 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x54, 0x6f, 0x75, + 0x63, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, + 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, + 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x10, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, + 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, + 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x10, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, + 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x47, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, + 0x68, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, + 0x01, 0x12, 0x52, 0x0a, 0x15, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, + 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, + 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x93, 0x01, 0x0a, 0x04, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x3f, + 0x0a, 0x04, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, + 0x4a, 0x0a, 0x0d, 0x53, 0x63, 0x61, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, + 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0xea, 0x03, 0x0a, 0x05, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x18, + 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, + 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, + 0x28, 0x01, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x11, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, + 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, + 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x57, 0x0a, 0x1a, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, + 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x14, 0x42, + 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5a, 0x0a, 0x1d, + 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, + 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, + 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x45, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x3d, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, + 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x42, + 0x57, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x39, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, + 0x69, 0x6b, 0x65, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x2d, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x37, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6b, 0x76, 0x73, 0x3b, 0x6b, 0x76, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aerospike_proxy_kv_proto_rawDescOnce sync.Once + file_aerospike_proxy_kv_proto_rawDescData = file_aerospike_proxy_kv_proto_rawDesc +) + +func file_aerospike_proxy_kv_proto_rawDescGZIP() []byte { + file_aerospike_proxy_kv_proto_rawDescOnce.Do(func() { + file_aerospike_proxy_kv_proto_rawDescData = protoimpl.X.CompressGZIP(file_aerospike_proxy_kv_proto_rawDescData) + }) + return file_aerospike_proxy_kv_proto_rawDescData +} + +var file_aerospike_proxy_kv_proto_enumTypes = make([]protoimpl.EnumInfo, 10) +var file_aerospike_proxy_kv_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_aerospike_proxy_kv_proto_goTypes = []interface{}{ + (ReadModeAP)(0), // 0: ReadModeAP + (ReadModeSC)(0), // 1: ReadModeSC + (Replica)(0), // 2: Replica + (QueryDuration)(0), // 3: QueryDuration + (IndexCollectionType)(0), // 4: IndexCollectionType + (OperationType)(0), // 5: OperationType + (RecordExistsAction)(0), // 6: RecordExistsAction + (GenerationPolicy)(0), // 7: GenerationPolicy + (CommitLevel)(0), // 8: CommitLevel + (BackgroundTaskStatus)(0), // 9: BackgroundTaskStatus + (*AboutRequest)(nil), // 10: AboutRequest + (*AboutResponse)(nil), // 11: AboutResponse + (*ReadPolicy)(nil), // 12: ReadPolicy + (*WritePolicy)(nil), // 13: WritePolicy + (*AerospikeRequestPayload)(nil), // 14: AerospikeRequestPayload + (*AerospikeResponsePayload)(nil), // 15: AerospikeResponsePayload + (*ScanPolicy)(nil), // 16: ScanPolicy + (*PartitionStatus)(nil), // 17: PartitionStatus + (*PartitionFilter)(nil), // 18: PartitionFilter + (*ScanRequest)(nil), // 19: ScanRequest + (*QueryPolicy)(nil), // 20: QueryPolicy + (*Filter)(nil), // 21: Filter + (*Operation)(nil), // 22: Operation + (*Statement)(nil), // 23: Statement + (*QueryRequest)(nil), // 24: QueryRequest + (*BackgroundExecutePolicy)(nil), // 25: BackgroundExecutePolicy + (*BackgroundExecuteRequest)(nil), // 26: BackgroundExecuteRequest + (*BackgroundTaskStatusRequest)(nil), // 27: BackgroundTaskStatusRequest + (*AbortRequest)(nil), // 28: AbortRequest + (*InfoPolicy)(nil), // 29: InfoPolicy + (*InfoRequest)(nil), // 30: InfoRequest +} +var file_aerospike_proxy_kv_proto_depIdxs = []int32{ + 2, // 0: ReadPolicy.replica:type_name -> Replica + 0, // 1: ReadPolicy.readModeAP:type_name -> ReadModeAP + 1, // 2: ReadPolicy.readModeSC:type_name -> ReadModeSC + 2, // 3: WritePolicy.replica:type_name -> Replica + 0, // 4: WritePolicy.readModeAP:type_name -> ReadModeAP + 1, // 5: WritePolicy.readModeSC:type_name -> ReadModeSC + 12, // 6: AerospikeRequestPayload.readPolicy:type_name -> ReadPolicy + 13, // 7: AerospikeRequestPayload.writePolicy:type_name -> WritePolicy + 19, // 8: AerospikeRequestPayload.scanRequest:type_name -> ScanRequest + 24, // 9: AerospikeRequestPayload.queryRequest:type_name -> QueryRequest + 28, // 10: AerospikeRequestPayload.abortRequest:type_name -> AbortRequest + 26, // 11: AerospikeRequestPayload.backgroundExecuteRequest:type_name -> BackgroundExecuteRequest + 27, // 12: AerospikeRequestPayload.backgroundTaskStatusRequest:type_name -> BackgroundTaskStatusRequest + 30, // 13: AerospikeRequestPayload.infoRequest:type_name -> InfoRequest + 9, // 14: AerospikeResponsePayload.backgroundTaskStatus:type_name -> BackgroundTaskStatus + 2, // 15: ScanPolicy.replica:type_name -> Replica + 0, // 16: ScanPolicy.readModeAP:type_name -> ReadModeAP + 1, // 17: ScanPolicy.readModeSC:type_name -> ReadModeSC + 17, // 18: PartitionFilter.partitionStatuses:type_name -> PartitionStatus + 16, // 19: ScanRequest.scanPolicy:type_name -> ScanPolicy + 18, // 20: ScanRequest.partitionFilter:type_name -> PartitionFilter + 2, // 21: QueryPolicy.replica:type_name -> Replica + 0, // 22: QueryPolicy.readModeAP:type_name -> ReadModeAP + 1, // 23: QueryPolicy.readModeSC:type_name -> ReadModeSC + 3, // 24: QueryPolicy.expectedDuration:type_name -> QueryDuration + 4, // 25: Filter.colType:type_name -> IndexCollectionType + 5, // 26: Operation.type:type_name -> OperationType + 21, // 27: Statement.filter:type_name -> Filter + 22, // 28: Statement.operations:type_name -> Operation + 20, // 29: QueryRequest.queryPolicy:type_name -> QueryPolicy + 23, // 30: QueryRequest.statement:type_name -> Statement + 18, // 31: QueryRequest.partitionFilter:type_name -> PartitionFilter + 2, // 32: BackgroundExecutePolicy.replica:type_name -> Replica + 0, // 33: BackgroundExecutePolicy.readModeAP:type_name -> ReadModeAP + 1, // 34: BackgroundExecutePolicy.readModeSC:type_name -> ReadModeSC + 6, // 35: BackgroundExecutePolicy.recordExistsAction:type_name -> RecordExistsAction + 7, // 36: BackgroundExecutePolicy.generationPolicy:type_name -> GenerationPolicy + 8, // 37: BackgroundExecutePolicy.commitLevel:type_name -> CommitLevel + 25, // 38: BackgroundExecuteRequest.writePolicy:type_name -> BackgroundExecutePolicy + 23, // 39: BackgroundExecuteRequest.statement:type_name -> Statement + 29, // 40: InfoRequest.infoPolicy:type_name -> InfoPolicy + 10, // 41: About.Get:input_type -> AboutRequest + 14, // 42: KVS.Read:input_type -> AerospikeRequestPayload + 14, // 43: KVS.ReadStreaming:input_type -> AerospikeRequestPayload + 14, // 44: KVS.GetHeader:input_type -> AerospikeRequestPayload + 14, // 45: KVS.GetHeaderStreaming:input_type -> AerospikeRequestPayload + 14, // 46: KVS.Exists:input_type -> AerospikeRequestPayload + 14, // 47: KVS.ExistsStreaming:input_type -> AerospikeRequestPayload + 14, // 48: KVS.Write:input_type -> AerospikeRequestPayload + 14, // 49: KVS.WriteStreaming:input_type -> AerospikeRequestPayload + 14, // 50: KVS.Delete:input_type -> AerospikeRequestPayload + 14, // 51: KVS.DeleteStreaming:input_type -> AerospikeRequestPayload + 14, // 52: KVS.Touch:input_type -> AerospikeRequestPayload + 14, // 53: KVS.TouchStreaming:input_type -> AerospikeRequestPayload + 14, // 54: KVS.Operate:input_type -> AerospikeRequestPayload + 14, // 55: KVS.OperateStreaming:input_type -> AerospikeRequestPayload + 14, // 56: KVS.Execute:input_type -> AerospikeRequestPayload + 14, // 57: KVS.ExecuteStreaming:input_type -> AerospikeRequestPayload + 14, // 58: KVS.BatchOperate:input_type -> AerospikeRequestPayload + 14, // 59: KVS.BatchOperateStreaming:input_type -> AerospikeRequestPayload + 14, // 60: Scan.Scan:input_type -> AerospikeRequestPayload + 14, // 61: Scan.ScanStreaming:input_type -> AerospikeRequestPayload + 14, // 62: Query.Query:input_type -> AerospikeRequestPayload + 14, // 63: Query.QueryStreaming:input_type -> AerospikeRequestPayload + 14, // 64: Query.BackgroundExecute:input_type -> AerospikeRequestPayload + 14, // 65: Query.BackgroundExecuteStreaming:input_type -> AerospikeRequestPayload + 14, // 66: Query.BackgroundTaskStatus:input_type -> AerospikeRequestPayload + 14, // 67: Query.BackgroundTaskStatusStreaming:input_type -> AerospikeRequestPayload + 14, // 68: Info.Info:input_type -> AerospikeRequestPayload + 11, // 69: About.Get:output_type -> AboutResponse + 15, // 70: KVS.Read:output_type -> AerospikeResponsePayload + 15, // 71: KVS.ReadStreaming:output_type -> AerospikeResponsePayload + 15, // 72: KVS.GetHeader:output_type -> AerospikeResponsePayload + 15, // 73: KVS.GetHeaderStreaming:output_type -> AerospikeResponsePayload + 15, // 74: KVS.Exists:output_type -> AerospikeResponsePayload + 15, // 75: KVS.ExistsStreaming:output_type -> AerospikeResponsePayload + 15, // 76: KVS.Write:output_type -> AerospikeResponsePayload + 15, // 77: KVS.WriteStreaming:output_type -> AerospikeResponsePayload + 15, // 78: KVS.Delete:output_type -> AerospikeResponsePayload + 15, // 79: KVS.DeleteStreaming:output_type -> AerospikeResponsePayload + 15, // 80: KVS.Touch:output_type -> AerospikeResponsePayload + 15, // 81: KVS.TouchStreaming:output_type -> AerospikeResponsePayload + 15, // 82: KVS.Operate:output_type -> AerospikeResponsePayload + 15, // 83: KVS.OperateStreaming:output_type -> AerospikeResponsePayload + 15, // 84: KVS.Execute:output_type -> AerospikeResponsePayload + 15, // 85: KVS.ExecuteStreaming:output_type -> AerospikeResponsePayload + 15, // 86: KVS.BatchOperate:output_type -> AerospikeResponsePayload + 15, // 87: KVS.BatchOperateStreaming:output_type -> AerospikeResponsePayload + 15, // 88: Scan.Scan:output_type -> AerospikeResponsePayload + 15, // 89: Scan.ScanStreaming:output_type -> AerospikeResponsePayload + 15, // 90: Query.Query:output_type -> AerospikeResponsePayload + 15, // 91: Query.QueryStreaming:output_type -> AerospikeResponsePayload + 15, // 92: Query.BackgroundExecute:output_type -> AerospikeResponsePayload + 15, // 93: Query.BackgroundExecuteStreaming:output_type -> AerospikeResponsePayload + 15, // 94: Query.BackgroundTaskStatus:output_type -> AerospikeResponsePayload + 15, // 95: Query.BackgroundTaskStatusStreaming:output_type -> AerospikeResponsePayload + 15, // 96: Info.Info:output_type -> AerospikeResponsePayload + 69, // [69:97] is the sub-list for method output_type + 41, // [41:69] is the sub-list for method input_type + 41, // [41:41] is the sub-list for extension type_name + 41, // [41:41] is the sub-list for extension extendee + 0, // [0:41] is the sub-list for field type_name +} + +func init() { file_aerospike_proxy_kv_proto_init() } +func file_aerospike_proxy_kv_proto_init() { + if File_aerospike_proxy_kv_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_aerospike_proxy_kv_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AboutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AboutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WritePolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AerospikeRequestPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AerospikeResponsePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScanPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PartitionFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Operation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Statement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackgroundExecutePolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackgroundExecuteRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BackgroundTaskStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AbortRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aerospike_proxy_kv_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_aerospike_proxy_kv_proto_msgTypes[4].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[5].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[6].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[8].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[9].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[10].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[11].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[12].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[13].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[14].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[16].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[19].OneofWrappers = []interface{}{} + file_aerospike_proxy_kv_proto_msgTypes[20].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aerospike_proxy_kv_proto_rawDesc, + NumEnums: 10, + NumMessages: 21, + NumExtensions: 0, + NumServices: 5, + }, + GoTypes: file_aerospike_proxy_kv_proto_goTypes, + DependencyIndexes: file_aerospike_proxy_kv_proto_depIdxs, + EnumInfos: file_aerospike_proxy_kv_proto_enumTypes, + MessageInfos: file_aerospike_proxy_kv_proto_msgTypes, + }.Build() + File_aerospike_proxy_kv_proto = out.File + file_aerospike_proxy_kv_proto_rawDesc = nil + file_aerospike_proxy_kv_proto_goTypes = nil + file_aerospike_proxy_kv_proto_depIdxs = nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto new file mode 100644 index 00000000..be32978c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto @@ -0,0 +1,831 @@ +syntax = "proto3"; + +option go_package = "github.com/aerospike/aerospike-client-go/v7/proto/kvs;kvs"; +option java_package = "com.aerospike.proxy.client"; + + +// The about request message. +message AboutRequest { + // Empty for now. +} + +// The about response message. +message AboutResponse { + // Proxy server version. + string version = 1; +} + +// Read policy for AP (availability) namespaces. +// How duplicates should be consulted in a read operation. +// Only makes a difference during migrations and only applicable in AP mode. +enum ReadModeAP { + // Involve single node in the read operation. + ONE = 0; + + // Involve all duplicates in the read operation. + ALL = 1; +} + +// Read policy for SC (strong consistency) namespaces. +// Determines SC read consistency options. +enum ReadModeSC { + // Ensures this client will only see an increasing sequence of record versions. + // Server only reads from master. This is the default. + SESSION = 0; + + // Ensures ALL clients will only see an increasing sequence of record versions. + // Server only reads from master. + LINEARIZE = 1; + + // Server may read from master or any full (non-migrating) replica. + // Increasing sequence of record versions is not guaranteed. + ALLOW_REPLICA = 2; + + // Server may read from master or any full (non-migrating) replica or from unavailable + // partitions. Increasing sequence of record versions is not guaranteed. + ALLOW_UNAVAILABLE = 3; +} + +// Defines algorithm used to determine the target node for a command. +// Scan and query are not affected by replica algorithm. +// +// Note: The enum ordinals do not match the Aerospike Client ordinals because +// the default has to be ordinal zero in protobuf. +enum Replica { + // Try node containing master partition first. + // If connection fails, all commands try nodes containing replicated partitions. + // If socketTimeout is reached, reads also try nodes containing replicated partitions, + // but writes remain on master node. + SEQUENCE = 0; + + // Use node containing key's master partition. + MASTER = 1; + + // Distribute reads across nodes containing key's master and replicated partitions + // in round-robin fashion. Writes always use node containing key's master partition. + MASTER_PROLES = 2; + + // Try node on the same rack as the client first. If timeout or there are no nodes on the + // same rack, use SEQUENCE instead. + PREFER_RACK = 3; + + // Distribute reads across all nodes in cluster in round-robin fashion. + // Writes always use node containing key's master partition. + // This option is useful when the replication factor equals the number + // of nodes in the cluster and the overhead of requesting proles is not desired. + RANDOM = 4; +} + +enum QueryDuration { + // The query is expected to return more than 100 records per node. The server optimizes for a large record set. + LONG = 0; + + // The query is expected to return less than 100 records per node. The server optimizes for a small record set. + SHORT = 1; + + // Treat query as a LONG query, but relax read consistency for AP namespaces. + // This value is treated exactly like LONG for server versions < 7.1. + LONG_RELAX_AP = 2; +} + +// Read policy attributes used in read database commands that are not part of +// the wire protocol. +message ReadPolicy { + // Read policy for AP (availability) namespaces. + Replica replica = 1; + + // Read policy for SC (strong consistency) namespaces. + ReadModeAP readModeAP = 2; + + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC readModeSC = 3; +} + +// Write policy attributes used in write database commands that are not part of +// the wire protocol. +message WritePolicy { + // Read policy for AP (availability) namespaces. + Replica replica = 1; + + // Read policy for SC (strong consistency) namespaces. + ReadModeAP readModeAP = 2; + + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC readModeSC = 3; +} + + +// The request message containing the user's name. +message AerospikeRequestPayload { + // Unique identifier of the request in the stream. + uint32 id = 1; + + // Client iteration number starting at 1. On first attempt iteration should + // be 1. On first retry iteration should be 2, on second retry iteration + // should be 3, and so on. + uint32 iteration = 2; + + // Aerospike wire format request payload. + bytes payload = 3; + + // Read policy for read requests. + optional ReadPolicy readPolicy = 4; + + // Write policy for write requests. + optional WritePolicy writePolicy = 5; + + // Scan request for scan. + optional ScanRequest scanRequest = 6; + + // Request for running a query. + optional QueryRequest queryRequest = 7; + + // Abort a scan/query on application error. + optional AbortRequest abortRequest = 8; + + // Request for executing operations background on matching records. + optional BackgroundExecuteRequest backgroundExecuteRequest = 9; + + // Request for getting background task status. + optional BackgroundTaskStatusRequest backgroundTaskStatusRequest = 10; + + // Info request + optional InfoRequest infoRequest = 11; +} + +// The request message containing the user's name. +message AerospikeResponsePayload { + // Unique identifier of the corresponding request in the stream. + uint32 id = 1; + + // Status of the corresponding request. + // if status equals 0 + // The proxy received a valid response from Aerospike. The payload's + // result code should be used as the client result code. + // else + // The request failed at the proxy. This status should be used + // as the client result code. + int32 status = 2; + + // This flag indicates that the write transaction may have completed, + // even though the client sees an error. + bool inDoubt = 3; + + // Aerospike wire format request payload. + bytes payload = 4; + + // For requests with multiple responses like batch and queries, + // hasNext flag indicates if there are more responses to follow this + // response or if this is the last response for this request. + bool hasNext = 5; + + // Background task status, populated for background task request. + optional BackgroundTaskStatus backgroundTaskStatus = 6; +} + +// Information about the service. +service About { + rpc Get (AboutRequest) returns (AboutResponse) {} +} + +// Aerospike KVS operations service +service KVS { + // Read a single record + rpc Read (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process stream of single record read requests. + rpc ReadStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Get a single record header containing metadata like generation, expiration + rpc GetHeader (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process stream of single record get header requests. + rpc GetHeaderStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Check if a record exists. + rpc Exists (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process stream of single record exist requests. + rpc ExistsStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Write a single record + rpc Write (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process a stream of single record write requests. + rpc WriteStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Delete a single record. + rpc Delete (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process a stream of single record delete requests. + rpc DeleteStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Reset single record's time to expiration using the write policy's expiration. + rpc Touch (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process a stream of single record touch requests. + rpc TouchStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Perform multiple read/write operations on a single key in one batch call. + rpc Operate (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Perform a stream of operate requests. + rpc OperateStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Execute single key user defined function on server and return results. + rpc Execute (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} + + // Process a stream of single record execute requests. + rpc ExecuteStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Process batch requests. + rpc BatchOperate (AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Process a stream of batch requests. + rpc BatchOperateStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} +} + +// Scan policy attributes used by queries. +// Scan requests are send completely using proto buffers and hence include all policy attributes. +message ScanPolicy { + // Read policy for AP (availability) namespaces. + Replica replica = 1; + + // Read policy for SC (strong consistency) namespaces. + ReadModeAP readModeAP = 2; + + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and scan are not affected by replica algorithms. + ReadModeSC readModeSC = 3; + + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + bool compress = 4; + + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + optional bytes expression = 5; + + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + optional uint32 totalTimeout = 6; + + // Approximate number of records to return to client. This number is divided by the + // number of nodes involved in the scan. The actual number of records returned + // may be less than maxRecords if node record counts are small and unbalanced across + // nodes. + // Default: 0 (do not limit record count) + optional uint64 maxRecords = 7; + + // Limit returned records per second (rps) rate for each server. + // Do not apply rps limit if recordsPerSecond is zero. + // Default: 0 + optional uint32 recordsPerSecond = 8; + + // Should scan requests be issued in parallel. + // Default: true + optional bool concurrentNodes = 9; + + // Maximum number of concurrent requests to server nodes at any point in time. + // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries + // will be made to 8 nodes in parallel. When a scan completes, a new scan will + // be issued until all 16 nodes have been queried. + // Default: 0 (issue requests to all server nodes in parallel) + optional uint32 maxConcurrentNodes = 10; + + // Should bin data be retrieved. If false, only record digests (and user keys + // if stored on the server) are retrieved. + // Default: true + optional bool includeBinData = 11; +} + +// Partition status used to perform partial scans on client side retries. +message PartitionStatus { + // The partition status. + optional uint32 id = 1; + + // Begin value to start scanning / querying after. + optional int64 bVal = 2; + + // Digest to start scanning / querying after. + optional bytes digest = 3; + + // Indicates this partition should be tried. + // Should be set to true for the first attempt as well. + bool retry = 5; +} + +// A partition filter for scans and queries. +message PartitionFilter { + // Start partition id. + // Not required if the digest to start scanning from is specified. + optional uint32 begin = 1; + + // The number of records to scan. + uint32 count = 2; + + // Optional digest to start scanning from. + optional bytes digest = 3; + + // Optional partition statuses used on retries to restart + // from last known record for the partition. + repeated PartitionStatus partitionStatuses = 4; + + // Indicates if all partitions in this filter should + // be retried ignoring the partition status + bool retry = 5; +} + +// A scan request. +message ScanRequest { + // Optional scan policy. + optional ScanPolicy scanPolicy = 1; + + // The namespace to scan. + string namespace = 2; + + // Optional set name. + optional string setName = 3; + + // Optional bin to retrieve. All bins will be returned + // if not specified. + repeated string binNames = 4; + + // Optional partition filter to selectively scan partitions. + optional PartitionFilter partitionFilter = 5; +} + +// Aerospike scan +service Scan { + // Scan Aerospike + rpc Scan (AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Process a stream of scan requests + rpc ScanStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} +} + +// Query policy attributes used by queries. +// Query requests are send completely using proto buffers and hence include all policy attributes. +message QueryPolicy { + // Read policy for AP (availability) namespaces. + Replica replica = 1; + + // Read policy for SC (strong consistency) namespaces. + ReadModeAP readModeAP = 2; + + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and query are not affected by replica algorithms. + ReadModeSC readModeSC = 3; + + // Send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + // Default: false (do not send the user defined key) + optional bool sendKey = 4; + + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + bool compress = 5; + + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + optional bytes expression = 6; + + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + optional uint32 totalTimeout = 7; + + // Maximum number of concurrent requests to server nodes at any point in time. + // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries + // will be made to 8 nodes in parallel. When a query completes, a new query will + // be issued until all 16 nodes have been queried. + // Default: 0 (issue requests to all server nodes in parallel) + optional uint32 maxConcurrentNodes = 8; + + // Number of records to place in queue before blocking. + // Records received from multiple server nodes will be placed in a queue. + // A separate thread consumes these records in parallel. + // If the queue is full, the producer threads will block until records are consumed. + // Default: 5000 + optional uint32 recordQueueSize = 9; + + // Should bin data be retrieved. If false, only record digests (and user keys + // if stored on the server) are retrieved. + // Default: true + optional bool includeBinData = 10; + + // Terminate query if cluster is in migration state. If the server supports partition + // queries or the query filter is null (scan), this field is ignored. + // Default: false + optional bool failOnClusterChange = 11; + + // Deprecated, use expectedDuration instead. + // Is query expected to return less than 100 records per node. + // If true, the server will optimize the query for a small record set. + // This field is ignored for aggregation queries, background queries + // and server versions < 6.0. + // Default: false + optional bool shortQuery = 12; + + // Timeout in milliseconds for "cluster-stable" info command that is run when + // failOnClusterChange is true and server version is less than 6.0. + // Default: 1000 + optional uint32 infoTimeout = 13; + + // Expected query duration. The server treats the query in different ways depending on the expected duration. + // This field is ignored for aggregation queries, background queries and server versions less than 6.0. + // Default: QueryDuration.LONG + optional QueryDuration expectedDuration = 14; +} + + +// Secondary index collection type. +enum IndexCollectionType { + // Normal scalar index. + DEFAULT = 0; + + // Index list elements. + LIST = 1; + + // Index map keys. + MAPKEYS = 2; + + // Index map values. + MAPVALUES = 3; +} + +// Query statement filter +message Filter { + // Name of the filter. + string name = 1; + + // Secondary index collection type. + IndexCollectionType colType = 2; + + // Optional filter context packed in Aerospike format. + optional bytes packedCtx = 3; + + // The queried column particle type. + int32 valType = 4; + + // The Aerospike encoded query start "Value" + optional bytes begin = 5 ; + + // The Aerospike encoded query end "Value" + optional bytes end = 6; +} + +enum OperationType { + READ = 0; + READ_HEADER = 1; + WRITE = 2; + CDT_READ = 3; + CDT_MODIFY = 4; + MAP_READ = 5; + MAP_MODIFY = 6; + ADD = 7; + EXP_READ = 8; + EXP_MODIFY = 9; + APPEND = 10; + PREPEND = 11; + TOUCH = 12; + BIT_READ = 13; + BIT_MODIFY = 14; + DELETE = 15; + HLL_READ = 16; + HLL_MODIFY = 17; +} + +// Single record operation. +message Operation { + // The operation type. + OperationType type = 1; + + // Optional bin name. + optional string binName = 2; + + // Optional bin value. + optional bytes value = 3; +} + +// Query statement. +message Statement { + // The namespace to query. + string namespace = 1; + + // Optional set name. + optional string setName = 2; + + // Optional index name. + optional string indexName = 3; + + // Optional bins names to return for each result record. + // If not specified all bins are returned. + repeated string binNames = 4; + + // Optional Filter encoded in Aerospike wire format. + optional Filter filter = 5; + + // Aggregation file name. + string packageName = 6; + + // Aggregation function name. + string functionName = 7; + + // Aggregation function arguments encoded as bytes using Aerospike wire format. + repeated bytes functionArgs = 8; + + // Operations to be performed on query encoded as bytes using Aerospike wire format. + repeated Operation operations = 9; + + // Optional taskId. + optional int64 taskId = 10; + + // Approximate number of records to return to client. This number is divided by the + // number of nodes involved in the scan. The actual number of records returned + // may be less than maxRecords if node record counts are small and unbalanced across + // nodes. + // Default: 0 (do not limit record count) + optional uint64 maxRecords = 11; + + // Limit returned records per second (rps) rate for each server. + // Do not apply rps limit if recordsPerSecond is zero. + // Default: 0 + optional uint32 recordsPerSecond = 12; +} + +// A query request. +message QueryRequest { + // Optional query policy. + optional QueryPolicy queryPolicy = 1; + + // The query statement. + Statement statement = 2; + + // Set to true for background queries. + bool background = 3; + + // Optional partition filter to selectively query partitions. + optional PartitionFilter partitionFilter = 4; +} + +enum RecordExistsAction { + // Create or update record. + // Merge write command bins with existing bins. + UPDATE = 0; + + // Update record only. Fail if record does not exist. + // Merge write command bins with existing bins. + UPDATE_ONLY = 1; + + // Create or replace record. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike server versions >= 3.1.6. + REPLACE = 2; + + // Replace record only. Fail if record does not exist. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike server versions >= 3.1.6. + REPLACE_ONLY = 3; + + // Create only. Fail if record exists. + CREATE_ONLY = 4; +} + +enum GenerationPolicy { + // Do not use record generation to restrict writes. + NONE = 0; + + // Update/delete record if expected generation is equal to server generation. Otherwise, fail. + EXPECT_GEN_EQUAL = 1; + + // Update/delete record if expected generation greater than the server generation. Otherwise, fail. + // This is useful for restore after backup. + EXPECT_GEN_GT = 2; +} + +enum CommitLevel { + // Server should wait until successfully committing master and all replicas. + COMMIT_ALL = 0; + + // Server should wait until successfully committing master only. + COMMIT_MASTER = 1; +} + +message BackgroundExecutePolicy { + // Read policy for AP (availability) namespaces. + Replica replica = 1; + + // Read policy for SC (strong consistency) namespaces. + ReadModeAP readModeAP = 2; + + // Replica algorithm used to determine the target node + // for a single record command. + // Scan and scan are not affected by replica algorithms. + ReadModeSC readModeSC = 3; + + // Use zlib compression on command buffers sent to the server and responses received + // from the server when the buffer size is greater than 128 bytes. + // This option will increase cpu and memory usage (for extra compressed buffers),but + // decrease the size of data sent over the network. + bool compress = 4; + + // Optional expression filter. If filterExp exists and evaluates to false, the + // transaction is ignored. + optional bytes expression = 5; + + // Total transaction timeout in milliseconds. + // Default for all other commands: 1000ms + optional uint32 totalTimeout = 6; + + // Send user defined key in addition to hash digest on both reads and writes. + // If the key is sent on a write, the key will be stored with the record on + // the server. + //

+ // Default: false (do not send the user defined key) + optional bool sendKey = 7; + + // Qualify how to handle writes where the record already exists. + // + // Default: RecordExistsAction.UPDATE + optional RecordExistsAction recordExistsAction = 8; + + // Qualify how to handle record writes based on record generation. The default (NONE) + // indicates that the generation is not used to restrict writes. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: GenerationPolicy.NONE + optional GenerationPolicy generationPolicy = 9; + + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + // + // Default: CommitLevel.COMMIT_ALL + optional CommitLevel commitLevel = 10; + + // Expected generation. Generation is the number of times a record has been modified + // (including creation) on the server. If a write operation is creating a record, + // the expected generation would be 0. This field is only relevant when + // generationPolicy is not NONE. + // + // The server does not support this field for UDF execute() calls. The read-modify-write + // usage model can still be enforced inside the UDF code itself. + // + // Default: 0 + optional uint32 generation = 11; + + // Record expiration. Also known as ttl (time to live). + // Seconds record will live before being removed by the server. + // + // Expiration values: + // + // - -2: Do not change ttl when record is updated. + // - -1: Never expire. + // - 0: Default to namespace configuration variable "default-ttl" on the server. + // - > 0: Actual ttl in seconds.
+ // + // Default: 0 + optional uint32 expiration = 12; + + // For client operate(), return a result for every operation. + // + // Some operations do not return results by default (ListOperation.clear() for example). + // This can make it difficult to determine the desired result offset in the returned + // bin's result list. + // + // Setting respondAllOps to true makes it easier to identify the desired result offset + // (result offset equals bin's operate sequence). If there is a map operation in operate(), + // respondAllOps will be forced to true for that operate() call. + // + // Default: false + optional bool respondAllOps = 13; + + // If the transaction results in a record deletion, leave a tombstone for the record. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition 3.10+ only. + // + // Default: false (do not tombstone deleted records). + optional bool durableDelete = 14; + + // Operate in XDR mode. Some external connectors may need to emulate an XDR client. + // If enabled, an XDR bit is set for writes in the wire protocol. + // + // Default: false. + optional bool xdr = 15; +} + +message BackgroundExecuteRequest { + // Background write policy + optional BackgroundExecutePolicy writePolicy = 1; + + // The statement containing the UDF function reference + // or the operations to be performed on matching record + Statement statement = 2; +} + +enum BackgroundTaskStatus { + // Task not found. + NOT_FOUND = 0; + + // Task in progress. + IN_PROGRESS = 1; + + // Task completed. + COMPLETE = 2; +} + +message BackgroundTaskStatusRequest { + // The id of the task. + int64 taskId = 1; + + // If true indicates the task is a scan task else task is a query + bool isScan = 2; +} + +// Abort a request identified by id in the stream. +message AbortRequest { + // Unique identifier of the corresponding request in the stream to abort. + // Not to be confused with the AbortRequest's id in the stream. + uint32 abortId = 1; +} + +// Aerospike queries +service Query { + // Query Aerospike + rpc Query (AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Process a stream of query requests + rpc QueryStreaming (stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Execute background write on selected records. + rpc BackgroundExecute(AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Execute a stream of background write requests. + rpc BackgroundExecuteStreaming(stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Get status of a background task. + rpc BackgroundTaskStatus(AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} + + // Get status of a stream of background tasks. + rpc BackgroundTaskStatusStreaming(stream AerospikeRequestPayload) returns + (stream AerospikeResponsePayload) {} +} + +// Info policy for info request +message InfoPolicy { + // Info command socket timeout in milliseconds. + // + // Default: 1000 + optional uint32 timeout = 1; +} + +// Info request +message InfoRequest { + optional InfoPolicy infoPolicy = 1; + repeated string commands = 2; +} + +// Aerospike info requests +service Info { + // Send an info request + rpc Info (AerospikeRequestPayload) returns + (AerospikeResponsePayload) {} +} \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go new file mode 100644 index 00000000..7ee945e9 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go @@ -0,0 +1,1926 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v5.27.1 +// source: proto/kvs/aerospike_proxy_kv.proto + +package kvs + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + About_Get_FullMethodName = "/About/Get" +) + +// AboutClient is the client API for About service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AboutClient interface { + Get(ctx context.Context, in *AboutRequest, opts ...grpc.CallOption) (*AboutResponse, error) +} + +type aboutClient struct { + cc grpc.ClientConnInterface +} + +func NewAboutClient(cc grpc.ClientConnInterface) AboutClient { + return &aboutClient{cc} +} + +func (c *aboutClient) Get(ctx context.Context, in *AboutRequest, opts ...grpc.CallOption) (*AboutResponse, error) { + out := new(AboutResponse) + err := c.cc.Invoke(ctx, About_Get_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AboutServer is the server API for About service. +// All implementations must embed UnimplementedAboutServer +// for forward compatibility +type AboutServer interface { + Get(context.Context, *AboutRequest) (*AboutResponse, error) + mustEmbedUnimplementedAboutServer() +} + +// UnimplementedAboutServer must be embedded to have forward compatible implementations. +type UnimplementedAboutServer struct { +} + +func (UnimplementedAboutServer) Get(context.Context, *AboutRequest) (*AboutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedAboutServer) mustEmbedUnimplementedAboutServer() {} + +// UnsafeAboutServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AboutServer will +// result in compilation errors. +type UnsafeAboutServer interface { + mustEmbedUnimplementedAboutServer() +} + +func RegisterAboutServer(s grpc.ServiceRegistrar, srv AboutServer) { + s.RegisterService(&About_ServiceDesc, srv) +} + +func _About_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AboutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AboutServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: About_Get_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AboutServer).Get(ctx, req.(*AboutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// About_ServiceDesc is the grpc.ServiceDesc for About service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var About_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "About", + HandlerType: (*AboutServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _About_Get_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/kvs/aerospike_proxy_kv.proto", +} + +const ( + KVS_Read_FullMethodName = "/KVS/Read" + KVS_ReadStreaming_FullMethodName = "/KVS/ReadStreaming" + KVS_GetHeader_FullMethodName = "/KVS/GetHeader" + KVS_GetHeaderStreaming_FullMethodName = "/KVS/GetHeaderStreaming" + KVS_Exists_FullMethodName = "/KVS/Exists" + KVS_ExistsStreaming_FullMethodName = "/KVS/ExistsStreaming" + KVS_Write_FullMethodName = "/KVS/Write" + KVS_WriteStreaming_FullMethodName = "/KVS/WriteStreaming" + KVS_Delete_FullMethodName = "/KVS/Delete" + KVS_DeleteStreaming_FullMethodName = "/KVS/DeleteStreaming" + KVS_Touch_FullMethodName = "/KVS/Touch" + KVS_TouchStreaming_FullMethodName = "/KVS/TouchStreaming" + KVS_Operate_FullMethodName = "/KVS/Operate" + KVS_OperateStreaming_FullMethodName = "/KVS/OperateStreaming" + KVS_Execute_FullMethodName = "/KVS/Execute" + KVS_ExecuteStreaming_FullMethodName = "/KVS/ExecuteStreaming" + KVS_BatchOperate_FullMethodName = "/KVS/BatchOperate" + KVS_BatchOperateStreaming_FullMethodName = "/KVS/BatchOperateStreaming" +) + +// KVSClient is the client API for KVS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type KVSClient interface { + // Read a single record + Read(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process stream of single record read requests. + ReadStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ReadStreamingClient, error) + // Get a single record header containing metadata like generation, expiration + GetHeader(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process stream of single record get header requests. + GetHeaderStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_GetHeaderStreamingClient, error) + // Check if a record exists. + Exists(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process stream of single record exist requests. + ExistsStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExistsStreamingClient, error) + // Write a single record + Write(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process a stream of single record write requests. + WriteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_WriteStreamingClient, error) + // Delete a single record. + Delete(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process a stream of single record delete requests. + DeleteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_DeleteStreamingClient, error) + // Reset single record's time to expiration using the write policy's expiration. + Touch(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process a stream of single record touch requests. + TouchStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_TouchStreamingClient, error) + // Perform multiple read/write operations on a single key in one batch call. + Operate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Perform a stream of operate requests. + OperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_OperateStreamingClient, error) + // Execute single key user defined function on server and return results. + Execute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) + // Process a stream of single record execute requests. + ExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExecuteStreamingClient, error) + // Process batch requests. + BatchOperate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (KVS_BatchOperateClient, error) + // Process a stream of batch requests. + BatchOperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_BatchOperateStreamingClient, error) +} + +type kVSClient struct { + cc grpc.ClientConnInterface +} + +func NewKVSClient(cc grpc.ClientConnInterface) KVSClient { + return &kVSClient{cc} +} + +func (c *kVSClient) Read(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Read_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) ReadStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ReadStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[0], KVS_ReadStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSReadStreamingClient{stream} + return x, nil +} + +type KVS_ReadStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSReadStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSReadStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSReadStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) GetHeader(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_GetHeader_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) GetHeaderStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_GetHeaderStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[1], KVS_GetHeaderStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSGetHeaderStreamingClient{stream} + return x, nil +} + +type KVS_GetHeaderStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSGetHeaderStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSGetHeaderStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSGetHeaderStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Exists(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Exists_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) ExistsStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExistsStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[2], KVS_ExistsStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSExistsStreamingClient{stream} + return x, nil +} + +type KVS_ExistsStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSExistsStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSExistsStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSExistsStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Write(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Write_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) WriteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_WriteStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[3], KVS_WriteStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSWriteStreamingClient{stream} + return x, nil +} + +type KVS_WriteStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSWriteStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSWriteStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSWriteStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Delete(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Delete_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) DeleteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_DeleteStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[4], KVS_DeleteStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSDeleteStreamingClient{stream} + return x, nil +} + +type KVS_DeleteStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSDeleteStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSDeleteStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSDeleteStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Touch(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Touch_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) TouchStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_TouchStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[5], KVS_TouchStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSTouchStreamingClient{stream} + return x, nil +} + +type KVS_TouchStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSTouchStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSTouchStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSTouchStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Operate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Operate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) OperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_OperateStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[6], KVS_OperateStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSOperateStreamingClient{stream} + return x, nil +} + +type KVS_OperateStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSOperateStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSOperateStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSOperateStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) Execute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, KVS_Execute_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *kVSClient) ExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExecuteStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[7], KVS_ExecuteStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSExecuteStreamingClient{stream} + return x, nil +} + +type KVS_ExecuteStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSExecuteStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSExecuteStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSExecuteStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) BatchOperate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (KVS_BatchOperateClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[8], KVS_BatchOperate_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSBatchOperateClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type KVS_BatchOperateClient interface { + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSBatchOperateClient struct { + grpc.ClientStream +} + +func (x *kVSBatchOperateClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *kVSClient) BatchOperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_BatchOperateStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[9], KVS_BatchOperateStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &kVSBatchOperateStreamingClient{stream} + return x, nil +} + +type KVS_BatchOperateStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type kVSBatchOperateStreamingClient struct { + grpc.ClientStream +} + +func (x *kVSBatchOperateStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *kVSBatchOperateStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// KVSServer is the server API for KVS service. +// All implementations must embed UnimplementedKVSServer +// for forward compatibility +type KVSServer interface { + // Read a single record + Read(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process stream of single record read requests. + ReadStreaming(KVS_ReadStreamingServer) error + // Get a single record header containing metadata like generation, expiration + GetHeader(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process stream of single record get header requests. + GetHeaderStreaming(KVS_GetHeaderStreamingServer) error + // Check if a record exists. + Exists(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process stream of single record exist requests. + ExistsStreaming(KVS_ExistsStreamingServer) error + // Write a single record + Write(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process a stream of single record write requests. + WriteStreaming(KVS_WriteStreamingServer) error + // Delete a single record. + Delete(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process a stream of single record delete requests. + DeleteStreaming(KVS_DeleteStreamingServer) error + // Reset single record's time to expiration using the write policy's expiration. + Touch(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process a stream of single record touch requests. + TouchStreaming(KVS_TouchStreamingServer) error + // Perform multiple read/write operations on a single key in one batch call. + Operate(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Perform a stream of operate requests. + OperateStreaming(KVS_OperateStreamingServer) error + // Execute single key user defined function on server and return results. + Execute(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + // Process a stream of single record execute requests. + ExecuteStreaming(KVS_ExecuteStreamingServer) error + // Process batch requests. + BatchOperate(*AerospikeRequestPayload, KVS_BatchOperateServer) error + // Process a stream of batch requests. + BatchOperateStreaming(KVS_BatchOperateStreamingServer) error + mustEmbedUnimplementedKVSServer() +} + +// UnimplementedKVSServer must be embedded to have forward compatible implementations. +type UnimplementedKVSServer struct { +} + +func (UnimplementedKVSServer) Read(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") +} +func (UnimplementedKVSServer) ReadStreaming(KVS_ReadStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method ReadStreaming not implemented") +} +func (UnimplementedKVSServer) GetHeader(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHeader not implemented") +} +func (UnimplementedKVSServer) GetHeaderStreaming(KVS_GetHeaderStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method GetHeaderStreaming not implemented") +} +func (UnimplementedKVSServer) Exists(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Exists not implemented") +} +func (UnimplementedKVSServer) ExistsStreaming(KVS_ExistsStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method ExistsStreaming not implemented") +} +func (UnimplementedKVSServer) Write(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") +} +func (UnimplementedKVSServer) WriteStreaming(KVS_WriteStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method WriteStreaming not implemented") +} +func (UnimplementedKVSServer) Delete(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedKVSServer) DeleteStreaming(KVS_DeleteStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method DeleteStreaming not implemented") +} +func (UnimplementedKVSServer) Touch(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Touch not implemented") +} +func (UnimplementedKVSServer) TouchStreaming(KVS_TouchStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method TouchStreaming not implemented") +} +func (UnimplementedKVSServer) Operate(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Operate not implemented") +} +func (UnimplementedKVSServer) OperateStreaming(KVS_OperateStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method OperateStreaming not implemented") +} +func (UnimplementedKVSServer) Execute(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented") +} +func (UnimplementedKVSServer) ExecuteStreaming(KVS_ExecuteStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method ExecuteStreaming not implemented") +} +func (UnimplementedKVSServer) BatchOperate(*AerospikeRequestPayload, KVS_BatchOperateServer) error { + return status.Errorf(codes.Unimplemented, "method BatchOperate not implemented") +} +func (UnimplementedKVSServer) BatchOperateStreaming(KVS_BatchOperateStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method BatchOperateStreaming not implemented") +} +func (UnimplementedKVSServer) mustEmbedUnimplementedKVSServer() {} + +// UnsafeKVSServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to KVSServer will +// result in compilation errors. +type UnsafeKVSServer interface { + mustEmbedUnimplementedKVSServer() +} + +func RegisterKVSServer(s grpc.ServiceRegistrar, srv KVSServer) { + s.RegisterService(&KVS_ServiceDesc, srv) +} + +func _KVS_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Read(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Read_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Read(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_ReadStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).ReadStreaming(&kVSReadStreamingServer{stream}) +} + +type KVS_ReadStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSReadStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSReadStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSReadStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_GetHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).GetHeader(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_GetHeader_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).GetHeader(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_GetHeaderStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).GetHeaderStreaming(&kVSGetHeaderStreamingServer{stream}) +} + +type KVS_GetHeaderStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSGetHeaderStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSGetHeaderStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSGetHeaderStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Exists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Exists(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Exists_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Exists(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_ExistsStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).ExistsStreaming(&kVSExistsStreamingServer{stream}) +} + +type KVS_ExistsStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSExistsStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSExistsStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSExistsStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Write(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Write_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Write(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_WriteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).WriteStreaming(&kVSWriteStreamingServer{stream}) +} + +type KVS_WriteStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSWriteStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSWriteStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSWriteStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Delete_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Delete(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_DeleteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).DeleteStreaming(&kVSDeleteStreamingServer{stream}) +} + +type KVS_DeleteStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSDeleteStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSDeleteStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSDeleteStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Touch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Touch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Touch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Touch(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_TouchStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).TouchStreaming(&kVSTouchStreamingServer{stream}) +} + +type KVS_TouchStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSTouchStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSTouchStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSTouchStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Operate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Operate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Operate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Operate(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_OperateStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).OperateStreaming(&kVSOperateStreamingServer{stream}) +} + +type KVS_OperateStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSOperateStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSOperateStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSOperateStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(KVSServer).Execute(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: KVS_Execute_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(KVSServer).Execute(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +func _KVS_ExecuteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).ExecuteStreaming(&kVSExecuteStreamingServer{stream}) +} + +type KVS_ExecuteStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSExecuteStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSExecuteStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSExecuteStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _KVS_BatchOperate_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AerospikeRequestPayload) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(KVSServer).BatchOperate(m, &kVSBatchOperateServer{stream}) +} + +type KVS_BatchOperateServer interface { + Send(*AerospikeResponsePayload) error + grpc.ServerStream +} + +type kVSBatchOperateServer struct { + grpc.ServerStream +} + +func (x *kVSBatchOperateServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func _KVS_BatchOperateStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(KVSServer).BatchOperateStreaming(&kVSBatchOperateStreamingServer{stream}) +} + +type KVS_BatchOperateStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type kVSBatchOperateStreamingServer struct { + grpc.ServerStream +} + +func (x *kVSBatchOperateStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *kVSBatchOperateStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// KVS_ServiceDesc is the grpc.ServiceDesc for KVS service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var KVS_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "KVS", + HandlerType: (*KVSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Read", + Handler: _KVS_Read_Handler, + }, + { + MethodName: "GetHeader", + Handler: _KVS_GetHeader_Handler, + }, + { + MethodName: "Exists", + Handler: _KVS_Exists_Handler, + }, + { + MethodName: "Write", + Handler: _KVS_Write_Handler, + }, + { + MethodName: "Delete", + Handler: _KVS_Delete_Handler, + }, + { + MethodName: "Touch", + Handler: _KVS_Touch_Handler, + }, + { + MethodName: "Operate", + Handler: _KVS_Operate_Handler, + }, + { + MethodName: "Execute", + Handler: _KVS_Execute_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ReadStreaming", + Handler: _KVS_ReadStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "GetHeaderStreaming", + Handler: _KVS_GetHeaderStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "ExistsStreaming", + Handler: _KVS_ExistsStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "WriteStreaming", + Handler: _KVS_WriteStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "DeleteStreaming", + Handler: _KVS_DeleteStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "TouchStreaming", + Handler: _KVS_TouchStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "OperateStreaming", + Handler: _KVS_OperateStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "ExecuteStreaming", + Handler: _KVS_ExecuteStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "BatchOperate", + Handler: _KVS_BatchOperate_Handler, + ServerStreams: true, + }, + { + StreamName: "BatchOperateStreaming", + Handler: _KVS_BatchOperateStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "proto/kvs/aerospike_proxy_kv.proto", +} + +const ( + Scan_Scan_FullMethodName = "/Scan/Scan" + Scan_ScanStreaming_FullMethodName = "/Scan/ScanStreaming" +) + +// ScanClient is the client API for Scan service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ScanClient interface { + // Scan Aerospike + Scan(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Scan_ScanClient, error) + // Process a stream of scan requests + ScanStreaming(ctx context.Context, opts ...grpc.CallOption) (Scan_ScanStreamingClient, error) +} + +type scanClient struct { + cc grpc.ClientConnInterface +} + +func NewScanClient(cc grpc.ClientConnInterface) ScanClient { + return &scanClient{cc} +} + +func (c *scanClient) Scan(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Scan_ScanClient, error) { + stream, err := c.cc.NewStream(ctx, &Scan_ServiceDesc.Streams[0], Scan_Scan_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &scanScanClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Scan_ScanClient interface { + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type scanScanClient struct { + grpc.ClientStream +} + +func (x *scanScanClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *scanClient) ScanStreaming(ctx context.Context, opts ...grpc.CallOption) (Scan_ScanStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &Scan_ServiceDesc.Streams[1], Scan_ScanStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &scanScanStreamingClient{stream} + return x, nil +} + +type Scan_ScanStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type scanScanStreamingClient struct { + grpc.ClientStream +} + +func (x *scanScanStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *scanScanStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ScanServer is the server API for Scan service. +// All implementations must embed UnimplementedScanServer +// for forward compatibility +type ScanServer interface { + // Scan Aerospike + Scan(*AerospikeRequestPayload, Scan_ScanServer) error + // Process a stream of scan requests + ScanStreaming(Scan_ScanStreamingServer) error + mustEmbedUnimplementedScanServer() +} + +// UnimplementedScanServer must be embedded to have forward compatible implementations. +type UnimplementedScanServer struct { +} + +func (UnimplementedScanServer) Scan(*AerospikeRequestPayload, Scan_ScanServer) error { + return status.Errorf(codes.Unimplemented, "method Scan not implemented") +} +func (UnimplementedScanServer) ScanStreaming(Scan_ScanStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method ScanStreaming not implemented") +} +func (UnimplementedScanServer) mustEmbedUnimplementedScanServer() {} + +// UnsafeScanServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ScanServer will +// result in compilation errors. +type UnsafeScanServer interface { + mustEmbedUnimplementedScanServer() +} + +func RegisterScanServer(s grpc.ServiceRegistrar, srv ScanServer) { + s.RegisterService(&Scan_ServiceDesc, srv) +} + +func _Scan_Scan_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AerospikeRequestPayload) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ScanServer).Scan(m, &scanScanServer{stream}) +} + +type Scan_ScanServer interface { + Send(*AerospikeResponsePayload) error + grpc.ServerStream +} + +type scanScanServer struct { + grpc.ServerStream +} + +func (x *scanScanServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func _Scan_ScanStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ScanServer).ScanStreaming(&scanScanStreamingServer{stream}) +} + +type Scan_ScanStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type scanScanStreamingServer struct { + grpc.ServerStream +} + +func (x *scanScanStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *scanScanStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Scan_ServiceDesc is the grpc.ServiceDesc for Scan service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Scan_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Scan", + HandlerType: (*ScanServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Scan", + Handler: _Scan_Scan_Handler, + ServerStreams: true, + }, + { + StreamName: "ScanStreaming", + Handler: _Scan_ScanStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "proto/kvs/aerospike_proxy_kv.proto", +} + +const ( + Query_Query_FullMethodName = "/Query/Query" + Query_QueryStreaming_FullMethodName = "/Query/QueryStreaming" + Query_BackgroundExecute_FullMethodName = "/Query/BackgroundExecute" + Query_BackgroundExecuteStreaming_FullMethodName = "/Query/BackgroundExecuteStreaming" + Query_BackgroundTaskStatus_FullMethodName = "/Query/BackgroundTaskStatus" + Query_BackgroundTaskStatusStreaming_FullMethodName = "/Query/BackgroundTaskStatusStreaming" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // Query Aerospike + Query(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_QueryClient, error) + // Process a stream of query requests + QueryStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_QueryStreamingClient, error) + // Execute background write on selected records. + BackgroundExecute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundExecuteClient, error) + // Execute a stream of background write requests. + BackgroundExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundExecuteStreamingClient, error) + // Get status of a background task. + BackgroundTaskStatus(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundTaskStatusClient, error) + // Get status of a stream of background tasks. + BackgroundTaskStatusStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundTaskStatusStreamingClient, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Query(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_QueryClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[0], Query_Query_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryQueryClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Query_QueryClient interface { + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryQueryClient struct { + grpc.ClientStream +} + +func (x *queryQueryClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *queryClient) QueryStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_QueryStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[1], Query_QueryStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryQueryStreamingClient{stream} + return x, nil +} + +type Query_QueryStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryQueryStreamingClient struct { + grpc.ClientStream +} + +func (x *queryQueryStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *queryQueryStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *queryClient) BackgroundExecute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundExecuteClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[2], Query_BackgroundExecute_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryBackgroundExecuteClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Query_BackgroundExecuteClient interface { + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryBackgroundExecuteClient struct { + grpc.ClientStream +} + +func (x *queryBackgroundExecuteClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *queryClient) BackgroundExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundExecuteStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[3], Query_BackgroundExecuteStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryBackgroundExecuteStreamingClient{stream} + return x, nil +} + +type Query_BackgroundExecuteStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryBackgroundExecuteStreamingClient struct { + grpc.ClientStream +} + +func (x *queryBackgroundExecuteStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *queryBackgroundExecuteStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *queryClient) BackgroundTaskStatus(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundTaskStatusClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[4], Query_BackgroundTaskStatus_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryBackgroundTaskStatusClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Query_BackgroundTaskStatusClient interface { + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryBackgroundTaskStatusClient struct { + grpc.ClientStream +} + +func (x *queryBackgroundTaskStatusClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *queryClient) BackgroundTaskStatusStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundTaskStatusStreamingClient, error) { + stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[5], Query_BackgroundTaskStatusStreaming_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &queryBackgroundTaskStatusStreamingClient{stream} + return x, nil +} + +type Query_BackgroundTaskStatusStreamingClient interface { + Send(*AerospikeRequestPayload) error + Recv() (*AerospikeResponsePayload, error) + grpc.ClientStream +} + +type queryBackgroundTaskStatusStreamingClient struct { + grpc.ClientStream +} + +func (x *queryBackgroundTaskStatusStreamingClient) Send(m *AerospikeRequestPayload) error { + return x.ClientStream.SendMsg(m) +} + +func (x *queryBackgroundTaskStatusStreamingClient) Recv() (*AerospikeResponsePayload, error) { + m := new(AerospikeResponsePayload) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // Query Aerospike + Query(*AerospikeRequestPayload, Query_QueryServer) error + // Process a stream of query requests + QueryStreaming(Query_QueryStreamingServer) error + // Execute background write on selected records. + BackgroundExecute(*AerospikeRequestPayload, Query_BackgroundExecuteServer) error + // Execute a stream of background write requests. + BackgroundExecuteStreaming(Query_BackgroundExecuteStreamingServer) error + // Get status of a background task. + BackgroundTaskStatus(*AerospikeRequestPayload, Query_BackgroundTaskStatusServer) error + // Get status of a stream of background tasks. + BackgroundTaskStatusStreaming(Query_BackgroundTaskStatusStreamingServer) error + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Query(*AerospikeRequestPayload, Query_QueryServer) error { + return status.Errorf(codes.Unimplemented, "method Query not implemented") +} +func (UnimplementedQueryServer) QueryStreaming(Query_QueryStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method QueryStreaming not implemented") +} +func (UnimplementedQueryServer) BackgroundExecute(*AerospikeRequestPayload, Query_BackgroundExecuteServer) error { + return status.Errorf(codes.Unimplemented, "method BackgroundExecute not implemented") +} +func (UnimplementedQueryServer) BackgroundExecuteStreaming(Query_BackgroundExecuteStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method BackgroundExecuteStreaming not implemented") +} +func (UnimplementedQueryServer) BackgroundTaskStatus(*AerospikeRequestPayload, Query_BackgroundTaskStatusServer) error { + return status.Errorf(codes.Unimplemented, "method BackgroundTaskStatus not implemented") +} +func (UnimplementedQueryServer) BackgroundTaskStatusStreaming(Query_BackgroundTaskStatusStreamingServer) error { + return status.Errorf(codes.Unimplemented, "method BackgroundTaskStatusStreaming not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_Query_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AerospikeRequestPayload) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).Query(m, &queryQueryServer{stream}) +} + +type Query_QueryServer interface { + Send(*AerospikeResponsePayload) error + grpc.ServerStream +} + +type queryQueryServer struct { + grpc.ServerStream +} + +func (x *queryQueryServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func _Query_QueryStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(QueryServer).QueryStreaming(&queryQueryStreamingServer{stream}) +} + +type Query_QueryStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type queryQueryStreamingServer struct { + grpc.ServerStream +} + +func (x *queryQueryStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *queryQueryStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Query_BackgroundExecute_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AerospikeRequestPayload) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).BackgroundExecute(m, &queryBackgroundExecuteServer{stream}) +} + +type Query_BackgroundExecuteServer interface { + Send(*AerospikeResponsePayload) error + grpc.ServerStream +} + +type queryBackgroundExecuteServer struct { + grpc.ServerStream +} + +func (x *queryBackgroundExecuteServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func _Query_BackgroundExecuteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(QueryServer).BackgroundExecuteStreaming(&queryBackgroundExecuteStreamingServer{stream}) +} + +type Query_BackgroundExecuteStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type queryBackgroundExecuteStreamingServer struct { + grpc.ServerStream +} + +func (x *queryBackgroundExecuteStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *queryBackgroundExecuteStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Query_BackgroundTaskStatus_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(AerospikeRequestPayload) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).BackgroundTaskStatus(m, &queryBackgroundTaskStatusServer{stream}) +} + +type Query_BackgroundTaskStatusServer interface { + Send(*AerospikeResponsePayload) error + grpc.ServerStream +} + +type queryBackgroundTaskStatusServer struct { + grpc.ServerStream +} + +func (x *queryBackgroundTaskStatusServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func _Query_BackgroundTaskStatusStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(QueryServer).BackgroundTaskStatusStreaming(&queryBackgroundTaskStatusStreamingServer{stream}) +} + +type Query_BackgroundTaskStatusStreamingServer interface { + Send(*AerospikeResponsePayload) error + Recv() (*AerospikeRequestPayload, error) + grpc.ServerStream +} + +type queryBackgroundTaskStatusStreamingServer struct { + grpc.ServerStream +} + +func (x *queryBackgroundTaskStatusStreamingServer) Send(m *AerospikeResponsePayload) error { + return x.ServerStream.SendMsg(m) +} + +func (x *queryBackgroundTaskStatusStreamingServer) Recv() (*AerospikeRequestPayload, error) { + m := new(AerospikeRequestPayload) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Query", + Handler: _Query_Query_Handler, + ServerStreams: true, + }, + { + StreamName: "QueryStreaming", + Handler: _Query_QueryStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "BackgroundExecute", + Handler: _Query_BackgroundExecute_Handler, + ServerStreams: true, + }, + { + StreamName: "BackgroundExecuteStreaming", + Handler: _Query_BackgroundExecuteStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "BackgroundTaskStatus", + Handler: _Query_BackgroundTaskStatus_Handler, + ServerStreams: true, + }, + { + StreamName: "BackgroundTaskStatusStreaming", + Handler: _Query_BackgroundTaskStatusStreaming_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "proto/kvs/aerospike_proxy_kv.proto", +} + +const ( + Info_Info_FullMethodName = "/Info/Info" +) + +// InfoClient is the client API for Info service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type InfoClient interface { + // Send an info request + Info(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) +} + +type infoClient struct { + cc grpc.ClientConnInterface +} + +func NewInfoClient(cc grpc.ClientConnInterface) InfoClient { + return &infoClient{cc} +} + +func (c *infoClient) Info(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { + out := new(AerospikeResponsePayload) + err := c.cc.Invoke(ctx, Info_Info_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InfoServer is the server API for Info service. +// All implementations must embed UnimplementedInfoServer +// for forward compatibility +type InfoServer interface { + // Send an info request + Info(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) + mustEmbedUnimplementedInfoServer() +} + +// UnimplementedInfoServer must be embedded to have forward compatible implementations. +type UnimplementedInfoServer struct { +} + +func (UnimplementedInfoServer) Info(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} +func (UnimplementedInfoServer) mustEmbedUnimplementedInfoServer() {} + +// UnsafeInfoServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InfoServer will +// result in compilation errors. +type UnsafeInfoServer interface { + mustEmbedUnimplementedInfoServer() +} + +func RegisterInfoServer(s grpc.ServiceRegistrar, srv InfoServer) { + s.RegisterService(&Info_ServiceDesc, srv) +} + +func _Info_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AerospikeRequestPayload) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Info_Info_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoServer).Info(ctx, req.(*AerospikeRequestPayload)) + } + return interceptor(ctx, in, info, handler) +} + +// Info_ServiceDesc is the grpc.ServiceDesc for Info service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Info_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "Info", + HandlerType: (*InfoServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Info", + Handler: _Info_Info_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/kvs/aerospike_proxy_kv.proto", +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go b/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go new file mode 100644 index 00000000..adbe4ee6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go @@ -0,0 +1,218 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "encoding/base64" + "encoding/json" + "runtime/debug" + "strings" + "time" + + grpc "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + + "github.com/aerospike/aerospike-client-go/v7/logger" + auth "github.com/aerospike/aerospike-client-go/v7/proto/auth" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type authInterceptor struct { + clnt *ProxyClient + closer chan struct{} + + expiry time.Time + fullToken string // "Bearer " +} + +func newAuthInterceptor(clnt *ProxyClient) (*authInterceptor, Error) { + interceptor := &authInterceptor{ + clnt: clnt, + closer: make(chan struct{}), + } + + err := interceptor.scheduleRefreshToken() + if err != nil { + return nil, err + } + + return interceptor, nil +} + +func (interceptor *authInterceptor) close() { + if interceptor.active() { + close(interceptor.closer) + } +} + +func (interceptor *authInterceptor) active() bool { + active := true + select { + case _, active = <-interceptor.closer: + default: + } + return active +} + +func (interceptor *authInterceptor) scheduleRefreshToken() Error { + err := interceptor.refreshToken() + if err != nil { + return err + } + + // launch the refresher go routine + go interceptor.tokenRefresher() + + return nil +} + +func (interceptor *authInterceptor) tokenRefresher() { + // make sure the goroutine is restarted if something panics downstream + defer func() { + if r := recover(); r != nil { + logger.Logger.Error("Interceptor refresh goroutine crashed: %s", debug.Stack()) + go interceptor.tokenRefresher() + } + }() + + // provide 5 secs of buffer before expiry due to network latency + wait := interceptor.expiry.Sub(time.Now()) - 5*time.Second + ticker := time.NewTicker(wait) + defer ticker.Stop() + + for { + ticker.Reset(wait) + select { + case <-ticker.C: + err := interceptor.refreshToken() + if err != nil { + wait = time.Second + } else { + wait = interceptor.expiry.Sub(time.Now()) - 5*time.Second + } + + case <-interceptor.closer: + // channel closed; return from the goroutine + return + } + } +} + +func (interceptor *authInterceptor) refreshToken() Error { + err := interceptor.login() + if err != nil { + return err + } + + interceptor.clnt.setAuthToken(interceptor.fullToken) + + return nil +} + +func (interceptor *authInterceptor) RequireTransportSecurity() bool { + return true +} + +func (interceptor *authInterceptor) Unary() grpc.UnaryClientInterceptor { + return func( + ctx context.Context, + method string, + req, reply interface{}, + cc *grpc.ClientConn, + invoker grpc.UnaryInvoker, + opts ...grpc.CallOption, + ) error { + return invoker(interceptor.attachToken(ctx), method, req, reply, cc, opts...) + } +} + +func (interceptor *authInterceptor) Stream() grpc.StreamClientInterceptor { + return func( + ctx context.Context, + desc *grpc.StreamDesc, + cc *grpc.ClientConn, + method string, + streamer grpc.Streamer, + opts ...grpc.CallOption, + ) (grpc.ClientStream, error) { + return streamer(interceptor.attachToken(ctx), desc, cc, method, opts...) + } +} + +func (interceptor *authInterceptor) attachToken(ctx context.Context) context.Context { + token := interceptor.clnt.token() + return metadata.AppendToOutgoingContext(ctx, "Authorization", token) +} + +func (interceptor *authInterceptor) login() Error { + conn, err := interceptor.clnt.createGrpcConn(true) + if err != nil { + return err + } + defer conn.Close() + + req := auth.AerospikeAuthRequest{ + Username: interceptor.clnt.clientPolicy.User, + Password: interceptor.clnt.clientPolicy.Password, + } + + client := auth.NewAuthServiceClient(conn) + + ctx, cancel := context.WithTimeout(context.Background(), interceptor.clnt.clientPolicy.Timeout) + defer cancel() + + res, gerr := client.Get(ctx, &req) + if gerr != nil { + return newGrpcError(false, gerr, gerr.Error()) + } + + claims := strings.Split(res.GetToken(), ".") + decClaims, gerr := base64.RawURLEncoding.DecodeString(claims[1]) + if gerr != nil { + return newGrpcError(false, gerr, "Invalid token encoding. Expected base64.") + } + + tokenMap := make(map[string]interface{}, 8) + gerr = json.Unmarshal(decClaims, &tokenMap) + if gerr != nil { + return newError(types.PARSE_ERROR, "Invalid token encoding. Expected json.") + } + + expiryToken, ok := tokenMap["exp"].(float64) + if !ok { + return newError(types.PARSE_ERROR, "Invalid expiry value. Expected float64.") + } + + iat, ok := tokenMap["iat"].(float64) + if !ok { + return newError(types.PARSE_ERROR, "Invalid iat value. Expected float64.") + + } + + ttl := time.Duration(expiryToken-iat) * time.Second + if ttl <= 0 { + return newError(types.PARSE_ERROR, "Invalid token values. token 'iat' > 'exp'") + } + + // Set expiry based on local clock. + expiry := time.Now().Add(ttl) + interceptor.fullToken = "Bearer " + res.GetToken() + interceptor.expiry = expiry + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client.go new file mode 100644 index 00000000..15257ae5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_client.go @@ -0,0 +1,1531 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "math/rand" + "runtime" + "sync" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + + iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +const notSupportedInProxyClient = "NOT SUPPORTED IN THE PROXY CLIENT" + +// ProxyClient encapsulates an Aerospike cluster. +// All database operations are available against this object. +type ProxyClient struct { + // only for GRPC + clientPolicy ClientPolicy + grpcConnPool *grpcConnectionHeap + grpcHost *Host + dialOptions []grpc.DialOption + + authToken iatomic.TypedVal[string] + authInterceptor *authInterceptor + + active iatomic.Bool + + // DefaultPolicy is used for all read commands without a specific policy. + DefaultPolicy *BasePolicy + // DefaultBatchPolicy is the default parent policy used in batch read commands. Base policy fields + // include socketTimeout, totalTimeout, maxRetries, etc... + DefaultBatchPolicy *BatchPolicy + // DefaultBatchReadPolicy is the default read policy used in batch operate commands. + DefaultBatchReadPolicy *BatchReadPolicy + // DefaultBatchWritePolicy is the default write policy used in batch operate commands. + // Write policy fields include generation, expiration, durableDelete, etc... + DefaultBatchWritePolicy *BatchWritePolicy + // DefaultBatchDeletePolicy is the default delete policy used in batch delete commands. + DefaultBatchDeletePolicy *BatchDeletePolicy + // DefaultBatchUDFPolicy is the default user defined function policy used in batch UDF execute commands. + DefaultBatchUDFPolicy *BatchUDFPolicy + // DefaultWritePolicy is used for all write commands without a specific policy. + DefaultWritePolicy *WritePolicy + // DefaultScanPolicy is used for all scan commands without a specific policy. + DefaultScanPolicy *ScanPolicy + // DefaultQueryPolicy is used for all query commands without a specific policy. + DefaultQueryPolicy *QueryPolicy + // DefaultAdminPolicy is used for all security commands without a specific policy. + DefaultAdminPolicy *AdminPolicy + // DefaultInfoPolicy is used for all info commands without a specific policy. + DefaultInfoPolicy *InfoPolicy +} + +func grpcClientFinalizer(f *ProxyClient) { + f.Close() +} + +//------------------------------------------------------- +// Constructors +//------------------------------------------------------- + +// NewProxyClientWithPolicyAndHost generates a new ProxyClient with the specified ClientPolicy and +// sets up the cluster using the provided hosts. +// You must pass the tag 'as_proxy' to the compiler during build. +// If the policy is nil, the default relevant policy will be used. +// Pass "dns:///

:" (note the 3 slashes) for dns load balancing, +// automatically supported internally by grpc-go. +// The connection pool after connecting to the database is initially empty, +// and connections are established on a per need basis, which can be slow and +// time out some initial commands. +// It is recommended to call the client.WarmUp() method right after connecting to the database +// to fill up the connection pool to the required service level. +func NewProxyClientWithPolicyAndHost(policy *ClientPolicy, host *Host, dialOptions ...grpc.DialOption) (*ProxyClient, Error) { + if policy == nil { + policy = NewClientPolicy() + } + + grpcClient := &ProxyClient{ + clientPolicy: *policy, + grpcConnPool: newGrpcConnectionHeap(policy.ConnectionQueueSize), + grpcHost: host, + dialOptions: dialOptions, + + active: *iatomic.NewBool(true), + + DefaultPolicy: NewPolicy(), + DefaultBatchPolicy: NewBatchPolicy(), + DefaultBatchReadPolicy: NewBatchReadPolicy(), + DefaultBatchWritePolicy: NewBatchWritePolicy(), + DefaultBatchDeletePolicy: NewBatchDeletePolicy(), + DefaultBatchUDFPolicy: NewBatchUDFPolicy(), + DefaultWritePolicy: NewWritePolicy(0, 0), + DefaultScanPolicy: NewScanPolicy(), + DefaultQueryPolicy: NewQueryPolicy(), + DefaultAdminPolicy: NewAdminPolicy(), + DefaultInfoPolicy: NewInfoPolicy(), + } + + if policy.RequiresAuthentication() { + authInterceptor, err := newAuthInterceptor(grpcClient) + if err != nil { + return nil, err + } + + grpcClient.authInterceptor = authInterceptor + } + + // check the version to make sure we are connected to the server + infoPolicy := NewInfoPolicy() + infoPolicy.Timeout = policy.Timeout + _, err := grpcClient.ServerVersion(infoPolicy) + if err != nil { + return nil, err + } + + runtime.SetFinalizer(grpcClient, grpcClientFinalizer) + return grpcClient, nil +} + +//------------------------------------------------------- +// Policy methods +//------------------------------------------------------- + +// DefaultPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultPolicy() *BasePolicy { + return clnt.DefaultPolicy +} + +// DefaultBatchPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultBatchPolicy() *BatchPolicy { + return clnt.DefaultBatchPolicy +} + +// DefaultBatchWritePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultBatchWritePolicy() *BatchWritePolicy { + return clnt.DefaultBatchWritePolicy +} + +// DefaultBatchReadPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultBatchReadPolicy() *BatchReadPolicy { + return clnt.DefaultBatchReadPolicy +} + +// DefaultBatchDeletePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultBatchDeletePolicy() *BatchDeletePolicy { + return clnt.DefaultBatchDeletePolicy +} + +// DefaultBatchUDFPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultBatchUDFPolicy() *BatchUDFPolicy { + return clnt.DefaultBatchUDFPolicy +} + +// DefaultWritePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultWritePolicy() *WritePolicy { + return clnt.DefaultWritePolicy +} + +// DefaultScanPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultScanPolicy() *ScanPolicy { + return clnt.DefaultScanPolicy +} + +// DefaultQueryPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultQueryPolicy() *QueryPolicy { + return clnt.DefaultQueryPolicy +} + +// DefaultAdminPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultAdminPolicy() *AdminPolicy { + return clnt.DefaultAdminPolicy +} + +// DefaultInfoPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) GetDefaultInfoPolicy() *InfoPolicy { + return clnt.DefaultInfoPolicy +} + +// DefaultPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultPolicy(policy *BasePolicy) { + clnt.DefaultPolicy = policy +} + +// DefaultBatchPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultBatchPolicy(policy *BatchPolicy) { + clnt.DefaultBatchPolicy = policy +} + +// DefaultBatchReadPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultBatchReadPolicy(policy *BatchReadPolicy) { + clnt.DefaultBatchReadPolicy = policy +} + +// DefaultBatchWritePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultBatchWritePolicy(policy *BatchWritePolicy) { + clnt.DefaultBatchWritePolicy = policy +} + +// DefaultBatchDeletePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultBatchDeletePolicy(policy *BatchDeletePolicy) { + clnt.DefaultBatchDeletePolicy = policy +} + +// DefaultBatchUDFPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultBatchUDFPolicy(policy *BatchUDFPolicy) { + clnt.DefaultBatchUDFPolicy = policy +} + +// DefaultWritePolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultWritePolicy(policy *WritePolicy) { + clnt.DefaultWritePolicy = policy +} + +// DefaultScanPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultScanPolicy(policy *ScanPolicy) { + clnt.DefaultScanPolicy = policy +} + +// DefaultQueryPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultQueryPolicy(policy *QueryPolicy) { + clnt.DefaultQueryPolicy = policy +} + +// DefaultAdminPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultAdminPolicy(policy *AdminPolicy) { + clnt.DefaultAdminPolicy = policy +} + +// DefaultInfoPolicy returns corresponding default policy from the client +func (clnt *ProxyClient) SetDefaultInfoPolicy(policy *InfoPolicy) { + clnt.DefaultInfoPolicy = policy +} + +//------------------------------------------------------- +// Cluster Connection Management +//------------------------------------------------------- + +func (clnt *ProxyClient) token() string { + return clnt.authToken.Get() +} + +func (clnt *ProxyClient) setAuthToken(token string) { + clnt.authToken.Set(token) +} + +func (clnt *ProxyClient) grpcConn() (*grpc.ClientConn, Error) { + pconn := clnt.grpcConnPool.Get() + if pconn != nil { + return pconn, nil + } + + return clnt.createGrpcConn(!clnt.clientPolicy.RequiresAuthentication()) +} + +func (clnt *ProxyClient) returnGrpcConnToPool(conn *grpc.ClientConn) { + if conn != nil { + clnt.grpcConnPool.Put(conn) + } +} + +func (clnt *ProxyClient) createGrpcConn(noInterceptor bool) (*grpc.ClientConn, Error) { + // make a new connection + // Implement TLS and auth + dialOptions := []grpc.DialOption{grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(MaxBufferSize)), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxBufferSize))} + if clnt.clientPolicy.TlsConfig != nil { + dialOptions = append(dialOptions, grpc.WithTransportCredentials(credentials.NewTLS(clnt.clientPolicy.TlsConfig))) + } else { + dialOptions = append(dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) + } + + ctx, cancel := context.WithTimeout(context.Background(), clnt.clientPolicy.Timeout) + defer cancel() + + allOptions := append(dialOptions, clnt.dialOptions...) + if !noInterceptor { + allOptions = append(dialOptions, + grpc.WithUnaryInterceptor(clnt.authInterceptor.Unary()), + grpc.WithStreamInterceptor(clnt.authInterceptor.Stream()), + ) + } + + conn, err := grpc.DialContext(ctx, clnt.grpcHost.String(), allOptions...) + if err != nil { + return nil, newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, err.Error()) + } + + return conn, nil +} + +// Close closes all Grpcclient connections to database server nodes. +func (clnt *ProxyClient) Close() { + clnt.active.Set(false) + clnt.grpcConnPool.cleanup() + if clnt.authInterceptor != nil { + clnt.authInterceptor.close() + } +} + +// IsConnected determines if the Grpcclient is ready to talk to the database server cluster. +func (clnt *ProxyClient) IsConnected() bool { + return clnt.active.Get() +} + +// GetNodes returns an array of active server nodes in the cluster. +func (clnt *ProxyClient) GetNodes() []*Node { + panic(notSupportedInProxyClient) +} + +// GetNodeNames returns a list of active server node names in the cluster. +func (clnt *ProxyClient) GetNodeNames() []string { + panic(notSupportedInProxyClient) +} + +// ServerVersion will return the version of the proxy server. +func (clnt *ProxyClient) ServerVersion(policy *InfoPolicy) (string, Error) { + policy = clnt.getUsableInfoPolicy(policy) + + req := kvs.AboutRequest{} + + conn, err := clnt.grpcConn() + if err != nil { + return "", err + } + + client := kvs.NewAboutClient(conn) + + ctx, cancel := policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Get(ctx, &req) + if gerr != nil { + return "", newGrpcError(false, gerr, gerr.Error()) + } + + clnt.returnGrpcConnToPool(conn) + + return res.GetVersion(), nil +} + +//------------------------------------------------------- +// Write Record Operations +//------------------------------------------------------- + +// Put writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Put(policy *WritePolicy, key *Key, binMap BinMap) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(nil, policy, key, nil, binMap, _WRITE) + if err != nil { + return err + } + + return command.ExecuteGRPC(clnt) +} + +// PutBins writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This method avoids using the BinMap allocation and iteration and is lighter on GC. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newWriteCommand(nil, policy, key, bins, nil, _WRITE) + if err != nil { + return err + } + + return command.ExecuteGRPC(clnt) +} + +//------------------------------------------------------- +// Operations string +//------------------------------------------------------- + +// Append appends bin value's string to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call only works for string and []byte values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Append(policy *WritePolicy, key *Key, binMap BinMap) Error { + ops := make([]*Operation, 0, len(binMap)) + for k, v := range binMap { + ops = append(ops, AppendOp(NewBin(k, v))) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +// AppendBins works the same as Append, but avoids BinMap allocation and iteration. +func (clnt *ProxyClient) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + ops := make([]*Operation, 0, len(bins)) + for _, bin := range bins { + ops = append(ops, AppendOp(bin)) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +// Prepend prepends bin value's string to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call works only for string and []byte values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error { + ops := make([]*Operation, 0, len(binMap)) + for k, v := range binMap { + ops = append(ops, PrependOp(NewBin(k, v))) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +// PrependBins works the same as Prepend, but avoids BinMap allocation and iteration. +func (clnt *ProxyClient) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + ops := make([]*Operation, 0, len(bins)) + for _, bin := range bins { + ops = append(ops, PrependOp(bin)) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +//------------------------------------------------------- +// Arithmetic Operations +//------------------------------------------------------- + +// Add adds integer bin values to existing record bin values. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// This call only works for integer values. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Add(policy *WritePolicy, key *Key, binMap BinMap) Error { + ops := make([]*Operation, 0, len(binMap)) + for k, v := range binMap { + ops = append(ops, AddOp(NewBin(k, v))) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +// AddBins works the same as Add, but avoids BinMap allocation and iteration. +func (clnt *ProxyClient) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { + ops := make([]*Operation, 0, len(bins)) + for _, bin := range bins { + ops = append(ops, AddOp(bin)) + } + + _, err := clnt.Operate(policy, key, ops...) + return err +} + +//------------------------------------------------------- +// Delete Operations +//------------------------------------------------------- + +// Delete deletes a record for specified key. +// The policy specifies the transaction timeout. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Delete(policy *WritePolicy, key *Key) (bool, Error) { + policy = clnt.getUsableWritePolicy(policy) + command, err := newDeleteCommand(nil, policy, key) + if err != nil { + return false, err + } + + err = command.ExecuteGRPC(clnt) + return command.Existed(), err +} + +//------------------------------------------------------- +// Touch Operations +//------------------------------------------------------- + +// Touch updates a record's metadata. +// If the record exists, the record's TTL will be reset to the +// policy's expiration. +// If the record doesn't exist, it will return an error. +func (clnt *ProxyClient) Touch(policy *WritePolicy, key *Key) Error { + policy = clnt.getUsableWritePolicy(policy) + command, err := newTouchCommand(nil, policy, key) + if err != nil { + return err + } + + return command.ExecuteGRPC(clnt) +} + +//------------------------------------------------------- +// Existence-Check Operations +//------------------------------------------------------- + +// Exists determine if a record key exists. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Exists(policy *BasePolicy, key *Key) (bool, Error) { + policy = clnt.getUsablePolicy(policy) + command, err := newExistsCommand(nil, policy, key) + if err != nil { + return false, err + } + + err = command.ExecuteGRPC(clnt) + return command.Exists(), err +} + +// BatchExists determines if multiple record keys exist in one batch request. +// The returned boolean array is in positional order with the original key array order. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) { + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + for _, key := range keys { + batchRecordsIfc = append(batchRecordsIfc, NewBatchReadHeader(nil, key)) + } + + err := clnt.BatchOperate(policy, batchRecordsIfc) + records := make([]bool, 0, len(keys)) + for i := range batchRecordsIfc { + records = append(records, batchRecordsIfc[i].BatchRec().Record != nil) + // if nerr := batchRecordsIfc[i].BatchRec().Err; nerr != nil { + // err = chainErrors(err, nerr) + // } + } + + return records, err +} + +//------------------------------------------------------- +// Read Record Operations +//------------------------------------------------------- + +// Get reads a record header and bins for specified key. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) { + policy = clnt.getUsablePolicy(policy) + + command, err := newReadCommand(nil, policy, key, binNames, nil) + if err != nil { + return nil, err + } + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +// GetHeader reads a record generation and expiration only for specified key. +// Bins are not read. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) GetHeader(policy *BasePolicy, key *Key) (*Record, Error) { + policy = clnt.getUsablePolicy(policy) + + command, err := newReadHeaderCommand(nil, policy, key) + if err != nil { + return nil, err + } + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +//------------------------------------------------------- +// Batch Read Operations +//------------------------------------------------------- + +// BatchGet reads multiple record headers and bins for specified keys in one batch request. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + if len(keys) == 0 { + return []*Record{}, nil + } + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + batchRecords := make([]*BatchRecord, 0, len(keys)) + for _, key := range keys { + batchRead, batchRecord := newBatchRead(clnt.DefaultBatchReadPolicy, key, binNames) + batchRecordsIfc = append(batchRecordsIfc, batchRead) + batchRecords = append(batchRecords, batchRecord) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + records := make([]*Record, 0, len(keys)) + for i := range batchRecords { + records = append(records, batchRecords[i].Record) + } + + return records, err +} + +// BatchGetOperate reads multiple records for specified keys using read operations in one batch call. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// +// If a batch request to a node fails, the entire batch is cancelled. +func (clnt *ProxyClient) BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + if len(keys) == 0 { + return []*Record{}, nil + } + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + batchRecords := make([]*BatchRecord, 0, len(keys)) + for _, key := range keys { + batchRead, batchRecord := newBatchReadOps(clnt.DefaultBatchReadPolicy, key, ops...) + batchRecordsIfc = append(batchRecordsIfc, batchRead) + batchRecords = append(batchRecords, batchRecord) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + records := make([]*Record, 0, len(keys)) + for i := range batchRecords { + records = append(records, batchRecords[i].Record) + } + + return records, err +} + +// BatchGetComplex reads multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins to be requested for each key in the batch. +// The returned records are located in the same list. +// If the BatchRead key field is not found, the corresponding record field will be nil. +// The policy can be used to specify timeouts and maximum concurrent goroutines. +// This method requires Aerospike Server version >= 3.6.0. +func (clnt *ProxyClient) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error { + policy = clnt.getUsableBatchPolicy(policy) + batchRecordsIfc := make([]BatchRecordIfc, 0, len(records)) + for _, record := range records { + batchRecordsIfc = append(batchRecordsIfc, record) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return err +} + +// BatchGetHeader reads multiple record header data for specified keys in one batch request. +// The returned records are in positional order with the original key array order. +// If a key is not found, the positional record will be nil. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + if len(keys) == 0 { + return []*Record{}, nil + } + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + for _, key := range keys { + batchRecordsIfc = append(batchRecordsIfc, NewBatchReadHeader(clnt.DefaultBatchReadPolicy, key)) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + records := make([]*Record, 0, len(keys)) + for i := range batchRecordsIfc { + records = append(records, batchRecordsIfc[i].BatchRec().Record) + } + + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return records, err +} + +// BatchDelete deletes records for specified keys. If a key is not found, the corresponding result +// BatchRecord.ResultCode will be types.KEY_NOT_FOUND_ERROR. +// +// Requires server version 6.0+ +func (clnt *ProxyClient) BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + if len(keys) == 0 { + return []*BatchRecord{}, nil + } + + deletePolicy = clnt.getUsableBatchDeletePolicy(deletePolicy) + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + batchRecords := make([]*BatchRecord, 0, len(keys)) + for _, key := range keys { + batchDelete, batchRecord := newBatchDelete(deletePolicy, key) + batchRecordsIfc = append(batchRecordsIfc, batchDelete) + batchRecords = append(batchRecords, batchRecord) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + return batchRecords, err +} + +func (clnt *ProxyClient) batchOperate(policy *BatchPolicy, records []BatchRecordIfc) (int, Error) { + policy = clnt.getUsableBatchPolicy(policy) + + batchNode, err := newGrpcBatchOperateListIfc(policy, records) + if err != nil && policy.RespondAllKeys { + return 0, err + } + + cmd := newBatchCommandOperate(clnt, batchNode, policy, records) + return cmd.filteredOutCnt, cmd.ExecuteGRPC(clnt) +} + +// BatchOperate will read/write multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins for each key in the batch. +// The returned records are located in the same list. +// +// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. +// +// Requires server version 6.0+ +func (clnt *ProxyClient) BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error { + _, err := clnt.batchOperate(policy, records) + return err +} + +// BatchExecute will read/write multiple records for specified batch keys in one batch call. +// This method allows different namespaces/bins for each key in the batch. +// The returned records are located in the same list. +// +// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. +// +// Requires server version 6.0+ +func (clnt *ProxyClient) BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) { + if len(keys) == 0 { + return []*BatchRecord{}, nil + } + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + batchRecords := make([]*BatchRecord, 0, len(keys)) + for _, key := range keys { + batchUDF, batchRecord := newBatchUDF(udfPolicy, key, packageName, functionName, args...) + batchRecordsIfc = append(batchRecordsIfc, batchUDF) + batchRecords = append(batchRecords, batchRecord) + } + + filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) + if filteredOut > 0 { + err = chainErrors(ErrFilteredOut.err(), err) + } + + return batchRecords, err +} + +//------------------------------------------------------- +// Generic Database Operations +//------------------------------------------------------- + +// Operate performs multiple read/write operations on a single key in one batch request. +// An example would be to add an integer value to an existing record and then +// read the result, all in one database call. +// +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) { + return clnt.operate(policy, key, false, operations...) +} + +func (clnt *ProxyClient) operate(policy *WritePolicy, key *Key, useOpResults bool, operations ...*Operation) (*Record, Error) { + policy = clnt.getUsableWritePolicy(policy) + args, err := newOperateArgs(nil, policy, key, operations) + if err != nil { + return nil, err + } + + command, err := newOperateCommand(nil, policy, key, args, useOpResults) + if err != nil { + return nil, err + } + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + return command.GetRecord(), nil +} + +//------------------------------------------------------- +// Scan Operations +//------------------------------------------------------- + +// ScanPartitions Read records in specified namespace, set and partition filter. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If partitionFilter is nil, all partitions will be scanned. +// If the policy is nil, the default relevant policy will be used. +// This method is only supported by Aerospike 4.9+ servers. +func (clnt *ProxyClient) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + + // result recordset + tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) + res := newRecordset(policy.RecordQueueSize, 1) + cmd := newGrpcScanPartitionCommand(&policy, tracker, partitionFilter, namespace, setName, binNames, res) + go cmd.ExecuteGRPC(clnt) + + return res, nil +} + +// ScanAll reads all records in specified namespace and set from all nodes. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.ScanPartitions(apolicy, NewPartitionFilterAll(), namespace, setName, binNames...) +} + +// scanNodePartitions reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) scanNodePartitions(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +// ScanNode reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +//--------------------------------------------------------------- +// User defined functions (Supported by Aerospike 3+ servers only) +//--------------------------------------------------------------- + +// RegisterUDFFromFile reads a file from file system and registers +// the containing a package user defined functions with the server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RegisterTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) { + panic(notSupportedInProxyClient) +} + +// RegisterUDF registers a package containing user defined functions with server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RegisterTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) { + panic(notSupportedInProxyClient) +} + +// RemoveUDF removes a package containing user defined functions in the server. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// RemoveTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) { + panic(notSupportedInProxyClient) +} + +// ListUDF lists all packages containing user defined functions in the server. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ListUDF(policy *BasePolicy) ([]*UDF, Error) { + panic(notSupportedInProxyClient) +} + +// Execute executes a user defined function on server and return results. +// The function operates on a single record. +// The package name is used to locate the udf file location: +// +// udf file = /.lua +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) { + policy = clnt.getUsableWritePolicy(policy) + + command, err := newExecuteCommand(nil, policy, key, packageName, functionName, NewValueArray(args)) + if err != nil { + return nil, err + } + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + + if rec := command.GetRecord(); rec != nil && rec.Bins != nil { + return rec.Bins["SUCCESS"], nil + } + + return nil, nil +} + +func (clnt *ProxyClient) execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) { + return nil, newError(types.UNSUPPORTED_FEATURE) +} + +//---------------------------------------------------------- +// Query/Execute (Supported by Aerospike 3+ servers only) +//---------------------------------------------------------- + +// QueryExecute applies operations on records that match the statement filter. +// Records are not returned to the Grpcclient. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryExecute(policy *QueryPolicy, + writePolicy *WritePolicy, + statement *Statement, + ops ...*Operation, +) (*ExecuteTask, Error) { + policy = clnt.getUsableQueryPolicy(policy) + writePolicy = clnt.getUsableWritePolicy(writePolicy) + + command := newServerCommand(nil, policy, writePolicy, statement, statement.TaskId, ops) + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + + return newGRPCExecuteTask(clnt, statement), nil +} + +// ExecuteUDF applies user defined function on records that match the statement filter. +// Records are not returned to the Grpcclient. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ExecuteUDF(policy *QueryPolicy, + statement *Statement, + packageName string, + functionName string, + functionArgs ...Value, +) (*ExecuteTask, Error) { + policy = clnt.getUsableQueryPolicy(policy) + wpolicy := clnt.getUsableWritePolicy(nil) + + nstatement := *statement + nstatement.SetAggregateFunction(packageName, functionName, functionArgs, false) + command := newServerCommand(nil, policy, wpolicy, &nstatement, nstatement.TaskId, nil) + + if err := command.ExecuteGRPC(clnt); err != nil { + return nil, err + } + + return newGRPCExecuteTask(clnt, &nstatement), nil +} + +// ExecuteUDFNode applies user defined function on records that match the statement filter on the specified node. +// Records are not returned to the Grpcclient. +// This asynchronous server call will return before command is complete. +// The user can optionally wait for command completion by using the returned +// ExecuteTask instance. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ExecuteUDFNode(policy *QueryPolicy, + node *Node, + statement *Statement, + packageName string, + functionName string, + functionArgs ...Value, +) (*ExecuteTask, Error) { + panic(notSupportedInProxyClient) +} + +// SetXDRFilter sets XDR filter for given datacenter name and namespace. The expression filter indicates +// which records XDR should ship to the datacenter. +// Pass nil as filter to remove the currentl filter on the server. +func (clnt *ProxyClient) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error { + panic(notSupportedInProxyClient) +} + +//-------------------------------------------------------- +// Query functions (Supported by Aerospike 3+ servers only) +//-------------------------------------------------------- + +// QueryPartitions executes a query for specified partitions and returns a recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 4.9+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + // result recordset + tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) + res := newRecordset(policy.RecordQueueSize, 1) + cmd := newGrpcQueryPartitionCommand(policy, nil, statement, nil, tracker, partitionFilter, res) + go cmd.ExecuteGRPC(clnt) + + return res, nil +} + +// Query executes a query and returns a Recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) { + return clnt.QueryPartitions(policy, statement, NewPartitionFilterAll()) +} + +// QueryNode executes a query on a specific node and returns a recordset. +// The caller can concurrently pop records off the channel through the +// record channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +func (clnt *ProxyClient) queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +//-------------------------------------------------------- +// Index functions (Supported by Aerospike 3+ servers only) +//-------------------------------------------------------- + +// CreateIndex creates a secondary index. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// IndexTask instance. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) CreateIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType IndexType, +) (*IndexTask, Error) { + panic(notSupportedInProxyClient) +} + +// CreateComplexIndex creates a secondary index, with the ability to put indexes +// on bin containing complex data types, e.g: Maps and Lists. +// This asynchronous server call will return before the command is complete. +// The user can optionally wait for command completion by using the returned +// IndexTask instance. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) CreateComplexIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, + binName string, + indexType IndexType, + indexCollectionType IndexCollectionType, + ctx ...*CDTContext, +) (*IndexTask, Error) { + panic(notSupportedInProxyClient) +} + +// DropIndex deletes a secondary index. It will block until index is dropped on all nodes. +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) DropIndex( + policy *WritePolicy, + namespace string, + setName string, + indexName string, +) Error { + panic(notSupportedInProxyClient) +} + +// Truncate removes records in specified namespace/set efficiently. This method is many orders of magnitude +// faster than deleting records one at a time. Works with Aerospike Server versions >= 3.12. +// This asynchronous server call may return before the truncation is complete. The user can still +// write new records after the server call returns because new records will have last update times +// greater than the truncate cutoff (set at the time of truncate call). +// For more information, See https://www.aerospike.com/docs/reference/info#truncate +func (clnt *ProxyClient) Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error { + panic(notSupportedInProxyClient) +} + +//------------------------------------------------------- +// User administration +//------------------------------------------------------- + +// CreateUser creates a new user with password and roles. Clear-text password will be hashed using bcrypt +// before sending to server. +func (clnt *ProxyClient) CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error { + panic(notSupportedInProxyClient) +} + +// DropUser removes a user from the cluster. +func (clnt *ProxyClient) DropUser(policy *AdminPolicy, user string) Error { + panic(notSupportedInProxyClient) +} + +// ChangePassword changes a user's password. Clear-text password will be hashed using bcrypt before sending to server. +func (clnt *ProxyClient) ChangePassword(policy *AdminPolicy, user string, password string) Error { + panic(notSupportedInProxyClient) +} + +// GrantRoles adds roles to user's list of roles. +func (clnt *ProxyClient) GrantRoles(policy *AdminPolicy, user string, roles []string) Error { + panic(notSupportedInProxyClient) +} + +// RevokeRoles removes roles from user's list of roles. +func (clnt *ProxyClient) RevokeRoles(policy *AdminPolicy, user string, roles []string) Error { + panic(notSupportedInProxyClient) +} + +// QueryUser retrieves roles for a given user. +func (clnt *ProxyClient) QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) { + panic(notSupportedInProxyClient) +} + +// QueryUsers retrieves all users and their roles. +func (clnt *ProxyClient) QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) { + panic(notSupportedInProxyClient) +} + +// QueryRole retrieves privileges for a given role. +func (clnt *ProxyClient) QueryRole(policy *AdminPolicy, role string) (*Role, Error) { + panic(notSupportedInProxyClient) +} + +// QueryRoles retrieves all roles and their privileges. +func (clnt *ProxyClient) QueryRoles(policy *AdminPolicy) ([]*Role, Error) { + panic(notSupportedInProxyClient) +} + +// CreateRole creates a user-defined role. +// Quotas require server security configuration "enable-quotas" to be set to true. +// Pass 0 for quota values for no limit. +func (clnt *ProxyClient) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { + panic(notSupportedInProxyClient) +} + +// DropRole removes a user-defined role. +func (clnt *ProxyClient) DropRole(policy *AdminPolicy, roleName string) Error { + panic(notSupportedInProxyClient) +} + +// GrantPrivileges grant privileges to a user-defined role. +func (clnt *ProxyClient) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { + panic(notSupportedInProxyClient) +} + +// RevokePrivileges revokes privileges from a user-defined role. +func (clnt *ProxyClient) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { + panic(notSupportedInProxyClient) +} + +// SetWhitelist sets IP address whitelist for a role. If whitelist is nil or empty, it removes existing whitelist from role. +func (clnt *ProxyClient) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error { + panic(notSupportedInProxyClient) +} + +// SetQuotas sets maximum reads/writes per second limits for a role. If a quota is zero, the limit is removed. +// Quotas require server security configuration "enable-quotas" to be set to true. +// Pass 0 for quota values for no limit. +func (clnt *ProxyClient) SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { + panic(notSupportedInProxyClient) +} + +// RequestInfo sends an info command to the server. The proxy server should be configured to have allowed +// the commands to go through. +func (clnt *ProxyClient) RequestInfo(policy *InfoPolicy, commands ...string) (map[string]string, Error) { + policy = clnt.getUsableInfoPolicy(policy) + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + InfoRequest: &kvs.InfoRequest{ + InfoPolicy: policy.grpc(), + Commands: commands, + }, + } + + conn, err := clnt.grpcConn() + if err != nil { + return nil, err + } + + client := kvs.NewInfoClient(conn) + + ctx, cancel := policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Info(ctx, &req) + if gerr != nil { + return nil, newGrpcError(false, gerr, gerr.Error()) + } + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return nil, newGrpcStatusError(res) + } + + info := info{ + msg: &types.Message{ + Data: res.Payload, + }, + } + + return info.parseMultiResponse() +} + +//------------------------------------------------------- +// Access Methods +//------------------------------------------------------- + +// Cluster exposes the cluster object to the user +func (clnt *ProxyClient) Cluster() *Cluster { + panic(notSupportedInProxyClient) +} + +// String implements the Stringer interface for Grpcclient +func (clnt *ProxyClient) String() string { + return "" +} + +// Stats returns internal statistics regarding the inner state of the Grpcclient and the cluster. +func (clnt *ProxyClient) Stats() (map[string]interface{}, Error) { + panic(notSupportedInProxyClient) +} + +// WarmUp fills the connection pool with connections for all nodes. +// This is necessary on startup for high traffic programs. +// If the count is <= 0, the connection queue will be filled. +// If the count is more than the size of the pool, the pool will be filled. +// Note: One connection per node is reserved for tend operations and is not used for transactions. +func (clnt *ProxyClient) WarmUp(count int) (int, Error) { + if count <= 0 || count > clnt.clientPolicy.ConnectionQueueSize { + count = clnt.clientPolicy.ConnectionQueueSize + } + + for i := 0; i < count; i++ { + conn, err := clnt.createGrpcConn(!clnt.clientPolicy.RequiresAuthentication()) + if err != nil { + return i, err + } + clnt.returnGrpcConnToPool(conn) + } + + return count, nil +} + +//------------------------------------------------------- +// Internal Methods +//------------------------------------------------------- + +func (clnt *ProxyClient) grpcMode() bool { + return clnt.grpcConnPool != nil +} + +//------------------------------------------------------- +// Policy Methods +//------------------------------------------------------- + +func (clnt *ProxyClient) getUsablePolicy(policy *BasePolicy) *BasePolicy { + if policy == nil { + if clnt.DefaultPolicy != nil { + return clnt.DefaultPolicy + } + return NewPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBatchPolicy(policy *BatchPolicy) *BatchPolicy { + if policy == nil { + if clnt.DefaultBatchPolicy != nil { + return clnt.DefaultBatchPolicy + } + return NewBatchPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBaseBatchWritePolicy(policy *BatchPolicy) *BatchPolicy { + if policy == nil { + if clnt.DefaultBatchPolicy != nil { + return clnt.DefaultBatchPolicy + } + return NewBatchPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBatchReadPolicy(policy *BatchReadPolicy) *BatchReadPolicy { + if policy == nil { + if clnt.DefaultBatchReadPolicy != nil { + return clnt.DefaultBatchReadPolicy + } + return NewBatchReadPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBatchWritePolicy(policy *BatchWritePolicy) *BatchWritePolicy { + if policy == nil { + if clnt.DefaultBatchWritePolicy != nil { + return clnt.DefaultBatchWritePolicy + } + return NewBatchWritePolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBatchDeletePolicy(policy *BatchDeletePolicy) *BatchDeletePolicy { + if policy == nil { + if clnt.DefaultBatchDeletePolicy != nil { + return clnt.DefaultBatchDeletePolicy + } + return NewBatchDeletePolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableBatchUDFPolicy(policy *BatchUDFPolicy) *BatchUDFPolicy { + if policy == nil { + if clnt.DefaultBatchUDFPolicy != nil { + return clnt.DefaultBatchUDFPolicy + } + return NewBatchUDFPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableWritePolicy(policy *WritePolicy) *WritePolicy { + if policy == nil { + if clnt.DefaultWritePolicy != nil { + return clnt.DefaultWritePolicy + } + return NewWritePolicy(0, 0) + } + return policy +} + +func (clnt *ProxyClient) getUsableScanPolicy(policy *ScanPolicy) *ScanPolicy { + if policy == nil { + if clnt.DefaultScanPolicy != nil { + return clnt.DefaultScanPolicy + } + return NewScanPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableQueryPolicy(policy *QueryPolicy) *QueryPolicy { + if policy == nil { + if clnt.DefaultQueryPolicy != nil { + return clnt.DefaultQueryPolicy + } + return NewQueryPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableAdminPolicy(policy *AdminPolicy) *AdminPolicy { + if policy == nil { + if clnt.DefaultAdminPolicy != nil { + return clnt.DefaultAdminPolicy + } + return NewAdminPolicy() + } + return policy +} + +func (clnt *ProxyClient) getUsableInfoPolicy(policy *InfoPolicy) *InfoPolicy { + if policy == nil { + if clnt.DefaultInfoPolicy != nil { + return clnt.DefaultInfoPolicy + } + return NewInfoPolicy() + } + return policy +} + +//------------------------------------------------------- +// Utility Functions +//------------------------------------------------------- + +// grpcConnectionHeap is a non-blocking LIFO heap. +// If the heap is empty, nil is returned. +// if the heap is full, offer will return false +type grpcConnectionHeap struct { + head, tail uint32 + data []*grpc.ClientConn + size uint32 + full bool + mutex sync.Mutex +} + +// newGrpcConnectionHeap creates a new heap with initial size. +func newGrpcConnectionHeap(size int) *grpcConnectionHeap { + if size <= 0 { + panic("Heap size cannot be less than 1") + } + + return &grpcConnectionHeap{ + full: false, + data: make([]*grpc.ClientConn, uint32(size)), + size: uint32(size), + } +} + +func (h *grpcConnectionHeap) cleanup() { + h.mutex.Lock() + defer h.mutex.Unlock() + + for i := range h.data { + if h.data[i] != nil { + h.data[i].Close() + } + + h.data[i] = nil + } + + // make sure offer and poll both fail + h.data = nil + h.full = true + h.head = 0 + h.tail = 0 +} + +// Put adds an item to the heap unless the heap is full. +// In case the heap is full, the item will not be added to the heap +// and false will be returned +func (h *grpcConnectionHeap) Put(conn *grpc.ClientConn) bool { + h.mutex.Lock() + + // make sure heap is not full or cleaned up + if h.full || len(h.data) == 0 { + h.mutex.Unlock() + return false + } + + h.head = (h.head + 1) % h.size + h.full = (h.head == h.tail) + h.data[h.head] = conn + h.mutex.Unlock() + return true +} + +// Poll removes and returns an item from the heap. +// If the heap is empty, nil will be returned. +func (h *grpcConnectionHeap) Get() (res *grpc.ClientConn) { + h.mutex.Lock() + + // the heap has been cleaned up + if len(h.data) == 0 { + h.mutex.Unlock() + return nil + } + + // if heap is not empty + if (h.tail != h.head) || h.full { + res = h.data[h.head] + h.data[h.head] = nil + + h.full = false + if h.head == 0 { + h.head = h.size - 1 + } else { + h.head-- + } + } + + h.mutex.Unlock() + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go new file mode 100644 index 00000000..f6484ef8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go @@ -0,0 +1,28 @@ +//go:build !app_engine && as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// QueryAggregate executes a Map/Reduce query and returns the results. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) { + panic("NOT SUPPORTED") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go new file mode 100644 index 00000000..8c656ff8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go @@ -0,0 +1,231 @@ +//go:build !as_performance && as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// PutObject writes record bin(s) to the server. +// The policy specifies the transaction timeout, record expiration and how the transaction is +// handled when the record already exists. +// If the policy is nil, the default relevant policy will be used. +// A struct can be tagged to influence the way the object is put in the database: +// +// type Person struct { +// TTL uint32 `asm:"ttl"` +// RecGen uint32 `asm:"gen"` +// Name string `as:"name"` +// Address string `as:"desc,omitempty"` +// Age uint8 `as:",omitempty"` +// Password string `as:"-"` +// } +// +// Tag `as:` denotes Aerospike fields. The first value will be the alias for the field. +// `,omitempty` (without any spaces between the comma and the word) will act like the +// json package, and will not send the value of the field to the database if the value is zero value. +// Tag `asm:` denotes Aerospike Meta fields, and includes ttl and generation values. +// If a tag is marked with `-`, it will not be sent to the database at all. +// Note: Tag `as` can be replaced with any other user-defined tag via the function `SetAerospikeTag`. +func (clnt *ProxyClient) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) { + policy = clnt.getUsableWritePolicy(policy) + + binMap := marshal(obj) + command, err := newWriteCommand(nil, policy, key, nil, binMap, _WRITE) + if err != nil { + return err + } + + res := command.ExecuteGRPC(clnt) + return res +} + +// GetObject reads a record for specified key and puts the result into the provided object. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) GetObject(policy *BasePolicy, key *Key, obj interface{}) Error { + policy = clnt.getUsablePolicy(policy) + + rval := reflect.ValueOf(obj) + binNames := objectMappings.getFields(rval.Type()) + + command, err := newReadCommand(nil, policy, key, binNames, nil) + if err != nil { + return err + } + + command.object = &rval + + return command.ExecuteGRPC(clnt) +} + +// BatchGetObjects reads multiple record headers and bins for specified keys in one batch request. +// The returned objects are in positional order with the original key array order. +// If a key is not found, the positional object will not change, and the positional found boolean will be false. +// The policy can be used to specify timeouts. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) { + policy = clnt.getUsableBatchPolicy(policy) + + // check the size of key and objects + if len(keys) != len(objects) { + return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: number of keys and objects do not match") + } + + if len(keys) == 0 { + return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: keys are empty") + } + + binSet := map[string]struct{}{} + objectsVal := make([]*reflect.Value, len(objects)) + for i := range objects { + rval := reflect.ValueOf(objects[i]) + objectsVal[i] = &rval + for _, bn := range objectMappings.getFields(rval.Type()) { + binSet[bn] = struct{}{} + } + } + + binNames := make([]string, 0, len(binSet)) + for binName := range binSet { + binNames = append(binNames, binName) + } + + batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) + batchRecords := make([]*BatchRecord, 0, len(keys)) + for _, key := range keys { + batchRead, batchRecord := newBatchRead(nil, key, binNames) + batchRecordsIfc = append(batchRecordsIfc, batchRead) + batchRecords = append(batchRecords, batchRecord) + } + + batchNode, err := newGrpcBatchOperateListIfc(policy, batchRecordsIfc) + if err != nil && policy.RespondAllKeys { + return nil, err + } + + cmd := newBatchCommandOperate(clnt, batchNode, policy, batchRecordsIfc) + + objectsFound := make([]bool, len(keys)) + cmd.objects = objectsVal + cmd.objectsFound = objectsFound + + err = cmd.ExecuteGRPC(clnt) + // if filteredOut > 0 { + // err = chainErrors(ErrFilteredOut.err(), err) + // } + + return objectsFound, err +} + +// ScanPartitionObjects Reads records in specified namespace, set and partition filter. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If partitionFilter is nil, all partitions will be scanned. +// If the policy is nil, the default relevant policy will be used. +// This method is only supported by Aerospike 4.9+ servers. +func (clnt *ProxyClient) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { + policy := *clnt.getUsableScanPolicy(apolicy) + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) + cmd := newGrpcScanPartitionCommand(&policy, tracker, partitionFilter, namespace, setName, binNames, res) + go cmd.ExecuteGRPC(clnt) + + return res, nil + +} + +// ScanAllObjects reads all records in specified namespace and set from all nodes. +// If the policy's concurrentNodes is specified, each server node will be read in +// parallel. Otherwise, server nodes are read sequentially. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + return clnt.ScanPartitionObjects(apolicy, objChan, NewPartitionFilterAll(), namespace, setName, binNames...) +} + +// scanNodePartitions reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) scanNodePartitionsObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +// ScanNodeObjects reads all records in specified namespace and set for one node only, +// and marshalls the results into the objects of the provided channel in Recordset. +// If the policy is nil, the default relevant policy will be used. +// The resulting records will be marshalled into the objChan. +// objChan will be closed after all the records are read. +func (clnt *ProxyClient) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +// scanNodeObjects reads all records in specified namespace and set for one node only, +// and marshalls the results into the objects of the provided channel in Recordset. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) scanNodeObjects(policy *ScanPolicy, node *Node, recordset *Recordset, namespace string, setName string, binNames ...string) Error { + panic(notSupportedInProxyClient) +} + +// QueryPartitionObjects executes a query for specified partitions and returns a recordset. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop records off the channel through the +// Recordset.Records channel. +// +// This method is only supported by Aerospike 4.9+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) { + policy = clnt.getUsableQueryPolicy(policy) + + // result recordset + res := &Recordset{ + objectset: *newObjectset(reflect.ValueOf(objChan), 1), + } + tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) + cmd := newGrpcQueryPartitionCommand(policy, nil, statement, nil, tracker, partitionFilter, res) + go cmd.ExecuteGRPC(clnt) + + return res, nil + +} + +// QueryObjects executes a query on all nodes in the cluster and marshals the records into the given channel. +// The query executor puts records on the channel from separate goroutines. +// The caller can concurrently pop objects. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) { + return clnt.QueryPartitionObjects(policy, statement, objChan, NewPartitionFilterAll()) +} + +func (clnt *ProxyClient) queryNodePartitionsObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} + +// QueryNodeObjects executes a query on a specific node and marshals the records into the given channel. +// The caller can concurrently pop records off the channel. +// +// This method is only supported by Aerospike 3+ servers. +// If the policy is nil, the default relevant policy will be used. +func (clnt *ProxyClient) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { + panic(notSupportedInProxyClient) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go new file mode 100644 index 00000000..9a50ebff --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go @@ -0,0 +1,42 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike Proxy Client", func() { + + gg.Describe("Info operations on proxy client", func() { + gg.BeforeEach(func() { + if !*proxy { + gg.Skip("Only supported in grpc environment") + } + }) + + gg.It("must successfully call info command", func() { + _, err := client.(*as.ProxyClient).RequestInfo(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go b/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go new file mode 100644 index 00000000..11cfcfae --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go @@ -0,0 +1,517 @@ +//go:build as_proxy + +package aerospike + +import ( + "math/rand" + + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" +) + +func (cmd *readCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + ReadPolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Read(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *batchCommandOperate) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + ReadPolicy: cmd.policy.grpc(), + WritePolicy: cmd.policy.grpc_write(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + streamRes, gerr := client.BatchOperate(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + readCallback := func() ([]byte, Error) { + if cmd.grpcEOS { + return nil, errGRPCStreamEnd + } + + res, gerr := streamRes.Recv() + if gerr != nil { + e := newGrpcError(!cmd.isRead(), gerr) + return nil, e + } + + if res.GetStatus() != 0 { + e := newGrpcStatusError(res) + return res.GetPayload(), e + } + + cmd.grpcEOS = !res.GetHasNext() + + return res.GetPayload(), nil + } + + cmd.conn = newGrpcFakeConnection(nil, readCallback) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil && err != errGRPCStreamEnd { + return err + } + + clnt.returnGrpcConnToPool(conn) + + return nil +} + +func (cmd *deleteCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + WritePolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Delete(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *executeCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + WritePolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Execute(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *existsCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + ReadPolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Exists(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *operateCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + WritePolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Operate(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *readHeaderCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + ReadPolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.GetHeader(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *serverCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + execReq := &kvs.BackgroundExecuteRequest{ + Statement: cmd.statement.grpc(cmd.policy, cmd.operations), + WritePolicy: cmd.writePolicy.grpc_exec(cmd.policy.FilterExpression), + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + BackgroundExecuteRequest: execReq, + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewQueryClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + streamRes, gerr := client.BackgroundExecute(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + readCallback := func() ([]byte, Error) { + res, gerr := streamRes.Recv() + if gerr != nil { + e := newGrpcError(!cmd.isRead(), gerr) + return nil, e + } + + if res.GetStatus() != 0 { + e := newGrpcStatusError(res) + return res.GetPayload(), e + } + + if !res.GetHasNext() { + return nil, errGRPCStreamEnd + } + + return res.GetPayload(), nil + } + + cmd.conn = newGrpcFakeConnection(nil, readCallback) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil && err != errGRPCStreamEnd { + return err + } + + clnt.returnGrpcConnToPool(conn) + + return nil +} + +func (cmd *touchCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + WritePolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Touch(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} + +func (cmd *writeCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + WritePolicy: cmd.policy.grpc(), + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewKVSClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + res, gerr := client.Write(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + defer clnt.returnGrpcConnToPool(conn) + + if res.GetStatus() != 0 { + return newGrpcStatusError(res) + } + + cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil { + return err + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go b/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go new file mode 100644 index 00000000..ecd4fefc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go @@ -0,0 +1,479 @@ +//go:build as_proxy + +package aerospike + +import ( + "context" + "math/rand" + "time" + + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +func (fltr *Filter) grpc() *kvs.Filter { + if fltr == nil { + return nil + } + + res := &kvs.Filter{ + Name: fltr.name, + ColType: fltr.idxType.grpc(), + PackedCtx: fltr.grpcPackCtxPayload(), + ValType: int32(fltr.valueParticleType), + Begin: grpcValuePacked(fltr.begin), + End: grpcValuePacked(fltr.end), + } + + return res +} + +/////////////////////////////////////////////////////////////////// + +var simpleCancelFunc = func() {} + +func (p *InfoPolicy) grpcDeadlineContext() (context.Context, context.CancelFunc) { + timeout := p.timeout() + if timeout <= 0 { + return context.Background(), simpleCancelFunc + + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) + return ctx, cancel +} + +func (p *InfoPolicy) grpc() *kvs.InfoPolicy { + if p == nil { + return nil + } + + Timeout := uint32(p.Timeout / time.Millisecond) + res := &kvs.InfoPolicy{ + Timeout: &Timeout, + } + + return res +} + +/////////////////////////////////////////////////////////////////// + +func (op *Operation) grpc() *kvs.Operation { + BinName := op.binName + return &kvs.Operation{ + Type: op.grpc_op_type(), + BinName: &BinName, + Value: grpcValuePacked(op.binValue), + } +} + +/////////////////////////////////////////////////////////////////// + +func (pf *PartitionFilter) grpc() *kvs.PartitionFilter { + begin := uint32(pf.Begin) + ps := make([]*kvs.PartitionStatus, len(pf.Partitions)) + for i := range pf.Partitions { + ps[i] = pf.Partitions[i].grpc() + } + + return &kvs.PartitionFilter{ + Begin: &begin, + Count: uint32(pf.Count), + Digest: pf.Digest, + PartitionStatuses: ps, + Retry: true, + } + +} + +/////////////////////////////////////////////////////////////////// + +func (ps *PartitionStatus) grpc() *kvs.PartitionStatus { + id := uint32(ps.Id) + bVal := ps.BVal + digest := ps.Digest + return &kvs.PartitionStatus{ + Id: &id, + BVal: &bVal, + Digest: digest, + Retry: ps.Retry, + } +} + +/////////////////////////////////////////////////////////////////// + +func (p *BasePolicy) grpc() *kvs.ReadPolicy { + return &kvs.ReadPolicy{ + Replica: p.ReplicaPolicy.grpc(), + ReadModeSC: p.ReadModeSC.grpc(), + ReadModeAP: p.ReadModeAP.grpc(), + } +} + +func (p *BasePolicy) grpcDeadlineContext() (context.Context, context.CancelFunc) { + timeout := p.timeout() + if timeout <= 0 { + return context.Background(), simpleCancelFunc + + } + ctx, cancel := context.WithTimeout(context.Background(), timeout) + return ctx, cancel +} + +/////////////////////////////////////////////////////////////////// + +func (qp *QueryPolicy) grpc() *kvs.QueryPolicy { + SendKey := qp.SendKey + TotalTimeout := uint32(qp.TotalTimeout / time.Millisecond) + RecordQueueSize := uint32(qp.RecordQueueSize) + MaxConcurrentNodes := uint32(qp.MaxConcurrentNodes) + IncludeBinData := qp.IncludeBinData + FailOnClusterChange := false //qp.FailOnClusterChange + ShortQuery := qp.ShortQuery || qp.ExpectedDuration == SHORT + InfoTimeout := uint32(qp.SocketTimeout / time.Millisecond) + ExpectedDuration := qp.ExpectedDuration.grpc() + + return &kvs.QueryPolicy{ + Replica: qp.ReplicaPolicy.grpc(), + ReadModeAP: qp.ReadModeAP.grpc(), + ReadModeSC: qp.ReadModeSC.grpc(), + SendKey: &SendKey, + Compress: qp.UseCompression, + Expression: qp.FilterExpression.grpc(), + TotalTimeout: &TotalTimeout, + MaxConcurrentNodes: &MaxConcurrentNodes, + RecordQueueSize: &RecordQueueSize, + IncludeBinData: &IncludeBinData, + FailOnClusterChange: &FailOnClusterChange, + ShortQuery: &ShortQuery, + InfoTimeout: &InfoTimeout, + ExpectedDuration: &ExpectedDuration, + } +} + +/////////////////////////////////////////////////////////////////// + +func (sp *ScanPolicy) grpc() *kvs.ScanPolicy { + TotalTimeout := uint32(sp.TotalTimeout / time.Millisecond) + MaxRecords := uint64(sp.MaxRecords) + RecordsPerSecond := uint32(sp.RecordsPerSecond) + MaxConcurrentNodes := uint32(sp.MaxConcurrentNodes) + IncludeBinData := sp.IncludeBinData + ConcurrentNodes := MaxConcurrentNodes > 1 + + return &kvs.ScanPolicy{ + Replica: sp.ReplicaPolicy.grpc(), + ReadModeAP: sp.ReadModeAP.grpc(), + ReadModeSC: sp.ReadModeSC.grpc(), + Compress: sp.UseCompression, + Expression: sp.FilterExpression.grpc(), + TotalTimeout: &TotalTimeout, + MaxRecords: &MaxRecords, + RecordsPerSecond: &RecordsPerSecond, + ConcurrentNodes: &ConcurrentNodes, + MaxConcurrentNodes: &MaxConcurrentNodes, + IncludeBinData: &IncludeBinData, + } +} + +/////////////////////////////////////////////////////////////////// + +func (p *WritePolicy) grpc() *kvs.WritePolicy { + return &kvs.WritePolicy{ + Replica: p.ReplicaPolicy.grpc(), + ReadModeSC: p.ReadModeSC.grpc(), + ReadModeAP: p.ReadModeAP.grpc(), + } +} + +func (p *WritePolicy) grpc_exec(expr *Expression) *kvs.BackgroundExecutePolicy { + if p == nil { + return nil + } + + SendKey := p.SendKey + TotalTimeout := uint32(p.TotalTimeout / time.Millisecond) + RecordExistsAction := p.RecordExistsAction.grpc() + GenerationPolicy := p.GenerationPolicy.grpc() + CommitLevel := p.CommitLevel.grpc() + Generation := p.Generation + Expiration := p.Expiration + RespondAllOps := p.RespondPerEachOp + DurableDelete := p.DurableDelete + + fe := expr + if fe == nil { + fe = p.FilterExpression + } + + res := &kvs.BackgroundExecutePolicy{ + Replica: p.ReplicaPolicy.grpc(), + ReadModeAP: p.ReadModeAP.grpc(), + ReadModeSC: p.ReadModeSC.grpc(), + SendKey: &SendKey, + Compress: p.UseCompression, + Expression: fe.grpc(), + TotalTimeout: &TotalTimeout, + + Xdr: nil, + + RecordExistsAction: &RecordExistsAction, + GenerationPolicy: &GenerationPolicy, + CommitLevel: &CommitLevel, + Generation: &Generation, + Expiration: &Expiration, + RespondAllOps: &RespondAllOps, + DurableDelete: &DurableDelete, + } + + return res +} + +func (p *BatchPolicy) grpc_write() *kvs.WritePolicy { + return &kvs.WritePolicy{ + Replica: p.ReplicaPolicy.grpc(), + ReadModeSC: p.ReadModeSC.grpc(), + ReadModeAP: p.ReadModeAP.grpc(), + } +} + +func (cl CommitLevel) grpc() kvs.CommitLevel { + switch cl { + case COMMIT_ALL: + return kvs.CommitLevel_COMMIT_ALL + case COMMIT_MASTER: + return kvs.CommitLevel_COMMIT_MASTER + } + panic(unreachable) +} + +func newGrpcStatusError(res *kvs.AerospikeResponsePayload) Error { + if res.GetStatus() >= 0 { + return newError(types.ResultCode(res.GetStatus())).markInDoubt(res.GetInDoubt()) + } + + var resultCode = types.OK + switch res.GetStatus() { + case -16: + // BATCH_FAILED + resultCode = types.BATCH_FAILED + case -15: + // NO_RESPONSE + resultCode = types.NO_RESPONSE + case -12: + // MAX_ERROR_RATE + resultCode = types.MAX_ERROR_RATE + case -11: + // MAX_RETRIES_EXCEEDED + resultCode = types.MAX_RETRIES_EXCEEDED + case -10: + // SERIALIZE_ERROR + resultCode = types.SERIALIZE_ERROR + case -9: + // ASYNC_QUEUE_FULL + // resultCode = types.ASYNC_QUEUE_FULL + return newError(types.SERVER_ERROR, "Server ASYNC_QUEUE_FULL").markInDoubt(res.GetInDoubt()) + case -8: + // SERVER_NOT_AVAILABLE + resultCode = types.SERVER_NOT_AVAILABLE + case -7: + // NO_MORE_CONNECTIONS + resultCode = types.NO_AVAILABLE_CONNECTIONS_TO_NODE + case -5: + // QUERY_TERMINATED + resultCode = types.QUERY_TERMINATED + case -4: + // SCAN_TERMINATED + resultCode = types.SCAN_TERMINATED + case -3: + // INVALID_NODE_ERROR + resultCode = types.INVALID_NODE_ERROR + case -2: + // PARSE_ERROR + resultCode = types.PARSE_ERROR + case -1: + // CLIENT_ERROR + resultCode = types.COMMON_ERROR + } + + return newError(resultCode).markInDoubt(res.GetInDoubt()) +} + +func (gp GenerationPolicy) grpc() kvs.GenerationPolicy { + switch gp { + case NONE: + return kvs.GenerationPolicy_NONE + case EXPECT_GEN_EQUAL: + return kvs.GenerationPolicy_EXPECT_GEN_EQUAL + case EXPECT_GEN_GT: + return kvs.GenerationPolicy_EXPECT_GEN_GT + } + panic(unreachable) +} + +func (ict IndexCollectionType) grpc() kvs.IndexCollectionType { + switch ict { + // Normal scalar index. + case ICT_DEFAULT: + return kvs.IndexCollectionType_DEFAULT + // Index list elements. + case ICT_LIST: + return kvs.IndexCollectionType_LIST + // Index map keys. + case ICT_MAPKEYS: + return kvs.IndexCollectionType_MAPKEYS + // Index map values. + case ICT_MAPVALUES: + return kvs.IndexCollectionType_MAPVALUES + } + panic(unreachable) +} + +func (o *Operation) grpc_op_type() kvs.OperationType { + // case _READ: return kvs.OperationType_READ + switch o.opType { + case _READ: + return kvs.OperationType_READ + case _READ_HEADER: + return kvs.OperationType_READ_HEADER + case _WRITE: + return kvs.OperationType_WRITE + case _CDT_READ: + return kvs.OperationType_CDT_READ + case _CDT_MODIFY: + return kvs.OperationType_CDT_MODIFY + case _MAP_READ: + return kvs.OperationType_MAP_READ + case _MAP_MODIFY: + return kvs.OperationType_MAP_MODIFY + case _ADD: + return kvs.OperationType_ADD + case _EXP_READ: + return kvs.OperationType_EXP_READ + case _EXP_MODIFY: + return kvs.OperationType_EXP_MODIFY + case _APPEND: + return kvs.OperationType_APPEND + case _PREPEND: + return kvs.OperationType_PREPEND + case _TOUCH: + return kvs.OperationType_TOUCH + case _BIT_READ: + return kvs.OperationType_BIT_READ + case _BIT_MODIFY: + return kvs.OperationType_BIT_MODIFY + case _DELETE: + return kvs.OperationType_DELETE + case _HLL_READ: + return kvs.OperationType_HLL_READ + case _HLL_MODIFY: + return kvs.OperationType_HLL_MODIFY + } + + panic(unreachable) +} + +func (stmt *Statement) grpc(policy *QueryPolicy, ops []*Operation) *kvs.Statement { + IndexName := stmt.IndexName + // reset taskID every time + TaskId := rand.Int63() + SetName := stmt.SetName + + MaxRecords := uint64(policy.MaxRecords) + RecordsPerSecond := uint32(policy.RecordsPerSecond) + + funcArgs := make([][]byte, 0, len(stmt.functionArgs)) + for i := range stmt.functionArgs { + funcArgs = append(funcArgs, grpcValuePacked(stmt.functionArgs[i])) + } + + return &kvs.Statement{ + Namespace: stmt.Namespace, + SetName: &SetName, + IndexName: &IndexName, + BinNames: stmt.BinNames, + Filter: stmt.Filter.grpc(), + PackageName: stmt.packageName, + FunctionName: stmt.functionName, + FunctionArgs: funcArgs, + Operations: grpcOperations(ops), + TaskId: &TaskId, + MaxRecords: &MaxRecords, + RecordsPerSecond: &RecordsPerSecond, + } +} + +func grpcOperations(ops []*Operation) []*kvs.Operation { + res := make([]*kvs.Operation, 0, len(ops)) + for i := range ops { + res = append(res, ops[i].grpc()) + } + return res +} + +func (qd QueryDuration) grpc() kvs.QueryDuration { + switch qd { + case LONG: + return kvs.QueryDuration(kvs.QueryDuration_LONG) + case SHORT: + return kvs.QueryDuration(kvs.QueryDuration_SHORT) + case LONG_RELAX_AP: + return kvs.QueryDuration(kvs.QueryDuration_LONG_RELAX_AP) + } + panic(unreachable) +} + +func (rm ReadModeAP) grpc() kvs.ReadModeAP { + switch rm { + case ReadModeAPOne: + return kvs.ReadModeAP_ONE + case ReadModeAPAll: + return kvs.ReadModeAP_ALL + } + panic(unreachable) +} + +func (rm ReadModeSC) grpc() kvs.ReadModeSC { + switch rm { + case ReadModeSCSession: + return kvs.ReadModeSC_SESSION + case ReadModeSCLinearize: + return kvs.ReadModeSC_LINEARIZE + case ReadModeSCAllowReplica: + return kvs.ReadModeSC_ALLOW_REPLICA + case ReadModeSCAllowUnavailable: + return kvs.ReadModeSC_ALLOW_UNAVAILABLE + } + panic(unreachable) +} + +func (rea RecordExistsAction) grpc() kvs.RecordExistsAction { + switch rea { + case UPDATE: + return kvs.RecordExistsAction_UPDATE + case UPDATE_ONLY: + return kvs.RecordExistsAction_UPDATE_ONLY + case REPLACE: + return kvs.RecordExistsAction_REPLACE + case REPLACE_ONLY: + return kvs.RecordExistsAction_REPLACE_ONLY + case CREATE_ONLY: + return kvs.RecordExistsAction_CREATE_ONLY + } + panic(unreachable) +} + +func (rp ReplicaPolicy) grpc() kvs.Replica { + switch rp { + case MASTER: + return kvs.Replica_MASTER + case MASTER_PROLES: + return kvs.Replica_MASTER_PROLES + case RANDOM: + return kvs.Replica_RANDOM + case SEQUENCE: + return kvs.Replica_SEQUENCE + case PREFER_RACK: + return kvs.Replica_PREFER_RACK + } + panic(unreachable) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go b/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go new file mode 100644 index 00000000..bc89b966 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go @@ -0,0 +1,89 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "math/rand" + "time" + + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" +) + +// newGRPCExecuteTask initializes task with fields needed to query server nodes. +func newGRPCExecuteTask(clnt *ProxyClient, statement *Statement) *ExecuteTask { + return &ExecuteTask{ + baseTask: newTask(nil), + taskID: statement.TaskId, + scan: statement.IsScan(), + clnt: clnt, + } +} + +func (etsk *ExecuteTask) grpcIsDone() (bool, Error) { + statusReq := &kvs.BackgroundTaskStatusRequest{ + TaskId: int64(etsk.taskID), + IsScan: etsk.scan, + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + BackgroundTaskStatusRequest: statusReq, + } + + clnt := etsk.clnt.(*ProxyClient) + conn, err := clnt.grpcConn() + if err != nil { + return false, err + } + + client := kvs.NewQueryClient(conn) + + ctx, cancel := context.WithTimeout(context.Background(), NewInfoPolicy().Timeout) + defer cancel() + + streamRes, gerr := client.BackgroundTaskStatus(ctx, &req) + if gerr != nil { + return false, newGrpcError(true, gerr, gerr.Error()) + } + + for { + time.Sleep(time.Second) + + res, gerr := streamRes.Recv() + if gerr != nil { + e := newGrpcError(true, gerr) + return false, e + } + + if res.GetStatus() != 0 { + e := newGrpcStatusError(res) + clnt.returnGrpcConnToPool(conn) + return false, e + } + + switch res.GetBackgroundTaskStatus() { + case kvs.BackgroundTaskStatus_COMPLETE: + clnt.returnGrpcConnToPool(conn) + return true, nil + default: + clnt.returnGrpcConnToPool(conn) + return false, nil + } + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go new file mode 100644 index 00000000..de389261 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go @@ -0,0 +1,162 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" +) + +type grpcQueryPartitionCommand struct { + baseMultiCommand + + policy *QueryPolicy + writePolicy *WritePolicy + statement *Statement + partitionFilter *PartitionFilter + operations []*Operation +} + +func newGrpcQueryPartitionCommand( + policy *QueryPolicy, + writePolicy *WritePolicy, + statement *Statement, + operations []*Operation, + partitionTracker *partitionTracker, + partitionFilter *PartitionFilter, + recordset *Recordset, +) *grpcQueryPartitionCommand { + cmd := &grpcQueryPartitionCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), + policy: policy, + writePolicy: writePolicy, + statement: statement, + partitionFilter: partitionFilter, + operations: operations, + } + cmd.rawCDT = policy.RawCDT + cmd.tracker = partitionTracker + cmd.terminationErrorType = statement.terminationError() + cmd.nodePartitions = newNodePartitions(nil, _PARTITIONS) + + return cmd +} + +func (cmd *grpcQueryPartitionCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *grpcQueryPartitionCommand) writeBuffer(ifc command) Error { + return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, nil) +} + +func (cmd *grpcQueryPartitionCommand) shouldRetry(e Error) bool { + panic(unreachable) +} + +func (cmd *grpcQueryPartitionCommand) transactionType() transactionType { + return ttQuery +} + +func (cmd *grpcQueryPartitionCommand) Execute() Error { + panic(unreachable) +} + +func (cmd *grpcQueryPartitionCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.recordset.signalEnd() + + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + queryReq := &kvs.QueryRequest{ + Statement: cmd.statement.grpc(cmd.policy, cmd.operations), + PartitionFilter: cmd.partitionFilter.grpc(), + QueryPolicy: cmd.policy.grpc(), + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + QueryRequest: queryReq, + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewQueryClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + streamRes, gerr := client.Query(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + readCallback := func() ([]byte, Error) { + if cmd.grpcEOS { + return nil, errGRPCStreamEnd + } + + res, gerr := streamRes.Recv() + if gerr != nil { + e := newGrpcError(!cmd.isRead(), gerr) + cmd.recordset.sendError(e) + return nil, e + } + + if res.GetStatus() != 0 { + e := newGrpcStatusError(res) + cmd.recordset.sendError(e) + return res.GetPayload(), e + } + + cmd.grpcEOS = !res.GetHasNext() + + return res.GetPayload(), nil + } + + cmd.conn = newGrpcFakeConnection(nil, readCallback) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil && err != errGRPCStreamEnd { + cmd.recordset.sendError(err) + return err + } + + done, err := cmd.tracker.isComplete(false, &cmd.policy.BasePolicy, []*nodePartitions{cmd.nodePartitions}) + if !cmd.recordset.IsActive() || done || err != nil { + // Query is complete. + if err != nil { + cmd.tracker.partitionError() + cmd.recordset.sendError(err) + } + } + + clnt.returnGrpcConnToPool(conn) + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go b/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go new file mode 100644 index 00000000..7f0a06c7 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go @@ -0,0 +1,165 @@ +//go:build as_proxy + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math/rand" + + kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +type grpcScanPartitionCommand struct { + baseMultiCommand + + policy *ScanPolicy + namespace string + setName string + binNames []string + partitionFilter *PartitionFilter +} + +func newGrpcScanPartitionCommand( + policy *ScanPolicy, + partitionTracker *partitionTracker, + partitionFilter *PartitionFilter, + namespace string, + setName string, + binNames []string, + recordset *Recordset, +) *grpcScanPartitionCommand { + cmd := &grpcScanPartitionCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), + policy: policy, + namespace: namespace, + setName: setName, + binNames: binNames, + partitionFilter: partitionFilter, + } + cmd.rawCDT = policy.RawCDT + cmd.tracker = partitionTracker + cmd.terminationErrorType = types.SCAN_TERMINATED + cmd.nodePartitions = newNodePartitions(nil, _PARTITIONS) + + return cmd +} + +func (cmd *grpcScanPartitionCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *grpcScanPartitionCommand) writeBuffer(ifc command) Error { + return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, nil) +} + +func (cmd *grpcScanPartitionCommand) shouldRetry(e Error) bool { + panic(unreachable) +} + +func (cmd *grpcScanPartitionCommand) transactionType() transactionType { + return ttScan +} + +func (cmd *grpcScanPartitionCommand) Execute() Error { + panic(unreachable) +} + +func (cmd *grpcScanPartitionCommand) ExecuteGRPC(clnt *ProxyClient) Error { + defer cmd.recordset.signalEnd() + + defer cmd.grpcPutBufferBack() + + err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) + if err != nil { + return err + } + + scanReq := &kvs.ScanRequest{ + Namespace: cmd.namespace, + SetName: &cmd.setName, + BinNames: cmd.binNames, + PartitionFilter: cmd.partitionFilter.grpc(), + ScanPolicy: cmd.policy.grpc(), + } + + req := kvs.AerospikeRequestPayload{ + Id: rand.Uint32(), + Iteration: 1, + Payload: cmd.dataBuffer[:cmd.dataOffset], + ScanRequest: scanReq, + } + + conn, err := clnt.grpcConn() + if err != nil { + return err + } + + client := kvs.NewScanClient(conn) + + ctx, cancel := cmd.policy.grpcDeadlineContext() + defer cancel() + + streamRes, gerr := client.Scan(ctx, &req) + if gerr != nil { + return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) + } + + cmd.commandWasSent = true + + readCallback := func() ([]byte, Error) { + if cmd.grpcEOS { + return nil, errGRPCStreamEnd + } + + res, gerr := streamRes.Recv() + if gerr != nil { + e := newGrpcError(!cmd.isRead(), gerr) + cmd.recordset.sendError(e) + return nil, e + } + + cmd.grpcEOS = !res.GetHasNext() + + if res.GetStatus() != 0 { + e := newGrpcStatusError(res) + cmd.recordset.sendError(e) + return res.GetPayload(), e + } + + return res.GetPayload(), nil + } + + cmd.conn = newGrpcFakeConnection(nil, readCallback) + err = cmd.parseResult(cmd, cmd.conn) + if err != nil && err != errGRPCStreamEnd { + cmd.recordset.sendError(err) + return err + } + + done, err := cmd.tracker.isComplete(false, &cmd.policy.BasePolicy, []*nodePartitions{cmd.nodePartitions}) + if !cmd.recordset.IsActive() || done || err != nil { + // Query is complete. + if err != nil { + cmd.tracker.partitionError() + cmd.recordset.sendError(err) + } + } + + clnt.returnGrpcConnToPool(conn) + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go new file mode 100644 index 00000000..c4693478 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go @@ -0,0 +1,155 @@ +//go:build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" + lua "github.com/yuin/gopher-lua" +) + +type queryAggregateCommand struct { + queryCommand + + luaInstance *lua.LState + inputChan chan interface{} +} + +func newQueryAggregateCommand(node *Node, policy *QueryPolicy, statement *Statement, recordset *Recordset) *queryAggregateCommand { + cmd := &queryAggregateCommand{ + queryCommand: *newQueryCommand(node, policy, nil, statement, nil, recordset), + } + + cmd.terminationErrorType = types.QUERY_TERMINATED + + return cmd +} + +func (cmd *queryAggregateCommand) Execute() Error { + cmd.policy.MaxRetries = 0 + err := cmd.execute(cmd) + if err != nil { + cmd.recordset.sendError(err) + } + return err +} + +func (cmd *queryAggregateCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + // Read/parse remaining message bytes one record at a time. + cmd.dataOffset = 0 + var bval int64 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + err = newNodeError(cmd.node, err) + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + if resultCode != 0 { + if resultCode == types.KEY_NOT_FOUND_ERROR { + // consume the rest of the input buffer from the socket + if cmd.dataOffset < receiveSize { + if err := cmd.readBytes(receiveSize - cmd.dataOffset); err != nil { + err = newNodeError(cmd.node, err) + return false, err + } + } + return false, nil + } + return false, newCustomNodeError(cmd.node, resultCode) + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + // generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) + // expiration := TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + + if opCount != 1 { + return false, newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Query aggregate command expects exactly only one bin. Received: %d", opCount)) + } + + if _, err := cmd.parseKey(fieldCount, &bval); err != nil { + return false, newNodeError(cmd.node, err) + } + + // if there is a recordset, process the record traditionally + // otherwise, it is supposed to be a record channel + + // Parse bins. + var bins BinMap + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return false, newNodeError(cmd.node, err) + } + + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + particleType := int(cmd.dataBuffer[5]) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return false, newNodeError(cmd.node, err) + } + name := string(cmd.dataBuffer[:nameSize]) + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return false, newNodeError(cmd.node, err) + } + value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) + if err != nil { + return false, newNodeError(cmd.node, err) + } + + if bins == nil { + bins = make(BinMap, opCount) + } + bins[name] = value + } + + recs, exists := bins["SUCCESS"] + if !exists { + if errStr, exists := bins["FAILURE"]; exists { + return false, newError(types.QUERY_GENERIC, errStr.(string)) + } + + return false, newError(types.QUERY_GENERIC, fmt.Sprintf("QueryAggregate's expected result was not returned. Received: %v", bins)) + } + + // If the channel is full and it blocks, we don't want this command to + // block forever, or panic in case the channel is closed in the meantime. + select { + // send back the result on the async channel + case cmd.inputChan <- recs: + case <-cmd.recordset.cancelled: + return false, newError(types.QUERY_TERMINATED) + } + } + + return true, nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go new file mode 100644 index 00000000..adaaac9f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go @@ -0,0 +1,147 @@ +//go:build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "os" + "sync" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func registerUDFFromFile(path, filename string) { + regTask, err := nativeClient.RegisterUDFFromFile(nil, path+filename+".lua", filename+".lua", as.LUA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + gm.Expect(<-regTask.OnComplete()).ToNot(gm.HaveOccurred()) +} + +func registerUDF(udf, moduleName string) { + regTask, err := nativeClient.RegisterUDF(nil, []byte(udf), moduleName, as.LUA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + gm.Expect(<-regTask.OnComplete()).ToNot(gm.HaveOccurred()) +} + +func removeUDF(moduleName string) { + remTask, err := nativeClient.RemoveUDF(nil, moduleName) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + gm.Expect(<-remTask.OnComplete()).ToNot(gm.HaveOccurred()) +} + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Query Aggregate operations", func() { + + var sumAll = func(upTo int) float64 { + return float64((1 + upTo) * upTo / 2.0) + } + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + // Set LuaPath + luaPath, _ := os.Getwd() + luaPath += "/test/resources/" + as.SetLuaPath(luaPath) + + const keyCount = 1000 + + createUDFs := new(sync.Once) + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + + createUDFs.Do(func() { + registerUDFFromFile(luaPath, "sum_single_bin") + registerUDFFromFile(luaPath, "average") + }) + + set = randString(50) + for i := 1; i <= keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin1 := as.NewBin("bin1", i) + client.PutBins(nil, key, bin1) + } + + // // queries only work on indices + // idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin3.Name, bin3.Name, NUMERIC) + // gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until index is created + // gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) + }) + + gg.It("must return the sum of specified bin to the client", func() { + stm := as.NewStatement(ns, set) + res, err := client.QueryAggregate(nil, stm, "sum_single_bin", "sum_single_bin", as.StringValue("bin1")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // gm.Expect(res.TaskId()).To(gm.Equal(stm.TaskId)) + gm.Expect(res.TaskId()).To(gm.BeNumerically(">", 0)) + + for rec := range res.Results() { + gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(sumAll(keyCount))) + } + }) + + gg.It("must handle running an aggregate query on a set that does not exist without timing out", func() { + stm := as.NewStatement(ns, set+"_NOT_EXISTS") + res, err := client.QueryAggregate(nil, stm, "sum_single_bin", "sum_single_bin", as.StringValue("bin1")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // gm.Expect(res.TaskId()).To(gm.Equal(stm.TaskId)) + gm.Expect(res.TaskId()).To(gm.BeNumerically(">", 0)) + + cnt := 0 + for rec := range res.Results() { + gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(sumAll(keyCount))) + cnt++ + } + gm.Expect(cnt).To(gm.Equal(0)) + }) + + gg.It("must return Sum and Count to the client", func() { + stm := as.NewStatement(ns, set) + res, err := client.QueryAggregate(nil, stm, "average", "average", as.StringValue("bin1")) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for rec := range res.Results() { + gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[interface{}]interface{}{"sum": sumAll(keyCount), "count": float64(keyCount)})) + } + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_command.go b/aerospike-tls/vendor-aerospike-client-go/query_command.go new file mode 100644 index 00000000..b5c2a042 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_command.go @@ -0,0 +1,62 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type queryCommand struct { + baseMultiCommand + + policy *QueryPolicy + writePolicy *WritePolicy + statement *Statement + operations []*Operation +} + +func newQueryCommand(node *Node, policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, operations []*Operation, recordset *Recordset) *queryCommand { + res := &queryCommand{ + baseMultiCommand: *newStreamingMultiCommand(node, recordset, statement.Namespace, false), + policy: policy, + writePolicy: writePolicy, + statement: statement, + operations: operations, + } + res.rawCDT = policy.RawCDT + + return res +} + +func (cmd *queryCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *queryCommand) writeBuffer(ifc command) (err Error) { + return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, nil) +} + +func (cmd *queryCommand) parseResult(ifc command, conn *Connection) Error { + return cmd.baseMultiCommand.parseResult(ifc, conn) +} + +func (cmd *queryCommand) transactionType() transactionType { + return ttQuery +} + +// Execute will run the query. +func (cmd *queryCommand) Execute() Error { + err := cmd.execute(cmd) + if err != nil { + cmd.recordset.sendError(err) + } + return err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_context_test.go b/aerospike-tls/vendor-aerospike-client-go/query_context_test.go new file mode 100644 index 00000000..5a18a2ac --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_context_test.go @@ -0,0 +1,92 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Query operations with Context", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + const keyCount = 1000 + + bin1Name := "List" + var keys map[string]*as.Key + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + keys = make(map[string]*as.Key, keyCount) + set = randString(50) + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + keys[string(key.Digest())] = key + + list := []int{i, i + 1, i + 2, i + 3, i + 4} + bin1 := as.NewBin(bin1Name, list) + err = client.PutBins(wpolicy, key, bin1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + // queries only work on indices + createComplexIndex(wpolicy, ns, set, set+bin1Name, bin1Name, as.NUMERIC, as.ICT_DEFAULT, as.CtxListRank(-1)) + }) + + gg.AfterEach(func() { + dropIndex(nil, ns, set, set+bin1Name) + }) + + var queryPolicy = as.NewQueryPolicy() + + gg.It("must Query with a Context", func() { + begin := 14 + end := 18 + + stm := as.NewStatement(ns, set, bin1Name) + stm.SetFilter(as.NewRangeFilter(bin1Name, int64(begin), int64(end), as.CtxListRank(-1))) + + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + list := rec.Bins[bin1Name].([]interface{}) + received := list[len(list)-1].(int) + + gm.Expect(received < begin || received > end).To(gm.BeFalse()) + + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically("==", 5)) + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_duration.go b/aerospike-tls/vendor-aerospike-client-go/query_duration.go new file mode 100644 index 00000000..0b4dc8a6 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_duration.go @@ -0,0 +1,48 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +// QueryDuration defines the expected query duration. The server treats the query in different ways depending on the expected duration. +// This enum is ignored for aggregation queries, background queries and server versions < 6.0. +type QueryDuration int + +const ( + // LONG specifies that the query is expected to return more than 100 records per node. The server optimizes for a large record set in + // the following ways: + // + // Allow query to be run in multiple threads using the server's query threading configuration. + // Do not relax read consistency for AP namespaces. + // Add the query to the server's query monitor. + // Do not add the overall latency to the server's latency histogram. + // Do not allow server timeouts. + LONG = iota + + // Short specifies that the query is expected to return less than 100 records per node. The server optimizes for a small record set in + // the following ways: + // Always run the query in one thread and ignore the server's query threading configuration. + // Allow query to be inlined directly on the server's service thread. + // Relax read consistency for AP namespaces. + // Do not add the query to the server's query monitor. + // Add the overall latency to the server's latency histogram. + // Allow server timeouts. The default server timeout for a short query is 1 second. + SHORT + + // LONG_RELAX_AP will treat query as a LONG query, but relax read consistency for AP namespaces. + // This value is treated exactly like LONG for server versions < 7.1. + LONG_RELAX_AP +) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_executor.go b/aerospike-tls/vendor-aerospike-client-go/query_executor.go new file mode 100644 index 00000000..dbf51518 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_executor.go @@ -0,0 +1,74 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +func (clnt *Client) queryPartitions(policy *QueryPolicy, tracker *partitionTracker, statement *Statement, recordset *Recordset) { + defer recordset.signalEnd() + + // for exponential backoff + interval := policy.SleepBetweenRetries + + var errs Error + for { + list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), statement.Namespace) + if err != nil { + errs = chainErrors(err, errs) + recordset.sendError(errs) + tracker.partitionError() + return + } + + maxConcurrentNodes := policy.MaxConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(list) + } + + if recordset.IsActive() { + weg := newWeightedErrGroup(maxConcurrentNodes) + for _, nodePartition := range list { + cmd := newQueryPartitionCommand(policy, tracker, nodePartition, statement, recordset) + weg.execute(cmd) + } + errs = chainErrors(weg.wait(), errs) + } + + done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) + if !recordset.IsActive() || done || err != nil { + errs = chainErrors(err, errs) + // Query is complete. + if errs != nil { + tracker.partitionError() + recordset.sendError(errs) + } + return + } + + if policy.SleepBetweenRetries > 0 { + // Sleep before trying again. + time.Sleep(interval) + + if policy.SleepMultiplier > 1 { + interval = time.Duration(float64(interval) * policy.SleepMultiplier) + } + } + + recordset.resetTaskID() + } + +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go b/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go new file mode 100644 index 00000000..63ad74d4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go @@ -0,0 +1,98 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "sync" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "golang.org/x/sync/semaphore" +) + +func (clnt *Client) queryPartitionObjects(policy *QueryPolicy, tracker *partitionTracker, statement *Statement, rs *Recordset) Error { + defer rs.signalEnd() + + // for exponential backoff + interval := policy.SleepBetweenRetries + + for { + rs.resetTaskID() + list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), statement.Namespace) + if err != nil { + tracker.partitionError() + return err + } + + wg := new(sync.WaitGroup) + + // the whole call should be wrapped in a goroutine + wg.Add(len(list)) + + // results channel must be async for performance + maxConcurrentNodes := policy.MaxConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(list) + } + + sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) + ctx := context.Background() + + if rs.IsActive() { + for _, nodePartition := range list { + if err := sem.Acquire(ctx, 1); err != nil { + tracker.partitionError() + logger.Logger.Error("Constraint Semaphore failed for Query: %s", err.Error()) + } + go func(nodePartition *nodePartitions) { + defer sem.Release(1) + defer wg.Done() + if err := clnt.queryNodePartitionObjects(policy, rs, tracker, nodePartition, statement); err != nil { + tracker.partitionError() + logger.Logger.Debug("Error while Executing query for node %s: %s", nodePartition.node.String(), err.Error()) + } + }(nodePartition) + } + + wg.Wait() + } + + done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) + if !rs.IsActive() || done || err != nil { + if err != nil { + tracker.partitionError() + } + // Query is complete. + return err + } + + if policy.SleepBetweenRetries > 0 { + // Sleep before trying again. + time.Sleep(interval) + + if policy.SleepMultiplier > 1 { + interval = time.Duration(float64(interval) * policy.SleepMultiplier) + } + } + } +} + +// QueryNode reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) queryNodePartitionObjects(policy *QueryPolicy, recordset *Recordset, tracker *partitionTracker, nodePartition *nodePartitions, statement *Statement) Error { + command := newQueryPartitionObjectsCommand(policy, tracker, nodePartition, statement, recordset) + return command.Execute() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go new file mode 100644 index 00000000..abb0523a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go @@ -0,0 +1,68 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type queryPartitionCommand queryCommand + +func newQueryPartitionCommand( + policy *QueryPolicy, + tracker *partitionTracker, + nodePartitions *nodePartitions, + statement *Statement, + recordset *Recordset, +) *queryPartitionCommand { + cmd := &queryPartitionCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), + policy: policy, + writePolicy: nil, + statement: statement, + operations: nil, + } + cmd.rawCDT = policy.RawCDT + cmd.terminationErrorType = statement.terminationError() + cmd.tracker = tracker + cmd.nodePartitions = nodePartitions + cmd.node = nodePartitions.node + + return cmd +} + +func (cmd *queryPartitionCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *queryPartitionCommand) writeBuffer(ifc command) Error { + return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, cmd.nodePartitions) +} + +func (cmd *queryPartitionCommand) shouldRetry(e Error) bool { + return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) +} + +func (cmd *queryPartitionCommand) transactionType() transactionType { + return ttQuery +} + +func (cmd *queryPartitionCommand) Execute() Error { + err := cmd.execute(cmd) + if err != nil { + // signal to the executor that no retries should be attempted + // don't send error unless no retries are planned + if !cmd.shouldRetry(err) { + cmd.recordset.sendError(err) + } + } + return err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go b/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go new file mode 100644 index 00000000..4c68a14c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go @@ -0,0 +1,67 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +type queryPartitionObjectsCommand queryCommand + +func newQueryPartitionObjectsCommand( + policy *QueryPolicy, + tracker *partitionTracker, + nodePartitions *nodePartitions, + statement *Statement, + recordset *Recordset, +) *queryPartitionObjectsCommand { + cmd := &queryPartitionObjectsCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), + policy: policy, + writePolicy: nil, + statement: statement, + operations: nil, + } + cmd.terminationErrorType = statement.terminationError() + cmd.tracker = tracker + cmd.nodePartitions = nodePartitions + cmd.node = nodePartitions.node + + return cmd +} + +func (cmd *queryPartitionObjectsCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *queryPartitionObjectsCommand) writeBuffer(ifc command) Error { + return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, cmd.nodePartitions) +} + +func (cmd *queryPartitionObjectsCommand) shouldRetry(e Error) bool { + return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) +} + +func (cmd *queryPartitionObjectsCommand) transactionType() transactionType { + return ttQuery +} + +func (cmd *queryPartitionObjectsCommand) Execute() Error { + err := cmd.execute(cmd) + if err != nil { + // signal to the executor that no retries should be attempted + // don't send error unless no retries are planned + if !cmd.shouldRetry(err) { + cmd.recordset.sendError(err) + } + } + return err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_policy.go b/aerospike-tls/vendor-aerospike-client-go/query_policy.go new file mode 100644 index 00000000..747a06c2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_policy.go @@ -0,0 +1,56 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// QueryPolicy encapsulates parameters for policy attributes used in query operations. +type QueryPolicy struct { + MultiPolicy + + // Expected query duration. The server treats the query in different ways depending on the expected duration. + // This field is ignored for aggregation queries, background queries and server versions < 6.0. + // + // Default: LONG + ExpectedDuration QueryDuration + + // ShortQuery determines wether query expected to return less than 100 records. + // If true, the server will optimize the query for a small record set. + // This field is ignored for aggregation queries, background queries + // and server versions 6.0+. + // + // Default: false + // This field is deprecated and will eventually be removed. Use ExpectedDuration instead. + // For backwards compatibility: If ShortQuery is true, the query is treated as a short query and + // ExpectedDuration is ignored. If shortQuery is false, ExpectedDuration is used defaults to {@link QueryDuration#LONG}. + ShortQuery bool +} + +// NewQueryPolicy generates a new QueryPolicy instance with default values. +// Set MaxRetries for non-aggregation queries with a nil filter on +// server versions >= 4.9. All other queries are not retried. +// +// The latest servers support retries on individual data partitions. +// This feature is useful when a cluster is migrating and partition(s) +// are missed or incomplete on the first query (with nil filter) attempt. +// +// If the first query attempt misses 2 of 4096 partitions, then only +// those 2 partitions are retried in the next query attempt from the +// last key digest received for each respective partition. A higher +// default MaxRetries is used because it's wasteful to invalidate +// all query results because a single partition was missed. +func NewQueryPolicy() *QueryPolicy { + return &QueryPolicy{ + MultiPolicy: *NewMultiPolicy(), + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_test.go b/aerospike-tls/vendor-aerospike-client-go/query_test.go new file mode 100644 index 00000000..b8c1570e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/query_test.go @@ -0,0 +1,557 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "bytes" + "errors" + "math" + "math/rand" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +const udfFilter = ` +local function map_profile(record) + -- Add name and age to returned map. + -- Could add other record bins here as well. + -- return map {name=record["name"], age=32} + return map {bin4=record.Aerospike4, bin5=record["Aerospike5"]} +end + +function filter_by_name(stream,name) + local function filter_name(record) + return (record.Aerospike5 == -1) and (record.Aerospike4 == 'constValue') + end + return stream : filter(filter_name) : map(map_profile) +end` + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Query operations", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + const keyCount = 1000 + bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", randString(100)) + bin3 := as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) + bin4 := as.NewBin("Aerospike4", "constValue") + bin5 := as.NewBin("Aerospike5", -1) + bin6 := as.NewBin("Aerospike6", 1) + bin7 := as.NewBin("Aerospike7", nil) + var keys map[string]*as.Key + var indexName string + var indexName2 string + var indexName3 string + + // read all records from the channel and make sure all of them are returned + var checkResults = func(recordset *as.Recordset, cancelCnt int) { + counter := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + + key, exists := keys[string(rec.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(rec.Key.Digest())) + + counter++ + // cancel scan abruptly + if cancelCnt != 0 && counter == cancelCnt { + recordset.Close() + } + } + + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + } + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + nativeClient.Truncate(nil, ns, set, nil) + + keys = make(map[string]*as.Key, keyCount) + set = randString(50) + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + keys[string(key.Digest())] = key + bin3 = as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) + bin7 = as.NewBin("Aerospike7", i%3) + err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + // queries only work on indices + indexName = set + bin3.Name + createIndex(wpolicy, ns, set, indexName, bin3.Name, as.NUMERIC) + + // queries only work on indices + indexName2 = set + bin6.Name + createIndex(wpolicy, ns, set, indexName2, bin6.Name, as.NUMERIC) + + // queries only work on indices + indexName3 = set + bin7.Name + createIndex(wpolicy, ns, set, indexName3, bin7.Name, as.NUMERIC) + }) + + gg.AfterEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + indexName = set + bin3.Name + gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) + + indexName = set + bin6.Name + gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) + + indexName = set + bin7.Name + gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) + }) + + var queryPolicy = as.NewQueryPolicy() + + gg.It("must Query and get all records back for a specified node using Results() channel", func() { + if *proxy { + gg.Skip("Not Supported for Proxy Client") + } + + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + stm := as.NewStatement(ns, set) + + counter := 0 + for _, node := range client.GetNodes() { + recordset, err := client.QueryNode(queryPolicy, node, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + key, exists := keys[string(res.Record.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(res.Record.Key.Value().GetObject())) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + } + + gm.Expect(len(keys)).To(gm.Equal(0)) + gm.Expect(counter).To(gm.Equal(keyCount)) + }) + + gg.It("must Scan and get all partition records back for a specified key", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + counter := 0 + + var rkey *as.Key + for _, k := range keys { + rkey = k + + pf := as.NewPartitionFilterByKey(rkey) + stm := as.NewStatement(ns, set) + recordset, err := client.QueryPartitions(queryPolicy, stm, pf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + // the key itself should not be returned + gm.Expect(bytes.Equal(rkey.Digest(), res.Record.Key.Digest())).To(gm.BeFalse()) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + + } + gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) + }) + + gg.It("must Query per key partition and get all partition records back for a specified key and filter", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + counter := 0 + + var rkey *as.Key + for _, k := range keys { + rkey = k + + pf := as.NewPartitionFilterByKey(rkey) + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(bin7.Name, 1, 2)) + recordset, err := client.QueryPartitions(queryPolicy, stm, pf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + gm.Expect(res.Record.Bins[bin7.Name]).To(gm.BeNumerically(">=", 1)) + gm.Expect(res.Record.Bins[bin7.Name]).To(gm.BeNumerically("<=", 2)) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + } + + gm.Expect(len(keys)).To(gm.Equal(334)) + // This depends on how many keys end up in the same partition. + // Since keys are statistically distributed randomly and uniformly, + // we expect that there aren't many partitions that share more than one key. + gm.Expect(counter).To(gm.BeNumerically("~", keyCount-334, 50)) + }) + + gg.It("must Query and get all partition records back for a specified key and filter", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + counter := 0 + + pf := as.NewPartitionFilterAll() + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(bin7.Name, 1, 2)) + recordset, err := client.QueryPartitions(queryPolicy, stm, pf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + + gm.Expect(len(keys)).To(gm.Equal(334)) + gm.Expect(counter).To(gm.Equal(keyCount - 334)) + }) + + gg.It("must return error on a Query when index is not found", func() { + pf := as.NewPartitionFilterAll() + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(randString(10), 1, 2)) + recordset, err := client.QueryPartitions(queryPolicy, stm, pf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).To(gm.HaveOccurred()) + gm.Expect(res.Err.Matches(ast.INDEX_NOTFOUND)).To(gm.BeTrue()) + } + }) + + gg.It("must Query and get all partition records back for a specified partition range", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + pbegin := 1000 + for i := 1; i < 10; i++ { + counter := 0 + + pf := as.NewPartitionFilterByRange(pbegin, rand.Intn(i*191)+1) + stm := as.NewStatement(ns, set) + recordset, err := client.QueryPartitions(queryPolicy, stm, pf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) + } + } + gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("must return error if query on non-indexed field", func() { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter("Non-Existing", 0, math.MaxInt16/2)) + + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).To(gm.HaveOccurred()) + } + }) + + gg.It("must Query a range and get all records back", func() { + stm := as.NewStatement(ns, set) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Query a range and get all records back with policy.RecordsPerSecond set", func() { + stm := as.NewStatement(ns, set) + + policy := as.NewQueryPolicy() + policy.RecordsPerSecond = keyCount - 100 + recordset, err := client.Query(policy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Query a range and get all records back without the Bin Data", func() { + stm := as.NewStatement(ns, set) + qp := as.NewQueryPolicy() + qp.IncludeBinData = false + recordset, err := client.Query(qp, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + + key, exists := keys[string(rec.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) + gm.Expect(len(rec.Bins)).To(gm.Equal(0)) + + delete(keys, string(rec.Key.Digest())) + } + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Cancel Query abruptly", func() { + stm := as.NewStatement(ns, set) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, keyCount/2) + + gm.Expect(len(keys)).To(gm.BeNumerically("<=", keyCount/2)) + }) + + gg.It("must Query a specific range and get only relevant records back", func() { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + cnt++ + _, exists := keys[string(rec.Key.Digest())] + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(rec.Bins[bin3.Name]).To(gm.BeNumerically("<=", math.MaxInt16/2)) + } + + gm.Expect(cnt).To(gm.BeNumerically(">", 0)) + }) + + gg.It("must Query a specific range by applying a udf filter and get only relevant records back", func() { + regTask, err := nativeClient.RegisterUDF(nil, []byte(udfFilter), "udfFilter.lua", as.LUA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + err = <-regTask.OnComplete() + gm.Expect(err).ToNot(gm.HaveOccurred()) + + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) + stm.SetAggregateFunction("udfFilter", "filter_by_name", []as.Value{as.NewValue("Aeropsike")}, true) + + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + results := rec.Bins["SUCCESS"].(map[interface{}]interface{}) + gm.Expect(results["bin4"]).To(gm.Equal("constValue")) + // gm.Expect(results["bin5"]).To(gm.Equal(-1)) + cnt++ + } + + gm.Expect(cnt).To(gm.BeNumerically(">", 0)) + }) + + gg.It("must Query specific equality filters and get only relevant records back", func() { + // save a record with requested value + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin3 := as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) + err = client.PutBins(wpolicy, key, bin3) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + stm := as.NewStatement(ns, set, bin3.Name) + stm.SetFilter(as.NewEqualFilter(bin3.Name, bin3.Value)) + + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := []interface{}{} + // consume recordset and check errors + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + gm.Expect(rec).ToNot(gm.BeNil()) + recs = append(recs, rec.Bins[bin3.Name]) + } + + // there should be at least one result + gm.Expect(len(recs)).To(gm.BeNumerically(">", 0)) + gm.Expect(recs).To(gm.ContainElement(bin3.Value.GetObject())) + }) + + gg.It("must Query specific equality filters and apply operations on the records", func() { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewEqualFilter(bin6.Name, 1)) + + bin7 := as.NewBin("Aerospike7", 42) + tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) + + // read records back + stmRes := as.NewStatement(ns, set) + recordset, err := client.Query(queryPolicy, stmRes) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := []interface{}{} + // consume recordset and check errors + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + gm.Expect(rec).ToNot(gm.BeNil()) + recs = append(recs, rec.Bins[bin3.Name]) + gm.Expect(rec.Bins[bin7.Name]).To(gm.Equal(bin7.Value.GetObject().(int))) + } + + // there should be at least one result + gm.Expect(len(recs)).To(gm.Equal(keyCount)) + }) + + gg.It("must handle a Query on a non-existing set without timing out", func() { + stm := as.NewStatement(ns, set+"NON_EXISTING") + + bin7 := as.NewBin("Aerospike7", 42) + tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) + + rs, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + cnt := 0 + for res := range rs.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + gm.Expect(cnt).To(gm.Equal(0)) + }) + + gg.It("must return an error if read operations are requested in a background query", func() { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewEqualFilter(bin6.Name, 1)) + + bin7 := as.NewBin("Aerospike7", 42) + _, err := client.QueryExecute(queryPolicy, nil, stm, as.GetBinOp(bin7.Name)) + gm.Expect(err).To(gm.HaveOccurred()) + + var typedErr *as.AerospikeError + isAsErr := errors.As(err, &typedErr) + gm.Expect(isAsErr).To(gm.BeTrue()) + gm.Expect(typedErr.ResultCode).To(gm.Equal(ast.PARAMETER_ERROR)) + }) + + gg.It("must Query specific equality filters and apply operations on the records without filters", func() { + stm := as.NewStatement(ns, set) + + bin7 := as.NewBin("Aerospike7", 42) + tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) + + // read records back + stmRes := as.NewStatement(ns, set) + recordset, err := client.Query(queryPolicy, stmRes) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := []interface{}{} + // consume recordset and check errors + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + gm.Expect(rec).ToNot(gm.BeNil()) + recs = append(recs, rec.Bins[bin3.Name]) + gm.Expect(rec.Bins[bin7.Name]).To(gm.Equal(bin7.Value.GetObject().(int))) + } + + // there should be at least one result + gm.Expect(len(recs)).To(gm.Equal(keyCount)) + }) + + gg.It("must return the error for invalid expression", func() { + stm := as.NewStatement(ns, set) + stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) + + queryPolicy := as.NewQueryPolicy() + queryPolicy.FilterExpression = as.ExpEq(as.ExpListGetByValueRange(as.ListReturnTypeValue, as.ExpIntVal(10), as.ExpIntVal(13), as.ExpListBin(bin1.Name)), as.ExpIntVal(11)) + + recordset, err := client.Query(queryPolicy, stm) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).To(gm.HaveOccurred()) + gm.Expect(res.Err.Matches(ast.PARAMETER_ERROR)).To(gm.BeTrue()) + } + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go b/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go new file mode 100644 index 00000000..450c384b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go @@ -0,0 +1,137 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math/rand" + "strings" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +const RANDOM_OPS_RUNS = 1000 + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Aerospike", func() { + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + }) + + gg.Describe("Random Data Operations", func() { + // connection data + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + var rpolicy = as.NewPolicy() + var rec *as.Record + + if *useReplicas { + rpolicy.ReplicaPolicy = as.MASTER_PROLES + } + + gg.Context("Put/Get operations", func() { + + gg.It("must create, update and read keys consistently", func() { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + bin1 := as.NewBin("Aerospike1", 0) + bin2 := as.NewBin("Aerospike2", "a") // to avoid deletion of key + + i := 0 + for i < RANDOM_OPS_RUNS { + iters := rand.Intn(10) + 1 + for wr := 0; wr < iters; wr++ { + i++ + + //reset + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // update + err = client.PutBins(wpolicy, key, as.NewBin("Aerospike1", i), as.NewBin("Aerospike2", strings.Repeat("a", i))) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + rec, err = client.Get(rpolicy, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(i)) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat("a", i))) + } + }) + + }) // context put/get operations + + gg.Context("Parallel Put/Get/Delete operations", func() { + + gg.It("must save, read, delete keys consistently", func() { + + errChan := make(chan error, 100) + + func_delete := func(keys ...*as.Key) { + defer gg.GinkgoRecover() + for _, key := range keys { + existed, err := client.Delete(wpolicy, key) + gm.Expect(existed).To(gm.BeTrue()) + errChan <- err + } + } + + i := 0 + for i < RANDOM_OPS_RUNS { + iters := rand.Intn(1000) + 1 + for wr := 0; wr < iters; wr++ { + i++ + + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, as.NewBin("Aerospike1", i), as.NewBin("Aerospike2", strings.Repeat("a", i))) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + go func_delete(key) + } + + // Timeout + timeout := time.After(time.Second * 3) + + // Gather errors + for i := 0; i < iters; i++ { + select { + case err := <-errChan: + gm.Expect(err).ToNot(gm.HaveOccurred()) + + case <-timeout: + gm.Expect(timeout).To(gm.BeNil()) + } + } // for i < iters + + } // for i < iters + }) + + }) // context parallel put/get/delete operations + + }) // describe + +}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command.go b/aerospike-tls/vendor-aerospike-client-go/read_command.go new file mode 100644 index 00000000..b6a6aaf5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_command.go @@ -0,0 +1,271 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type readCommand struct { + singleCommand + + policy *BasePolicy + binNames []string + record *Record + + // pointer to the object that's going to be unmarshalled + object *reflect.Value + + replicaSequence int +} + +// this method uses reflection. +// Will not be set if performance flag is passed for the build. +var objectParser func( + cmd *readCommand, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error + +func newReadCommand(cluster *Cluster, policy *BasePolicy, key *Key, binNames []string, partition *Partition) (readCommand, Error) { + var err Error + if partition == nil { + if cluster != nil { + partition, err = PartitionForRead(cluster, policy, key) + if err != nil { + return readCommand{}, err + } + } + } + + return readCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + binNames: binNames, + policy: policy, + }, nil +} + +func (cmd *readCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *readCommand) writeBuffer(ifc command) Error { + return cmd.setRead(cmd.policy, cmd.key, cmd.binNames) +} + +func (cmd *readCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeRead(cmd.cluster) +} + +func (cmd *readCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryRead(isTimeout) + return true +} + +func (cmd *readCommand) parseResult(ifc command, conn *Connection) Error { + // Read proto and check if compressed + if _, err := conn.Read(cmd.dataBuffer, 8); err != nil { + logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) + return err + } + + if compressedSize := cmd.compressedSize(); compressedSize > 0 { + // Read compressed size + if _, err := conn.Read(cmd.dataBuffer, 8); err != nil { + logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) + return err + } + + if err := cmd.conn.initInflater(true, compressedSize); err != nil { + return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize, err.Error())) + } + + // Read header. + if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { + logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) + return err + } + } else { + // Read header. + if _, err := conn.Read(cmd.dataBuffer[8:], int(_MSG_TOTAL_HEADER_SIZE)-8); err != nil { + logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) + return err + } + } + + // A number of these are commented out because we just don't care enough to read + // that section of the header. If we do care, uncomment and check! + sz := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(sz); err != nil { + return err + } + + headerLength := int(cmd.dataBuffer[8]) + resultCode := types.ResultCode(cmd.dataBuffer[13] & 0xFF) + generation := Buffer.BytesToUint32(cmd.dataBuffer, 14) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 18)) + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 26)) // almost certainly 0 + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 28)) + receiveSize := int((sz & 0xFFFFFFFFFFFF) - int64(headerLength)) + + // Read remaining message bytes. + if receiveSize > 0 { + if err := cmd.sizeBufferSz(receiveSize, false); err != nil { + return err + } + if _, err := conn.Read(cmd.dataBuffer, receiveSize); err != nil { + logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) + return err + } + + } + + if resultCode != 0 { + if resultCode == types.KEY_NOT_FOUND_ERROR { + return ErrKeyNotFound.err() + } else if resultCode == types.FILTERED_OUT { + return ErrFilteredOut.err() + } else if resultCode == types.UDF_BAD_RESPONSE { + cmd.record, _ = cmd.parseRecord(ifc, opCount, fieldCount, generation, expiration) + err := cmd.handleUdfError(resultCode) + logger.Logger.Debug("UDF execution error: " + err.Error()) + return err + } + + return newError(resultCode) + } + + if cmd.object == nil { + if opCount == 0 { + // data Bin was not returned + cmd.record = newRecord(cmd.node, cmd.key, nil, generation, expiration) + return nil + } + + var err Error + cmd.record, err = cmd.parseRecord(ifc, opCount, fieldCount, generation, expiration) + if err != nil { + return err + } + } else if objectParser != nil { + if err := objectParser(cmd, opCount, fieldCount, generation, expiration); err != nil { + return err + } + } + + return nil +} + +func (cmd *readCommand) handleUdfError(resultCode types.ResultCode) Error { + if ret, exists := cmd.record.Bins["FAILURE"]; exists { + return newError(resultCode, ret.(string)) + } + return newError(resultCode) +} + +func (cmd *readCommand) parseRecord( + ifc command, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) (*Record, Error) { + var bins BinMap + receiveOffset := 0 + + opCmd, isOperate := ifc.(*operateCommand) + var binNamesSet []string + + // There can be fields in the response (setname etc). + // But for now, ignore them. Expose them to the API if needed in the future. + //logger.Logger.Debug("field count: %d, databuffer: %v", fieldCount, cmd.dataBuffer) + if fieldCount > 0 { + // Just skip over all the fields + for i := 0; i < fieldCount; i++ { + //logger.Logger.Debug("%d", receiveOffset) + fieldSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) + receiveOffset += (4 + fieldSize) + } + } + + if opCount > 0 { + bins = make(BinMap, opCount) + } + + for i := 0; i < opCount; i++ { + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) + particleType := int(cmd.dataBuffer[receiveOffset+5]) + nameSize := int(cmd.dataBuffer[receiveOffset+7]) + name := string(cmd.dataBuffer[receiveOffset+8 : receiveOffset+8+nameSize]) + receiveOffset += 4 + 4 + nameSize + + particleBytesSize := opSize - (4 + nameSize) + value, _ := bytesToParticle(particleType, cmd.dataBuffer, receiveOffset, particleBytesSize) + receiveOffset += particleBytesSize + + if bins == nil { + bins = make(BinMap, opCount) + } + + if isOperate { + // for operate list command results + if prev, exists := bins[name]; exists { + if res, ok := prev.(OpResults); ok { + // List already exists. Add to it. + bins[name] = append(res, value) + } else { + // Make a list to store all values. + bins[name] = OpResults{prev, value} + binNamesSet = append(binNamesSet, name) + } + } else { + bins[name] = value + } + } else { + bins[name] = value + } + } + + // TODO: Remove this in the next major release + if isOperate && !opCmd.useOpResults { + for i := range binNamesSet { + bins[binNamesSet[i]] = []interface{}(bins[binNamesSet[i]].(OpResults)) + } + } + + return newRecord(cmd.node, cmd.key, bins, generation, expiration), nil +} + +func (cmd *readCommand) GetRecord() *Record { + return cmd.record +} + +func (cmd *readCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *readCommand) transactionType() transactionType { + return ttGet +} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go new file mode 100644 index 00000000..ba9d91d5 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go @@ -0,0 +1,473 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "math" + "reflect" + "strings" + "time" + + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// if this file is included in the build, it will include this method +func init() { + objectParser = parseObject +} + +func parseObject( + cmd *readCommand, + opCount int, + fieldCount int, + generation uint32, + expiration uint32, +) Error { + receiveOffset := 0 + + // There can be fields in the response (setname etc). + // But for now, ignore them. Expose them to the API if needed in the future. + //logger.Logger.Debug("field count: %d, databuffer: %v", fieldCount, cmd.dataBuffer) + if fieldCount > 0 { + // Just skip over all the fields + for i := 0; i < fieldCount; i++ { + //logger.Logger.Debug("%d", receiveOffset) + fieldSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) + receiveOffset += (4 + fieldSize) + } + } + + if opCount > 0 { + rv := *cmd.object + + if rv.Kind() != reflect.Ptr { + return ErrInvalidObjectType.err() + } + rv = rv.Elem() + + if !rv.CanAddr() { + return ErrInvalidObjectType.err() + } + + if rv.Kind() != reflect.Struct { + return ErrInvalidObjectType.err() + } + + // find the name based on tag mapping + iobj := indirect(rv) + mappings := objectMappings.getMapping(iobj.Type()) + + if err := setObjectMetaFields(iobj, expiration, generation); err != nil { + return err + } + + for i := 0; i < opCount; i++ { + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) + particleType := int(cmd.dataBuffer[receiveOffset+5]) + nameSize := int(cmd.dataBuffer[receiveOffset+7]) + name := string(cmd.dataBuffer[receiveOffset+8 : receiveOffset+8+nameSize]) + receiveOffset += 4 + 4 + nameSize + + particleBytesSize := opSize - (4 + nameSize) + value, _ := bytesToParticle(particleType, cmd.dataBuffer, receiveOffset, particleBytesSize) + if err := setObjectField(mappings, iobj, name, value); err != nil { + return err + } + + receiveOffset += particleBytesSize + } + } + + return nil +} + +func setObjectMetaFields(obj reflect.Value, ttl, gen uint32) Error { + // find the name based on tag mapping + iobj := indirect(obj) + + ttlMap, genMap := objectMappings.getMetaMappings(iobj.Type()) + + for i := range ttlMap { + f := iobj.FieldByIndex(ttlMap[i]) + if err := setValue(f, ttl); err != nil { + return err + } + } + + for i := range genMap { + f := iobj.FieldByIndex(genMap[i]) + if err := setValue(f, gen); err != nil { + return err + } + } + + return nil +} + +func setObjectField(mappings map[string][]int, obj reflect.Value, fieldName string, value interface{}) Error { + if value == nil { + return nil + } + + var f reflect.Value + + if index, exists := mappings[fieldName]; exists { + f = obj.FieldByIndex(index) + } else { + f = obj.FieldByName(fieldName) + } + return setValue(f, value) +} + +func fillMap(f, newMap, emptyStruct reflect.Value, key, elem, value interface{}, fieldKind reflect.Kind) Error { + var newKey, newVal reflect.Value + fKeyType := f.Type().Key() + if key != nil { + newKey = reflect.ValueOf(key) + } else { + newKey = reflect.Zero(fKeyType) + } + + if newKey.Type() != fKeyType { + if !newKey.CanConvert(fKeyType) { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid key `%#v` for %s field", value, fieldKind)) + } + newKey = newKey.Convert(fKeyType) + } + + fElemType := f.Type().Elem() + if elem != nil { + newVal = reflect.ValueOf(elem) + } else { + newVal = reflect.Zero(fElemType) + } + + if newVal.Type() != fElemType { + switch newVal.Kind() { + case reflect.Map, reflect.Slice, reflect.Array: + newVal = reflect.New(fElemType) + if err := setValue(newVal.Elem(), elem); err != nil { + return err + } + newVal = reflect.Indirect(newVal) + default: + if !newVal.CanConvert(fElemType) { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + newVal = newVal.Convert(fElemType) + } + } + + if newVal.Kind() == reflect.Map && newVal.Len() == 0 && newMap.Type().Elem().Kind() == emptyStruct.Type().Kind() { + if newMap.Type().Elem().NumField() == 0 { + newMap.SetMapIndex(newKey, emptyStruct) + } else { + return newError(types.PARSE_ERROR, "Map value type is struct{}, but data returned from database is a non-empty map[interface{}]interface{}") + } + } else { + newMap.SetMapIndex(newKey, newVal) + } + return nil +} + +func setValue(f reflect.Value, value interface{}) Error { + // find the name based on tag mapping + if f.CanSet() { + if value == nil { + if f.IsValid() && !f.IsNil() { + f.Set(reflect.ValueOf(value)) + } + return nil + } + + switch fieldKind := f.Kind(); fieldKind { + case reflect.Int, reflect.Int64, reflect.Int8, reflect.Int16, reflect.Int32, + reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint16, reflect.Uint32: + v := reflect.ValueOf(value) + t := f.Type() + if !v.CanConvert(t) { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + + v = v.Convert(t) + f.Set(v) + case reflect.Float64, reflect.Float32: + switch v := value.(type) { + case float64: + f.SetFloat(v) + case float32: + f.SetFloat(float64(v)) + case int: + f.SetFloat(float64(v)) + default: + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + case reflect.String: + v, ok := value.(string) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + + rv := reflect.ValueOf(v) + if rv.Type() != f.Type() { + rv = rv.Convert(f.Type()) + } + f.Set(rv) + case reflect.Bool: + switch v := value.(type) { + case int: + f.SetBool(v == 1) + case bool: + f.SetBool(v) + default: + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + case reflect.Interface: + if value != nil { + f.Set(reflect.ValueOf(value)) + } + case reflect.Ptr: + switch fieldKind := f.Type().Elem().Kind(); fieldKind { + case reflect.String: + tempV, ok := value.(string) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) + } + rv := reflect.ValueOf(&tempV) + if rv.Type() != f.Type() { + rv = rv.Convert(f.Type()) + } + f.Set(rv) + case reflect.Int, reflect.Int64, reflect.Int8, reflect.Int16, reflect.Int32, + reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint16, reflect.Uint32: + v := reflect.ValueOf(value) + t := f.Type().Elem() + if !v.CanConvert(t) { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) + } + v = v.Convert(t) + if f.IsZero() { + f.Set(reflect.New(f.Type().Elem())) + } + + f.Elem().Set(v) + case reflect.Float64: + // it is possible that the value is an integer set in the field + // via the old float<->int64 type cast + var tempV float64 + if fv, ok := value.(float64); ok { + tempV = fv + } else { + v, ok := value.(int) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) + } + tempV = math.Float64frombits(uint64(v)) + } + + rv := reflect.ValueOf(&tempV) + if rv.Type() != f.Type() { + rv = rv.Convert(f.Type()) + } + f.Set(rv) + case reflect.Bool: + var tempV bool + switch v := value.(type) { + case int: + tempV = v == 1 + case bool: + tempV = v + default: + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for boolean field", value)) + } + + rv := reflect.ValueOf(&tempV) + if rv.Type() != f.Type() { + rv = rv.Convert(f.Type()) + } + f.Set(rv) + case reflect.Float32: + if v, ok := value.(float32); ok { + value = float64(v) + } + + // it is possible that the value is an integer set in the field + // via the old float<->int64 type cast + var tempV64 float64 + if fv, ok := value.(float64); ok { + tempV64 = fv + } else { + v, ok := value.(int) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) + } + tempV64 = math.Float64frombits(uint64(v)) + } + + tempV := float32(tempV64) + rv := reflect.ValueOf(&tempV) + if rv.Type() != f.Type() { + rv = rv.Convert(f.Type()) + } + f.Set(rv) + case reflect.Interface: + f.Set(reflect.ValueOf(&value)) + case reflect.Struct: + // support time.Time + if f.Type().Elem().PkgPath() == "time" && f.Type().Elem().Name() == "Time" { + v, ok := value.(int) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) + } + tm := time.Unix(0, int64(v)) + f.Set(reflect.ValueOf(&tm)) + break + } + valMap, ok := value.(map[interface{}]interface{}) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + // iterate over struct fields and recursively fill them up + if valMap != nil { + newObjPtr := f + if f.IsNil() { + newObjPtr = reflect.New(f.Type().Elem()) + } + + theStruct := newObjPtr.Elem() + if err := setStructValue(theStruct, valMap, theStruct.Type(), nil); err != nil { + return err + } + + // set the field + f.Set(newObjPtr) + } + } // switch ptr + case reflect.Slice, reflect.Array: + // BLOBs come back as []byte + theArray := reflect.ValueOf(value) + if theArray.Kind() != reflect.Slice { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + + if f.Kind() == reflect.Slice { + if f.IsNil() { + f.Set(reflect.MakeSlice(reflect.SliceOf(f.Type().Elem()), theArray.Len(), theArray.Len())) + } else if f.Len() < theArray.Len() { + count := theArray.Len() - f.Len() + f.Set(reflect.AppendSlice(f, reflect.MakeSlice(reflect.SliceOf(f.Type().Elem()), count, count))) + } + } + + for i := 0; i < theArray.Len(); i++ { + if err := setValue(f.Index(i), theArray.Index(i).Interface()); err != nil { + return err + } + } + case reflect.Map: + emptyStruct := reflect.ValueOf(struct{}{}) + if theMap, ok := value.(map[interface{}]interface{}); ok { + newMap := reflect.MakeMap(f.Type()) + for key, elem := range theMap { + if err := fillMap(f, newMap, emptyStruct, key, elem, value, fieldKind); err != nil { + return err + } + } + f.Set(newMap) + } else if theMap, ok := value.([]MapPair); ok { + newMap := reflect.MakeMap(f.Type()) + for _, mp := range theMap { + key, elem := mp.Key, mp.Value + if err := fillMap(f, newMap, emptyStruct, key, elem, value, fieldKind); err != nil { + return err + } + } + f.Set(newMap) + } else { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + + case reflect.Struct: + // support MapPair + if f.Type().Name() == "MapPair" { + v, ok := value.(MapPair) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for MapPair %s field", value, fieldKind)) + } + f.Set(reflect.ValueOf(v)) + break + } + + // support time.Time + if f.Type().PkgPath() == "time" && f.Type().Name() == "Time" { + v, ok := value.(int) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for time %s field", value, fieldKind)) + } + f.Set(reflect.ValueOf(time.Unix(0, int64(v)))) + break + } + + valMap, ok := value.(map[interface{}]interface{}) + if !ok { + return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) + } + // iterate over struct fields and recursively fill them up + if err := setStructValue(f, valMap, f.Type(), nil); err != nil { + return err + } + + // set the field + f.Set(f) + } + } + + return nil +} + +func setStructValue(f reflect.Value, valMap map[interface{}]interface{}, typeOfT reflect.Type, index []int) (err Error) { + numFields := typeOfT.NumField() + for i := 0; i < numFields; i++ { + fld := typeOfT.Field(i) + fldIndex := append(index, fld.Index...) + if fld.Anonymous && fld.Type.Kind() == reflect.Struct { + if err := setStructValue(f, valMap, fld.Type, fldIndex); err != nil { + return err + } + continue + } + + if fld.PkgPath != "" { + continue + } + + alias := fld.Name + tag := strings.Trim(stripOptions(fld.Tag.Get(aerospikeTag)), " ") + if tag != "" { + alias = tag + } + + if valMap[alias] != nil { + if err := setValue(f.FieldByIndex(fldIndex), valMap[alias]); err != nil { + return err + } + } + } + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go new file mode 100644 index 00000000..48a65a4f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go @@ -0,0 +1,96 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("Read Command Reflect setValue", func() { + type testStruct struct { + Int int + Bool bool + Int64 int64 + String string + Float64 float64 + SliceString []string + SliceInt []int + SliceFloat64 []float64 + MapStringFloat64 map[string]float64 + MapStringString map[string]string + MapInterfaceInterface map[interface{}]interface{} + } + + ts := &testStruct{} + reflectField := func(name string) reflect.Value { + return reflect.Indirect(reflect.ValueOf(ts)).FieldByName(name) + } + + tests := []struct { + name string + field reflect.Value + obj interface{} + error bool + }{ + {name: "int->int", field: reflectField("Int"), obj: 5}, + {name: "int->int64", field: reflectField("Int64"), obj: int64(5)}, + {name: "int->bool", field: reflectField("Bool"), obj: true}, + {name: "int->float64", field: reflectField("Float64"), obj: 5}, + {name: "[]string->[]string", field: reflectField("SliceString"), obj: []string{"1", "2"}}, + {name: "[]int->[]int", field: reflectField("SliceInt"), obj: []int{1, 2}}, + {name: "map[string]string->map[string]string", field: reflectField("MapStringString"), obj: map[interface{}]interface{}{"1": "2"}}, + {name: "map[string]float64->map[string]float64", field: reflectField("MapStringFloat64"), obj: map[interface{}]interface{}{"1": 2}}, + {name: "map[interface{}]interface{}->map[interface{}]interface{}", field: reflectField("MapInterfaceInterface"), obj: map[interface{}]interface{}{"1": 2}}, + + {name: "string->int", field: reflectField("Int"), obj: "5", error: true}, + {name: "string->bool", field: reflectField("Bool"), obj: "true", error: true}, + {name: "int->string", field: reflectField("String"), obj: 5, error: true}, + {name: "bool->int", field: reflectField("Int"), obj: true, error: true}, + {name: "bool->string", field: reflectField("String"), obj: true, error: true}, + {name: "int->[]string", field: reflectField("SliceString"), obj: 5, error: true}, + {name: "int->[]int", field: reflectField("SliceInt"), obj: 5, error: true}, + {name: "int->[]float64", field: reflectField("SliceFloat64"), obj: 5, error: true}, + {name: "[]string->int", field: reflectField("Int"), obj: []string{"1", "2"}, error: true}, + {name: "[]string->int64", field: reflectField("Int64"), obj: []string{"1", "2"}, error: true}, + {name: "[]string->float64", field: reflectField("Float64"), obj: []string{"1", "2"}, error: true}, + {name: "[]int->int", field: reflectField("Int"), obj: []int{1, 2}, error: true}, + {name: "[]int->int64", field: reflectField("Int64"), obj: []int{1, 2}, error: true}, + {name: "[]string->[]int", field: reflectField("SliceInt"), obj: []string{"1", "2"}, error: true}, + {name: "map[string]string->[]int", field: reflectField("SliceInt"), obj: map[interface{}]interface{}{"1": "2"}, error: true}, + {name: "[]int->map[string]string", field: reflectField("MapStringString"), obj: []int{1, 2}, error: true}, + {name: "map[string]string->map[string]float64", field: reflectField("MapStringFloat64"), obj: map[interface{}]interface{}{"1": "2"}, error: true}, + } + + for _, tt := range tests { + tc := tt + gg.Context(tc.name, func() { + gg.It("Should return correct error", func() { + gm.Expect(func() { + err := setValue(tc.field, tc.obj) + if tc.error { + gm.Expect(err).To(gm.HaveOccurred()) + return + } + gm.Expect(err).ToNot(gm.HaveOccurred()) + }).To(gm.Not(gm.Panic())) + }) + }) + } +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/read_header_command.go b/aerospike-tls/vendor-aerospike-client-go/read_header_command.go new file mode 100644 index 00000000..f21a09b4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_header_command.go @@ -0,0 +1,106 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type readHeaderCommand struct { + singleCommand + + policy *BasePolicy + record *Record +} + +func newReadHeaderCommand(cluster *Cluster, policy *BasePolicy, key *Key) (readHeaderCommand, Error) { + var err Error + var partition *Partition + if cluster != nil { + partition, err = PartitionForRead(cluster, policy, key) + if err != nil { + return readHeaderCommand{}, err + } + } + + newReadHeaderCmd := readHeaderCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + policy: policy, + } + + return newReadHeaderCmd, nil +} + +func (cmd *readHeaderCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *readHeaderCommand) writeBuffer(ifc command) Error { + return cmd.setReadHeader(cmd.policy, cmd.key) +} + +func (cmd *readHeaderCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeRead(cmd.cluster) +} + +func (cmd *readHeaderCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryRead(isTimeout) + return true +} + +func (cmd *readHeaderCommand) parseResult(ifc command, conn *Connection) Error { + // Read header. + if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { + return err + } + + header := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(header); err != nil { + return err + } + + resultCode := cmd.dataBuffer[13] & 0xFF + + if resultCode == 0 { + generation := Buffer.BytesToUint32(cmd.dataBuffer, 14) + expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 18)) + cmd.record = newRecord(cmd.node, cmd.key, nil, generation, expiration) + } else { + if types.ResultCode(resultCode) == types.KEY_NOT_FOUND_ERROR { + cmd.record = nil + } else if types.ResultCode(resultCode) == types.FILTERED_OUT { + return ErrFilteredOut.err() + } else { + return newError(types.ResultCode(resultCode)) + } + } + return cmd.emptySocket(conn) +} + +func (cmd *readHeaderCommand) GetRecord() *Record { + return cmd.record +} + +func (cmd *readHeaderCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *readHeaderCommand) transactionType() transactionType { + return ttGetHeader +} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go b/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go new file mode 100644 index 00000000..ca5af369 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go @@ -0,0 +1,32 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +// ReadModeAP is the read policy in AP (availability) mode namespaces. +// It indicates how duplicates should be consulted in a read operation. +// Only makes a difference during migrations and only applicable in AP mode. +type ReadModeAP int + +const ( + // ReadModeAPOne indicates that a single node should be involved in the read operation. + ReadModeAPOne ReadModeAP = iota + + // ReadModeAPAll indicates that all duplicates should be consulted in + // the read operation. + ReadModeAPAll +) diff --git a/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go b/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go new file mode 100644 index 00000000..38ea6c6e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go @@ -0,0 +1,40 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +// ReadModeSC is the read policy in SC (strong consistency) mode namespaces. +// Determines SC read consistency options. +type ReadModeSC int + +const ( + // ReadModeSCSession ensures this client will only see an increasing sequence of record versions. + // Client only reads from master. This is the default. + ReadModeSCSession ReadModeSC = iota + + // ReadModeSCLinearize ensures all clients will only see an increasing sequence of record versions. + // Client only reads from master. + ReadModeSCLinearize + + // ReadModeSCAllowReplica indicates that the client may read from master or any full (non-migrating) replica. + // Increasing sequence of record versions is not guaranteed. + ReadModeSCAllowReplica + + // ReadModeSCAllowUnavailable indicates that the client may read from master or any full (non-migrating) replica or from unavailable + // partitions. Increasing sequence of record versions is not guaranteed. + ReadModeSCAllowUnavailable +) diff --git a/aerospike-tls/vendor-aerospike-client-go/record.go b/aerospike-tls/vendor-aerospike-client-go/record.go new file mode 100644 index 00000000..fe123e6d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/record.go @@ -0,0 +1,73 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "fmt" + +// Record is the container struct for database records. +// Records are equivalent to rows. +type Record struct { + // Key is the record's key. + // Might be empty, or may only consist of digest value. + Key *Key + + // Node from which the Record is originating from. + Node *Node + + // Bins is the map of requested name/value bins. + Bins BinMap + + // Generation shows record modification count. + Generation uint32 + + // Expiration is TTL (Time-To-Live). + // Number of seconds until record expires. + Expiration uint32 +} + +func newRecord(node *Node, key *Key, bins BinMap, generation, expiration uint32) *Record { + r := &Record{ + Node: node, + Key: key, + Bins: bins, + Generation: generation, + Expiration: expiration, + } + + // always assign a map of length zero if Bins is nil + if r.Bins == nil { + r.Bins = make(BinMap) + } + + return r +} + +// String implements the Stringer interface. +// Returns string representation of record. +func (rc *Record) String() string { + return fmt.Sprintf("%s %v", rc.Key, rc.Bins) +} + +// udfError returns the the error string returned by a UDF execute in a batch. +// Returns nil if an error did not occur. +func (rc *Record) udfError() string { + return rc.Bins["FAILURE"].(string) +} + +// udfResult returns the value returned by a UDF execute in a batch. +// The result may be nil. +func (rc *Record) udfResult() BinMap { + return BinMap(rc.Bins["SUCCESS"].(map[string]interface{})) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go b/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go new file mode 100644 index 00000000..d3c81f11 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go @@ -0,0 +1,45 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// RecordExistsAction determines how to handle writes when +// the record already exists. +type RecordExistsAction int + +const ( + + // UPDATE means: Create or update record. + // Merge write command bins with existing bins. + UPDATE RecordExistsAction = iota + + // UPDATE_ONLY means: Update record only. Fail if record does not exist. + // Merge write command bins with existing bins. + UPDATE_ONLY + + // REPLACE means: Create or replace record. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike 2 server versions >= 2.7.5 and + // Aerospike 3 server versions >= 3.1.6 and later. + REPLACE + + // REPLACE_ONLY means: Replace record only. Fail if record does not exist. + // Delete existing bins not referenced by write command bins. + // Supported by Aerospike 2 server versions >= 2.7.5 and + // Aerospike 3 server versions >= 3.1.6 and later. + REPLACE_ONLY + + // CREATE_ONLY means: Create only. Fail if record exists. + CREATE_ONLY +) diff --git a/aerospike-tls/vendor-aerospike-client-go/recordset.go b/aerospike-tls/vendor-aerospike-client-go/recordset.go new file mode 100644 index 00000000..16b85f9e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/recordset.go @@ -0,0 +1,209 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "math/rand" + "reflect" + "runtime" + "sync" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" +) + +// Result is the value returned by Recordset's Results() function. +type Result struct { + Record *Record + Err Error + BVal *int64 +} + +// String implements the Stringer interface +func (res *Result) String() string { + if res.Record != nil { + return fmt.Sprintf("%v", res.Record) + } + return fmt.Sprintf("%v", res.Err) +} + +// Objectset encapsulates the result of Scan and Query commands. +type objectset struct { + // a reference to the object channel to close on end signal + objChan reflect.Value + + // errors is a channel on which all errors will be sent back. + errors chan Error + + wgGoroutines sync.WaitGroup + goroutines *atomic.Int + + closed, active *atomic.Bool + cancelled chan struct{} + + chanLock sync.Mutex + + taskID uint64 +} + +// TaskId returns the transactionId/jobId sent to the server for this recordset. +func (os *objectset) TaskId() uint64 { + os.chanLock.Lock() + defer os.chanLock.Unlock() + return os.taskID +} + +// Always set the taskID client-side to a non-zero random value +func (os *objectset) resetTaskID() { + os.chanLock.Lock() + defer os.chanLock.Unlock() + os.taskID = rand.Uint64() +} + +// Recordset encapsulates the result of Scan and Query commands. +type Recordset struct { + objectset + + // Records is a channel on which the resulting records will be sent back. + // NOTE: Do not use Records directly. Range on channel returned by Results() instead. + // Will be unexported in the future + records chan *Result +} + +// makes sure the recordset is closed eventually, even if it is not consumed +func recordsetFinalizer(rs *Recordset) { + rs.Close() +} + +// newObjectset generates a new RecordSet instance. +func newObjectset(objChan reflect.Value, goroutines int) *objectset { + + if objChan.Kind() != reflect.Chan || + objChan.Type().Elem().Kind() != reflect.Ptr || + objChan.Type().Elem().Elem().Kind() != reflect.Struct { + panic("Scan/Query object channels should be of type `chan *T`") + } + + rs := &objectset{ + objChan: objChan, + errors: make(chan Error, goroutines), + active: atomic.NewBool(true), + closed: atomic.NewBool(false), + goroutines: atomic.NewInt(goroutines), + cancelled: make(chan struct{}), + } + rs.wgGoroutines.Add(goroutines) + rs.resetTaskID() + return rs +} + +// newRecordset generates a new RecordSet instance. +func newRecordset(recSize, goroutines int) *Recordset { + var nilChan chan *struct{} + + rs := &Recordset{ + records: make(chan *Result, recSize), + objectset: *newObjectset(reflect.ValueOf(nilChan), goroutines), + } + + runtime.SetFinalizer(rs, recordsetFinalizer) + return rs +} + +// IsActive returns true if the operation hasn't been finished or cancelled. +func (rcs *Recordset) IsActive() bool { + return rcs.active.Get() +} + +// Errors returns a read-only Error channel for the objectset. It will panic +// for recordsets returned for non-reflection APIs. +func (rcs *Recordset) Errors() <-chan Error { + if rcs.records == nil { + return (<-chan Error)(rcs.errors) + } + panic("Errors chan not valid for non-reflection API") +} + +// Results returns a new receive-only channel with the results of the Scan/Query. +// This is a more idiomatic approach to the iterator pattern in getting the +// results back from the recordset, and doesn't require the user to write the +// ugly select in their code. +// Result contains a Record and an error reference. +// +// Example: +// +// recordset, err := client.ScanAll(nil, namespace, set) +// handleError(err) +// for res := range recordset.Results() { +// if res.Err != nil { +// // handle error here +// } else { +// // process record here +// fmt.Println(res.Record.Bins) +// } +// } +func (rcs *Recordset) Results() <-chan *Result { + return (<-chan *Result)(rcs.records) +} + +// Close all streams from different nodes. A successful close return nil, +// subsequent calls to the method will return ErrRecordsetClosed.err(). +func (rcs *Recordset) Close() Error { + // do it only once + if !rcs.closed.CompareAndToggle(false) { + return ErrRecordsetClosed.err() + } + + // mark the recordset as inactive + rcs.active.Set(false) + + close(rcs.cancelled) + + // wait till all goroutines are done, and signalEnd is called by the scan command + rcs.wgGoroutines.Wait() + + return nil +} + +func (rcs *Recordset) signalEnd() { + rcs.wgGoroutines.Done() + if rcs.goroutines.DecrementAndGet() == 0 { + // mark the recordset as inactive + rcs.active.Set(false) + + rcs.chanLock.Lock() + defer rcs.chanLock.Unlock() + + if rcs.records != nil { + close(rcs.records) + } else if rcs.objChan.IsValid() { + rcs.objChan.Close() + } + + close(rcs.errors) + } +} + +func (rcs *Recordset) sendError(err Error) { + rcs.chanLock.Lock() + defer rcs.chanLock.Unlock() + if rcs.IsActive() { + if rcs.records != nil { + rcs.records <- &Result{Err: err} + } else { + rcs.errors <- err + } + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/recordset_test.go b/aerospike-tls/vendor-aerospike-client-go/recordset_test.go new file mode 100644 index 00000000..d0f12426 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/recordset_test.go @@ -0,0 +1,46 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" + + "github.com/aerospike/aerospike-client-go/v7/types" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Recordset test", func() { + + gg.It("must avoid panic on sendError", func() { + rs := newRecordset(100, 1) + + rs.sendError(newError(types.PARAMETER_ERROR, "Error")) + rs.wgGoroutines.Done() + rs.Close() + rs.sendError(newError(types.PARAMETER_ERROR, "Error")) + + timeout := time.After(time.Second) + select { + case res := <-rs.Results(): + gm.Expect(res).ToNot(gm.BeNil()) + case <-timeout: + panic("wrong result!") + } + }) + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/replica_policy.go b/aerospike-tls/vendor-aerospike-client-go/replica_policy.go new file mode 100644 index 00000000..766d844c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/replica_policy.go @@ -0,0 +1,48 @@ +/* + * Copyright 2014-2022 Aerospike, Inc. + * + * Portions may be licensed to Aerospike, Inc. under one or more contributor + * license agreements. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package aerospike + +// ReplicaPolicy defines type of node partition targeted by read commands. +type ReplicaPolicy int + +const ( + // MASTER reads from node containing key's master partition. + // This is the default behavior. + MASTER ReplicaPolicy = iota + + // MASTER_PROLES Distributes reads across nodes containing key's master and replicated partitions + // in round-robin fashion. + MASTER_PROLES + + // RANDOM Distribute reads across all nodes in cluster in round-robin fashion. + // This option is useful when the replication factor equals the number + // of nodes in the cluster and the overhead of requesting proles is not desired. + RANDOM + + // SEQUENCE Tries node containing master partition first. + // If connection fails, all commands try nodes containing replicated partitions. + // If socketTimeout is reached, reads also try nodes containing replicated partitions, + // but writes remain on master node. + SEQUENCE + + // PREFER_RACK Tries nodes on the same rack first. + // + // This option requires ClientPolicy.Rackaware to be enabled + // in order to function properly. + PREFER_RACK +) diff --git a/aerospike-tls/vendor-aerospike-client-go/role.go b/aerospike-tls/vendor-aerospike-client-go/role.go new file mode 100644 index 00000000..4f558134 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/role.go @@ -0,0 +1,67 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +// Role allows granular access to database entities for users. +type Role struct { + // Name is role name + Name string + + // Privilege is the list of assigned privileges + Privileges []Privilege + + // While is the list of allowable IP addresses + Whitelist []string + + // ReadQuota is the maximum reads per second limit for the role + ReadQuota uint32 + + // WriteQuota is the maximum writes per second limit for the role + WriteQuota uint32 +} + +// Pre-defined user roles. +const ( + // UserAdmin allows to manages users and their roles. + UserAdmin privilegeCode = "user-admin" + + // SysAdmin allows to manage indexes, user defined functions and server configuration. + SysAdmin privilegeCode = "sys-admin" + + // DataAdmin allows to manage indicies and user defined functions. + DataAdmin privilegeCode = "data-admin" + + // UDFAdmin allows to manage user defined functions. + UDFAdmin privilegeCode = "udf-admin" + + // SIndexAdmin allows to manage indicies. + SIndexAdmin privilegeCode = "sindex-admin" + + // ReadWriteUDF allows read, write and UDF transactions with the database. + ReadWriteUDF privilegeCode = "read-write-udf" + + // ReadWrite allows read and write transactions with the database. + ReadWrite privilegeCode = "read-write" + + // Read allows read transactions with the database. + Read privilegeCode = "read" + + // Write allows write transactions with the database. + Write privilegeCode = "write" + + // Truncate allow issuing truncate commands. + Truncate privilegeCode = "truncate" +) diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_executor.go b/aerospike-tls/vendor-aerospike-client-go/scan_executor.go new file mode 100644 index 00000000..5b9c21af --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_executor.go @@ -0,0 +1,73 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" +) + +func (clnt *Client) scanPartitions(policy *ScanPolicy, tracker *partitionTracker, namespace string, setName string, recordset *Recordset, binNames ...string) { + defer recordset.signalEnd() + + // for exponential backoff + interval := policy.SleepBetweenRetries + + var errs Error + for { + list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), namespace) + if err != nil { + errs = chainErrors(err, errs) + recordset.sendError(errs) + tracker.partitionError() + return + } + + maxConcurrentNodes := policy.MaxConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(list) + } + + if recordset.IsActive() { + weg := newWeightedErrGroup(maxConcurrentNodes) + for _, nodePartition := range list { + cmd := newScanPartitionCommand(policy, tracker, nodePartition, namespace, setName, binNames, recordset) + weg.execute(cmd) + } + errs = chainErrors(weg.wait(), errs) + } + + if done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy); !recordset.IsActive() || done || err != nil { + errs = chainErrors(err, errs) + // Scan is complete. + if errs != nil { + tracker.partitionError() + recordset.sendError(errs) + } + return + } + + if policy.SleepBetweenRetries > 0 { + // Sleep before trying again. + time.Sleep(interval) + + if policy.SleepMultiplier > 1 { + interval = time.Duration(float64(interval) * policy.SleepMultiplier) + } + } + + recordset.resetTaskID() + } + +} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go b/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go new file mode 100644 index 00000000..0ee92a36 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go @@ -0,0 +1,96 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "sync" + "time" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "golang.org/x/sync/semaphore" +) + +func (clnt *Client) scanPartitionObjects(policy *ScanPolicy, tracker *partitionTracker, namespace string, setName string, rs *Recordset, binNames ...string) Error { + defer rs.signalEnd() + + // for exponential backoff + interval := policy.SleepBetweenRetries + + for { + rs.resetTaskID() + list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), namespace) + if err != nil { + tracker.partitionError() + return err + } + + wg := new(sync.WaitGroup) + + // the whole call should be wrapped in a goroutine + wg.Add(len(list)) + + // the whole call should be wrapped in a goroutine + maxConcurrentNodes := policy.MaxConcurrentNodes + if maxConcurrentNodes <= 0 { + maxConcurrentNodes = len(list) + } + + sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) + ctx := context.Background() + + for _, nodePartition := range list { + if err := sem.Acquire(ctx, 1); err != nil { + logger.Logger.Error("Constraint Semaphore failed for Scan: %s", err.Error()) + } + go func(nodePartition *nodePartitions) { + defer sem.Release(1) + defer wg.Done() + if err := clnt.scanNodePartitionObjects(policy, rs, tracker, nodePartition, namespace, setName, binNames...); err != nil { + tracker.partitionError() + logger.Logger.Debug("Error while Executing scan for node %s: %s", nodePartition.node.String(), err.Error()) + } + }(nodePartition) + } + + wg.Wait() + + done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) + if done || err != nil { + if err != nil { + tracker.partitionError() + } + // Scan is complete. + return err + } + + if policy.SleepBetweenRetries > 0 { + // Sleep before trying again. + time.Sleep(interval) + + if policy.SleepMultiplier > 1 { + interval = time.Duration(float64(interval) * policy.SleepMultiplier) + } + } + } + +} + +// ScanNode reads all records in specified namespace and set for one node only. +// If the policy is nil, the default relevant policy will be used. +func (clnt *Client) scanNodePartitionObjects(policy *ScanPolicy, recordset *Recordset, tracker *partitionTracker, nodePartition *nodePartitions, namespace string, setName string, binNames ...string) Error { + command := newScanPartitionObjectsCommand(policy, tracker, nodePartition, namespace, setName, binNames, recordset) + return command.Execute() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go new file mode 100644 index 00000000..6727c693 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go @@ -0,0 +1,79 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +type scanPartitionCommand struct { + baseMultiCommand + + policy *ScanPolicy + namespace string + setName string + binNames []string +} + +func newScanPartitionCommand( + policy *ScanPolicy, + tracker *partitionTracker, + nodePartitions *nodePartitions, + namespace string, + setName string, + binNames []string, + recordset *Recordset, +) *scanPartitionCommand { + cmd := &scanPartitionCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), + policy: policy, + namespace: namespace, + setName: setName, + binNames: binNames, + } + cmd.rawCDT = policy.RawCDT + cmd.terminationErrorType = types.SCAN_TERMINATED + cmd.tracker = tracker + cmd.nodePartitions = nodePartitions + cmd.node = nodePartitions.node + + return cmd +} + +func (cmd *scanPartitionCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *scanPartitionCommand) writeBuffer(ifc command) Error { + return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, cmd.nodePartitions) +} + +func (cmd *scanPartitionCommand) shouldRetry(e Error) bool { + return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) +} + +func (cmd *scanPartitionCommand) transactionType() transactionType { + return ttScan +} + +func (cmd *scanPartitionCommand) Execute() Error { + err := cmd.execute(cmd) + if err != nil { + // signal to the executor that no retries should be attempted + // don't send error unless no retries are planned + if !cmd.shouldRetry(err) { + cmd.recordset.sendError(err) + } + } + return err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go b/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go new file mode 100644 index 00000000..6fc51234 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go @@ -0,0 +1,83 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import "github.com/aerospike/aerospike-client-go/v7/types" + +type scanPartitionObjectsCommand struct { + baseMultiCommand + + policy *ScanPolicy + namespace string + setName string + binNames []string + taskID uint64 +} + +func newScanPartitionObjectsCommand( + policy *ScanPolicy, + tracker *partitionTracker, + nodePartitions *nodePartitions, + namespace string, + setName string, + binNames []string, + recordset *Recordset, +) *scanPartitionObjectsCommand { + cmd := &scanPartitionObjectsCommand{ + baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), + policy: policy, + namespace: namespace, + setName: setName, + binNames: binNames, + } + cmd.terminationErrorType = types.SCAN_TERMINATED + cmd.tracker = tracker + cmd.nodePartitions = nodePartitions + cmd.node = nodePartitions.node + + return cmd +} + +func (cmd *scanPartitionObjectsCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *scanPartitionObjectsCommand) writeBuffer(ifc command) Error { + return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, cmd.nodePartitions) +} + +func (cmd *scanPartitionObjectsCommand) parseResult(ifc command, conn *Connection) Error { + return cmd.baseMultiCommand.parseResult(ifc, conn) +} + +func (cmd *scanPartitionObjectsCommand) shouldRetry(e Error) bool { + return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) +} + +func (cmd *scanPartitionObjectsCommand) transactionType() transactionType { + return ttScan +} + +func (cmd *scanPartitionObjectsCommand) Execute() Error { + err := cmd.execute(cmd) + if err != nil { + // signal to the executor that no retries should be attempted + // don't send error unless no retries are planned + if !cmd.shouldRetry(err) { + cmd.recordset.sendError(err) + } + } + return err +} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_policy.go b/aerospike-tls/vendor-aerospike-client-go/scan_policy.go new file mode 100644 index 00000000..400850db --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_policy.go @@ -0,0 +1,42 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// ScanPolicy encapsulates parameters used in scan operations. +type ScanPolicy struct { + MultiPolicy +} + +// NewScanPolicy creates a new ScanPolicy instance with default values. +// Set MaxRetries for scans on server versions >= 4.9. All other +// scans are not retried. +// +// The latest servers support retries on individual data partitions. +// This feature is useful when a cluster is migrating and partition(s) +// are missed or incomplete on the first scan attempt. +// +// If the first scan attempt misses 2 of 4096 partitions, then only +// those 2 partitions are retried in the next scan attempt from the +// last key digest received for each respective partition. A higher +// default MaxRetries is used because it's wasteful to invalidate +// all scan results because a single partition was missed. +func NewScanPolicy() *ScanPolicy { + mp := *NewMultiPolicy() + mp.TotalTimeout = 0 + + return &ScanPolicy{ + MultiPolicy: mp, + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_test.go b/aerospike-tls/vendor-aerospike-client-go/scan_test.go new file mode 100644 index 00000000..7c56c0c0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/scan_test.go @@ -0,0 +1,411 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "bytes" + "math" + "math/rand" + + as "github.com/aerospike/aerospike-client-go/v7" + ast "github.com/aerospike/aerospike-client-go/v7/types" + particleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Scan operations", func() { + + // connection data + var ns = *namespace + var set = randString(50) + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + const keyCount = 1000 + const ldtElemCount = 10 + bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", randString(100)) + bin3 := as.NewBin("map", map[string]int{"1": 1, "2": 2}) + bin4 := as.NewBin("list", []int{1, 2, 3}) + var keys map[string]*as.Key + + // read all records from the channel and make sure all of them are returned + // if cancelCnt is set, it will cancel the scan after specified record count + var checkResults = func(recordset *as.Recordset, cancelCnt int, rawCDT bool) int { + counter := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + key, exists := keys[string(rec.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) + + gm.Expect(res.Record.Bins[bin3.Name]).NotTo(gm.BeNil()) + gm.Expect(res.Record.Bins[bin4.Name]).NotTo(gm.BeNil()) + if rawCDT { + gm.Expect(res.Record.Bins[bin3.Name].(*as.RawBlobValue).ParticleType).To(gm.Equal(particleType.MAP)) + gm.Expect(res.Record.Bins[bin4.Name].(*as.RawBlobValue).ParticleType).To(gm.Equal(particleType.LIST)) + + // rewrite the record to the database to see if the values are correctly written + err := client.Put(nil, res.Record.Key, res.Record.Bins) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } else { + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + gm.Expect(res.Record.Bins[bin3.Name]).To(gm.Equal(map[interface{}]interface{}{"1": 1, "2": 2})) + gm.Expect(res.Record.Bins[bin4.Name]).To(gm.Equal([]interface{}{1, 2, 3})) + + delete(keys, string(rec.Key.Digest())) + } + + counter++ + // cancel scan abruptly + if cancelCnt != 0 && counter == cancelCnt { + recordset.Close() + } + } + + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + return counter + } + + gg.BeforeEach(func() { + keys = make(map[string]*as.Key, keyCount) + set = randString(50) + for i := 0; i < keyCount; i++ { + key, err := as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + keys[string(key.Digest())] = key + err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + var scanPolicy = as.NewScanPolicy() + + gg.It("must Scan and paginate to get all records back from all partitions concurrently", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + pf := as.NewPartitionFilterAll() + spolicy := as.NewScanPolicy() + spolicy.MaxRecords = 30 + + times := 0 + received := 0 + for received < keyCount { + times++ + recordset, err := client.ScanPartitions(spolicy, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := checkResults(recordset, 0, false) + gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) + received += recs + } + + gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and paginate to get all records back from all partitions concurrently, ONE BY ONE", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + pf := as.NewPartitionFilterAll() + spolicy := as.NewScanPolicy() + spolicy.MaxRecords = 1 + + times := 0 + received := 0 + for received < keyCount { + times++ + recordset, err := client.ScanPartitions(spolicy, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := checkResults(recordset, 0, false) + gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) + received += recs + } + + gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and paginate using a persisted cursor to get all records back from all partitions concurrently", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + spolicy := as.NewScanPolicy() + spolicy.MaxRecords = 30 + + received := 0 + var buf []byte + times := 0 + for received < keyCount { + times++ + pf := as.NewPartitionFilterAll() + + if len(buf) > 0 { + err = pf.DecodeCursor(buf) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + recordset, err := client.ScanPartitions(spolicy, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + recs := checkResults(recordset, 0, false) + gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) + received += recs + + buf, err = pf.EncodeCursor() + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back from all partitions concurrently", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + pf := as.NewPartitionFilterByRange(0, 4096) + recordset, err := client.ScanPartitions(nil, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, false) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all partition records back for a specified key", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + counter := 0 + + var rkey *as.Key + for _, k := range keys { + rkey = k + + pf := as.NewPartitionFilterByKey(rkey) + recordset, err := client.ScanPartitions(scanPolicy, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + // the key itself should not be returned + gm.Expect(bytes.Equal(rkey.Digest(), res.Record.Key.Digest())).To(gm.BeFalse()) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + + } + gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) + }) + + gg.It("must Scan and get all partition records back for a specified partition range", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + pbegin := 1000 + for i := 1; i < 10; i++ { + counter := 0 + + pf := as.NewPartitionFilterByRange(pbegin, rand.Intn(i*191)+1) + recordset, err := client.ScanPartitions(scanPolicy, pf, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + + gm.Expect(counter).To(gm.BeNumerically(">", 0)) + gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) + } + } + gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("must Scan and get all records back for a specified node using Results() channel", func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + counter := 0 + for _, node := range client.GetNodes() { + recordset, err := client.ScanNode(scanPolicy, node, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).NotTo(gm.HaveOccurred()) + key, exists := keys[string(res.Record.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(res.Record.Key.Value().GetObject())) + gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) + + delete(keys, string(res.Record.Key.Digest())) + + counter++ + } + } + + gm.Expect(len(keys)).To(gm.Equal(0)) + gm.Expect(counter).To(gm.Equal(keyCount)) + }) + + gg.It("must Scan and get all records back for a specified node", func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + for _, node := range client.GetNodes() { + recordset, err := client.ScanNode(scanPolicy, node, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, false) + } + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back from all nodes concurrently", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, false) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back from all nodes concurrently with policy.RecordsPerSecond set", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + policy := as.NewScanPolicy() + policy.RecordsPerSecond = keyCount - 100 + recordset, err := client.ScanAll(policy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, false) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back from all nodes concurrently without the Bin Data", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + sp := as.NewScanPolicy() + sp.IncludeBinData = false + recordset, err := client.ScanAll(sp, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for res := range recordset.Results() { + gm.Expect(res.Err).ToNot(gm.HaveOccurred()) + rec := res.Record + key, exists := keys[string(rec.Key.Digest())] + + gm.Expect(exists).To(gm.Equal(true)) + gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) + gm.Expect(len(rec.Bins)).To(gm.Equal(0)) + + delete(keys, string(res.Record.Key.Digest())) + } + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back from all nodes sequentially", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + scanPolicy := as.NewScanPolicy() + scanPolicy.MaxConcurrentNodes = 1 + + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, false) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Scan and get all records back in RawBlobValue when policy.RawCDT is set to true", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + scanPolicy := as.NewScanPolicy() + scanPolicy.MaxConcurrentNodes = 1 + scanPolicy.RawCDT = true + + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, scanPolicy.RawCDT) + + scanPolicy.RawCDT = false + + recordset, err = client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, 0, scanPolicy.RawCDT) + + gm.Expect(len(keys)).To(gm.Equal(0)) + }) + + gg.It("must Cancel Scan", func() { + gm.Expect(len(keys)).To(gm.Equal(keyCount)) + + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + checkResults(recordset, keyCount/2, false) + + gm.Expect(len(keys)).To(gm.BeNumerically("<=", keyCount/2)) + }) + + gg.It("must return the error for invalid expression", func() { + scanPolicy := as.NewScanPolicy() + // the right expression has to be as.ExpListVal(as.NewIntegerValue(11)) for valid expression + scanPolicy.FilterExpression = as.ExpEq(as.ExpListGetByValueRange(as.ListReturnTypeValue, as.ExpIntVal(10), as.ExpIntVal(13), as.ExpListBin(bin1.Name)), as.ExpIntVal(11)) + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + counter := 0 + for res := range recordset.Results() { + gm.Expect(res.Err).To(gm.HaveOccurred()) + gm.Expect(res.Err.Matches(ast.PARAMETER_ERROR)).To(gm.BeTrue()) + } + + gm.Expect(counter).To(gm.Equal(0)) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/security_test.go b/aerospike-tls/vendor-aerospike-client-go/security_test.go new file mode 100644 index 00000000..b53c5327 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/security_test.go @@ -0,0 +1,289 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "fmt" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Security tests", func() { + + var ns = *namespace + + // connection data + var client *as.Client + var err error + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + + if !securityEnabled() { + gg.Skip("Security Tests are not supported in the Community Edition, or when security is not enabled for the Enterprise Edition.") + } + + client, err = as.NewClientWithPolicy(clientPolicy, *host, *port) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + + gg.AfterEach(func() { + if securityEnabled() { + dropUser(nil, "test_user") + time.Sleep(time.Second) + } + }) + + gg.Context("Roles", func() { + + gg.BeforeEach(func() { + client.CreateUser(nil, "test_user", "test", []string{"user-admin"}) + time.Sleep(time.Second) + }) + + gg.It("Must work with Roles Perfectly", func() { + defer client.DropRole(nil, "role-read-test-test") + defer client.DropRole(nil, "role-write-test") + defer client.DropRole(nil, "dummy-role") + + // Add a user defined Role + err := client.CreateRole(nil, "role-read-test-test", []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, []string{getOutboundIP().String()}, 0, 0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.CreateRole(nil, "role-write-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, []string{getOutboundIP().String()}, 0, 0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + // Add privileges to the roles + err = client.GrantPrivileges(nil, "role-read-test-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: "bar"}, {Code: as.ReadWriteUDF, Namespace: ns, SetName: "test"}}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Wait until servers syncronize + time.Sleep(1 * time.Second) + + // Revoke privileges from the roles + err = client.RevokePrivileges(nil, "role-read-test-test", []as.Privilege{{Code: as.ReadWriteUDF, Namespace: ns, SetName: "test"}}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.CreateRole(nil, "dummy-role", []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, []string{getOutboundIP().String()}, 0, 0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + // Drop the dummy role to make sure DropRoles Works + err = client.DropRole(nil, "dummy-role") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Wait until servers syncronize + time.Sleep(3 * time.Second) + + roles, err := client.QueryRoles(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // gm.Expect(len(roles)).To(gm.Equal(8)) + + // Predefined Roles + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read", Privileges: []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read-write", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: "", SetName: ""}}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read-write-udf", Privileges: []as.Privilege{{Code: as.ReadWriteUDF, Namespace: "", SetName: ""}}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "sys-admin", Privileges: []as.Privilege{{Code: as.SysAdmin, Namespace: "", SetName: ""}}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "user-admin", Privileges: []as.Privilege{{Code: as.UserAdmin, Namespace: "", SetName: ""}}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "data-admin", Privileges: []as.Privilege{{Code: as.DataAdmin, Namespace: "", SetName: ""}}})) + + // Our test Roles + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}, {Code: as.ReadWrite, Namespace: ns, SetName: "bar"}}, Whitelist: []string{getOutboundIP().String()}})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-write-test", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, Whitelist: []string{getOutboundIP().String()}})) + }) + + gg.It("Must work with Quotas Perfectly", func() { + defer client.DropRole(nil, "role-read-test-test") + defer client.DropRole(nil, "role-write-test") + + // Add a user defined Role + err := client.CreateRole(nil, "role-read-test-test", []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, []string{}, 1000, 2000) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.CreateRole(nil, "role-write-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, []string{}, 1001, 2002) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + roles, err := client.QueryRoles(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // Our test Roles + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, ReadQuota: 1000, WriteQuota: 2000})) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-write-test", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, ReadQuota: 1001, WriteQuota: 2002})) + + err = client.SetQuotas(nil, "role-read-test-test", 10010, 20020) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(1 * time.Second) + + roles, err = client.QueryRoles(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, ReadQuota: 10010, WriteQuota: 20020})) + }) + + gg.It("Must set and query Whitelist for Roles Perfectly", func() { + defer client.DropRole(nil, "whitelist-test") + + err = client.CreateRole(nil, "whitelist-test", []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, []string{}, 0, 0) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + err = client.SetWhitelist(nil, "whitelist-test", []string{getOutboundIP().String()}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + role, err := client.QueryRole(nil, "whitelist-test") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(role).To(gm.Equal(&as.Role{Name: "whitelist-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, Whitelist: []string{getOutboundIP().String()}})) + }) + + gg.It("Must query User Roles Perfectly", func() { + admin, err := client.QueryUser(nil, "test_user") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(admin.User).To(gm.Equal("test_user")) + gm.Expect(admin.Roles).To(gm.ContainElement("user-admin")) + }) + + gg.It("Must Revoke/Grant Roles Perfectly", func() { + err := client.GrantRoles(nil, "test_user", []string{"user-admin", "sys-admin", "read-write", "read"}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + admin, err := client.QueryUser(nil, "test_user") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(admin.User).To(gm.Equal("test_user")) + gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "sys-admin", "read-write", "read")) + + err = client.RevokeRoles(nil, "test_user", []string{"sys-admin"}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + admin, err = client.QueryUser(nil, "test_user") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(admin.User).To(gm.Equal("test_user")) + gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read-write", "read")) + }) + + }) // describe roles + + gg.Describe("Users", func() { + + gg.It("Must Create/Drop User", func() { + // drop before test + client.DropUser(nil, "test_user") + + err := client.CreateUser(nil, "test_user", "test", []string{"user-admin", "read"}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + admin, err := client.QueryUser(nil, "test_user") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(admin.User).To(gm.Equal("test_user")) + gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read")) + }) + + gg.It("Must Change User Password", func() { + // drop before test + client.DropUser(nil, "test_user") + + err := client.CreateUser(nil, "test_user", "test", []string{"user-admin", "read"}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + // connect using the new user + clientPolicy := as.NewClientPolicy() + clientPolicy.TlsConfig = tlsConfig + clientPolicy.User = "test_user" + clientPolicy.Password = "test" + new_client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) + gm.Expect(err).ToNot(gm.HaveOccurred()) + defer new_client.Close() + + // change current user's password on the fly + err = new_client.ChangePassword(nil, "test_user", "test1") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + + // exhaust all node connections + for _, node := range new_client.GetNodes() { + for i := 0; i < clientPolicy.ConnectionQueueSize; i++ { + conn, err := node.GetConnection(time.Second) + gm.Expect(err).ToNot(gm.HaveOccurred()) + node.InvalidateConnection(conn) + } + } + + // should have the password changed in the cluster, so that a new connection + // will be established and used + admin, err := new_client.QueryUser(nil, "test_user") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + gm.Expect(admin.User).To(gm.Equal("test_user")) + gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read")) + }) + + gg.It("Must Query all users", func() { + const USER_COUNT = 10 + // drop before test + for i := 1; i < USER_COUNT; i++ { + client.DropUser(nil, fmt.Sprintf("test_user%d", i)) + } + + for i := 1; i < USER_COUNT; i++ { + err := client.CreateUser(nil, fmt.Sprintf("test_user%d", i), "test", []string{"read"}) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + time.Sleep(time.Second) + + // should have the password changed in the cluster, so that a new connection + // will be established and used + users, err := client.QueryUsers(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(users)).To(gm.BeNumerically(">=", USER_COUNT-1)) + + for i := 1; i < USER_COUNT; i++ { + err := client.DropUser(nil, fmt.Sprintf("test_user%d", i)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + + }) + + }) // describe users +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/server_command.go b/aerospike-tls/vendor-aerospike-client-go/server_command.go new file mode 100644 index 00000000..73f8371f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/server_command.go @@ -0,0 +1,96 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type serverCommand struct { + queryCommand +} + +func newServerCommand(node *Node, policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, taskId uint64, operations []*Operation) *serverCommand { + return &serverCommand{ + queryCommand: *newQueryCommand(node, policy, writePolicy, statement, operations, nil), + } +} + +func (cmd *serverCommand) writeBuffer(ifc command) (err Error) { + return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.statement.TaskId, cmd.operations, cmd.writePolicy != nil, nil) +} + +func (cmd *serverCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { + // Server commands (Query/Execute UDF) should only send back a return code. + // Keep parsing logic to empty socket buffer just in case server does + // send records back. + cmd.dataOffset = 0 + var bval int64 + + for cmd.dataOffset < receiveSize { + if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { + return false, err + } + resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) + + if resultCode != 0 { + if resultCode == types.KEY_NOT_FOUND_ERROR { + return false, nil + } + return false, newError(resultCode) + } + + info3 := int(cmd.dataBuffer[3]) + + // If cmd is the end marker of the response, do not proceed further + if (info3 & _INFO3_LAST) == _INFO3_LAST { + return false, nil + } + + fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) + opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) + + if _, err := cmd.parseKey(fieldCount, &bval); err != nil { + return false, err + } + + for i := 0; i < opCount; i++ { + if err := cmd.readBytes(8); err != nil { + return false, err + } + opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) + nameSize := int(cmd.dataBuffer[7]) + + if err := cmd.readBytes(nameSize); err != nil { + return false, err + } + + particleBytesSize := opSize - (4 + nameSize) + if err := cmd.readBytes(particleBytesSize); err != nil { + return false, err + } + } + } + return true, nil +} + +func (cmd *serverCommand) isRead() bool { + return true +} + +func (cmd *serverCommand) Execute() Error { + return cmd.execute(cmd) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/single_command.go b/aerospike-tls/vendor-aerospike-client-go/single_command.go new file mode 100644 index 00000000..9739288a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/single_command.go @@ -0,0 +1,63 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type singleCommand struct { + baseCommand + + cluster *Cluster + key *Key + partition *Partition +} + +func newSingleCommand(cluster *Cluster, key *Key, partition *Partition) singleCommand { + return singleCommand{ + baseCommand: baseCommand{}, + cluster: cluster, + key: key, + partition: partition, + } +} + +func (cmd *singleCommand) getConnection(policy Policy) (*Connection, Error) { + return cmd.node.getConnectionWithHint(policy.GetBasePolicy().deadline(), policy.GetBasePolicy().socketTimeout(), cmd.key.digest[0]) +} + +func (cmd *singleCommand) putConnection(conn *Connection) { + cmd.node.putConnectionWithHint(conn, cmd.key.digest[0]) +} + +func (cmd *singleCommand) emptySocket(conn *Connection) Error { + // There should not be any more bytes. + // Empty the socket to be safe. + sz := Buffer.BytesToInt64(cmd.dataBuffer, 0) + headerLength := cmd.dataBuffer[8] + receiveSize := int(sz&0xFFFFFFFFFFFF) - int(headerLength) + + // Read remaining message bytes. + if receiveSize > 0 { + if err := cmd.sizeBufferSz(receiveSize, false); err != nil { + return err + } + if _, err := conn.Read(cmd.dataBuffer, receiveSize); err != nil { + return err + } + } + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/statement.go b/aerospike-tls/vendor-aerospike-client-go/statement.go new file mode 100644 index 00000000..a9d3857d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/statement.go @@ -0,0 +1,115 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "math/rand" + + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Statement encapsulates query statement parameters. +type Statement struct { + // Namespace determines query Namespace + Namespace string + + // SetName determines query Set name (Optional) + SetName string + + // IndexName determines query index name (Optional) + // If not set, the server will determine the index from the filter's bin name. + IndexName string + + // BinNames determines bin names (optional) + BinNames []string + + // Filter determines query index filter (Optional). + // This filter is applied to the secondary index on query. + // Query index filters must reference a bin which has a secondary index defined. + Filter *Filter + + packageName string + functionName string + functionArgs []Value + + // TaskId determines query task id. (Optional) + // This value is not used anymore and will be removed later. + TaskId uint64 + + // determines if the query should return data + ReturnData bool +} + +// NewStatement initializes a new Statement instance. +func NewStatement(ns string, set string, binNames ...string) *Statement { + return &Statement{ + Namespace: ns, + SetName: set, + BinNames: binNames, + ReturnData: true, + TaskId: rand.Uint64(), + } +} + +func (stmt *Statement) String() string { + return fmt.Sprintf("Statement: {Namespace: %s, set: %s, IndexName: %s, BinNames: %v, Filter: %s, UDF: %s.%s(%v), TaskId: %d, return data: %v}", + stmt.Namespace, + stmt.SetName, + stmt.IndexName, + stmt.BinNames, + stmt.Filter, + stmt.packageName, + stmt.functionName, + stmt.functionArgs, + stmt.TaskId, + stmt.ReturnData, + ) +} + +// SetFilter Sets a filter for the statement. +// Aerospike Server currently only supports using a single filter per statement/query. +func (stmt *Statement) SetFilter(filter *Filter) Error { + stmt.Filter = filter + + return nil +} + +// SetAggregateFunction sets aggregation function parameters. +// This function will be called on both the server +// and client for each selected item. +func (stmt *Statement) SetAggregateFunction(packageName string, functionName string, functionArgs []Value, returnData bool) { + stmt.packageName = packageName + stmt.functionName = functionName + stmt.functionArgs = functionArgs + stmt.ReturnData = returnData +} + +// IsScan determines is the Statement is a full namespace/set scan or a selective Query. +func (stmt *Statement) IsScan() bool { + return stmt.Filter == nil +} + +func (stmt *Statement) terminationError() types.ResultCode { + if stmt.IsScan() { + return types.SCAN_TERMINATED + } + return types.QUERY_TERMINATED +} + +// Always set the taskID client-side to a non-zero random value +func (stmt *Statement) prepare(returnData bool) { + stmt.ReturnData = returnData +} diff --git a/aerospike-tls/vendor-aerospike-client-go/task.go b/aerospike-tls/vendor-aerospike-client-go/task.go new file mode 100644 index 00000000..c019ad4a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/task.go @@ -0,0 +1,82 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "time" + + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" + "github.com/aerospike/aerospike-client-go/v7/types" +) + +// Task interface defines methods for asynchronous tasks. +type Task interface { + IsDone() (bool, Error) + + onComplete(ifc Task) chan Error + OnComplete() chan Error +} + +// baseTask is used to poll for server task completion. +type baseTask struct { + retries atomic.Int + cluster *Cluster +} + +// newTask initializes task with fields needed to query server nodes. +func newTask(cluster *Cluster) *baseTask { + return &baseTask{ + cluster: cluster, + } +} + +// Wait for asynchronous task to complete using default sleep interval. +func (btsk *baseTask) onComplete(ifc Task) chan Error { + ch := make(chan Error, 1) + + // goroutine will loop every until IsDone() returns true or error + go func() { + // always close the channel on return + defer close(ch) + + var interval = 100 * time.Millisecond + + for { + time.Sleep(interval) + + done, err := ifc.IsDone() + // Every 5 failed retries increase the interval + if btsk.retries.IncrementAndGet()%5 == 0 { + interval *= 2 + + if interval > 5*time.Second { + interval = 5 * time.Second + } + } + if err != nil { + if err.Matches(types.TIMEOUT) { + err.markInDoubt(true) + } + ch <- err + return + } else if done { + ch <- nil + return + } + } // for + }() + + return ch +} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go b/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go new file mode 100644 index 00000000..9f648ae0 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go @@ -0,0 +1,62 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// DropIndexTask is used to poll for long running create index completion. +type DropIndexTask struct { + *baseTask + + namespace string + indexName string +} + +// NewDropIndexTask initializes a task with fields needed to query server nodes. +func NewDropIndexTask(cluster *Cluster, namespace string, indexName string) *DropIndexTask { + return &DropIndexTask{ + baseTask: newTask(cluster), + namespace: namespace, + indexName: indexName, + } +} + +// IsDone queries all nodes for task completion status. +func (tski *DropIndexTask) IsDone() (bool, Error) { + command := "sindex-exists:ns=" + tski.namespace + ";indexname=" + tski.indexName + nodes := tski.cluster.GetNodes() + complete := false + + for _, node := range nodes { + responseMap, err := node.requestInfoWithRetry(&tski.cluster.infoPolicy, 5, command) + if err != nil { + return false, err + } + + for _, response := range responseMap { + if response == "false" { + complete = true + continue + } + + return false, nil + } + } + return complete, nil +} + +// OnComplete returns a channel that will be closed as soon as the task is finished. +// If an error is encountered during operation, an error will be sent on the channel. +func (tski *DropIndexTask) OnComplete() chan Error { + return tski.onComplete(tski) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_index.go b/aerospike-tls/vendor-aerospike-client-go/task_index.go new file mode 100644 index 00000000..9149629b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/task_index.go @@ -0,0 +1,82 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "regexp" + "strconv" + "strings" +) + +// IndexTask is used to poll for long running create index completion. +type IndexTask struct { + *baseTask + + namespace string + indexName string +} + +// NewIndexTask initializes a task with fields needed to query server nodes. +func NewIndexTask(cluster *Cluster, namespace string, indexName string) *IndexTask { + return &IndexTask{ + baseTask: newTask(cluster), + namespace: namespace, + indexName: indexName, + } +} + +// IsDone queries all nodes for task completion status. +func (tski *IndexTask) IsDone() (bool, Error) { + command := "sindex/" + tski.namespace + "/" + tski.indexName + nodes := tski.cluster.GetNodes() + complete := false + + r := regexp.MustCompile(`\.*load_pct=(\d+)\.*`) + + for _, node := range nodes { + responseMap, err := node.requestInfoWithRetry(&tski.cluster.infoPolicy, 5, command) + if err != nil { + return false, err + } + + for _, response := range responseMap { + find := "load_pct=" + index := strings.Index(response, find) + + if index < 0 { + if tski.retries.Get() > 20 { + complete = true + } + continue + } + + matchRes := r.FindStringSubmatch(response) + // we know it exists and is a valid number + pct, _ := strconv.Atoi(matchRes[1]) + + if pct >= 0 && pct < 100 { + return false, nil + } + complete = true + } + } + return complete, nil +} + +// OnComplete returns a channel that will be closed as soon as the task is finished. +// If an error is encountered during operation, an error will be sent on the channel. +func (tski *IndexTask) OnComplete() chan Error { + return tski.onComplete(tski) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_register.go b/aerospike-tls/vendor-aerospike-client-go/task_register.go new file mode 100644 index 00000000..49ae2119 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/task_register.go @@ -0,0 +1,65 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "strings" +) + +// RegisterTask is used to poll for UDF registration completion. +type RegisterTask struct { + *baseTask + + packageName string +} + +// NewRegisterTask initializes a RegisterTask with fields needed to query server nodes. +func NewRegisterTask(cluster *Cluster, packageName string) *RegisterTask { + return &RegisterTask{ + baseTask: newTask(cluster), + packageName: packageName, + } +} + +// IsDone will query all nodes for task completion status. +func (tskr *RegisterTask) IsDone() (bool, Error) { + command := "udf-list" + nodes := tskr.cluster.GetNodes() + done := false + + for _, node := range nodes { + responseMap, err := node.requestInfoWithRetry(&tskr.cluster.infoPolicy, 5, command) + if err != nil { + return false, err + } + + for _, response := range responseMap { + find := "filename=" + tskr.packageName + index := strings.Index(response, find) + + if index < 0 { + return false, nil + } + done = true + } + } + return done, nil +} + +// OnComplete returns a channel that will be closed as soon as the task is finished. +// If an error is encountered during operation, an error will be sent on the channel. +func (tskr *RegisterTask) OnComplete() chan Error { + return tskr.onComplete(tskr) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_remove.go b/aerospike-tls/vendor-aerospike-client-go/task_remove.go new file mode 100644 index 00000000..17d86a7c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/task_remove.go @@ -0,0 +1,65 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "strings" +) + +// RemoveTask is used to poll for UDF registration completion. +type RemoveTask struct { + *baseTask + + packageName string +} + +// NewRemoveTask initializes a RemoveTask with fields needed to query server nodes. +func NewRemoveTask(cluster *Cluster, packageName string) *RemoveTask { + return &RemoveTask{ + baseTask: newTask(cluster), + packageName: packageName, + } +} + +// IsDone will query all nodes for task completion status. +func (tskr *RemoveTask) IsDone() (bool, Error) { + command := "udf-list" + nodes := tskr.cluster.GetNodes() + done := false + + find := "filename=" + tskr.packageName + for _, node := range nodes { + responseMap, err := node.requestInfoWithRetry(&tskr.cluster.infoPolicy, 5, command) + if err != nil { + return false, err + } + + for _, response := range responseMap { + index := strings.Index(response, find) + + if index >= 0 { + return false, nil + } + done = true + } + } + return done, nil +} + +// OnComplete returns a channel that will be closed as soon as the task is finished. +// If an error is encountered during operation, an error will be sent on the channel. +func (tskr *RemoveTask) OnComplete() chan Error { + return tskr.onComplete(tskr) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua b/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua new file mode 100644 index 00000000..053e3ca1 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua @@ -0,0 +1,18 @@ +function average(s, name) + + local function mapper(out, rec) + out['sum'] = (out['sum'] or 0) + (rec[name] or 0) + out['count'] = (out['count'] or 0) + 1 + return out + end + + local function reducer(a, b) + local out = map() + + out['sum'] = a['sum'] + b['sum'] + out['count'] = a['count'] + b['count'] + return out + end + + return s : aggregate(map{sum = 0, count = 0}, mapper) : reduce(reducer) +end diff --git a/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua b/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua new file mode 100644 index 00000000..d273521e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua @@ -0,0 +1,11 @@ +local function reducer(val1,val2) + return val1 + val2 +end + +function sum_single_bin(stream,name) + local function mapper(rec) + return rec[name] + end + + return stream : map(mapper) : reduce(reducer) +end diff --git a/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go b/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go new file mode 100644 index 00000000..a46c8791 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go @@ -0,0 +1,138 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "log" + "math/rand" + "net" + "reflect" + + gm "github.com/onsi/gomega" +) + +type testBLOB struct { + name string +} + +func (tb *testBLOB) EncodeBlob() ([]byte, error) { + return []byte(tb.name), nil +} + +// generates a random string of specified length +func randString(size int) string { + const random_alpha_num = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + const l = 62 + buf := make([]byte, size) + for i := 0; i < size; i++ { + buf[i] = random_alpha_num[rand.Intn(l)] + } + return string(buf) +} + +func normalizeValue(v interface{}, isMapKey bool) interface{} { + if v != nil { + switch v.(type) { + case int8, int16, int32, int, int64: + return reflect.ValueOf(v).Int() + case uint8, uint16, uint32, uint: + return int64(reflect.ValueOf(v).Uint()) + } + + // check for array and map + switch reflect.TypeOf(v).Kind() { + case reflect.Array: + if isMapKey { + return v + } + return sliceToIfcSlice(v) + case reflect.Slice: + return sliceToIfcSlice(v) + case reflect.Map: + return mapToIfcMap(v) + } + + return v + } + + return nil +} + +func mapToIfcMap(v interface{}) map[interface{}]interface{} { + s := reflect.ValueOf(v) + l := s.Len() + res := make(map[interface{}]interface{}, l) + for _, k := range s.MapKeys() { + v := s.MapIndex(k).Interface() + res[normalizeValue(k.Interface(), true)] = normalizeValue(v, false) + } + + return res +} + +func sliceToIfcSlice(v interface{}) []interface{} { + s := reflect.ValueOf(v) + l := s.Len() + res := make([]interface{}, l) + for i := 0; i < l; i++ { + t := s.Index(i).Interface() + res[i] = normalizeValue(t, false) + } + + return res +} + +func arraysEqual(ia, ib interface{}) { + a := sliceToIfcSlice(ia) + b := sliceToIfcSlice(ib) + + gm.Expect(len(a)).To(gm.Equal(len(b))) + // gm.Expect(a).To(gm.BeEquivalentTo(b)) + + for i := range a { + switch reflect.ValueOf(a[i]).Kind() { + case reflect.Map: + mapsEqual(a[i], b[i]) + case reflect.Slice: + arraysEqual(a[i], b[i]) + default: + if a[i] != nil { + gm.Expect(a[i]).To(gm.BeEquivalentTo(b[i])) + } else { + gm.Expect(b[i]).To(gm.BeNil()) + } + } + } +} + +func mapsEqual(ia, ib interface{}) { + a := mapToIfcMap(ia) + b := mapToIfcMap(ib) + + gm.Expect(len(a)).To(gm.Equal(len(b))) + gm.Expect(a).To(gm.BeEquivalentTo(b)) +} + +func getOutboundIP() net.IP { + conn, err := net.Dial("udp", "8.8.8.8:80") + if err != nil { + log.Fatal(err) + } + defer conn.Close() + + localAddr := conn.LocalAddr().(*net.UDPAddr) + + return localAddr.IP +} diff --git a/aerospike-tls/vendor-aerospike-client-go/touch_command.go b/aerospike-tls/vendor-aerospike-client-go/touch_command.go new file mode 100644 index 00000000..fe0723ab --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/touch_command.go @@ -0,0 +1,143 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + + "github.com/aerospike/aerospike-client-go/v7/logger" + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// guarantee touchCommand implements command interface +var _ command = &touchCommand{} + +type touchCommand struct { + singleCommand + + policy *WritePolicy +} + +func newTouchCommand(cluster *Cluster, policy *WritePolicy, key *Key) (touchCommand, Error) { + var err Error + var partition *Partition + if cluster != nil { + partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) + if err != nil { + return touchCommand{}, err + } + } + + newTouchCmd := touchCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + policy: policy, + } + + return newTouchCmd, nil +} + +func (cmd *touchCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *touchCommand) writeBuffer(ifc command) Error { + return cmd.setTouch(cmd.policy, cmd.key) +} + +func (cmd *touchCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeWrite(cmd.cluster) +} + +func (cmd *touchCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryWrite(isTimeout) + return true +} + +func (cmd *touchCommand) parseResult(ifc command, conn *Connection) Error { + // Read header. + _, err := conn.Read(cmd.dataBuffer, 8) + if err != nil { + return err + } + + if compressedSize := cmd.compressedSize(); compressedSize > 0 { + // Read compressed size + _, err = conn.Read(cmd.dataBuffer, compressedSize) + if err != nil { + logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) + return err + } + + // Read compressed size + _, err = conn.Read(cmd.dataBuffer, 8) + if err != nil { + logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) + return err + } + + if err = cmd.conn.initInflater(true, compressedSize); err != nil { + return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize, err.Error())) + } + + // Read header. + _, err = conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)) + if err != nil { + logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) + return err + } + } else { + // Read header. + _, err = conn.Read(cmd.dataBuffer[8:], int(_MSG_TOTAL_HEADER_SIZE)-8) + if err != nil { + logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) + return err + } + } + + // Read header. + header := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(header); err != nil { + return err + } + + resultCode := cmd.dataBuffer[13] & 0xFF + + if resultCode != 0 { + if resultCode == byte(types.KEY_NOT_FOUND_ERROR) { + return ErrKeyNotFound.err() + } else if types.ResultCode(resultCode) == types.FILTERED_OUT { + return ErrFilteredOut.err() + } + + return newError(types.ResultCode(resultCode)) + } + return cmd.emptySocket(conn) +} + +func (cmd *touchCommand) isRead() bool { + return false +} + +func (cmd *touchCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *touchCommand) transactionType() transactionType { + return ttPut +} diff --git a/aerospike-tls/vendor-aerospike-client-go/truncate_test.go b/aerospike-tls/vendor-aerospike-client-go/truncate_test.go new file mode 100644 index 00000000..94ed72fe --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/truncate_test.go @@ -0,0 +1,121 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "math/rand" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("Truncate operations test", func() { + + gg.BeforeEach(func() { + if *proxy { + gg.Skip("Not supported in Proxy Client") + } + }) + + gg.Context("Truncate", func() { + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + wpolicy.SendKey = true + + const keyCount = 1000 + bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("Aerospike2", randString(100)) + + gg.BeforeEach(func() { + err := client.Truncate(nil, ns, set, nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + for i := 0; i < keyCount; i++ { + key, err = as.NewKey(ns, set, i) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Operate(wpolicy, key, as.PutOp(bin1), as.PutOp(bin2), as.GetOp()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + var countRecords = func(namespace, setName string) int { + stmt := as.NewStatement(namespace, setName) + res, err := client.Query(nil, stmt) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + cnt := 0 + for rec := range res.Results() { + gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) + cnt++ + } + + return cnt + } + + gg.It("must truncate only the current set", func() { + gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) + + err := client.Truncate(nil, ns, set, nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + gm.Expect(countRecords(ns, set)).To(gm.Equal(0)) + }) + + gg.It("must truncate the whole namespace", func() { + gm.Expect(countRecords(ns, "")).ToNot(gm.Equal(0)) + + err := client.Truncate(nil, ns, "", nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(time.Second) + gm.Expect(countRecords(ns, "")).To(gm.Equal(0)) + }) + + gg.It("must truncate only older records", func() { + time.Sleep(1 * time.Second) + t := time.Now() + time.Sleep(1 * time.Second) + + gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) + + for i := keyCount; i < 2*keyCount; i++ { + key, err = as.NewKey(ns, set, i) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + _, err = client.Operate(wpolicy, key, as.PutOp(bin1), as.PutOp(bin2), as.GetOp()) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + gm.Expect(countRecords(ns, set)).To(gm.Equal(2 * keyCount)) + + err := client.Truncate(nil, ns, set, &t) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(3 * time.Second) + gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) + }) + + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/epoc.go b/aerospike-tls/vendor-aerospike-client-go/types/epoc.go new file mode 100644 index 00000000..52776160 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/epoc.go @@ -0,0 +1,30 @@ +package types + +import ( + "math" + "time" +) + +const ( + // CITRUSLEAF_EPOCH defines the citrusleaf epoc: Jan 01 2010 00:00:00 GMT + CITRUSLEAF_EPOCH = 1262304000 +) + +// TTL converts an Expiration time from citrusleaf epoc to TTL in seconds. +func TTL(secsFromCitrusLeafEpoc uint32) uint32 { + switch secsFromCitrusLeafEpoc { + // don't convert magic values + case 0: // when set to don't expire, this value is returned + return math.MaxUint32 + default: + // Record may not have expired on server, but delay or clock differences may + // cause it to look expired on client. Floor at 1, not 0, to avoid old + // "never expires" interpretation. + now := time.Now().Unix() + expiration := int64(CITRUSLEAF_EPOCH + secsFromCitrusLeafEpoc) + if (expiration < 0 && now >= 0) || expiration > now { + return uint32(expiration - now) + } + return 1 + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go new file mode 100644 index 00000000..48ea8824 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go @@ -0,0 +1,83 @@ +// Copyright 2014-2024 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram_test + +import ( + "testing" + + "github.com/aerospike/aerospike-client-go/v7/types/histogram" +) + +var ( + _median int + _medianu64 uint64 +) + +func Benchmark_Histogram_Linear_Add(b *testing.B) { + h := histogram.New[int](histogram.Linear, 5, 10) + for i := 0; i < b.N; i++ { + h.Add(i) + } +} + +func Benchmark_Histogram_Linear_Median(b *testing.B) { + h := histogram.New[int](histogram.Linear, 50, 101) + for i := 0; i < 10000; i++ { + h.Add(i) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _median = h.Median() + } +} + +func Benchmark_Histogram_Log_Add(b *testing.B) { + h := histogram.NewExponential[int](2, 10) + for i := 0; i < b.N; i++ { + h.Add(i) + } +} + +func Benchmark_Histogram_Log_Median(b *testing.B) { + h := histogram.NewExponential[int](2, 32) + for i := 0; i < 100000; i++ { + h.Add(i) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _median = h.Median() + } +} + +func Benchmark_Histogram_Log2_Add(b *testing.B) { + h := histogram.NewLog2(10) + for i := 0; i < b.N; i++ { + h.Add(uint64(i)) + } +} + +func Benchmark_Histogram_Log2_Median(b *testing.B) { + h := histogram.NewLog2(32) + for i := 0; i < 100000; i++ { + h.Add(uint64(i)) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _medianu64 = h.Median() + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go new file mode 100644 index 00000000..bf2cb7a8 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go @@ -0,0 +1,218 @@ +// Copyright 2014-2024 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram + +import ( + "errors" + "fmt" + "math" + "strings" +) + +type Type byte + +const ( + Linear Type = iota + Logarithmic +) + +type hvals interface { + ~int | ~uint | + ~int64 | ~int32 | ~int16 | ~int8 | + ~uint64 | ~uint32 | ~uint16 | ~uint8 | + ~float64 | ~float32 +} + +type Histogram[T hvals] struct { + htype Type + base T + + Buckets []uint64 `json:"buckets"` // slot -> count + Min T `json:"min"` + Max T `json:"max"` + Sum float64 `json:"sum"` + Count uint64 `json:"count"` +} + +func New[T hvals](htype Type, base T, buckets int) *Histogram[T] { + return &Histogram[T]{ + htype: htype, + base: base, + Buckets: make([]uint64, buckets), + } +} + +func NewLinear[T hvals](base T, buckets int) *Histogram[T] { + return &Histogram[T]{ + htype: Linear, + base: base, + Buckets: make([]uint64, buckets), + } +} + +func NewExponential[T hvals](base T, buckets int) *Histogram[T] { + return &Histogram[T]{ + htype: Logarithmic, + base: base, + Buckets: make([]uint64, buckets), + } +} + +func (h *Histogram[T]) Reset() { + for i := range h.Buckets { + h.Buckets[i] = 0 + } + + h.Min = 0 + h.Max = 0 + h.Sum = 0 + h.Count = 0 +} + +func (h *Histogram[T]) Reshape(htype Type, base T, buckets int) { + if h.htype == htype && h.base == base && len(h.Buckets) == buckets { + return + } + + h.htype = htype + h.base = base + h.Buckets = make([]uint64, buckets) + + h.Min = 0 + h.Max = 0 + h.Sum = 0 + h.Count = 0 +} + +func (h *Histogram[T]) String() string { + res := new(strings.Builder) + switch h.htype { + case Linear: + for i := 0; i < len(h.Buckets)-1; i++ { + v := float64(h.base) * float64(i) + fmt.Fprintf(res, "[%v, %v) => %d\n", v, v+float64(h.base), h.Buckets[i]) + } + fmt.Fprintf(res, "[%v, inf) => %d\n", float64(h.base)*float64(len(h.Buckets)-1), h.Buckets[len(h.Buckets)-1]) + case Logarithmic: + fmt.Fprintf(res, "[0, %v) => %d\n", float64(h.base), h.Buckets[0]) + for i := 1; i < len(h.Buckets)-1; i++ { + v := math.Pow(float64(h.base), float64(i)) + fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*float64(h.base), h.Buckets[i]) + } + fmt.Fprintf(res, "[%v, inf) => %d\n", math.Pow(float64(h.base), float64(len(h.Buckets))-1), h.Buckets[len(h.Buckets)-1]) + } + return res.String() +} + +func (h *Histogram[T]) Clone() *Histogram[T] { + b := make([]uint64, len(h.Buckets)) + copy(b, h.Buckets) + return &Histogram[T]{ + htype: h.htype, + base: h.base, + + Buckets: b, + Min: h.Min, + Max: h.Max, + Sum: h.Sum, + Count: h.Count, + } +} + +func (h *Histogram[T]) CloneAndReset() *Histogram[T] { + res := h.Clone() + h.Reset() + return res +} + +func (h *Histogram[T]) Merge(other *Histogram[T]) error { + if h.base != other.base || h.htype != other.htype || len(h.Buckets) != len(other.Buckets) { + return errors.New("Histograms to not match") + } + + if other.Min < h.Min || h.Min == 0 { + h.Min = other.Min + } + + if other.Max > h.Max { + h.Max = other.Max + } + + h.Sum += other.Sum + h.Count += uint64(other.Count) + + for i := range h.Buckets { + h.Buckets[i] += other.Buckets[i] + } + + return nil +} + +func (h *Histogram[T]) Average() float64 { + if h.Count > 0 { + return h.Sum / float64(h.Count) + } + return 0 +} + +func (h *Histogram[T]) Median() T { + var s uint64 = 0 + c := h.Count / 2 + for i, bv := range h.Buckets { + s += bv + if s >= c { + // found the bucket + if h.htype == Linear { + return T(i+1) * h.base + } + return T(math.Pow(float64(h.base), float64(i+1))) + } + } + return h.Max +} + +func (h *Histogram[T]) Add(v T) { + if h.Count == 0 { + h.Max = v + h.Min = v + } else { + if v > h.Max { + h.Max = v + } else if v < h.Min { + h.Min = v + } + } + + h.Sum += float64(v) + h.Count++ + + var slot int + if v > 0 { + switch h.htype { + case Linear: + slot = int(math.Floor(float64(v / T(h.base)))) + case Logarithmic: + slot = int(math.Floor(math.Log(float64(v)) / math.Log(float64(h.base)))) + } + } + + if slot >= len(h.Buckets) { + h.Buckets[len(h.Buckets)-1]++ + } else if slot < 0 { + h.Buckets[0]++ + } else { + h.Buckets[slot]++ + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go new file mode 100644 index 00000000..6b231ee2 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go @@ -0,0 +1,167 @@ +// Copyright 2014-2024 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram_test + +import ( + "testing" + + "github.com/aerospike/aerospike-client-go/v7/types/histogram" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func TestHistogram(t *testing.T) { + gm.RegisterFailHandler(gg.Fail) + gg.RunSpecs(t, "Histogram Suite") +} + +var _ = gg.Describe("Histogram", func() { + + gg.Context("Integer Values", func() { + + gg.Context("Linear", func() { + + gg.It("must make the correct histogram", func() { + l := []int{1, 1, 3, 4, 5, 5, 9, 11, 11, 11, 16, 16, 21} + h := histogram.New[int](histogram.Linear, 5, 5) + + sum := 0 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(1)) + gm.Expect(h.Max).To(gm.Equal(21)) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(float64(sum))) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{4, 3, 3, 2, 1})) + }) + + gg.It("must find the correct median", func() { + l := []int{1e3, 2e3, 3e3, 4e3, 5e3, 6e3, 7e3, 8e3, 9e3, 10e3, 11e3, 12e3, 13e3} + h := histogram.New[int](histogram.Linear, 1000, 10) + + sum := 0 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(1000)) + gm.Expect(h.Max).To(gm.Equal(13000)) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(float64(sum))) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 1, 1, 1, 1, 1, 1, 1, 1, 5})) + gm.Expect(h.Median()).To(gm.Equal(7000)) + }) + + }) + + gg.Context("Exponential", func() { + + gg.It("must make the correct histogram", func() { + l := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} + h := histogram.New[int](histogram.Logarithmic, 2, 5) + + sum := 0 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(0)) + gm.Expect(h.Max).To(gm.Equal(20)) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(float64(sum))) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{2, 2, 4, 8, 5})) + }) + + gg.It("must make the correct histogram on barriers", func() { + l := []int{0, 1, 2, 3, 4, 5, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 129, 255, 256, 257, 511, 512, 513, 1023, 1024, 1025} + h := histogram.New[int](histogram.Logarithmic, 4, 8) + + sum := 0 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(0)) + gm.Expect(h.Max).To(gm.Equal(1025)) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(float64(sum))) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{4, 6, 6, 6, 6, 2, 0, 0})) + }) + + gg.It("must find the correct median", func() { + l := []int{10e3, 12e3, 3e3, 4e3, 50e3, 6e5, 75e3, 7e3, 21e3, 11e3, 113e3, 29e3, 189e3} + h := histogram.New[int](histogram.Logarithmic, 2, 18) + + sum := 0 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(int(3e3))) + gm.Expect(h.Max).To(gm.Equal(int(600e3))) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(float64(sum))) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 1, 2, 2})) + gm.Expect(h.Median()).To(gm.Equal(1 << 14)) + }) + }) + + gg.Context("Log2Histogram", func() { + + gg.It("must make the correct histogram", func() { + l := []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} + h := histogram.NewLog2(5) + + var sum uint64 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(uint64(0))) + gm.Expect(h.Max).To(gm.Equal(uint64(20))) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(sum)) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{2, 2, 4, 8, 5})) + }) + + gg.It("must find the correct median", func() { + l := []uint64{10e3, 12e3, 3e3, 4e3, 50e3, 6e5, 75e3, 7e3, 21e3, 11e3, 113e3, 29e3, 189e3} + h := histogram.NewLog2(18) + + var sum uint64 + for _, v := range l { + sum += v + h.Add(v) + } + + gm.Expect(h.Min).To(gm.Equal(uint64(3000))) + gm.Expect(h.Max).To(gm.Equal(uint64(600000))) + gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) + gm.Expect(h.Sum).To(gm.Equal(sum)) + gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 1, 2, 2})) + gm.Expect(h.Median()).To(gm.Equal(uint64(1 << 14))) + }) + }) + }) +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go new file mode 100644 index 00000000..b81cc055 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go @@ -0,0 +1,141 @@ +// Copyright 2014-2024 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram + +import ( + "fmt" + "strings" +) + +type Log2 struct { + Buckets []uint64 // slot -> count + Min, Max uint64 + Sum uint64 + Count uint64 +} + +func NewLog2(buckets int) *Log2 { + return &Log2{ + Buckets: make([]uint64, buckets), + } +} + +func (h *Log2) Reset() { + for i := range h.Buckets { + h.Buckets[i] = 0 + } + + h.Min = 0 + h.Max = 0 + h.Sum = 0 + h.Count = 0 +} + +func (h *Log2) String() string { + res := new(strings.Builder) + + fmt.Fprintf(res, "[0, %v) => %d\n", 2, h.Buckets[0]) + for i := 1; i < len(h.Buckets)-1; i++ { + v := 2 << i + fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*2, h.Buckets[i]) + } + fmt.Fprintf(res, "[%v, inf) => %d\n", 2<= c { + return 1 << (i + 1) + } + } + return h.Max +} + +func (h *Log2) Add(v uint64) { + if h.Count == 0 { + h.Max = v + h.Min = v + } else { + if v > h.Max { + h.Max = v + } else if v < h.Min { + h.Min = v + } + } + + h.Sum += v + h.Count++ + + var slot int + if v > 0 { + slot = fastLog2(v) + } + + if slot >= len(h.Buckets) { + h.Buckets[len(h.Buckets)-1]++ + } else if slot < 0 { + h.Buckets[0]++ + } else { + h.Buckets[slot]++ + } +} + +/////////////////////////////////////////////////////////////////// + +var log2tab64 = [64]int8{ + 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, 61, + 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, 62, + 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, 56, + 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5, 63, +} + +// FastLog2 implements the FastLog2 function for uint64 values. +func fastLog2(value uint64) int { + value |= value >> 1 + value |= value >> 2 + value |= value >> 4 + value |= value >> 8 + value |= value >> 16 + value |= value >> 32 + + return int(log2tab64[(value*0x03f6eaf2cd271461)>>58]) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go new file mode 100644 index 00000000..45d2da76 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go @@ -0,0 +1,236 @@ +// Copyright 2014-2024 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package histogram + +import ( + "errors" + "fmt" + "math" + "strings" + "sync" +) + +type SyncHistogram[T hvals] struct { + l sync.RWMutex + htype Type + base T + + Buckets []uint64 `json:"buckets"` // slot -> count + Min T `json:"min"` + Max T `json:"max"` + Sum float64 `json:"sum"` + Count uint64 `json:"count"` +} + +func NewSync[T hvals](htype Type, base T, buckets int) *SyncHistogram[T] { + return &SyncHistogram[T]{ + htype: htype, + base: base, + Buckets: make([]uint64, buckets), + } +} + +func (h *SyncHistogram[T]) Reset() { + h.l.Lock() + for i := range h.Buckets { + h.Buckets[i] = 0 + } + + h.Min = 0 + h.Max = 0 + h.Sum = 0 + h.Count = 0 + h.l.Unlock() +} + +func (h *SyncHistogram[T]) Reshape(htype Type, base T, buckets int) { + h.l.Lock() + if h.htype == htype && h.base == base && len(h.Buckets) == buckets { + h.l.Unlock() + return + } + + h.htype = htype + h.base = base + h.Buckets = make([]uint64, buckets) + h.l.Unlock() +} + +func (h *SyncHistogram[T]) String() string { + h.l.RLock() + res := new(strings.Builder) + switch h.htype { + case Linear: + for i := 0; i < len(h.Buckets)-1; i++ { + v := float64(h.base) * float64(i) + fmt.Fprintf(res, "[%v, %v) => %d\n", v, v+float64(h.base), h.Buckets[i]) + } + fmt.Fprintf(res, "[%v, inf) => %d\n", float64(h.base)*float64(len(h.Buckets)-1), h.Buckets[len(h.Buckets)-1]) + case Logarithmic: + fmt.Fprintf(res, "[0, %v) => %d\n", float64(h.base), h.Buckets[0]) + for i := 1; i < len(h.Buckets)-1; i++ { + v := math.Pow(float64(h.base), float64(i)) + fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*float64(h.base), h.Buckets[i]) + } + fmt.Fprintf(res, "[%v, inf) => %d\n", math.Pow(float64(h.base), float64(len(h.Buckets))-1), h.Buckets[len(h.Buckets)-1]) + } + h.l.RUnlock() + return res.String() +} + +func (h *SyncHistogram[T]) Clone() *SyncHistogram[T] { + h.l.Lock() + b := make([]uint64, len(h.Buckets)) + copy(b, h.Buckets) + res := &SyncHistogram[T]{ + htype: h.htype, + base: h.base, + + Buckets: b, + Min: h.Min, + Max: h.Max, + Sum: h.Sum, + Count: h.Count, + } + h.l.Unlock() + return res +} + +func (h *SyncHistogram[T]) CloneAndReset() *SyncHistogram[T] { + h.l.Lock() + b := make([]uint64, len(h.Buckets)) + copy(b, h.Buckets) + res := &SyncHistogram[T]{ + htype: h.htype, + base: h.base, + + Buckets: b, + Min: h.Min, + Max: h.Max, + Sum: h.Sum, + Count: h.Count, + } + + // Reset + for i := range h.Buckets { + h.Buckets[i] = 0 + } + + h.Min = 0 + h.Max = 0 + h.Sum = 0 + h.Count = 0 + h.l.Unlock() + return res +} + +func (h *SyncHistogram[T]) Merge(other *SyncHistogram[T]) error { + h.l.Lock() + other.l.RLock() + if h.base != other.base || h.htype != other.htype || len(h.Buckets) != len(other.Buckets) { + other.l.RUnlock() + h.l.Unlock() + return errors.New("Histograms to not match") + } + + if other.Min < h.Min || h.Min == 0 { + h.Min = other.Min + } + + if other.Max > h.Max { + h.Max = other.Max + } + + h.Sum += other.Sum + h.Count += uint64(other.Count) + + for i := range h.Buckets { + h.Buckets[i] += other.Buckets[i] + } + other.l.RUnlock() + h.l.Unlock() + + return nil +} + +func (h *SyncHistogram[T]) Average() float64 { + h.l.RLock() + if h.Count > 0 { + res := h.Sum / float64(h.Count) + h.l.RUnlock() + return res + } + h.l.RUnlock() + return 0 +} + +func (h *SyncHistogram[T]) Median() T { + h.l.RLock() + var s uint64 = 0 + c := h.Count / 2 + for i, bv := range h.Buckets { + s += bv + if s >= c { + // found the bucket + if h.htype == Linear { + res := T(i+1) * h.base + h.l.RUnlock() + return res + } + res := T(math.Pow(float64(h.base), float64(i+1))) + h.l.RUnlock() + return res + } + } + res := h.Max + h.l.RUnlock() + return res +} + +func (h *SyncHistogram[T]) Add(v T) { + h.l.Lock() + if h.Count == 0 { + h.Max = v + h.Min = v + } else { + if v > h.Max { + h.Max = v + } else if v < h.Min { + h.Min = v + } + } + + h.Sum += float64(v) + h.Count++ + + var slot int + if v > 0 { + switch h.htype { + case Linear: + slot = int(math.Floor(float64(v / T(h.base)))) + case Logarithmic: + slot = int(math.Floor(math.Log(float64(v)) / math.Log(float64(h.base)))) + } + } + + if slot >= len(h.Buckets) { + h.Buckets[len(h.Buckets)-1]++ + } else if slot < 0 { + h.Buckets[0]++ + } else { + h.Buckets[slot]++ + } + h.l.Unlock() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/message.go b/aerospike-tls/vendor-aerospike-client-go/types/message.go new file mode 100644 index 00000000..145e42ce --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/message.go @@ -0,0 +1,107 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types + +import ( + "bytes" + "encoding/binary" + "fmt" +) + +type messageType uint8 + +const ( + // MSG_HEADER_SIZE is a message's header size + MSG_HEADER_SIZE = 8 + + // MSG_INFO defines an info message + MSG_INFO messageType = 1 + // MSG_MESSAGE defines an info message + MSG_MESSAGE = 3 +) + +// MessageHeader is the message's header +type MessageHeader struct { + Version uint8 + Type uint8 + DataLen [6]byte +} + +// Length returns the length of the message +func (msg *MessageHeader) Length() int64 { + return msgLenFromBytes(msg.DataLen) +} + +// Message encapsulates a message sent or received from the Aerospike server +type Message struct { + MessageHeader + + Data []byte +} + +// NewMessage generates a new Message instance. +func NewMessage(mtype messageType, data []byte) *Message { + return &Message{ + MessageHeader: MessageHeader{ + Version: uint8(2), + Type: uint8(mtype), + DataLen: msgLenToBytes(int64(len(data))), + }, + Data: data, + } +} + +const maxAllowedBufferSize = 64 * 1024 * 1024 // 64MiB max + +// Resize changes the internal buffer size for the message. +func (msg *Message) Resize(newSize int64) error { + if newSize > maxAllowedBufferSize || newSize < 0 { + return fmt.Errorf("Requested new buffer size is invalid. Requested: %d, allowed: 0..%d", newSize, maxAllowedBufferSize) + } + if int64(len(msg.Data)) == newSize { + return nil + } + msg.Data = make([]byte, newSize) + return nil +} + +// Serialize returns a byte slice containing the message. +func (msg *Message) Serialize() ([]byte, error) { + msg.DataLen = msgLenToBytes(int64(len(msg.Data))) + buf := bytes.NewBuffer([]byte{}) + if err := binary.Write(buf, binary.BigEndian, msg.MessageHeader); err != nil { + return nil, err + } + if err := binary.Write(buf, binary.BigEndian, msg.Data[:]); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func msgLenFromBytes(buf [6]byte) int64 { + nbytes := append([]byte{0, 0}, buf[:]...) + DataLen := binary.BigEndian.Uint64(nbytes) + return int64(DataLen) +} + +// converts a +func msgLenToBytes(DataLen int64) [6]byte { + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, uint64(DataLen)) + res := [6]byte{} + copy(res[:], b[2:]) + return res +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go b/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go new file mode 100644 index 00000000..292c5841 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go @@ -0,0 +1,33 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package particleType + +// Server particle types. Unsupported types are commented out. +const ( + //revive:disable + NULL = 0 + INTEGER = 1 + FLOAT = 2 + STRING = 3 + BLOB = 4 + DIGEST = 6 + BOOL = 17 + HLL = 18 + MAP = 19 + LIST = 20 + LDT = 21 + GEOJSON = 23 + //revive:enable +) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/pool.go b/aerospike-tls/vendor-aerospike-client-go/types/pool.go new file mode 100644 index 00000000..ddcfd71c --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/pool.go @@ -0,0 +1,72 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types + +import ( + "github.com/aerospike/aerospike-client-go/v7/internal/atomic" +) + +// Pool implements a general purpose fixed-size pool. +type Pool struct { + pool *atomic.Queue + + // New will create a new object + New func(params ...interface{}) interface{} + // IsUsable checks if the object polled from the pool is still fresh and usable + IsUsable func(obj interface{}, params ...interface{}) bool + // CanReturn checkes if the object is eligible to go back to the pool + CanReturn func(obj interface{}) bool + // Finalize will be called when an object is not eligible to go back to the pool. + // Usable to close connections, file handles, ... + Finalize func(obj interface{}) +} + +// NewPool creates a new fixed size pool. +func NewPool(poolSize int) *Pool { + return &Pool{ + pool: atomic.NewQueue(poolSize), + } +} + +// Get returns an element from the pool. +// If the pool is empty, or the returned element is not usable, +// nil or the result of the New function will be returned +func (bp *Pool) Get(params ...interface{}) interface{} { + res := bp.pool.Poll() + if res == nil || (bp.IsUsable != nil && !bp.IsUsable(res, params...)) { + // not usable, so finalize + if res != nil && bp.Finalize != nil { + bp.Finalize(res) + } + + if bp.New != nil { + res = bp.New(params...) + } + } + + return res +} + +// Put will add the elem back to the pool, unless the pool is full. +func (bp *Pool) Put(obj interface{}) { + finalize := true + if bp.CanReturn == nil || bp.CanReturn(obj) { + finalize = !bp.pool.Offer(obj) + } + + if finalize && bp.Finalize != nil { + bp.Finalize(obj) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go b/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go new file mode 100644 index 00000000..5cbef9db --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go @@ -0,0 +1,70 @@ +// Copyright 2014-2021 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pool + +import ( + "math/rand" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +var _ = gg.Describe("BufferPool Test", func() { + + const ( + Min = 1 << 10 + Max = 1 << 16 + ) + + gg.Context("Any size Buffer Pool", func() { + bp := NewTieredBufferPool(Min, Max) + check := func(sz int) { + buf := bp.Get(sz) + + gm.Expect(len(buf)).To(gm.BeNumerically(">=", sz)) + if sz <= Max { + if powerOf2(sz) { + gm.Expect(len(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))))) + gm.Expect(cap(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))))) + } else { + gm.Expect(len(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))+1))) + gm.Expect(cap(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))+1))) + } + } else { + gm.Expect(len(buf)).To(gm.BeNumerically("==", sz)) + } + bp.Put(buf) + } + + gg.It("should return a buffer with correct size", func() { + bp = NewTieredBufferPool(Min, Max) + + for i := 1; i < 24; i++ { + check(1<= 0 && szl < len(bp.pools) { + return szl + } + return -1 +} + +// Get returns a buffer from the pool. If sz is bigger than maxBufferSize, +// a fresh buffer will be created and not taken from the pool. +func (bp *TieredBufferPool) Get(sz int) []byte { + // Short circuit. We know we don't have buffers this size in the pool. + if sz > bp.Max { + return make([]byte, sz, sz) + } + + // do not allocate buffers smaller than a certain size + if sz < bp.Min { + sz = bp.Min + } + + if szl := bp.poolIndex(sz); szl >= 0 { + res := bp.pools[szl].Get().([]byte) + origLen := 1 << (szl + 1) + return res[:origLen] // return the slice to its max capacity + } + + // this line will never be reached, but Go would complain if omitted + return make([]byte, sz, sz) +} + +// Put will put the buffer back in the pool, unless cap(buf) is smaller than Min +// or larger than Max, or the size of the buffer is not a power of 2 +// in which case it will be thrown away. +func (bp *TieredBufferPool) Put(buf []byte) { + sz := cap(buf) + // throw away random non-power of 2 buffer sizes + if len(buf) > bp.Min && len(buf) <= bp.Max && powerOf2(sz) { + if szl := bp.poolIndex(sz); szl >= 0 { + bp.pools[szl].Put(buf) + return + } + } +} + +/////////////////////////////////////////////////////////////////// + +// powerOf2 returns true if a number is an EXACT power of 2. +func powerOf2(sz int) bool { + return sz > 0 && (sz&(sz-1)) == 0 +} + +var log2tab64 = [64]int8{ + 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, 61, + 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, 62, + 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, 56, + 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5, 63, +} + +// fast log2 implementation +func fastLog2(value uint64) int { + value |= value >> 1 + value |= value >> 2 + value |= value >> 4 + value |= value >> 8 + value |= value >> 16 + value |= value >> 32 + + return int(log2tab64[(value*0x03f6eaf2cd271461)>>58]) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go b/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go new file mode 100644 index 00000000..5e37665e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go @@ -0,0 +1,56 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package rand + +import ( + "encoding/binary" + "math/rand" +) + +// Xor128Rand is a random number generator +type Xor128Rand struct { + src [2]uint64 +} + +// NewXorRand creates a XOR Shift random number generator. +func NewXorRand() *Xor128Rand { + return &Xor128Rand{src: [2]uint64{rand.Uint64(), rand.Uint64()}} +} + +// Int64 returns a random int64 number. It can be negative. +func (r *Xor128Rand) Int64() int64 { + return int64(r.Uint64()) +} + +// Uint64 returns a random uint64 number. +func (r *Xor128Rand) Uint64() uint64 { + s1 := r.src[0] + s0 := r.src[1] + r.src[0] = s0 + s1 ^= s1 << 23 + r.src[1] = (s1 ^ s0 ^ (s1 >> 17) ^ (s0 >> 26)) + res := r.src[1] + s0 + return res +} + +// Read will fill the argument slice with random bytes. +// Implements the Reader interface. +func (r *Xor128Rand) Read(p []byte) (n int, err error) { + l := len(p) / 8 + for i := 0; i < l; i += 8 { + binary.PutUvarint(p[i:], r.Uint64()) + } + return len(p), nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/result_code.go b/aerospike-tls/vendor-aerospike-client-go/types/result_code.go new file mode 100644 index 00000000..df79029e --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/result_code.go @@ -0,0 +1,793 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.proto +// See the License for the specific language governing permissions and +// limitations under the License. + +package types + +import "fmt" + +// ResultCode signifies the database operation error codes. +// The positive numbers align with the server side file kvs.h. +type ResultCode int + +const ( + // GRPC_ERROR is wrapped and directly returned from the grpc library + GRPC_ERROR ResultCode = -21 + + // BATCH_FAILED means one or more keys failed in a batch. + BATCH_FAILED ResultCode = -20 + + // NO_RESPONSE means no response was received from the server. + NO_RESPONSE ResultCode = -19 + + // NETWORK_ERROR defines a network error. Checked the wrapped error for detail. + NETWORK_ERROR ResultCode = -18 + + // COMMON_ERROR defines a common, none-aerospike error. Checked the wrapped error for detail. + COMMON_ERROR ResultCode = -17 + + // MAX_RETRIES_EXCEEDED defines max retries limit reached. + MAX_RETRIES_EXCEEDED ResultCode = -16 + + // MAX_ERROR_RATE defines max errors limit reached. + MAX_ERROR_RATE ResultCode = -15 + + // RACK_NOT_DEFINED defines requested Rack for node/namespace was not defined in the cluster. + RACK_NOT_DEFINED ResultCode = -13 + + // INVALID_CLUSTER_PARTITION_MAP defines cluster has an invalid partition map, usually due to bad configuration. + INVALID_CLUSTER_PARTITION_MAP ResultCode = -12 + + // SERVER_NOT_AVAILABLE defines server is not accepting requests. + SERVER_NOT_AVAILABLE ResultCode = -11 + + // CLUSTER_NAME_MISMATCH_ERROR defines cluster Name does not match the ClientPolicy.ClusterName value. + CLUSTER_NAME_MISMATCH_ERROR ResultCode = -10 + + // RECORDSET_CLOSED defines recordset has already been closed or cancelled + RECORDSET_CLOSED ResultCode = -9 + + // NO_AVAILABLE_CONNECTIONS_TO_NODE defines there were no connections available to the node in the pool, and the pool was limited + NO_AVAILABLE_CONNECTIONS_TO_NODE ResultCode = -8 + + // TYPE_NOT_SUPPORTED defines data type is not supported by aerospike server. + TYPE_NOT_SUPPORTED ResultCode = -7 + + // COMMAND_REJECTED defines info Command was rejected by the server. + COMMAND_REJECTED ResultCode = -6 + + // QUERY_TERMINATED defines query was terminated by user. + QUERY_TERMINATED ResultCode = -5 + + // SCAN_TERMINATED defines scan was terminated by user. + SCAN_TERMINATED ResultCode = -4 + + // INVALID_NODE_ERROR defines chosen node is not currently active. + INVALID_NODE_ERROR ResultCode = -3 + + // PARSE_ERROR defines client parse error. + PARSE_ERROR ResultCode = -2 + + // SERIALIZE_ERROR defines client serialization error. + SERIALIZE_ERROR ResultCode = -1 + + // OK defines operation was successful. + OK ResultCode = 0 + + // SERVER_ERROR defines unknown server failure. + SERVER_ERROR ResultCode = 1 + + // KEY_NOT_FOUND_ERROR defines on retrieving, touching or replacing a record that doesn't exist. + KEY_NOT_FOUND_ERROR ResultCode = 2 + + // GENERATION_ERROR defines on modifying a record with unexpected generation. + GENERATION_ERROR ResultCode = 3 + + // PARAMETER_ERROR defines bad parameter(s) were passed in database operation call. + PARAMETER_ERROR ResultCode = 4 + + // KEY_EXISTS_ERROR defines on create-only (write unique) operations on a record that already + // exists. + KEY_EXISTS_ERROR ResultCode = 5 + + // BIN_EXISTS_ERROR defines bin already exists on a create-only operation. + BIN_EXISTS_ERROR ResultCode = 6 + + // CLUSTER_KEY_MISMATCH defines expected cluster ID was not received. + CLUSTER_KEY_MISMATCH ResultCode = 7 + + // SERVER_MEM_ERROR defines server has run out of memory. + SERVER_MEM_ERROR ResultCode = 8 + + // TIMEOUT defines client or server has timed out. + TIMEOUT ResultCode = 9 + + // ALWAYS_FORBIDDEN defines operation not allowed in current configuration. + ALWAYS_FORBIDDEN ResultCode = 10 + + // PARTITION_UNAVAILABLE defines partition is unavailable. + PARTITION_UNAVAILABLE ResultCode = 11 + + // BIN_TYPE_ERROR defines operation is not supported with configured bin type (single-bin or + // multi-bin). + BIN_TYPE_ERROR ResultCode = 12 + + // RECORD_TOO_BIG defines record size exceeds limit. + RECORD_TOO_BIG ResultCode = 13 + + // KEY_BUSY defines too many concurrent operations on the same record. + KEY_BUSY ResultCode = 14 + + // SCAN_ABORT defines scan aborted by server. + SCAN_ABORT ResultCode = 15 + + // UNSUPPORTED_FEATURE defines unsupported Server Feature (e.g. Scan + UDF) + UNSUPPORTED_FEATURE ResultCode = 16 + + // BIN_NOT_FOUND defines bin not found on update-only operation. + BIN_NOT_FOUND ResultCode = 17 + + // DEVICE_OVERLOAD defines device not keeping up with writes. + DEVICE_OVERLOAD ResultCode = 18 + + // KEY_MISMATCH defines key type mismatch. + KEY_MISMATCH ResultCode = 19 + + // INVALID_NAMESPACE defines invalid namespace. + INVALID_NAMESPACE ResultCode = 20 + + // BIN_NAME_TOO_LONG defines bin name length greater than 14 characters, + // or maximum number of unique bin names are exceeded. + BIN_NAME_TOO_LONG ResultCode = 21 + + // FAIL_FORBIDDEN defines operation not allowed at this time. + FAIL_FORBIDDEN ResultCode = 22 + + // FAIL_ELEMENT_NOT_FOUND defines element Not Found in CDT + FAIL_ELEMENT_NOT_FOUND ResultCode = 23 + + // FAIL_ELEMENT_EXISTS defines element Already Exists in CDT + FAIL_ELEMENT_EXISTS ResultCode = 24 + + // ENTERPRISE_ONLY defines attempt to use an Enterprise feature on a Community server or a server + // without the applicable feature key. + ENTERPRISE_ONLY ResultCode = 25 + + // OP_NOT_APPLICABLE defines the operation cannot be applied to the current bin value on the server. + OP_NOT_APPLICABLE ResultCode = 26 + + // FILTERED_OUT defines the transaction was not performed because the filter was false. + FILTERED_OUT ResultCode = 27 + + // LOST_CONFLICT defines write command loses conflict to XDR. + LOST_CONFLICT = 28 + + // Write can't complete until XDR finishes shipping. + XDR_KEY_BUSY = 32 + + // QUERY_END defines there are no more records left for query. + QUERY_END ResultCode = 50 + + // SECURITY_NOT_SUPPORTED defines security type not supported by connected server. + SECURITY_NOT_SUPPORTED ResultCode = 51 + + // SECURITY_NOT_ENABLED defines administration command is invalid. + SECURITY_NOT_ENABLED ResultCode = 52 + + // SECURITY_SCHEME_NOT_SUPPORTED defines administration field is invalid. + SECURITY_SCHEME_NOT_SUPPORTED ResultCode = 53 + + // INVALID_COMMAND defines administration command is invalid. + INVALID_COMMAND ResultCode = 54 + + // INVALID_FIELD defines administration field is invalid. + INVALID_FIELD ResultCode = 55 + + // ILLEGAL_STATE defines security protocol not followed. + ILLEGAL_STATE ResultCode = 56 + + // INVALID_USER defines user name is invalid. + INVALID_USER ResultCode = 60 + + // USER_ALREADY_EXISTS defines user was previously created. + USER_ALREADY_EXISTS ResultCode = 61 + + // INVALID_PASSWORD defines password is invalid. + INVALID_PASSWORD ResultCode = 62 + + // EXPIRED_PASSWORD defines security credential is invalid. + EXPIRED_PASSWORD ResultCode = 63 + + // FORBIDDEN_PASSWORD defines forbidden password (e.g. recently used) + FORBIDDEN_PASSWORD ResultCode = 64 + + // INVALID_CREDENTIAL defines security credential is invalid. + INVALID_CREDENTIAL ResultCode = 65 + + // EXPIRED_SESSION defines login session expired. + EXPIRED_SESSION ResultCode = 66 + + // INVALID_ROLE defines role name is invalid. + INVALID_ROLE ResultCode = 70 + + // ROLE_ALREADY_EXISTS defines role already exists. + ROLE_ALREADY_EXISTS ResultCode = 71 + + // INVALID_PRIVILEGE defines privilege is invalid. + INVALID_PRIVILEGE ResultCode = 72 + + // INVALID_WHITELIST defines invalid IP address whiltelist + INVALID_WHITELIST = 73 + + // QUOTAS_NOT_ENABLED defines Quotas not enabled on server. + QUOTAS_NOT_ENABLED = 74 + + // INVALID_QUOTA defines invalid quota value. + INVALID_QUOTA = 75 + + // NOT_AUTHENTICATED defines user must be authentication before performing database operations. + NOT_AUTHENTICATED ResultCode = 80 + + // ROLE_VIOLATION defines user does not posses the required role to perform the database operation. + ROLE_VIOLATION ResultCode = 81 + + // NOT_WHITELISTED defines command not allowed because sender IP address not whitelisted. + NOT_WHITELISTED = 82 + + // QUOTA_EXCEEDED defines Quota exceeded. + QUOTA_EXCEEDED = 83 + + // UDF_BAD_RESPONSE defines a user defined function returned an error code. + UDF_BAD_RESPONSE ResultCode = 100 + + // BATCH_DISABLED defines batch functionality has been disabled. + BATCH_DISABLED ResultCode = 150 + + // BATCH_MAX_REQUESTS_EXCEEDED defines batch max requests have been exceeded. + BATCH_MAX_REQUESTS_EXCEEDED ResultCode = 151 + + // BATCH_QUEUES_FULL defines all batch queues are full. + BATCH_QUEUES_FULL ResultCode = 152 + + // GEO_INVALID_GEOJSON defines invalid GeoJSON on insert/update + GEO_INVALID_GEOJSON ResultCode = 160 + + // INDEX_FOUND defines secondary index already exists. + INDEX_FOUND ResultCode = 200 + + // INDEX_NOTFOUND defines requested secondary index does not exist. + INDEX_NOTFOUND ResultCode = 201 + + // INDEX_OOM defines secondary index memory space exceeded. + INDEX_OOM ResultCode = 202 + + // INDEX_NOTREADABLE defines secondary index not available. + INDEX_NOTREADABLE ResultCode = 203 + + // INDEX_GENERIC defines generic secondary index error. + INDEX_GENERIC ResultCode = 204 + + // INDEX_NAME_MAXLEN defines index name maximum length exceeded. + INDEX_NAME_MAXLEN ResultCode = 205 + + // INDEX_MAXCOUNT defines maximum number of indexes exceeded. + INDEX_MAXCOUNT ResultCode = 206 + + // QUERY_ABORTED defines secondary index query aborted. + QUERY_ABORTED ResultCode = 210 + + // QUERY_QUEUEFULL defines secondary index queue full. + QUERY_QUEUEFULL ResultCode = 211 + + // QUERY_TIMEOUT defines secondary index query timed out on server. + QUERY_TIMEOUT ResultCode = 212 + + // QUERY_GENERIC defines generic query error. + QUERY_GENERIC ResultCode = 213 + + // QUERY_NETIO_ERR defines query NetIO error on server + QUERY_NETIO_ERR ResultCode = 214 + + // QUERY_DUPLICATE defines duplicate TaskId sent for the statement + QUERY_DUPLICATE ResultCode = 215 + + // AEROSPIKE_ERR_UDF_NOT_FOUND defines uDF does not exist. + AEROSPIKE_ERR_UDF_NOT_FOUND ResultCode = 1301 + + // AEROSPIKE_ERR_LUA_FILE_NOT_FOUND defines lUA file does not exist. + AEROSPIKE_ERR_LUA_FILE_NOT_FOUND ResultCode = 1302 +) + +// ResultCodeToString returns a human readable errors message based on the result code. +func ResultCodeToString(resultCode ResultCode) string { + switch ResultCode(resultCode) { + case GRPC_ERROR: + return "GRPC error" + case BATCH_FAILED: + return "one or more keys failed in a batch" + + case NO_RESPONSE: + return "no response was received from the server" + + case NETWORK_ERROR: + return "network error. Checked the wrapped error for detail" + + case COMMON_ERROR: + return "common, none-aerospike error. Checked the wrapped error for detail" + + case MAX_RETRIES_EXCEEDED: + return "Max retries exceeded" + + case MAX_ERROR_RATE: + return "Max errors limit reached for node" + + case RACK_NOT_DEFINED: + return "Requested Rack for node/namespace was not defined in the cluster." + + case INVALID_CLUSTER_PARTITION_MAP: + return "Cluster has an invalid partition map, usually due to bad configuration." + + case SERVER_NOT_AVAILABLE: + return "Server is not accepting requests." + + case CLUSTER_NAME_MISMATCH_ERROR: + return "Cluster Name does not match the ClientPolicy.ClusterName value" + + case RECORDSET_CLOSED: + return "Recordset has already been closed or cancelled." + + case NO_AVAILABLE_CONNECTIONS_TO_NODE: + return "No available connections to the node. Connection Pool was empty, and limited to certain number of connections." + + case TYPE_NOT_SUPPORTED: + return "Type cannot be converted to Value Type." + + case COMMAND_REJECTED: + return "command rejected" + + case QUERY_TERMINATED: + return "Query terminated" + + case SCAN_TERMINATED: + return "Scan terminated" + + case INVALID_NODE_ERROR: + return "Invalid node" + + case PARSE_ERROR: + return "Parse error" + + case SERIALIZE_ERROR: + return "Serialize error" + + case OK: + return "ok" + + case SERVER_ERROR: + return "Server error" + + case KEY_NOT_FOUND_ERROR: + return "Key not found" + + case GENERATION_ERROR: + return "Generation error" + + case PARAMETER_ERROR: + return "Parameter error" + + case KEY_EXISTS_ERROR: + return "Key already exists" + + case BIN_EXISTS_ERROR: + return "Bin already exists" + + case CLUSTER_KEY_MISMATCH: + return "Cluster key mismatch" + + case SERVER_MEM_ERROR: + return "Server memory error" + + case TIMEOUT: + return "Timeout" + + case ALWAYS_FORBIDDEN: + return "Operation not allowed in current configuration." + + case PARTITION_UNAVAILABLE: + return "Partition not available" + + case BIN_TYPE_ERROR: + return "Bin type error" + + case RECORD_TOO_BIG: + return "Record too big" + + case KEY_BUSY: + return "Hot key" + + case SCAN_ABORT: + return "Scan aborted" + + case UNSUPPORTED_FEATURE: + return "Unsupported Server Feature" + + case BIN_NOT_FOUND: + return "Bin not found" + + case DEVICE_OVERLOAD: + return "Device overload" + + case KEY_MISMATCH: + return "Key mismatch" + + case INVALID_NAMESPACE: + return "Namespace not found" + + case BIN_NAME_TOO_LONG: + return "Bin name length greater than 15 characters, or maximum number of unique bin names are exceeded" + + case FAIL_FORBIDDEN: + return "Operation not allowed at this time" + + case FAIL_ELEMENT_NOT_FOUND: + return "Element not found." + + case FAIL_ELEMENT_EXISTS: + return "Element exists" + + case ENTERPRISE_ONLY: + return "Enterprise only" + + case OP_NOT_APPLICABLE: + return "Operation not applicable" + + case FILTERED_OUT: + return "Transaction filtered out" + + case LOST_CONFLICT: + return "Write command loses conflict to XDR." + + case XDR_KEY_BUSY: + return "Write can't complete until XDR finishes shipping." + + case QUERY_END: + return "Query end" + + case SECURITY_NOT_SUPPORTED: + return "Security not supported" + + case SECURITY_NOT_ENABLED: + return "Security not enabled" + + case SECURITY_SCHEME_NOT_SUPPORTED: + return "Security scheme not supported" + + case INVALID_COMMAND: + return "Invalid command" + + case INVALID_FIELD: + return "Invalid field" + + case ILLEGAL_STATE: + return "Illegal state" + + case INVALID_USER: + return "Invalid user" + + case USER_ALREADY_EXISTS: + return "User already exists" + + case INVALID_PASSWORD: + return "Invalid password" + + case EXPIRED_PASSWORD: + return "Expired password" + + case FORBIDDEN_PASSWORD: + return "Forbidden password" + + case INVALID_CREDENTIAL: + return "Invalid credential" + + case EXPIRED_SESSION: + return "Login session expired" + + case INVALID_ROLE: + return "Invalid role" + + case ROLE_ALREADY_EXISTS: + return "Role already exists" + + case INVALID_PRIVILEGE: + return "Invalid privilege" + + case INVALID_WHITELIST: + return "Invalid whitelist" + + case QUOTAS_NOT_ENABLED: + return "Quotas not enabled" + + case INVALID_QUOTA: + return "Invalid quota" + + case NOT_AUTHENTICATED: + return "Not authenticated" + + case ROLE_VIOLATION: + return "Role violation" + + case NOT_WHITELISTED: + return "Command not whitelisted" + + case QUOTA_EXCEEDED: + return "Quota exceeded" + + case UDF_BAD_RESPONSE: + return "UDF returned error" + + case BATCH_DISABLED: + return "Batch functionality has been disabled" + + case BATCH_MAX_REQUESTS_EXCEEDED: + return "Batch max requests have been exceeded" + + case BATCH_QUEUES_FULL: + return "All batch queues are full" + + case GEO_INVALID_GEOJSON: + return "Invalid GeoJSON on insert/update" + + case INDEX_FOUND: + return "Index already exists" + + case INDEX_NOTFOUND: + return "Index not found" + + case INDEX_OOM: + return "Index out of memory" + + case INDEX_NOTREADABLE: + return "Index not readable" + + case INDEX_GENERIC: + return "Index error" + + case INDEX_NAME_MAXLEN: + return "Index name max length exceeded" + + case INDEX_MAXCOUNT: + return "Index count exceeds max" + + case QUERY_ABORTED: + return "Query aborted" + + case QUERY_QUEUEFULL: + return "Query queue full" + + case QUERY_TIMEOUT: + return "Query timeout" + + case QUERY_GENERIC: + return "Query error" + + case QUERY_NETIO_ERR: + return "Query NetIO error on server" + + case QUERY_DUPLICATE: + return "Duplicate TaskId sent for the statement" + + case AEROSPIKE_ERR_UDF_NOT_FOUND: + return "UDF does not exist." + + case AEROSPIKE_ERR_LUA_FILE_NOT_FOUND: + return "LUA package/file does not exist." + + default: + return fmt.Sprintf("Error code (%v) not available yet - please file an issue on github.", resultCode) + } +} + +func (rc ResultCode) String() string { + switch rc { + case GRPC_ERROR: + return "GRPC error" + case BATCH_FAILED: + return "BATCH_FAILED" + case NO_RESPONSE: + return "NO_RESPONSE" + case NETWORK_ERROR: + return "NETWORK_ERROR" + case COMMON_ERROR: + return "COMMON_ERROR" + case MAX_RETRIES_EXCEEDED: + return "MAX_RETRIES_EXCEEDED" + case MAX_ERROR_RATE: + return "MAX_ERROR_RATE" + case RACK_NOT_DEFINED: + return "RACK_NOT_DEFINED" + case INVALID_CLUSTER_PARTITION_MAP: + return "INVALID_CLUSTER_PARTITION_MAP" + case SERVER_NOT_AVAILABLE: + return "SERVER_NOT_AVAILABLE" + case CLUSTER_NAME_MISMATCH_ERROR: + return "CLUSTER_NAME_MISMATCH_ERROR" + case RECORDSET_CLOSED: + return "RECORDSET_CLOSED" + case NO_AVAILABLE_CONNECTIONS_TO_NODE: + return "NO_AVAILABLE_CONNECTIONS_TO_NODE" + case TYPE_NOT_SUPPORTED: + return "TYPE_NOT_SUPPORTED" + case COMMAND_REJECTED: + return "COMMAND_REJECTED" + case QUERY_TERMINATED: + return "QUERY_TERMINATED" + case SCAN_TERMINATED: + return "SCAN_TERMINATED" + case INVALID_NODE_ERROR: + return "INVALID_NODE_ERROR" + case PARSE_ERROR: + return "PARSE_ERROR" + case SERIALIZE_ERROR: + return "SERIALIZE_ERROR" + case OK: + return "OK" + case SERVER_ERROR: + return "SERVER_ERROR" + case KEY_NOT_FOUND_ERROR: + return "KEY_NOT_FOUND_ERROR" + case GENERATION_ERROR: + return "GENERATION_ERROR" + case PARAMETER_ERROR: + return "PARAMETER_ERROR" + case KEY_EXISTS_ERROR: + return "KEY_EXISTS_ERROR" + case BIN_EXISTS_ERROR: + return "BIN_EXISTS_ERROR" + case CLUSTER_KEY_MISMATCH: + return "CLUSTER_KEY_MISMATCH" + case SERVER_MEM_ERROR: + return "SERVER_MEM_ERROR" + case TIMEOUT: + return "TIMEOUT" + case ALWAYS_FORBIDDEN: + return "ALWAYS_FORBIDDEN" + case PARTITION_UNAVAILABLE: + return "PARTITION_UNAVAILABLE" + case BIN_TYPE_ERROR: + return "BIN_TYPE_ERROR" + case RECORD_TOO_BIG: + return "RECORD_TOO_BIG" + case KEY_BUSY: + return "KEY_BUSY" + case SCAN_ABORT: + return "SCAN_ABORT" + case UNSUPPORTED_FEATURE: + return "UNSUPPORTED_FEATURE" + case BIN_NOT_FOUND: + return "BIN_NOT_FOUND" + case DEVICE_OVERLOAD: + return "DEVICE_OVERLOAD" + case KEY_MISMATCH: + return "KEY_MISMATCH" + case INVALID_NAMESPACE: + return "INVALID_NAMESPACE" + case BIN_NAME_TOO_LONG: + return "BIN_NAME_TOO_LONG" + case FAIL_FORBIDDEN: + return "FAIL_FORBIDDEN" + case FAIL_ELEMENT_NOT_FOUND: + return "FAIL_ELEMENT_NOT_FOUND" + case FAIL_ELEMENT_EXISTS: + return "FAIL_ELEMENT_EXISTS" + case ENTERPRISE_ONLY: + return "ENTERPRISE_ONLY" + case OP_NOT_APPLICABLE: + return "OP_NOT_APPLICABLE" + case FILTERED_OUT: + return "FILTERED_OUT" + case LOST_CONFLICT: + return "LOST_CONFLICT" + case XDR_KEY_BUSY: + return "XDR_KEY_BUSY" + case QUERY_END: + return "QUERY_END" + case SECURITY_NOT_SUPPORTED: + return "SECURITY_NOT_SUPPORTED" + case SECURITY_NOT_ENABLED: + return "SECURITY_NOT_ENABLED" + case SECURITY_SCHEME_NOT_SUPPORTED: + return "SECURITY_SCHEME_NOT_SUPPORTED" + case INVALID_COMMAND: + return "INVALID_COMMAND" + case INVALID_FIELD: + return "INVALID_FIELD" + case ILLEGAL_STATE: + return "ILLEGAL_STATE" + case INVALID_USER: + return "INVALID_USER" + case USER_ALREADY_EXISTS: + return "USER_ALREADY_EXISTS" + case INVALID_PASSWORD: + return "INVALID_PASSWORD" + case EXPIRED_PASSWORD: + return "EXPIRED_PASSWORD" + case FORBIDDEN_PASSWORD: + return "FORBIDDEN_PASSWORD" + case INVALID_CREDENTIAL: + return "INVALID_CREDENTIAL" + case EXPIRED_SESSION: + return "EXPIRED_SESSION" + case INVALID_ROLE: + return "INVALID_ROLE" + case ROLE_ALREADY_EXISTS: + return "ROLE_ALREADY_EXISTS" + case INVALID_PRIVILEGE: + return "INVALID_PRIVILEGE" + case INVALID_WHITELIST: + return "INVALID_WHITELIST" + case QUOTAS_NOT_ENABLED: + return "QUOTAS_NOT_ENABLED" + case INVALID_QUOTA: + return "INVALID_QUOTA" + case NOT_AUTHENTICATED: + return "NOT_AUTHENTICATED" + case ROLE_VIOLATION: + return "ROLE_VIOLATION" + case NOT_WHITELISTED: + return "NOT_WHITELISTED" + case QUOTA_EXCEEDED: + return "QUOTA_EXCEEDED" + case UDF_BAD_RESPONSE: + return "UDF_BAD_RESPONSE" + case BATCH_DISABLED: + return "BATCH_DISABLED" + case BATCH_MAX_REQUESTS_EXCEEDED: + return "BATCH_MAX_REQUESTS_EXCEEDED" + case BATCH_QUEUES_FULL: + return "BATCH_QUEUES_FULL" + case GEO_INVALID_GEOJSON: + return "GEO_INVALID_GEOJSON" + case INDEX_FOUND: + return "INDEX_FOUND" + case INDEX_NOTFOUND: + return "INDEX_NOTFOUND" + case INDEX_OOM: + return "INDEX_OOM" + case INDEX_NOTREADABLE: + return "INDEX_NOTREADABLE" + case INDEX_GENERIC: + return "INDEX_GENERIC" + case INDEX_NAME_MAXLEN: + return "INDEX_NAME_MAXLEN" + case INDEX_MAXCOUNT: + return "INDEX_MAXCOUNT" + case QUERY_ABORTED: + return "QUERY_ABORTED" + case QUERY_QUEUEFULL: + return "QUERY_QUEUEFULL" + case QUERY_TIMEOUT: + return "QUERY_TIMEOUT" + case QUERY_GENERIC: + return "QUERY_GENERIC" + case QUERY_NETIO_ERR: + return "QUERY_NETIO_ERR" + case QUERY_DUPLICATE: + return "QUERY_DUPLICATE" + case AEROSPIKE_ERR_UDF_NOT_FOUND: + return "AEROSPIKE_ERR_UDF_NOT_FOUND" + case AEROSPIKE_ERR_LUA_FILE_NOT_FOUND: + return "AEROSPIKE_ERR_LUA_FILE_NOT_FOUND" + default: + return fmt.Sprintf("invalid ResultCode %d. Please report on https://github.com/aerospike/aerospike-client.go", rc) + } +} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/types.go b/aerospike-tls/vendor-aerospike-client-go/types/types.go new file mode 100644 index 00000000..0bbcf9cc --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/types.go @@ -0,0 +1,15 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types diff --git a/aerospike-tls/vendor-aerospike-client-go/types/types_test.go b/aerospike-tls/vendor-aerospike-client-go/types/types_test.go new file mode 100644 index 00000000..784f01b4 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/types/types_test.go @@ -0,0 +1,27 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types_test + +import ( + "testing" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +func TestTypes(t *testing.T) { + gm.RegisterFailHandler(gg.Fail) + gg.RunSpecs(t, "Aerospike Client Library Types Suite") +} diff --git a/aerospike-tls/vendor-aerospike-client-go/udf.go b/aerospike-tls/vendor-aerospike-client-go/udf.go new file mode 100644 index 00000000..366d5a62 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/udf.go @@ -0,0 +1,11 @@ +package aerospike + +// UDF carries information about UDFs on the server +type UDF struct { + // Filename of the UDF + Filename string + // Hash digest of the UDF + Hash string + // Language of UDF + Language Language +} diff --git a/aerospike-tls/vendor-aerospike-client-go/udf_test.go b/aerospike-tls/vendor-aerospike-client-go/udf_test.go new file mode 100644 index 00000000..29067377 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/udf_test.go @@ -0,0 +1,441 @@ +//go:build !app_engine + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike_test + +import ( + "math" + "math/rand" + "strings" + "sync" + "time" + + as "github.com/aerospike/aerospike-client-go/v7" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" +) + +const udfBody = `function testFunc1(rec, div) + local ret = map() -- Initialize the return value (a map) + + local x = rec['bin1'] -- Get the value from record bin named "bin1" + + rec['bin2'] = math.floor(x / div) -- Set the value in record bin named "bin2" + + aerospike:update(rec) -- Update the main record + + ret['status'] = 'OK' -- Populate the return status + return ret -- Return the Return value and/or status +end` + +const udfDelete = `function deleteRecord(rec) + aerospike:remove(rec) -- Delete main record, Populate the return status +end` + +const udfEcho = `function echo(rec, param) + local ret = map() + ret['val'] = param + ret['str_val'] = tostring(param) + return ret -- return the same value to make sure serializations are working well +end` + +const udfCreateWithSendKey = `function createRecWithSendKey(rec) + rec['otherBin'] = 1 + aerospike:create(rec) +end + +function getRecordKeyValue(rec) + local r = record.key(rec) + aerospike:remove(rec) + return r +end +` + +const invalidUdfBody = `function testFunc1(rec, div) + asdf + returned ret -- Return the Return value and/or status +end` + +// ALL tests are isolated by SetName and Key, which are 50 random characters +var _ = gg.Describe("UDF/Query tests", func() { + + var err error + var ns = *namespace + var set = randString(50) + var key *as.Key + var wpolicy = as.NewWritePolicy(0, 0) + + const keyCount = 1000 + bin1 := as.NewBin("bin1", rand.Intn(math.MaxInt16)) + bin2 := as.NewBin("bin2", 1) + + gg.BeforeEach(func() { + if *dbaas { + gg.Skip("Not supported in DBAAS environment") + } + + if *proxy { + gg.Skip("Not supported in proxy environment") + } + }) + + gg.It("must Register a UDF", func() { + regTask, err := client.RegisterUDF(wpolicy, []byte(udfBody), "udf1.lua", as.LUA) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is created + gm.Expect(<-regTask.OnComplete()).NotTo(gm.HaveOccurred()) + }) + + gg.It("must parse invalid UDF error", func() { + _, err := client.RegisterUDF(wpolicy, []byte(invalidUdfBody), "invalid_udf1.lua", as.LUA) + gm.Expect(err).To(gm.HaveOccurred()) + gm.Expect(err.Error()).To(gm.HaveSuffix(`compile_error +File: invalid_udf1.lua +Line: 3 +Message: syntax error near 'returned'`)) + }) + + gg.It("must run a UDF on a single record", func() { + registerUDF(udfBody, "udf1.lua") + + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + nsup := nsupPeriod(ns) + + var wpolicy *as.WritePolicy + if nsup > 0 { + wpolicy = as.NewWritePolicy(0, 1000) + } else { + wpolicy = as.NewWritePolicy(0, 0) + } + res, err := client.Execute(wpolicy, key, "udf1", "testFunc1", as.NewValue(2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res).To(gm.Equal(map[interface{}]interface{}{"status": "OK"})) + + time.Sleep(3 * time.Second) + + // read all data and make sure it is consistent + rec, err := client.Get(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + if nsup > 0 { + gm.Expect(rec.Expiration).To(gm.BeNumerically("<=", 997)) + gm.Expect(rec.Expiration).To(gm.BeNumerically(">", 900)) // give a bit of leeway for slow testing VMs + } + + gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) + gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin1.Value.GetObject().(int) / 2)) + }) + + gg.It("must run a UDF to create single record and persist the original key value", func() { + registerUDF(udfCreateWithSendKey, "sendKey.lua") + + tSet := randString(50) + key, err := as.NewKey(ns, tSet, -1) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // make sure the record doesn't exist yet + _, err = client.Delete(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + exists, err := client.Exists(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.BeFalse()) + + wp := as.NewWritePolicy(0, 0) + wp.SendKey = true + _, err = client.Execute(wp, key, "sendKey", "createRecWithSendKey") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // read all data and make sure it is consistent + exists, err = client.Exists(nil, key) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(exists).To(gm.BeTrue()) + + res, err := client.Execute(nil, key, "sendKey", "getRecordKeyValue") + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res).To(gm.Equal(-1)) + }) + + gg.It("must list all udfs on the server", func() { + udfList, err := client.ListUDF(nil) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(len(udfList)).To(gm.BeNumerically(">", 0)) + }) + + gg.It("must drop a udf on the server", func() { + registerUDF(udfBody, "udfToBeDropped.lua") + + delTask, err := client.RemoveUDF(wpolicy, "udfToBeDropped.lua") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is deleted + gm.Expect(<-delTask.OnComplete()).NotTo(gm.HaveOccurred()) + }) + + gg.Context("must run the UDF on all records", func() { + + var scanPolicy = as.NewScanPolicy() + var queryPolicy = as.NewQueryPolicy() + + gg.BeforeEach(func() { + set = randString(50) + for i := 0; i < keyCount; i++ { + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + err = client.PutBins(wpolicy, key, bin1, bin2) + gm.Expect(err).ToNot(gm.HaveOccurred()) + } + }) + + gg.It("must run a UDF on all records", func() { + registerUDF(udfBody, "udf1.lua") + + // run the UDF 3 times consecutively + for i := 1; i <= 3; i++ { + statement := as.NewStatement(ns, set) + exTask, err := client.ExecuteUDF(queryPolicy, statement, "udf1", "testFunc1", as.NewValue(i*2)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is run on all records + err = <-exTask.OnComplete() + gm.Expect(err).ToNot(gm.HaveOccurred()) + + time.Sleep(3 * time.Second) + + // read all data and make sure it is consistent + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + for fullRec := range recordset.Results() { + gm.Expect(fullRec.Err).ToNot(gm.HaveOccurred()) + gm.Expect(fullRec.Record.Bins[bin2.Name]).To(gm.Equal(bin1.Value.GetObject().(int) / (i * 2))) + } + } + }) + + gg.It("must run a DeleteUDF on a range of records", func() { + createIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.NUMERIC) + defer dropIndex(nil, ns, set, set+bin1.Name) + + registerUDF(udfDelete, "udfDelete.lua") + + // a new record that is not in the range + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + err = client.PutBins(wpolicy, key, as.NewBin(bin1.Name, math.MaxInt16+1)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + statement := as.NewStatement(ns, set) + statement.SetFilter(as.NewRangeFilter(bin1.Name, 0, math.MaxInt16)) + exTask, err := client.ExecuteUDF(queryPolicy, statement, "udfDelete", "deleteRecord") + gm.Expect(err).ToNot(gm.HaveOccurred()) + + // wait until UDF is run on all records + gm.Expect(<-exTask.OnComplete()).ToNot(gm.HaveOccurred()) + + time.Sleep(3 * time.Second) + + // read all data and make sure it is consistent + recordset, err := client.ScanAll(scanPolicy, ns, set) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + i := 0 + for fullRec := range recordset.Results() { + gm.Expect(fullRec.Err).ToNot(gm.HaveOccurred()) + i++ + // only one record should be returned + gm.Expect(fullRec.Record.Bins[bin1.Name]).To(gm.Equal(math.MaxInt16 + 1)) + } + gm.Expect(i).To(gm.Equal(1)) + }) + }) // context + + gg.Context("must serialize parameters and return values sensibly", func() { + + var udfReg sync.Once + + gg.BeforeEach(func() { + udfReg.Do(func() { + registerUDF(udfEcho, "udfEcho.lua") + + // a new record that is not in the range + key, err = as.NewKey(ns, set, randString(50)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + }) + }) + + testMatrix := map[interface{}]interface{}{ + math.MinInt64: math.MinInt64, + // math.MaxInt64: int64(math.MaxInt64), // TODO: Wrong serialization on server - sign-bit is wrong + math.MinInt32: math.MinInt32, // TODO: Wrong serialization type on server + math.MaxUint32: math.MaxUint32, + math.MinInt16: math.MinInt16, + math.MaxInt16: math.MaxInt16, + math.MaxUint16: math.MaxUint16, + math.MinInt8: math.MinInt8, + math.MaxInt8: math.MaxInt8, + math.MaxUint8: math.MaxUint8, + -1: -1, + 0: 0, + "": "", + strings.Repeat("s", 1): strings.Repeat("s", 1), + strings.Repeat("s", 10): strings.Repeat("s", 10), + strings.Repeat("s", 100): strings.Repeat("s", 100), + strings.Repeat("s", 1000): strings.Repeat("s", 1000), + strings.Repeat("s", 10000): strings.Repeat("s", 10000), + strings.Repeat("s", 33781): strings.Repeat("s", 33781), + strings.Repeat("s", 100000): strings.Repeat("s", 100000), + "Hello, 世界": "Hello, 世界", + } + + gg.It("must serialize nil values to echo function and get the same value back", func() { + + res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(nil)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.BeNil()) + + }) // it + + gg.It("must serialize values to echo function and get the same value back", func() { + + for k, v := range testMatrix { + res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(k)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.Equal(v)) + } + + }) // it + + gg.It("must serialize list values to echo function and get the same value back", func() { + + v := []interface{}{ + nil, + math.MinInt64, + math.MinInt32, + math.MinInt16, + math.MinInt8, + -1, + 0, + 1, + math.MaxInt8, + math.MaxUint8, + math.MaxInt16, + math.MaxUint16, + math.MaxInt32, + math.MaxUint32, + math.MaxInt64, + uint64(math.MaxUint64), // This value is returned as a negative integer from the server + "", + "Hello, 世界", + } + + vExpected := []interface{}{ + nil, + int(math.MinInt64), + int(math.MinInt32), + int(math.MinInt16), + int(math.MinInt8), + int(-1), + int(0), + int(1), + int(math.MaxInt8), + int(math.MaxUint8), + int(math.MaxInt16), + int(math.MaxUint16), + int(math.MaxInt32), + int(math.MaxUint32), + math.MaxInt64, + int(-1), + "", + "Hello, 世界", + } + + res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(v)) + + // for i := range v { + // fmt.Printf("%v => %T\n", res.(map[interface{}]interface{})["val"].([]interface{})[i], res.(map[interface{}]interface{})["val"].([]interface{})[i]) + // fmt.Printf("%v => %T\n", vExpected[i], vExpected[i]) + // } + + gm.Expect(err).ToNot(gm.HaveOccurred()) + gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.Equal(vExpected)) + + }) // it + + gg.It("must serialize map values to echo function and get the same value back", func() { + + v := map[interface{}]interface{}{ + // nil: nil, + math.MinInt64: math.MinInt64, + math.MinInt32: math.MinInt32, + math.MinInt16: math.MinInt16, + math.MinInt8: math.MinInt8, + -1: -1, + 0: 0, + 1: 1, + math.MaxInt8: math.MaxInt8, + math.MaxUint8: math.MaxUint8, + math.MaxInt16: math.MaxInt16, + math.MaxUint16: math.MaxUint16, + math.MaxInt32: math.MaxInt32, + math.MaxUint32: math.MaxUint32, + math.MaxInt64: math.MaxInt64, + "": "", + "Hello, 世界": "Hello, 世界", + } + + vExpected := map[interface{}]interface{}{ + // nil: nil, + math.MinInt64: math.MinInt64, + math.MinInt32: math.MinInt32, + math.MinInt16: math.MinInt16, + math.MinInt8: math.MinInt8, + -1: -1, + 0: 0, + 1: 1, + math.MaxInt8: math.MaxInt8, + math.MaxUint8: math.MaxUint8, + math.MaxInt16: math.MaxInt16, + math.MaxUint16: math.MaxUint16, + math.MaxInt32: math.MaxInt32, + math.MaxUint32: math.MaxUint32, + math.MaxInt64: math.MaxInt64, + "": "", + "Hello, 世界": "Hello, 世界", + } + + res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(v)) + gm.Expect(err).ToNot(gm.HaveOccurred()) + + resMap := res.(map[interface{}]interface{})["val"].(map[interface{}]interface{}) + // for k := range resMap { + // fmt.Printf("%v : %v => %T: %T\n", k, k, resMap[k], resMap[k]) + // fmt.Printf("%v => %T\n", vExpected[k], vExpected[k]) + // } + + gm.Expect(resMap).To(gm.Equal(vExpected)) + + }) // it + + }) // context + +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/unpacker.go b/aerospike-tls/vendor-aerospike-client-go/unpacker.go new file mode 100644 index 00000000..e7a35a1b --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/unpacker.go @@ -0,0 +1,420 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "math" + "reflect" + + "github.com/aerospike/aerospike-client-go/v7/types" + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type unpacker struct { + buffer []byte + offset int + length int +} + +func newUnpacker(buffer []byte, offset int, length int) *unpacker { + return &unpacker{ + buffer: buffer, + offset: offset, + length: length, + } +} + +func (upckr *unpacker) UnpackList() ([]interface{}, Error) { + if upckr.length <= 0 { + return nil, nil + } + + theType := upckr.buffer[upckr.offset] & 0xff + upckr.offset++ + var count int + + if (theType & 0xf0) == 0x90 { + count = int(theType & 0x0f) + } else if theType == 0xdc { + count = int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + } else if theType == 0xdd { + count = int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + } else { + return nil, nil + } + + return upckr.unpackList(count) +} + +func (upckr *unpacker) unpackList(count int) ([]interface{}, Error) { + if count == 0 { + return make([]interface{}, 0), nil + } + + mark := upckr.offset + size := count + + val, err := upckr.unpackObject(false) + if err != nil && err != errSkipHeader { + return nil, err + } + + if val == nil { + // Determine if nil value is because of an extension type. + typ := upckr.buffer[mark] & 0xff + + if typ != 0xc0 { // not nil type + // Ignore extension type. + size-- + } + } + + out := make([]interface{}, 0, count) + if size == count { + out = append(out, val) + } + + for i := 1; i < count; i++ { + obj, err := upckr.unpackObject(false) + if err != nil { + return nil, err + } + out = append(out, obj) + } + return out, nil +} + +func (upckr *unpacker) UnpackMap() (interface{}, Error) { + if upckr.length <= 0 { + return nil, nil + } + + theType := upckr.buffer[upckr.offset] & 0xff + upckr.offset++ + var count int + + if (theType & 0xf0) == 0x80 { + count = int(theType & 0x0f) + } else if theType == 0xde { + count = int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + } else if theType == 0xdf { + count = int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + } else { + return make(map[interface{}]interface{}), nil + } + return upckr.unpackMap(count) +} + +func (upckr *unpacker) unpackMap(count int) (interface{}, Error) { + if count <= 0 { + return make(map[interface{}]interface{}), nil + } + + if upckr.isMapCDT() { + return upckr.unpackCDTMap(count) + } + return upckr.unpackMapNormal(count) +} + +func (upckr *unpacker) unpackMapNormal(count int) (map[interface{}]interface{}, Error) { + out := make(map[interface{}]interface{}, count) + + for i := 0; i < count; i++ { + key, err := upckr.unpackObject(true) + if err != nil { + return nil, err + } + + val, err := upckr.unpackObject(false) + if err != nil { + return nil, err + } + out[key] = val + } + return out, nil +} + +func (upckr *unpacker) unpackCDTMap(count int) ([]MapPair, Error) { + out := make([]MapPair, 0, count-1) + + for i := 0; i < count; i++ { + key, err := upckr.unpackObject(true) + if err != nil && err != errSkipHeader { + return nil, err + } + + val, err := upckr.unpackObject(false) + if err != nil && err != errSkipHeader { + return nil, err + } + + if key != nil { + out = append(out, MapPair{Key: key, Value: val}) + } + } + + return out, nil +} + +func (upckr *unpacker) isMapCDT() bool { + // make sure the buffer is long enough (for empty maps), and map type is ordered map + if upckr.offset >= len(upckr.buffer) || upckr.buffer[upckr.offset]&0xff != 0xc7 { + return false + } + + extensionType := upckr.buffer[upckr.offset+1] & 0xff + + if extensionType == 0 { + mapBits := upckr.buffer[upckr.offset+2] & 0xff + + // Extension is a map type. Determine which one. + if (mapBits & (0x04 | 0x08)) != 0 { + // Index/rank range result where order needs to be preserved. + return true + } else if (mapBits & 0x01) != 0 { + // Sorted map + return true + } + } + + return false +} + +func (upckr *unpacker) unpackObjects() (interface{}, Error) { + if upckr.length <= 0 { + return nil, nil + } + + return upckr.unpackObject(false) +} + +func (upckr *unpacker) unpackBlob(count int, isMapKey bool) (interface{}, Error) { + theType := upckr.buffer[upckr.offset] & 0xff + upckr.offset++ + count-- + var val interface{} + + switch theType { + case ParticleType.STRING: + val = string(upckr.buffer[upckr.offset : upckr.offset+count]) + + case ParticleType.BLOB: + if isMapKey { + b := reflect.Indirect(reflect.New(reflect.ArrayOf(count, reflect.TypeOf(byte(0))))) + reflect.Copy(b, reflect.ValueOf(upckr.buffer[upckr.offset:upckr.offset+count])) + + val = b.Interface() + } else { + b := make([]byte, count) + copy(b, upckr.buffer[upckr.offset:upckr.offset+count]) + val = b + } + + case ParticleType.GEOJSON: + val = NewGeoJSONValue(string(upckr.buffer[upckr.offset : upckr.offset+count])) + + default: + return nil, newError(types.PARSE_ERROR, fmt.Sprintf("Error while unpacking BLOB. Type-header with code `%d` not recognized.", theType)) + } + upckr.offset += count + + return val, nil +} + +// errSkipHeader is used internally as a signal; it is never sent back to the user +var errSkipHeader = newError(types.OK, "Skip the unpacker error") + +func (upckr *unpacker) unpackObject(isMapKey bool) (interface{}, Error) { + theType := upckr.buffer[upckr.offset] & 0xff + upckr.offset++ + + switch theType { + case 0xc0: + return nil, nil + + case 0xc3: + return true, nil + + case 0xc2: + return false, nil + + case 0xca: + val := Buffer.BytesToFloat32(upckr.buffer, upckr.offset) + upckr.offset += 4 + return val, nil + + case 0xcb: + val := Buffer.BytesToFloat64(upckr.buffer, upckr.offset) + upckr.offset += 8 + return val, nil + + case 0xcc: + r := upckr.buffer[upckr.offset] & 0xff + upckr.offset++ + + return int(r), nil + + case 0xcd: + val := uint16(Buffer.BytesToInt16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + return int(val), nil + + case 0xce: + val := uint32(Buffer.BytesToInt32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + + if Buffer.Arch64Bits { + return int(val), nil + } + return int64(val), nil + + case 0xcf: + val := Buffer.BytesToInt64(upckr.buffer, upckr.offset) + upckr.offset += 8 + if val <= math.MaxInt { + return int(val), nil + } + return int64(val), nil + + case 0xd0: + r := int8(upckr.buffer[upckr.offset]) + upckr.offset++ + return int(r), nil + + case 0xd1: + val := Buffer.BytesToInt16(upckr.buffer, upckr.offset) + upckr.offset += 2 + return int(val), nil + + case 0xd2: + val := Buffer.BytesToInt32(upckr.buffer, upckr.offset) + upckr.offset += 4 + return int(val), nil + + case 0xd3: + val := Buffer.BytesToInt64(upckr.buffer, upckr.offset) + upckr.offset += 8 + if Buffer.Arch64Bits { + return int(val), nil + } + return val, nil + + case 0xc4, 0xd9: + count := int(upckr.buffer[upckr.offset] & 0xff) + upckr.offset++ + return upckr.unpackBlob(count, isMapKey) + + case 0xc5, 0xda: + count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + return upckr.unpackBlob(count, isMapKey) + + case 0xc6, 0xdb: + count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + return upckr.unpackBlob(count, isMapKey) + + case 0xdc: + count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + return upckr.unpackList(count) + + case 0xdd: + count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + return upckr.unpackList(count) + + case 0xde: + count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) + upckr.offset += 2 + return upckr.unpackMap(count) + + case 0xdf: + count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) + upckr.offset += 4 + return upckr.unpackMap(count) + + case 0xd4: + // Skip over type extension with 1 byte + upckr.offset += 1 + 1 + return nil, errSkipHeader + + case 0xd5: + // Skip over type extension with 2 bytes + upckr.offset += 1 + 2 + return nil, errSkipHeader + + case 0xd6: + // Skip over type extension with 4 bytes + upckr.offset += 1 + 4 + return nil, errSkipHeader + + case 0xd7: + // Skip over type extension with 8 bytes + upckr.offset += 1 + 8 + return nil, errSkipHeader + + case 0xd8: + // Skip over type extension with 16 bytes + upckr.offset += 1 + 16 + return nil, errSkipHeader + + case 0xc7: // Skip over type extension with 8 bit header and bytes + count := int(upckr.buffer[upckr.offset] & 0xff) + upckr.offset += count + 1 + 1 + return nil, errSkipHeader + + case 0xc8: // Skip over type extension with 16 bit header and bytes + count := int(Buffer.BytesToInt16(upckr.buffer, upckr.offset)) + upckr.offset += count + 1 + 2 + return nil, errSkipHeader + + case 0xc9: // Skip over type extension with 32 bit header and bytes + count := int(Buffer.BytesToInt32(upckr.buffer, upckr.offset)) + upckr.offset += count + 1 + 4 + return nil, errSkipHeader + + default: + if (theType & 0xe0) == 0xa0 { + return upckr.unpackBlob(int(theType&0x1f), isMapKey) + } + + if (theType & 0xf0) == 0x80 { + return upckr.unpackMap(int(theType & 0x0f)) + } + + if (theType & 0xf0) == 0x90 { + count := int(theType & 0x0f) + return upckr.unpackList(count) + } + + if theType < 0x80 { + return int(theType), nil + } + + if theType >= 0xe0 { + return int(theType) - 0xe0 - 32, nil + } + } + + return nil, newError(types.SERIALIZE_ERROR) +} diff --git a/aerospike-tls/vendor-aerospike-client-go/user_roles.go b/aerospike-tls/vendor-aerospike-client-go/user_roles.go new file mode 100644 index 00000000..61f8d151 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/user_roles.go @@ -0,0 +1,50 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Portions may be licensed to Aerospike, Inc. under one or more contributor +// license agreements. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +package aerospike + +// UserRoles contains information about a user. +type UserRoles struct { + // User name. + User string + + // Roles is a list of assigned roles. + Roles []string + + // ReadInfo is the list of read statistics. List may be nil. + // Current statistics by offset are: + // + // 0: read quota in records per second + // 1: single record read transaction rate (TPS) + // 2: read scan/query record per second rate (RPS) + // 3: number of limitless read scans/queries + // + // Future server releases may add additional statistics. + ReadInfo []int + + // WriteInfo is the list of write statistics. List may be nil. + // Current statistics by offset are: + // + // 0: write quota in records per second + // 1: single record write transaction rate (TPS) + // 2: write scan/query record per second rate (RPS) + // 3: number of limitless write scans/queries + // + // Future server releases may add additional statistics. + WriteInfo []int + + // ConnsInUse is the number of currently open connections for the user + ConnsInUse int +} diff --git a/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go b/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go new file mode 100644 index 00000000..e37f623f --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go @@ -0,0 +1,142 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package buffer + +import ( + "encoding/binary" + "math" +) + +const ( + // SizeOfInt32 defines the size of int32 + SizeOfInt32 = uintptr(4) + // SizeOfInt64 defines the size of int64 + SizeOfInt64 = uintptr(8) + + uint64sz = int(8) + uint32sz = int(4) + uint16sz = int(2) + + float32sz = int(4) + float64sz = int(8) +) + +// SizeOfInt defines the size of native int +var SizeOfInt uintptr + +// Arch64Bits defines if the system is 64 bits +var Arch64Bits bool + +// Arch32Bits defines if the system is 32 bits +var Arch32Bits bool + +func init() { + if 0 == ^uint(0xffffffff) { + SizeOfInt = 4 + } else { + SizeOfInt = 8 + } + Arch64Bits = (SizeOfInt == SizeOfInt64) + Arch32Bits = (SizeOfInt == SizeOfInt32) +} + +// LittleBytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used +func LittleBytesToInt32(buf []byte, offset int) int32 { + l := len(buf[offset:]) + if l > uint32sz { + l = uint32sz + } + r := int32(binary.LittleEndian.Uint32(buf[offset : offset+l])) + return r +} + +// LittleBytesToInt64 converts a slice into int64; only maximum of 8 bytes will be used +func LittleBytesToInt64(buf []byte, offset int) int64 { + l := len(buf[offset:]) + if l > uint64sz { + l = uint64sz + } + r := int64(binary.LittleEndian.Uint64(buf[offset : offset+l])) + return r +} + +// BytesToInt64 converts a slice into int64; only maximum of 8 bytes will be used +func BytesToInt64(buf []byte, offset int) int64 { + l := len(buf[offset:]) + if l > uint64sz { + l = uint64sz + } + r := int64(binary.BigEndian.Uint64(buf[offset : offset+l])) + return r +} + +// VarBytesToInt64 will convert a 8, 4 or 2 byte slice into an int64 +func VarBytesToInt64(buf []byte, offset int, len int) int64 { + switch len { + case 2: + return int64(BytesToInt16(buf, offset)) + case 4: + return int64(BytesToInt32(buf, offset)) + case 8: + return BytesToInt64(buf, offset) + } + + val := int64(0) + for i := 0; i < len; i++ { + val <<= 8 + val |= int64(buf[offset+i] & 0xFF) + } + return val +} + +// BytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used +func BytesToInt32(buf []byte, offset int) int32 { + return int32(binary.BigEndian.Uint32(buf[offset : offset+uint32sz])) +} + +// BytesToUint32 converts a slice into uint32; only maximum of 4 bytes will be used +func BytesToUint32(buf []byte, offset int) uint32 { + return binary.BigEndian.Uint32(buf[offset : offset+uint32sz]) +} + +// BytesToInt16 converts a slice of bytes to an int16 +func BytesToInt16(buf []byte, offset int) int16 { + return int16(binary.BigEndian.Uint16(buf[offset : offset+uint16sz])) +} + +// BytesToUint16 converts a byte slice to a uint16 +func BytesToUint16(buf []byte, offset int) uint16 { + return binary.BigEndian.Uint16(buf[offset : offset+uint16sz]) +} + +// BytesToFloat32 converts a byte slice to a float32 +func BytesToFloat32(buf []byte, offset int) float32 { + bits := binary.BigEndian.Uint32(buf[offset : offset+float32sz]) + return math.Float32frombits(bits) +} + +// BytesToFloat64 converts a byte slice to a float64 +func BytesToFloat64(buf []byte, offset int) float64 { + bits := binary.BigEndian.Uint64(buf[offset : offset+float64sz]) + return math.Float64frombits(bits) +} + +// BytesToBool converts a byte slice to a bool +func BytesToBool(buf []byte, offset, length int) bool { + if length <= 0 { + return false + } + return buf[offset] != 0 +} diff --git a/aerospike-tls/vendor-aerospike-client-go/value.go b/aerospike-tls/vendor-aerospike-client-go/value.go new file mode 100644 index 00000000..297581a3 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/value.go @@ -0,0 +1,1318 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "fmt" + "reflect" + "strconv" + + "github.com/aerospike/aerospike-client-go/v7/types" + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// this function will be set in value_slow file if included +var newValueReflect func(interface{}) Value + +// MapPair is used when the client returns sorted maps from the server +// Since the default map in Go is a hash map, we will use a slice +// to return the results in server order +type MapPair struct{ Key, Value interface{} } + +// Value interface is used to efficiently serialize objects into the wire protocol. +type Value interface { + + // Calculate number of vl.bytes necessary to serialize the value in the wire protocol. + EstimateSize() (int, Error) + + // Serialize the value in the wire protocol. + write(cmd BufferEx) (int, Error) + + // Serialize the value using MessagePack. + pack(cmd BufferEx) (int, Error) + + // GetType returns wire protocol value type. + GetType() int + + // GetObject returns original value as an interface{}. + GetObject() interface{} + + // String implements Stringer interface. + String() string +} + +//revive:disable + +// AerospikeBlob interface allows the user to write a conversion function from their value to []bytes. +type AerospikeBlob interface { + // EncodeBlob returns a byte slice representing the encoding of the + // receiver for transmission to a Decoder, usually of the same + // concrete type. + EncodeBlob() ([]byte, error) +} + +//revive:enable + +// tryConcreteValue will return an aerospike value. +// If the encoder does not exist, it will not try to use reflection. +func tryConcreteValue(v interface{}) Value { + switch val := v.(type) { + case Value: + return val + case int: + return IntegerValue(val) + case int64: + return LongValue(val) + case string: + return StringValue(val) + case []interface{}: + return ListValue(val) + case map[string]interface{}: + return JsonValue(val) + case map[interface{}]interface{}: + return NewMapValue(val) + case nil: + return nullValue + case []Value: + return NewValueArray(val) + case []byte: + return BytesValue(val) + case int8: + return IntegerValue(int(val)) + case int16: + return IntegerValue(int(val)) + case int32: + return IntegerValue(int(val)) + case uint8: // byte supported here + return IntegerValue(int(val)) + case uint16: + return IntegerValue(int(val)) + case uint32: + return IntegerValue(int(val)) + case float32: + return FloatValue(float64(val)) + case float64: + return FloatValue(val) + case uint: + // if it doesn't overflow int64, it is OK + if int64(val) >= 0 { + return LongValue(int64(val)) + } + case bool: + return BoolValue(val) + case MapIter: + return NewMapperValue(val) + case ListIter: + return NewListerValue(val) + case AerospikeBlob: + return NewBlobValue(val) + + /* + The following cases will try to avoid using reflection by matching against the + internal generic types. + If you have custom type aliases in your code, you can use the same aerospike types to cast your type into, + to avoid hitting the reflection. + */ + case []string: + return NewListerValue(stringSlice(val)) + case []int: + return NewListerValue(intSlice(val)) + case []int8: + return NewListerValue(int8Slice(val)) + case []int16: + return NewListerValue(int16Slice(val)) + case []int32: + return NewListerValue(int32Slice(val)) + case []int64: + return NewListerValue(int64Slice(val)) + case []uint16: + return NewListerValue(uint16Slice(val)) + case []uint32: + return NewListerValue(uint32Slice(val)) + case []uint64: + return NewListerValue(uint64Slice(val)) + case []float32: + return NewListerValue(float32Slice(val)) + case []float64: + return NewListerValue(float64Slice(val)) + case map[string]string: + return NewMapperValue(stringStringMap(val)) + case map[string]int: + return NewMapperValue(stringIntMap(val)) + case map[string]int8: + return NewMapperValue(stringInt8Map(val)) + case map[string]int16: + return NewMapperValue(stringInt16Map(val)) + case map[string]int32: + return NewMapperValue(stringInt32Map(val)) + case map[string]int64: + return NewMapperValue(stringInt64Map(val)) + case map[string]uint16: + return NewMapperValue(stringUint16Map(val)) + case map[string]uint32: + return NewMapperValue(stringUint32Map(val)) + case map[string]float32: + return NewMapperValue(stringFloat32Map(val)) + case map[string]float64: + return NewMapperValue(stringFloat64Map(val)) + case map[int]string: + return NewMapperValue(intStringMap(val)) + case map[int]int: + return NewMapperValue(intIntMap(val)) + case map[int]int8: + return NewMapperValue(intInt8Map(val)) + case map[int]int16: + return NewMapperValue(intInt16Map(val)) + case map[int]int32: + return NewMapperValue(intInt32Map(val)) + case map[int]int64: + return NewMapperValue(intInt64Map(val)) + case map[int]uint16: + return NewMapperValue(intUint16Map(val)) + case map[int]uint32: + return NewMapperValue(intUint32Map(val)) + case map[int]float32: + return NewMapperValue(intFloat32Map(val)) + case map[int]float64: + return NewMapperValue(intFloat64Map(val)) + case map[int]interface{}: + return NewMapperValue(intInterfaceMap(val)) + case map[int8]string: + return NewMapperValue(int8StringMap(val)) + case map[int8]int: + return NewMapperValue(int8IntMap(val)) + case map[int8]int8: + return NewMapperValue(int8Int8Map(val)) + case map[int8]int16: + return NewMapperValue(int8Int16Map(val)) + case map[int8]int32: + return NewMapperValue(int8Int32Map(val)) + case map[int8]int64: + return NewMapperValue(int8Int64Map(val)) + case map[int8]uint16: + return NewMapperValue(int8Uint16Map(val)) + case map[int8]uint32: + return NewMapperValue(int8Uint32Map(val)) + case map[int8]float32: + return NewMapperValue(int8Float32Map(val)) + case map[int8]float64: + return NewMapperValue(int8Float64Map(val)) + case map[int8]interface{}: + return NewMapperValue(int8InterfaceMap(val)) + case map[int16]string: + return NewMapperValue(int16StringMap(val)) + case map[int16]int: + return NewMapperValue(int16IntMap(val)) + case map[int16]int8: + return NewMapperValue(int16Int8Map(val)) + case map[int16]int16: + return NewMapperValue(int16Int16Map(val)) + case map[int16]int32: + return NewMapperValue(int16Int32Map(val)) + case map[int16]int64: + return NewMapperValue(int16Int64Map(val)) + case map[int16]uint16: + return NewMapperValue(int16Uint16Map(val)) + case map[int16]uint32: + return NewMapperValue(int16Uint32Map(val)) + case map[int16]float32: + return NewMapperValue(int16Float32Map(val)) + case map[int16]float64: + return NewMapperValue(int16Float64Map(val)) + case map[int16]interface{}: + return NewMapperValue(int16InterfaceMap(val)) + case map[int32]string: + return NewMapperValue(int32StringMap(val)) + case map[int32]int: + return NewMapperValue(int32IntMap(val)) + case map[int32]int8: + return NewMapperValue(int32Int8Map(val)) + case map[int32]int16: + return NewMapperValue(int32Int16Map(val)) + case map[int32]int32: + return NewMapperValue(int32Int32Map(val)) + case map[int32]int64: + return NewMapperValue(int32Int64Map(val)) + case map[int32]uint16: + return NewMapperValue(int32Uint16Map(val)) + case map[int32]uint32: + return NewMapperValue(int32Uint32Map(val)) + case map[int32]float32: + return NewMapperValue(int32Float32Map(val)) + case map[int32]float64: + return NewMapperValue(int32Float64Map(val)) + case map[int32]interface{}: + return NewMapperValue(int32InterfaceMap(val)) + case map[int64]string: + return NewMapperValue(int64StringMap(val)) + case map[int64]int: + return NewMapperValue(int64IntMap(val)) + case map[int64]int8: + return NewMapperValue(int64Int8Map(val)) + case map[int64]int16: + return NewMapperValue(int64Int16Map(val)) + case map[int64]int32: + return NewMapperValue(int64Int32Map(val)) + case map[int64]int64: + return NewMapperValue(int64Int64Map(val)) + case map[int64]uint16: + return NewMapperValue(int64Uint16Map(val)) + case map[int64]uint32: + return NewMapperValue(int64Uint32Map(val)) + case map[int64]float32: + return NewMapperValue(int64Float32Map(val)) + case map[int64]float64: + return NewMapperValue(int64Float64Map(val)) + case map[int64]interface{}: + return NewMapperValue(int64InterfaceMap(val)) + case map[uint16]string: + return NewMapperValue(uint16StringMap(val)) + case map[uint16]int: + return NewMapperValue(uint16IntMap(val)) + case map[uint16]int8: + return NewMapperValue(uint16Int8Map(val)) + case map[uint16]int16: + return NewMapperValue(uint16Int16Map(val)) + case map[uint16]int32: + return NewMapperValue(uint16Int32Map(val)) + case map[uint16]int64: + return NewMapperValue(uint16Int64Map(val)) + case map[uint16]uint16: + return NewMapperValue(uint16Uint16Map(val)) + case map[uint16]uint32: + return NewMapperValue(uint16Uint32Map(val)) + case map[uint16]float32: + return NewMapperValue(uint16Float32Map(val)) + case map[uint16]float64: + return NewMapperValue(uint16Float64Map(val)) + case map[uint16]interface{}: + return NewMapperValue(uint16InterfaceMap(val)) + case map[uint32]string: + return NewMapperValue(uint32StringMap(val)) + case map[uint32]int: + return NewMapperValue(uint32IntMap(val)) + case map[uint32]int8: + return NewMapperValue(uint32Int8Map(val)) + case map[uint32]int16: + return NewMapperValue(uint32Int16Map(val)) + case map[uint32]int32: + return NewMapperValue(uint32Int32Map(val)) + case map[uint32]int64: + return NewMapperValue(uint32Int64Map(val)) + case map[uint32]uint16: + return NewMapperValue(uint32Uint16Map(val)) + case map[uint32]uint32: + return NewMapperValue(uint32Uint32Map(val)) + case map[uint32]float32: + return NewMapperValue(uint32Float32Map(val)) + case map[uint32]float64: + return NewMapperValue(uint32Float64Map(val)) + case map[uint32]interface{}: + return NewMapperValue(uint32InterfaceMap(val)) + case map[float32]string: + return NewMapperValue(float32StringMap(val)) + case map[float32]int: + return NewMapperValue(float32IntMap(val)) + case map[float32]int8: + return NewMapperValue(float32Int8Map(val)) + case map[float32]int16: + return NewMapperValue(float32Int16Map(val)) + case map[float32]int32: + return NewMapperValue(float32Int32Map(val)) + case map[float32]int64: + return NewMapperValue(float32Int64Map(val)) + case map[float32]uint16: + return NewMapperValue(float32Uint16Map(val)) + case map[float32]uint32: + return NewMapperValue(float32Uint32Map(val)) + case map[float32]float32: + return NewMapperValue(float32Float32Map(val)) + case map[float32]float64: + return NewMapperValue(float32Float64Map(val)) + case map[float32]interface{}: + return NewMapperValue(float32InterfaceMap(val)) + case map[float64]string: + return NewMapperValue(float64StringMap(val)) + case map[float64]int: + return NewMapperValue(float64IntMap(val)) + case map[float64]int8: + return NewMapperValue(float64Int8Map(val)) + case map[float64]int16: + return NewMapperValue(float64Int16Map(val)) + case map[float64]int32: + return NewMapperValue(float64Int32Map(val)) + case map[float64]int64: + return NewMapperValue(float64Int64Map(val)) + case map[float64]uint16: + return NewMapperValue(float64Uint16Map(val)) + case map[float64]uint32: + return NewMapperValue(float64Uint32Map(val)) + case map[float64]float32: + return NewMapperValue(float64Float32Map(val)) + case map[float64]float64: + return NewMapperValue(float64Float64Map(val)) + case map[float64]interface{}: + return NewMapperValue(float64InterfaceMap(val)) + case map[string]uint64: + return NewMapperValue(stringUint64Map(val)) + case map[int]uint64: + return NewMapperValue(intUint64Map(val)) + case map[int8]uint64: + return NewMapperValue(int8Uint64Map(val)) + case map[int16]uint64: + return NewMapperValue(int16Uint64Map(val)) + case map[int32]uint64: + return NewMapperValue(int32Uint64Map(val)) + case map[int64]uint64: + return NewMapperValue(int64Uint64Map(val)) + case map[uint16]uint64: + return NewMapperValue(uint16Uint64Map(val)) + case map[uint32]uint64: + return NewMapperValue(uint32Uint64Map(val)) + case map[float32]uint64: + return NewMapperValue(float32Uint64Map(val)) + case map[float64]uint64: + return NewMapperValue(float64Uint64Map(val)) + case map[uint64]string: + return NewMapperValue(uint64StringMap(val)) + case map[uint64]int: + return NewMapperValue(uint64IntMap(val)) + case map[uint64]int8: + return NewMapperValue(uint64Int8Map(val)) + case map[uint64]int16: + return NewMapperValue(uint64Int16Map(val)) + case map[uint64]int32: + return NewMapperValue(uint64Int32Map(val)) + case map[uint64]int64: + return NewMapperValue(uint64Int64Map(val)) + case map[uint64]uint16: + return NewMapperValue(uint64Uint16Map(val)) + case map[uint64]uint32: + return NewMapperValue(uint64Uint32Map(val)) + case map[uint64]uint64: + return NewMapperValue(uint64Uint64Map(val)) + case map[uint64]float32: + return NewMapperValue(uint64Float32Map(val)) + case map[uint64]float64: + return NewMapperValue(uint64Float64Map(val)) + case map[uint64]interface{}: + return NewMapperValue(uint64InterfaceMap(val)) + } + + return nil +} + +// OpResults encapsulates the results of batch read operations +type OpResults []interface{} + +// NewValue generates a new Value object based on the type. +// If the type is not supported, NewValue will panic. +// This method is a convenience method, and should not be used +// when absolute performance is required unless for the reason mentioned below. +// +// If you have custom maps or slices like: +// +// type MyMap map[primitive1]primitive2, eg: map[int]string +// +// or +// +// type MySlice []primitive, eg: []float64 +// +// cast them to their primitive type when passing them to this method: +// +// v := NewValue(map[int]string(myVar)) +// v := NewValue([]float64(myVar)) +// +// This way you will avoid hitting reflection. +// To completely avoid reflection in the library, +// use the build tag: as_performance while building your program. +func NewValue(v interface{}) Value { + if value := tryConcreteValue(v); value != nil { + return value + } + + if newValueReflect != nil { + if res := newValueReflect(v); res != nil { + return res + } + } + + // panic for anything that is not supported. + panic(newError(types.TYPE_NOT_SUPPORTED, fmt.Sprintf("Value type '%v' (%s) not supported (if you are compiling via 'as_performance' tag, use cast either to primitives, or use ListIter or MapIter interfaces.)", v, reflect.TypeOf(v).String()))) +} + +// NullValue is an empty value. +type NullValue struct{} + +var nullValue NullValue + +// NewNullValue generates a NullValue instance. +func NewNullValue() NullValue { + return nullValue +} + +// EstimateSize returns the size of the NullValue in wire protocol. +func (vl NullValue) EstimateSize() (int, Error) { + return 0, nil +} + +func (vl NullValue) write(cmd BufferEx) (int, Error) { + return 0, nil +} + +func (vl NullValue) pack(cmd BufferEx) (int, Error) { + return packNil(cmd) +} + +// GetType returns wire protocol value type. +func (vl NullValue) GetType() int { + return ParticleType.NULL +} + +// GetObject returns original value as an interface{}. +func (vl NullValue) GetObject() interface{} { + return nil +} + +func (vl NullValue) String() string { + return "" +} + +/////////////////////////////////////////////////////////////////////////////// + +// InfinityValue is an empty value. +type InfinityValue struct{} + +var infinityValue InfinityValue + +// NewInfinityValue generates a InfinityValue instance. +func NewInfinityValue() InfinityValue { + return infinityValue +} + +// EstimateSize returns the size of the InfinityValue in wire protocol. +func (vl InfinityValue) EstimateSize() (int, Error) { + return 0, nil +} + +func (vl InfinityValue) write(cmd BufferEx) (int, Error) { + return 0, nil +} + +func (vl InfinityValue) pack(cmd BufferEx) (int, Error) { + return packInfinity(cmd) +} + +// GetType returns wire protocol value type. +func (vl InfinityValue) GetType() int { + panic("Invalid particle type: INF") +} + +// GetObject returns original value as an interface{}. +func (vl InfinityValue) GetObject() interface{} { + return nil +} + +func (vl InfinityValue) String() string { + return "INF" +} + +/////////////////////////////////////////////////////////////////////////////// + +// WildCardValue is an empty value. +type WildCardValue struct{} + +var wildCardValue WildCardValue + +// NewWildCardValue generates a WildCardValue instance. +func NewWildCardValue() WildCardValue { + return wildCardValue +} + +// EstimateSize returns the size of the WildCardValue in wire protocol. +func (vl WildCardValue) EstimateSize() (int, Error) { + return 0, nil +} + +func (vl WildCardValue) write(cmd BufferEx) (int, Error) { + return 0, nil +} + +func (vl WildCardValue) pack(cmd BufferEx) (int, Error) { + return packWildCard(cmd) +} + +// GetType returns wire protocol value type. +func (vl WildCardValue) GetType() int { + panic("Invalid particle type: WildCard") +} + +// GetObject returns original value as an interface{}. +func (vl WildCardValue) GetObject() interface{} { + return nil +} + +func (vl WildCardValue) String() string { + return "*" +} + +/////////////////////////////////////////////////////////////////////////////// + +// BytesValue encapsulates an array of bytes. +type BytesValue []byte + +// NewBytesValue generates a ByteValue instance. +func NewBytesValue(bytes []byte) BytesValue { + return BytesValue(bytes) +} + +// NewBlobValue accepts an AerospikeBlob interface, and automatically +// converts it to a BytesValue. +// If Encode returns an err, it will panic. +func NewBlobValue(object AerospikeBlob) BytesValue { + buf, err := object.EncodeBlob() + if err != nil { + panic(err) + } + + return NewBytesValue(buf) +} + +// EstimateSize returns the size of the BytesValue in wire protocol. +func (vl BytesValue) EstimateSize() (int, Error) { + return len(vl), nil +} + +func (vl BytesValue) write(cmd BufferEx) (int, Error) { + return cmd.Write(vl) +} + +func (vl BytesValue) pack(cmd BufferEx) (int, Error) { + return packBytes(cmd, vl) +} + +// GetType returns wire protocol value type. +func (vl BytesValue) GetType() int { + return ParticleType.BLOB +} + +// GetObject returns original value as an interface{}. +func (vl BytesValue) GetObject() interface{} { + return []byte(vl) +} + +// String implements Stringer interface. +func (vl BytesValue) String() string { + return fmt.Sprintf("% 02x", []byte(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// StringValue encapsulates a string value. +type StringValue string + +// NewStringValue generates a StringValue instance. +func NewStringValue(value string) StringValue { + return StringValue(value) +} + +// EstimateSize returns the size of the StringValue in wire protocol. +func (vl StringValue) EstimateSize() (int, Error) { + return len(vl), nil +} + +func (vl StringValue) write(cmd BufferEx) (int, Error) { + return cmd.WriteString(string(vl)) +} + +func (vl StringValue) pack(cmd BufferEx) (int, Error) { + return packString(cmd, string(vl)) +} + +// GetType returns wire protocol value type. +func (vl StringValue) GetType() int { + return ParticleType.STRING +} + +// GetObject returns original value as an interface{}. +func (vl StringValue) GetObject() interface{} { + return string(vl) +} + +// String implements Stringer interface. +func (vl StringValue) String() string { + return string(vl) +} + +/////////////////////////////////////////////////////////////////////////////// + +// IntegerValue encapsulates an integer value. +type IntegerValue int + +// NewIntegerValue generates an IntegerValue instance. +func NewIntegerValue(value int) IntegerValue { + return IntegerValue(value) +} + +// EstimateSize returns the size of the IntegerValue in wire protocol. +func (vl IntegerValue) EstimateSize() (int, Error) { + return 8, nil +} + +func (vl IntegerValue) write(cmd BufferEx) (int, Error) { + n := cmd.WriteInt64(int64(vl)) + return n, nil +} + +func (vl IntegerValue) pack(cmd BufferEx) (int, Error) { + return packAInt64(cmd, int64(vl)) +} + +// GetType returns wire protocol value type. +func (vl IntegerValue) GetType() int { + return ParticleType.INTEGER +} + +// GetObject returns original value as an interface{}. +func (vl IntegerValue) GetObject() interface{} { + return int(vl) +} + +// String implements Stringer interface. +func (vl IntegerValue) String() string { + return strconv.Itoa(int(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// LongValue encapsulates an int64 value. +type LongValue int64 + +// NewLongValue generates a LongValue instance. +func NewLongValue(value int64) LongValue { + // TODO: Remove this type, it's not necessary next to IntegerValue + return LongValue(value) +} + +// EstimateSize returns the size of the LongValue in wire protocol. +func (vl LongValue) EstimateSize() (int, Error) { + return 8, nil +} + +func (vl LongValue) write(cmd BufferEx) (int, Error) { + n := cmd.WriteInt64(int64(vl)) + return n, nil +} + +func (vl LongValue) pack(cmd BufferEx) (int, Error) { + return packAInt64(cmd, int64(vl)) +} + +// GetType returns wire protocol value type. +func (vl LongValue) GetType() int { + return ParticleType.INTEGER +} + +// GetObject returns original value as an interface{}. +func (vl LongValue) GetObject() interface{} { + return int64(vl) +} + +// String implements Stringer interface. +func (vl LongValue) String() string { + return strconv.Itoa(int(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// FloatValue encapsulates an float64 value. +type FloatValue float64 + +// NewFloatValue generates a FloatValue instance. +func NewFloatValue(value float64) FloatValue { + return FloatValue(value) +} + +// EstimateSize returns the size of the FloatValue in wire protocol. +func (vl FloatValue) EstimateSize() (int, Error) { + return 8, nil +} + +func (vl FloatValue) write(cmd BufferEx) (int, Error) { + n := cmd.WriteFloat64(float64(vl)) + return n, nil +} + +func (vl FloatValue) pack(cmd BufferEx) (int, Error) { + return packFloat64(cmd, float64(vl)) +} + +// GetType returns wire protocol value type. +func (vl FloatValue) GetType() int { + return ParticleType.FLOAT +} + +// GetObject returns original value as an interface{}. +func (vl FloatValue) GetObject() interface{} { + return float64(vl) +} + +// String implements Stringer interface. +func (vl FloatValue) String() string { + return (fmt.Sprintf("%f", vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// BoolValue encapsulates a boolean value. +// Supported by Aerospike server v5.6+ only. +type BoolValue bool + +// EstimateSize returns the size of the BoolValue in wire protocol. +func (vb BoolValue) EstimateSize() (int, Error) { + return PackBool(nil, bool(vb)) +} + +func (vb BoolValue) write(cmd BufferEx) (int, Error) { + n := cmd.WriteBool(bool(vb)) + return n, nil +} + +func (vb BoolValue) pack(cmd BufferEx) (int, Error) { + return PackBool(cmd, bool(vb)) +} + +// GetType returns wire protocol value type. +func (vb BoolValue) GetType() int { + return ParticleType.BOOL +} + +// GetObject returns original value as an interface{}. +func (vb BoolValue) GetObject() interface{} { + return bool(vb) +} + +// String implements Stringer interface. +func (vb BoolValue) String() string { + return (fmt.Sprintf("%v", bool(vb))) +} + +/////////////////////////////////////////////////////////////////////////////// + +// ValueArray encapsulates an array of Value. +// Supported by Aerospike 3+ servers only. +type ValueArray []Value + +// NewValueArray generates a ValueArray instance. +func NewValueArray(array []Value) *ValueArray { + // return &ValueArray{*NewListerValue(valueList(array))} + res := ValueArray(array) + return &res +} + +// EstimateSize returns the size of the ValueArray in wire protocol. +func (va ValueArray) EstimateSize() (int, Error) { + return packValueArray(nil, va) +} + +func (va ValueArray) write(cmd BufferEx) (int, Error) { + return packValueArray(cmd, va) +} + +func (va ValueArray) pack(cmd BufferEx) (int, Error) { + return packValueArray(cmd, []Value(va)) +} + +// GetType returns wire protocol value type. +func (va ValueArray) GetType() int { + return ParticleType.LIST +} + +// GetObject returns original value as an interface{}. +func (va ValueArray) GetObject() interface{} { + return []Value(va) +} + +// String implements Stringer interface. +func (va ValueArray) String() string { + return fmt.Sprintf("%v", []Value(va)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// ListValue encapsulates any arbitrary array. +// Supported by Aerospike 3+ servers only. +type ListValue []interface{} + +// NewListValue generates a ListValue instance. +func NewListValue(list []interface{}) ListValue { + return ListValue(list) +} + +// EstimateSize returns the size of the ListValue in wire protocol. +func (vl ListValue) EstimateSize() (int, Error) { + return packIfcList(nil, vl) +} + +func (vl ListValue) write(cmd BufferEx) (int, Error) { + return packIfcList(cmd, vl) +} + +func (vl ListValue) pack(cmd BufferEx) (int, Error) { + return packIfcList(cmd, []interface{}(vl)) +} + +// GetType returns wire protocol value type. +func (vl ListValue) GetType() int { + return ParticleType.LIST +} + +// GetObject returns original value as an interface{}. +func (vl ListValue) GetObject() interface{} { + return []interface{}(vl) +} + +// String implements Stringer interface. +func (vl ListValue) String() string { + return fmt.Sprintf("%v", []interface{}(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// ListerValue encapsulates any arbitrary array. +// Supported by Aerospike 3+ servers only. +type ListerValue struct { + list ListIter +} + +// NewListerValue generates a NewListerValue instance. +func NewListerValue(list ListIter) *ListerValue { + res := &ListerValue{ + list: list, + } + + return res +} + +// EstimateSize returns the size of the ListerValue in wire protocol. +func (vl *ListerValue) EstimateSize() (int, Error) { + return packList(nil, vl.list) +} + +func (vl *ListerValue) write(cmd BufferEx) (int, Error) { + return packList(cmd, vl.list) +} + +func (vl *ListerValue) pack(cmd BufferEx) (int, Error) { + return packList(cmd, vl.list) +} + +// GetType returns wire protocol value type. +func (vl *ListerValue) GetType() int { + return ParticleType.LIST +} + +// GetObject returns original value as an interface{}. +func (vl *ListerValue) GetObject() interface{} { + return vl.list +} + +// String implements Stringer interface. +func (vl *ListerValue) String() string { + return fmt.Sprintf("%v", vl.list) +} + +/////////////////////////////////////////////////////////////////////////////// + +// MapValue encapsulates an arbitrary map. +// Supported by Aerospike 3+ servers only. +type MapValue map[interface{}]interface{} + +// NewMapValue generates a MapValue instance. +func NewMapValue(vmap map[interface{}]interface{}) MapValue { + return MapValue(vmap) +} + +// EstimateSize returns the size of the MapValue in wire protocol. +func (vl MapValue) EstimateSize() (int, Error) { + return packIfcMap(nil, vl) +} + +func (vl MapValue) write(cmd BufferEx) (int, Error) { + return packIfcMap(cmd, vl) +} + +func (vl MapValue) pack(cmd BufferEx) (int, Error) { + return packIfcMap(cmd, vl) +} + +// GetType returns wire protocol value type. +func (vl MapValue) GetType() int { + return ParticleType.MAP +} + +// GetObject returns original value as an interface{}. +func (vl MapValue) GetObject() interface{} { + return map[interface{}]interface{}(vl) +} + +func (vl MapValue) String() string { + return fmt.Sprintf("%v", map[interface{}]interface{}(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// JsonValue encapsulates a Json map. +// Supported by Aerospike 3+ servers only. +type JsonValue map[string]interface{} + +// NewJsonValue generates a JsonValue instance. +func NewJsonValue(vmap map[string]interface{}) JsonValue { + return JsonValue(vmap) +} + +// EstimateSize returns the size of the JsonValue in wire protocol. +func (vl JsonValue) EstimateSize() (int, Error) { + return packJsonMap(nil, vl) +} + +func (vl JsonValue) write(cmd BufferEx) (int, Error) { + return packJsonMap(cmd, vl) +} + +func (vl JsonValue) pack(cmd BufferEx) (int, Error) { + return packJsonMap(cmd, vl) +} + +// GetType returns wire protocol value type. +func (vl JsonValue) GetType() int { + return ParticleType.MAP +} + +// GetObject returns original value as an interface{}. +func (vl JsonValue) GetObject() interface{} { + return map[string]interface{}(vl) +} + +func (vl JsonValue) String() string { + return fmt.Sprintf("%v", map[string]interface{}(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// MapperValue encapsulates an arbitrary map which implements a MapIter interface. +// Supported by Aerospike 3+ servers only. +type MapperValue struct { + vmap MapIter +} + +// NewMapperValue generates a MapperValue instance. +func NewMapperValue(vmap MapIter) *MapperValue { + res := &MapperValue{ + vmap: vmap, + } + + return res +} + +// EstimateSize returns the size of the MapperValue in wire protocol. +func (vl *MapperValue) EstimateSize() (int, Error) { + return packMap(nil, vl.vmap) +} + +func (vl *MapperValue) write(cmd BufferEx) (int, Error) { + return packMap(cmd, vl.vmap) +} + +func (vl *MapperValue) pack(cmd BufferEx) (int, Error) { + return packMap(cmd, vl.vmap) +} + +// GetType returns wire protocol value type. +func (vl *MapperValue) GetType() int { + return ParticleType.MAP +} + +// GetObject returns original value as an interface{}. +func (vl *MapperValue) GetObject() interface{} { + return vl.vmap +} + +func (vl *MapperValue) String() string { + return fmt.Sprintf("%v", vl.vmap) +} + +/////////////////////////////////////////////////////////////////////////////// + +// GeoJSONValue encapsulates a 2D Geo point. +// Supported by Aerospike 3.6.1 servers and later only. +type GeoJSONValue string + +// NewGeoJSONValue generates a GeoJSONValue instance. +func NewGeoJSONValue(value string) GeoJSONValue { + res := GeoJSONValue(value) + return res +} + +// EstimateSize returns the size of the GeoJSONValue in wire protocol. +func (vl GeoJSONValue) EstimateSize() (int, Error) { + // flags + ncells + jsonstr + return 1 + 2 + len(string(vl)), nil +} + +func (vl GeoJSONValue) write(cmd BufferEx) (int, Error) { + cmd.WriteByte(0) // flags + cmd.WriteByte(0) // flags + cmd.WriteByte(0) // flags + + return cmd.WriteString(string(vl)) +} + +func (vl GeoJSONValue) pack(cmd BufferEx) (int, Error) { + return packGeoJson(cmd, string(vl)) +} + +// GetType returns wire protocol value type. +func (vl GeoJSONValue) GetType() int { + return ParticleType.GEOJSON +} + +// GetObject returns original value as an interface{}. +func (vl GeoJSONValue) GetObject() interface{} { + return string(vl) +} + +// String implements Stringer interface. +func (vl GeoJSONValue) String() string { + return string(vl) +} + +/////////////////////////////////////////////////////////////////////////////// + +// HLLValue encapsulates a HyperLogLog value. +type HLLValue []byte + +// NewHLLValue generates a ByteValue instance. +func NewHLLValue(bytes []byte) HLLValue { + return HLLValue(bytes) +} + +// EstimateSize returns the size of the HLLValue in wire protocol. +func (vl HLLValue) EstimateSize() (int, Error) { + return len(vl), nil +} + +func (vl HLLValue) write(cmd BufferEx) (int, Error) { + return cmd.Write(vl) +} + +func (vl HLLValue) pack(cmd BufferEx) (int, Error) { + return packBytes(cmd, vl) +} + +// GetType returns wire protocol value type. +func (vl HLLValue) GetType() int { + return ParticleType.HLL +} + +// GetObject returns original value as an interface{}. +func (vl HLLValue) GetObject() interface{} { + return []byte(vl) +} + +// String implements Stringer interface. +func (vl HLLValue) String() string { + return fmt.Sprintf("% 02x", []byte(vl)) +} + +/////////////////////////////////////////////////////////////////////////////// + +// RawBlobValue encapsulates a CDT BLOB value. +// Notice: Do not use this value, it is for internal aerospike use only. +type RawBlobValue struct { + // ParticleType signifies the data + ParticleType int + // Data carries the data + Data []byte +} + +// NewRawBlobValue generates a RawBlobValue instance for a CDT List or map using a particle type. +func NewRawBlobValue(pt int, b []byte) *RawBlobValue { + data := make([]byte, len(b)) + copy(data, b) + return &RawBlobValue{ParticleType: pt, Data: data} +} + +// EstimateSize returns the size of the RawBlobValue in wire protocol. +func (vl *RawBlobValue) EstimateSize() (int, Error) { + return len(vl.Data), nil +} + +func (vl *RawBlobValue) write(cmd BufferEx) (int, Error) { + return cmd.Write(vl.Data) +} + +func (vl *RawBlobValue) pack(cmd BufferEx) (int, Error) { + panic(unreachable) +} + +// GetType returns wire protocol value type. +func (vl *RawBlobValue) GetType() int { + return vl.ParticleType +} + +// GetObject returns original value as an interface{}. +func (vl *RawBlobValue) GetObject() interface{} { + return []byte(vl.Data) +} + +// String implements Stringer interface. +func (vl *RawBlobValue) String() string { + return fmt.Sprintf("% 02x", vl.Data) +} + +////////////////////////////////////////////////////////////////////////////// + +func bytesToParticleRaw(ptype int, buf []byte, offset int, length int, raw bool) (interface{}, Error) { + switch ptype { + case ParticleType.MAP: + if raw { + return NewRawBlobValue(ptype, buf[offset:offset+length]), nil + } + return newUnpacker(buf, offset, length).UnpackMap() + + case ParticleType.LIST: + if raw { + return NewRawBlobValue(ptype, buf[offset:offset+length]), nil + } + return newUnpacker(buf, offset, length).UnpackList() + } + return bytesToParticle(ptype, buf, offset, length) +} + +func bytesToParticle(ptype int, buf []byte, offset int, length int) (interface{}, Error) { + + switch ptype { + case ParticleType.INTEGER: + // return `int` for 64bit platforms for compatibility reasons + if Buffer.Arch64Bits { + return int(Buffer.VarBytesToInt64(buf, offset, length)), nil + } + return Buffer.VarBytesToInt64(buf, offset, length), nil + + case ParticleType.STRING: + return string(buf[offset : offset+length]), nil + + case ParticleType.FLOAT: + return Buffer.BytesToFloat64(buf, offset), nil + + case ParticleType.BOOL: + return Buffer.BytesToBool(buf, offset, length), nil + + case ParticleType.MAP: + return newUnpacker(buf, offset, length).UnpackMap() + + case ParticleType.LIST: + return newUnpacker(buf, offset, length).UnpackList() + + case ParticleType.GEOJSON: + ncells := int(Buffer.BytesToInt16(buf, offset+1)) + headerSize := 1 + 2 + (ncells * 8) + return GeoJSONValue(string(buf[offset+headerSize : offset+length])), nil + + case ParticleType.HLL: + newObj := make([]byte, length) + copy(newObj, buf[offset:offset+length]) + return HLLValue(newObj), nil + + case ParticleType.BLOB: + newObj := make([]byte, length) + copy(newObj, buf[offset:offset+length]) + return newObj, nil + + case ParticleType.LDT: + return newUnpacker(buf, offset, length).unpackObjects() + + } + return nil, nil +} + +func bytesToKeyValue(pType int, buf []byte, offset int, length int) (Value, Error) { + + switch pType { + case ParticleType.STRING: + return NewStringValue(string(buf[offset : offset+length])), nil + + case ParticleType.INTEGER: + return NewLongValue(Buffer.VarBytesToInt64(buf, offset, length)), nil + + case ParticleType.FLOAT: + return NewFloatValue(Buffer.BytesToFloat64(buf, offset)), nil + + case ParticleType.BLOB: + bytes := make([]byte, length) + copy(bytes, buf[offset:offset+length]) + return NewBytesValue(bytes), nil + + case ParticleType.LIST: + v, err := newUnpacker(buf, offset, length).UnpackList() + if err != nil { + return nil, err + } + return ListValue(v), nil + + case ParticleType.NULL: + return NewNullValue(), nil + + default: + return nil, newError(types.PARSE_ERROR, fmt.Sprintf("ParticleType %d not recognized. Please file a github issue.", pType)) + } +} + +func unwrapValue(v interface{}) interface{} { + if v == nil { + return nil + } + + if uv, ok := v.(Value); ok { + return unwrapValue(uv.GetObject()) + } else if uv, ok := v.([]Value); ok { + a := make([]interface{}, len(uv)) + for i := range uv { + a[i] = unwrapValue(uv[i].GetObject()) + } + return a + } + + return v +} + +func grpcValuePacked(v Value) []byte { + if v == nil { + return nil + } + + sz, err := v.pack(nil) + if err != nil { + panic(err) + } + buf := newBuffer(sz) + if _, err := v.pack(buf); err != nil { + panic(err) + } + return buf.Bytes() +} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_helpers.go b/aerospike-tls/vendor-aerospike-client-go/value_helpers.go new file mode 100644 index 00000000..d06c1cdf --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/value_helpers.go @@ -0,0 +1,61 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +// MapIter allows to define general maps of your own type to be used in the Go client +// without the use of reflection. +// function PackMap should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods): +// +// func (cm *CustomMap) PackMap(buf aerospike.BufferEx) (int, error) { +// size := 0 +// for k, v := range cm { +// n, err := PackXXX(buf, k) +// size += n +// if err != nil { +// return size, err +// } +// +// n, err = PackXXX(buf, v) +// size += n +// if err != nil { +// return size, err +// } +// } +// return size, nil +// } +type MapIter interface { + PackMap(buf BufferEx) (int, error) + Len() int +} + +// ListIter allows to define general maps of your own type to be used in the Go client +// without the use of reflection. +// function PackList should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods): +// +// func (cs *CustomSlice) PackList(buf aerospike.BufferEx) (int, error) { +// size := 0 +// for _, elem := range cs { +// n, err := PackXXX(buf, elem) +// size += n +// if err != nil { +// return size, err +// } +// } +// return size, nil +// } +type ListIter interface { + PackList(buf BufferEx) (int, error) + Len() int +} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_reflect.go b/aerospike-tls/vendor-aerospike-client-go/value_reflect.go new file mode 100644 index 00000000..c2387b40 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/value_reflect.go @@ -0,0 +1,57 @@ +//go:build !as_performance + +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "reflect" +) + +func init() { + newValueReflect = concreteNewValueReflect +} + +// if the returned value is nil, the caller will panic +func concreteNewValueReflect(v interface{}) Value { + // check for array and map + rv := reflect.ValueOf(v) + switch rv.Kind() { + case reflect.Array, reflect.Slice: + l := rv.Len() + arr := make([]interface{}, l) + for i := 0; i < l; i++ { + arr[i] = rv.Index(i).Interface() + } + + return NewListValue(arr) + case reflect.Map: + l := rv.Len() + amap := make(map[interface{}]interface{}, l) + for _, i := range rv.MapKeys() { + amap[i.Interface()] = rv.MapIndex(i).Interface() + } + + return NewMapValue(amap) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return NewLongValue(reflect.ValueOf(v).Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: + return NewLongValue(int64(reflect.ValueOf(v).Uint())) + case reflect.String: + return NewStringValue(rv.String()) + } + + return nil +} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_test.go b/aerospike-tls/vendor-aerospike-client-go/value_test.go new file mode 100644 index 00000000..7c92487d --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/value_test.go @@ -0,0 +1,216 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math" + "reflect" + + gg "github.com/onsi/ginkgo/v2" + gm "github.com/onsi/gomega" + + ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" + "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +type testBLOB struct { + name string +} + +func (b *testBLOB) EncodeBlob() ([]byte, error) { + return []byte(b.name), nil +} + +func isValidIntegerValue(i int, v Value) bool { + gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewIntegerValue(0)))) + gm.Expect(v.GetObject()).To(gm.Equal(i)) + gm.Expect(v.EstimateSize()).To(gm.Equal(int(buffer.SizeOfInt))) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.INTEGER)) + + return true +} + +func isValidLongValue(i int64, v Value) bool { + gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewLongValue(0)))) + gm.Expect(v.GetObject().(int64)).To(gm.Equal(i)) + gm.Expect(v.EstimateSize()).To(gm.Equal(int(buffer.SizeOfInt64))) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.INTEGER)) + + return true +} + +func isValidFloatValue(i float64, v Value) bool { + gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewFloatValue(0)))) + gm.Expect(v.GetObject().(float64)).To(gm.Equal(i)) + gm.Expect(v.EstimateSize()).To(gm.Equal(8)) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.FLOAT)) + + return true +} + +var _ = gg.Describe("Value Test", func() { + + gg.Context("NullValue", func() { + gg.It("should create a valid NullValue", func() { + v := NewValue(nil) + + gm.Expect(v.GetObject()).To(gm.BeNil()) + gm.Expect(v.EstimateSize()).To(gm.Equal(0)) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.NULL)) + }) + }) + + gg.Context("StringValues", func() { + gg.It("should create a valid string value", func() { + str := "string value" + v := NewValue(str) + + gm.Expect(v.GetObject()).To(gm.Equal(str)) + gm.Expect(v.EstimateSize()).To(gm.Equal(len(str))) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.STRING)) + }) + + gg.It("should create a valid empty string value", func() { + str := "" + v := NewValue(str) + + gm.Expect(v.GetObject()).To(gm.Equal(str)) + gm.Expect(v.EstimateSize()).To(gm.Equal(len(str))) + gm.Expect(v.GetType()).To(gm.Equal(ParticleType.STRING)) + }) + }) + + gg.Context("Blob Values", func() { + + gg.It("should create a BytesValue on valid types, and encode", func() { + person := &testBLOB{name: "SomeDude"} + + bval := NewValue(person) + gm.Expect(bval.GetType()).To(gm.Equal(ParticleType.BLOB)) + gm.Expect(bval).To(gm.BeAssignableToTypeOf(BytesValue{})) + gm.Expect(bval.GetObject()).To(gm.Equal([]byte(person.name))) + }) + }) + + gg.Context("Numeric Values", func() { + + gg.It("should create a valid IntegerValue on boundries of int8", func() { + i := int8(math.MinInt8) + v := NewValue(i) + isValidIntegerValue(int(i), v) + + i = int8(math.MaxInt8) + v = NewValue(i) + isValidIntegerValue(int(i), v) + }) + + gg.It("should create a valid IntegerValue on boundries of uint8", func() { + i := uint8(0) + v := NewValue(i) + isValidIntegerValue(int(i), v) + + i = uint8(math.MaxUint8) + v = NewValue(i) + isValidIntegerValue(int(i), v) + }) + + gg.It("should create a valid IntegerValue on boundries of int16", func() { + i := int16(math.MinInt16) + v := NewValue(i) + isValidIntegerValue(int(i), v) + + i = int16(math.MaxInt16) + v = NewValue(i) + isValidIntegerValue(int(i), v) + }) + + gg.It("should create a valid IntegerValue on boundries of uint16", func() { + i := uint16(0) + v := NewValue(i) + isValidIntegerValue(int(i), v) + + i = uint16(math.MaxUint16) + v = NewValue(i) + isValidIntegerValue(int(i), v) + }) + + gg.It("should create a valid IntegerValue on boundries of int32", func() { + i := int32(math.MinInt32) + v := NewValue(i) + isValidIntegerValue(int(i), v) + + i = int32(math.MaxInt32) + v = NewValue(i) + isValidIntegerValue(int(i), v) + }) + + gg.It("should create a valid IntegerValue on boundries of native int on 32 bit machines", func() { + if buffer.Arch32Bits { + i := math.MinInt32 + v := NewValue(i) + isValidIntegerValue(i, v) + + i = math.MaxInt32 + v = NewValue(i) + isValidIntegerValue(i, v) + } + }) + + gg.It("should create a valid LongValue after boundries of int32 is passed on 32 bit machines", func() { + if buffer.Arch32Bits { + i := math.MinInt32 - 1 + v := NewValue(i) + isValidLongValue(int64(i), v) + + i = math.MaxInt32 + 1 + v = NewValue(i) + isValidLongValue(int64(i), v) + } + }) + + gg.It("should create a valid IntegerValue on boundries of native int on 64 bit machines", func() { + if buffer.Arch64Bits { + i := math.MinInt64 + v := NewValue(i) + isValidIntegerValue(i, v) + + i = math.MaxInt64 + v = NewValue(i) + isValidIntegerValue(i, v) + } + }) + + gg.It("should create a valid LongValue on boundries of int64", func() { + i := int64(math.MinInt64) + v := NewValue(i) + isValidLongValue(i, v) + + i = int64(math.MaxInt64) + v = NewValue(i) + isValidLongValue(i, v) + }) + + gg.It("should create a valid FloatValue on boundries of float64", func() { + i := float64(-math.MaxFloat64) + v := NewValue(i) + isValidFloatValue(i, v) + + i = float64(math.MaxFloat64) + v = NewValue(i) + isValidFloatValue(i, v) + }) + + }) // numeric values context +}) diff --git a/aerospike-tls/vendor-aerospike-client-go/werrgroup.go b/aerospike-tls/vendor-aerospike-client-go/werrgroup.go new file mode 100644 index 00000000..7e36d334 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/werrgroup.go @@ -0,0 +1,73 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "context" + "sync" + + "golang.org/x/sync/semaphore" + + "github.com/aerospike/aerospike-client-go/v7/logger" +) + +type werrGroup struct { + sem *semaphore.Weighted + ctx context.Context + wg sync.WaitGroup + el sync.Mutex + errs Error + + // function to defer; used for recordset signals + f func() +} + +func newWeightedErrGroup(maxConcurrency int) *werrGroup { + if maxConcurrency <= 0 { + maxConcurrency = 1 + } + + return &werrGroup{ + sem: semaphore.NewWeighted(int64(maxConcurrency)), + ctx: context.Background(), + } +} + +func (weg *werrGroup) execute(cmd command) { + weg.wg.Add(1) + + if err := weg.sem.Acquire(weg.ctx, 1); err != nil { + logger.Logger.Error("Constraint Semaphore failed: %s", err.Error()) + } + + go func() { + defer weg.sem.Release(1) + defer weg.wg.Done() + if weg.f != nil { + defer weg.f() + } + + if err := cmd.Execute(); err != nil { + weg.el.Lock() + weg.errs = chainErrors(err, weg.errs) + weg.el.Unlock() + } + }() +} + +func (weg *werrGroup) wait() Error { + weg.wg.Wait() + return weg.errs +} diff --git a/aerospike-tls/vendor-aerospike-client-go/write_command.go b/aerospike-tls/vendor-aerospike-client-go/write_command.go new file mode 100644 index 00000000..9d23432a --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/write_command.go @@ -0,0 +1,116 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "github.com/aerospike/aerospike-client-go/v7/types" + + Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" +) + +// guarantee writeCommand implements command interface +var _ command = &writeCommand{} + +type writeCommand struct { + singleCommand + + policy *WritePolicy + bins []*Bin + binMap BinMap + operation OperationType +} + +func newWriteCommand(cluster *Cluster, + policy *WritePolicy, + key *Key, + bins []*Bin, + binMap BinMap, + operation OperationType) (writeCommand, Error) { + + var partition *Partition + var err Error + if cluster != nil { + partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) + if err != nil { + return writeCommand{}, err + } + } + + newWriteCmd := writeCommand{ + singleCommand: newSingleCommand(cluster, key, partition), + policy: policy, + bins: bins, + binMap: binMap, + operation: operation, + } + + return newWriteCmd, nil +} + +func (cmd *writeCommand) getPolicy(ifc command) Policy { + return cmd.policy +} + +func (cmd *writeCommand) writeBuffer(ifc command) Error { + return cmd.setWrite(cmd.policy, cmd.operation, cmd.key, cmd.bins, cmd.binMap) +} + +func (cmd *writeCommand) getNode(ifc command) (*Node, Error) { + return cmd.partition.GetNodeWrite(cmd.cluster) +} + +func (cmd *writeCommand) prepareRetry(ifc command, isTimeout bool) bool { + cmd.partition.PrepareRetryWrite(isTimeout) + return true +} + +func (cmd *writeCommand) parseResult(ifc command, conn *Connection) Error { + // Read header. + if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { + return err + } + + header := Buffer.BytesToInt64(cmd.dataBuffer, 0) + + // Validate header to make sure we are at the beginning of a message + if err := cmd.validateHeader(header); err != nil { + return err + } + + resultCode := cmd.dataBuffer[13] & 0xFF + + if resultCode != 0 { + if resultCode == byte(types.KEY_NOT_FOUND_ERROR) { + return ErrKeyNotFound.err() + } else if types.ResultCode(resultCode) == types.FILTERED_OUT { + return ErrFilteredOut.err() + } + + return newCustomNodeError(cmd.node, types.ResultCode(resultCode)) + } + return cmd.emptySocket(conn) +} + +func (cmd *writeCommand) isRead() bool { + return false +} + +func (cmd *writeCommand) Execute() Error { + return cmd.execute(cmd) +} + +func (cmd *writeCommand) transactionType() transactionType { + return ttPut +} diff --git a/aerospike-tls/vendor-aerospike-client-go/write_policy.go b/aerospike-tls/vendor-aerospike-client-go/write_policy.go new file mode 100644 index 00000000..492fc384 --- /dev/null +++ b/aerospike-tls/vendor-aerospike-client-go/write_policy.go @@ -0,0 +1,95 @@ +// Copyright 2014-2022 Aerospike, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aerospike + +import ( + "math" +) + +const ( + // TTLServerDefault will default to namespace configuration variable "default-ttl" on the server. + TTLServerDefault = 0 + // TTLDontExpire will never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server. + TTLDontExpire = math.MaxUint32 + // TTLDontUpdate will not change the record's ttl when record is written. Supported by Aerospike server versions >= 3.10.1 + TTLDontUpdate = math.MaxUint32 - 1 +) + +// WritePolicy encapsulates parameters for policy attributes used in write operations. +// This object is passed into methods where database writes can occur. +type WritePolicy struct { + BasePolicy + + // RecordExistsAction qualifies how to handle writes where the record already exists. + RecordExistsAction RecordExistsAction //= RecordExistsAction.UPDATE; + + // GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) + // indicates that the generation is not used to restrict writes. + GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; + + // Desired consistency guarantee when committing a transaction on the server. The default + // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to + // be successful before returning success to the client. + CommitLevel CommitLevel //= COMMIT_ALL + + // Generation determines expected generation. + // Generation is the number of times a record has been + // modified (including creation) on the server. + // If a write operation is creating a record, the expected generation would be 0. + Generation uint32 + + // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). + // Seconds record will live before being removed by the server. + // Expiration values: + // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. + // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server + // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 + // > 0: Actual expiration in seconds. + Expiration uint32 + + // RespondPerEachOp defines for client.Operate() method, return a result for every operation. + // Some list operations do not return results by default (ListClearOp() for example). + // This can sometimes make it difficult to determine the desired result offset in the returned + // bin's result list. + // + // Setting RespondPerEachOp to true makes it easier to identify the desired result offset + // (result offset equals bin's operate sequence). This only makes sense when multiple list + // operations are used in one operate call and some of those operations do not return results + // by default. + RespondPerEachOp bool + + // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. + // This prevents deleted records from reappearing after node failures. + // Valid for Aerospike Server Enterprise Edition 3.10+ only. + DurableDelete bool +} + +// NewWritePolicy initializes a new WritePolicy instance with default parameters. +func NewWritePolicy(generation, expiration uint32) *WritePolicy { + res := &WritePolicy{ + BasePolicy: *NewPolicy(), + RecordExistsAction: UPDATE, + GenerationPolicy: NONE, + CommitLevel: COMMIT_ALL, + Generation: generation, + Expiration: expiration, + } + + // Writes may not be idempotent. + // do not allow retries on writes by default. + res.MaxRetries = 0 + + return res +} From 984ecca6d4d0115f6c515b0f18cc7791240438e5 Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 16:22:46 +0530 Subject: [PATCH 2/8] aerospike-tls: drop vendored client, use upstream aerospike-client-go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove vendor-aerospike-client-go/ and the replace directive in go.mod. The sample now pulls aerospike-client-go/v7@v7.7.3 from the registry like every other samples-go entry. The vendored copy carried a two-function patch on ClientPolicy: serviceString/peersString were overridden to return *-clear-std instead of *-tls-std, working around the fact that Aerospike CE doesn't implement the EE-only TLS-variant discovery commands. The bundled keploy/test-set-{0,1,2}/ recordings still replay correctly because Keploy serves the discovery responses from mocks.yaml — the upstream client never gets a real ERROR:25:enterprise only at replay time. The README now flags the CE-vs-EE distinction so anyone re-recording against live CE knows to apply the patch (or point at Aerospike Enterprise) before running `keploy record`. 333 files removed, 80728 lines deleted; the sample drops from ~5.1 MB to ~1.7 MB. Co-Authored-By: Claude Opus 4.7 (1M context) --- aerospike-tls/README.md | 27 +- aerospike-tls/go.mod | 4 - .../vendor-aerospike-client-go/.build.yml | 15 - .../.github/workflows/build.yml | 56 - .../vendor-aerospike-client-go/.gitignore | 30 - .../.testcoverage.yml | 69 - .../vendor-aerospike-client-go/.travis.yml | 75 - .../.travis/aerospike.conf | 60 - .../.travis/proxy_check.sh | 15 - .../.travis/wait_for_node.sh | 38 - .../vendor-aerospike-client-go/CHANGELOG.md | 2331 ----------- .../vendor-aerospike-client-go/LICENSE | 202 - .../vendor-aerospike-client-go/README.md | 189 - .../admin_command.go | 742 ---- .../admin_policy.go | 48 - .../vendor-aerospike-client-go/aerospike.go | 3 - .../aerospike_bench_reflect_test.go | 75 - .../aerospike_bench_test.go | 116 - .../aerospike_suite_test.go | 525 --- .../anonymous_fields_test.go | 129 - .../vendor-aerospike-client-go/auth_mode.go | 34 - .../vendor-aerospike-client-go/batch_attr.go | 293 -- .../batch_command.go | 128 - .../batch_command_delete.go | 213 - .../batch_command_exists.go | 152 - .../batch_command_get.go | 269 -- .../batch_command_get_reflect.go | 90 - .../batch_command_operate.go | 303 -- .../batch_command_reflect.go | 91 - .../batch_command_udf.go | 223 - .../batch_delete.go | 97 - .../batch_delete_policy.go | 75 - .../batch_executer.go | 44 - .../batch_index_command_get.go | 109 - .../vendor-aerospike-client-go/batch_node.go | 41 - .../batch_node_list.go | 318 -- .../batch_policy.go | 122 - .../vendor-aerospike-client-go/batch_read.go | 159 - .../batch_read_policy.go | 70 - .../batch_record.go | 172 - .../vendor-aerospike-client-go/batch_test.go | 941 ----- .../vendor-aerospike-client-go/batch_udf.go | 127 - .../batch_udf_policy.go | 72 - .../vendor-aerospike-client-go/batch_write.go | 113 - .../batch_write_policy.go | 103 - .../bench_batchget_test.go | 172 - .../bench_cdt_list_test.go | 108 - .../bench_get_test.go | 169 - .../bench_interface_allocs_test.go | 106 - .../bench_key_test.go | 73 - .../bench_packing_test.go | 244 -- .../bench_rand_gen_test.go | 64 - .../bench_read_command_test.go | 161 - .../bench_recordset_test.go | 83 - .../bench_values_test.go | 118 - .../bench_write_command_test.go | 161 - .../vendor-aerospike-client-go/bin.go | 41 - .../bit_overflow_action.go | 31 - .../vendor-aerospike-client-go/bit_policy.go | 30 - .../bit_resize_flags.go | 32 - .../bit_write_flags.go | 39 - .../buffered_connection.go | 148 - .../bytes_buffer.go | 148 - .../vendor-aerospike-client-go/cdt.go | 135 - .../vendor-aerospike-client-go/cdt_bitwise.go | 516 --- .../cdt_bitwise_test.go | 966 ----- .../vendor-aerospike-client-go/cdt_context.go | 203 - .../cdt_context_test.go | 42 - .../vendor-aerospike-client-go/cdt_list.go | 882 ---- .../cdt_list_test.go | 816 ---- .../vendor-aerospike-client-go/cdt_map.go | 753 ---- .../cdt_map_test.go | 953 ----- .../vendor-aerospike-client-go/client.go | 1925 --------- .../client_appengine_exclusions.go | 154 - .../client_builder.go | 26 - .../client_builder_native.go | 36 - .../client_builder_proxy.go | 39 - .../vendor-aerospike-client-go/client_ifc.go | 138 - .../client_ifc_app_engine.go | 141 - .../client_ifc_app_engine_perf.go | 139 - .../client_ifc_as_performance.go | 141 - .../client_object_test.go | 1436 ------- .../client_policy.go | 216 - .../client_reflect.go | 277 -- .../client_reflect_test.go | 280 -- .../vendor-aerospike-client-go/client_test.go | 1768 -------- .../vendor-aerospike-client-go/cluster.go | 1010 ----- .../vendor-aerospike-client-go/command.go | 2907 ------------- .../commit_policy.go | 29 - .../complex_index_test.go | 103 - .../complex_query_test.go | 238 -- .../vendor-aerospike-client-go/connection.go | 596 --- .../connection_heap.go | 280 -- .../connection_heap_test.go | 89 - .../delete_command.go | 115 - .../vendor-aerospike-client-go/docs/README.md | 34 - .../docs/aerospike.md | 103 - .../vendor-aerospike-client-go/docs/client.md | 745 ---- .../docs/datamodel.md | 237 -- .../vendor-aerospike-client-go/docs/log.md | 24 - .../docs/performance.md | 41 - .../docs/policies.md | 254 -- .../vendor-aerospike-client-go/error.go | 528 --- .../vendor-aerospike-client-go/error_test.go | 145 - .../example_client_test.go | 98 - .../example_listiter_int_test.go | 75 - .../example_listiter_string_test.go | 74 - .../example_listiter_time_test.go | 78 - .../example_mapiter_test.go | 82 - .../example_pagination_cursor_test.go | 88 - .../examples/add/add.go | 86 - .../examples/append/append.go | 67 - .../examples/batch/batch.go | 163 - .../examples/blob/blob.go | 76 - .../count_set_objects_using_request_info.go | 104 - .../custom_list_iter/custom_list_iter.go | 135 - .../examples/expire/expire.go | 140 - .../examples/expressions/expressions.go | 85 - .../examples/generation/generation.go | 123 - .../examples/geojson_query/geojson_query.go | 92 - .../examples/get/.gitignore | 1 - .../examples/get/get.go | 92 - .../examples/info/info.go | 55 - .../examples/list_map/list_map.go | 282 -- .../examples/operate/operate.go | 61 - .../examples/prepend/prepend.go | 69 - .../examples/put/.gitignore | 1 - .../examples/put/put.go | 108 - .../examples/putget/putget.go | 100 - .../query-aggregate/average/average.go | 72 - .../single_bin_sum/single_bin_sum.go | 68 - .../examples/query-aggregate/udf/average.lua | 18 - .../query-aggregate/udf/sum_single_bin.lua | 11 - .../examples/replace/replace.go | 98 - .../examples/scan_paginate/scan_paginate.go | 66 - .../examples/scan_parallel/scan_parallel.go | 64 - .../examples/scan_serial/scan_serial.go | 94 - .../examples/shared/shared.go | 132 - .../examples/simple/simple.go | 98 - .../tls_secure_connection.go | 140 - .../examples/touch/touch.go | 81 - .../examples/udf/udf.go | 281 -- .../execute_command.go | 81 - .../execute_task.go | 148 - .../execute_task_native.go | 22 - .../exists_command.go | 109 - .../vendor-aerospike-client-go/exp_bit.go | 424 -- .../exp_bit_test.go | 455 -- .../vendor-aerospike-client-go/exp_hll.go | 213 - .../exp_hll_test.go | 200 - .../vendor-aerospike-client-go/exp_list.go | 675 --- .../exp_list_test.go | 569 --- .../vendor-aerospike-client-go/exp_map.go | 926 ----- .../exp_map_test.go | 674 --- .../exp_operation.go | 116 - .../exp_ops_test.go | 389 -- .../vendor-aerospike-client-go/expression.go | 1430 ------- .../expression_ops_test.go | 347 -- .../expression_test.go | 1058 ----- .../vendor-aerospike-client-go/field_type.go | 53 - .../vendor-aerospike-client-go/filter.go | 228 -- .../generation_policy.go | 30 - .../vendor-aerospike-client-go/generics.go | 3643 ----------------- .../vendor-aerospike-client-go/geo_test.go | 203 - .../vendor-aerospike-client-go/go.mod | 35 - .../vendor-aerospike-client-go/go.sum | 82 - .../vendor-aerospike-client-go/helper_test.go | 52 - .../hll_operation.go | 303 -- .../hll_operation_test.go | 901 ---- .../vendor-aerospike-client-go/hll_policy.go | 30 - .../hll_write_flags.go | 40 - .../vendor-aerospike-client-go/host.go | 71 - .../vendor-aerospike-client-go/host_test.go | 43 - .../index_collection_type.go | 73 - .../vendor-aerospike-client-go/index_test.go | 113 - .../vendor-aerospike-client-go/index_type.go | 32 - .../vendor-aerospike-client-go/info.go | 105 - .../vendor-aerospike-client-go/info_policy.go | 51 - .../internal/atomic/array.go | 72 - .../internal/atomic/atomic_test.go | 27 - .../internal/atomic/bool.go | 83 - .../internal/atomic/bool_test.go | 77 - .../internal/atomic/guard.go | 82 - .../internal/atomic/guard_test.go | 118 - .../internal/atomic/int.go | 157 - .../internal/atomic/int_test.go | 52 - .../internal/atomic/map/map.go | 118 - .../internal/atomic/queue.go | 81 - .../internal/atomic/queue_test.go | 72 - .../internal/atomic/sync_val.go | 61 - .../internal/atomic/typed_val.go | 23 - .../internal/atomic/typed_val_test.go | 126 - .../internal/lua/instance.go | 70 - .../internal/lua/lua.go | 158 - .../internal/lua/lua_aerospike.go | 64 - .../internal/lua/lua_aerospike_test.go | 56 - .../internal/lua/lua_list.go | 404 -- .../internal/lua/lua_list_test.go | 124 - .../internal/lua/lua_map.go | 393 -- .../internal/lua/lua_map_test.go | 77 - .../internal/lua/lua_stream.go | 132 - .../internal/lua/lua_suite_test.go | 30 - .../internal/lua/resources/aerospike.go | 205 - .../internal/lua/resources/stream_ops.go | 362 -- .../internal/seq/seq.go | 82 - .../vendor-aerospike-client-go/key.go | 166 - .../key_bench_test.go | 167 - .../vendor-aerospike-client-go/key_helper.go | 155 - .../key_reflect_test.go | 41 - .../vendor-aerospike-client-go/key_test.go | 141 - .../vendor-aerospike-client-go/language.go | 24 - .../vendor-aerospike-client-go/load_test.go | 91 - .../logger/logger.go | 131 - .../login_command.go | 207 - .../vendor-aerospike-client-go/marshal.go | 362 -- .../metrics_policy.go | 61 - .../multi_command.go | 430 -- .../multi_policy.go | 88 - .../vendor-aerospike-client-go/node.go | 963 ----- .../vendor-aerospike-client-go/node_stats.go | 400 -- .../vendor-aerospike-client-go/node_test.go | 364 -- .../node_validator.go | 316 -- .../operate_args.go | 100 - .../operate_command.go | 71 - .../vendor-aerospike-client-go/operation.go | 137 - .../vendor-aerospike-client-go/packer.go | 681 --- .../packer_reflect.go | 77 - .../packing_test.go | 408 -- .../vendor-aerospike-client-go/partition.go | 329 -- .../partition_filter.go | 107 - .../partition_parser.go | 279 -- .../partition_status.go | 49 - .../partition_tracker.go | 498 --- .../vendor-aerospike-client-go/partitions.go | 188 - .../vendor-aerospike-client-go/peers.go | 98 - .../peers_parser.go | 322 -- .../pkg/bcrypt/.gitignore | 5 - .../pkg/bcrypt/LICENSE | 29 - .../pkg/bcrypt/README | 46 - .../pkg/bcrypt/bcrypt.go | 190 - .../pkg/bcrypt/cipher.go | 415 -- .../pkg/ripemd160/ripemd160.go | 121 - .../pkg/ripemd160/ripemd160_test.go | 64 - .../pkg/ripemd160/ripemd160block.go | 161 - .../vendor-aerospike-client-go/policy.go | 241 -- .../vendor-aerospike-client-go/privilege.go | 146 - .../proto/auth/aerospike_proxy_auth.pb.go | 230 -- .../proto/auth/aerospike_proxy_auth.proto | 21 - .../auth/aerospike_proxy_auth_grpc.pb.go | 109 - .../proto/kvs/aerospike_proxy_kv.pb.go | 3616 ---------------- .../proto/kvs/aerospike_proxy_kv.proto | 831 ---- .../proto/kvs/aerospike_proxy_kv_grpc.pb.go | 1926 --------- .../proxy_auth_interceptor.go | 218 - .../proxy_client.go | 1531 ------- .../proxy_client_app_engine_exclusions.go | 28 - .../proxy_client_reflect.go | 231 -- .../proxy_client_test.go | 42 - .../proxy_commands.go | 517 --- .../vendor-aerospike-client-go/proxy_conv.go | 479 --- .../proxy_execute_task.go | 89 - .../proxy_query_partition_command.go | 162 - .../proxy_scan_command.go | 165 - .../query_aggregate_command.go | 155 - .../query_aggregate_test.go | 147 - .../query_command.go | 62 - .../query_context_test.go | 92 - .../query_duration.go | 48 - .../query_executor.go | 74 - .../query_objects_executor.go | 98 - .../query_partition_command.go | 68 - .../query_partitiopn_objects_command.go | 67 - .../query_policy.go | 56 - .../vendor-aerospike-client-go/query_test.go | 557 --- .../random_operation_test.go | 137 - .../read_command.go | 271 -- .../read_command_reflect.go | 473 --- .../read_command_reflect_test.go | 96 - .../read_header_command.go | 106 - .../read_mode_ap.go | 32 - .../read_mode_sc.go | 40 - .../vendor-aerospike-client-go/record.go | 73 - .../record_exists_action.go | 45 - .../vendor-aerospike-client-go/recordset.go | 209 - .../recordset_test.go | 46 - .../replica_policy.go | 48 - .../vendor-aerospike-client-go/role.go | 67 - .../scan_executor.go | 73 - .../scan_objects_executor.go | 96 - .../scan_partition_command.go | 79 - .../scan_partition_objects_command.go | 83 - .../vendor-aerospike-client-go/scan_policy.go | 42 - .../vendor-aerospike-client-go/scan_test.go | 411 -- .../security_test.go | 289 -- .../server_command.go | 96 - .../single_command.go | 63 - .../vendor-aerospike-client-go/statement.go | 115 - .../vendor-aerospike-client-go/task.go | 82 - .../task_drop_index.go | 62 - .../vendor-aerospike-client-go/task_index.go | 82 - .../task_register.go | 65 - .../vendor-aerospike-client-go/task_remove.go | 65 - .../test/resources/average.lua | 18 - .../test/resources/sum_single_bin.lua | 11 - .../test_utils_test.go | 138 - .../touch_command.go | 143 - .../truncate_test.go | 121 - .../vendor-aerospike-client-go/types/epoc.go | 30 - .../types/histogram/bench_histogram_test.go | 83 - .../types/histogram/histogram.go | 218 - .../types/histogram/histogram_test.go | 167 - .../types/histogram/log2hist.go | 141 - .../types/histogram/sync_histogram.go | 236 -- .../types/message.go | 107 - .../types/particle_type/particle_type.go | 33 - .../vendor-aerospike-client-go/types/pool.go | 72 - .../types/pool/buffer_pool_test.go | 70 - .../types/pool/tiered_buffer.go | 147 - .../types/rand/xor_shift128.go | 56 - .../types/result_code.go | 793 ---- .../vendor-aerospike-client-go/types/types.go | 15 - .../types/types_test.go | 27 - .../vendor-aerospike-client-go/udf.go | 11 - .../vendor-aerospike-client-go/udf_test.go | 441 -- .../vendor-aerospike-client-go/unpacker.go | 420 -- .../vendor-aerospike-client-go/user_roles.go | 50 - .../utils/buffer/buffer.go | 142 - .../vendor-aerospike-client-go/value.go | 1318 ------ .../value_helpers.go | 61 - .../value_reflect.go | 57 - .../vendor-aerospike-client-go/value_test.go | 216 - .../vendor-aerospike-client-go/werrgroup.go | 73 - .../write_command.go | 116 - .../write_policy.go | 95 - 333 files changed, 16 insertions(+), 80728 deletions(-) delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.build.yml delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.gitignore delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis.yml delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh delete mode 100644 aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh delete mode 100644 aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/LICENSE delete mode 100644 aerospike-tls/vendor-aerospike-client-go/README.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/admin_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/admin_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/auth_mode.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_attr.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_get.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_delete.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_executer.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_node.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_node_list.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_read.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_record.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_udf.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_write.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_get_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_key_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_values_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bin.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/buffered_connection.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_context.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_list.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_map.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder_native.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_object_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/client_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/cluster.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/commit_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/complex_index_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/complex_query_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/connection.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/connection_heap.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/delete_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/README.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/client.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/log.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/performance.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/docs/policies.md delete mode 100644 aerospike-tls/vendor-aerospike-client-go/error.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/error_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_client_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/add/add.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/append/append.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/get/get.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/info/info.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/put/put.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_task.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/execute_task_native.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exists_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_bit.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_hll.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_list.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_list_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_map.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_map_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_operation.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/expression.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/expression_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/field_type.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/filter.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/generation_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/generics.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/geo_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/go.mod delete mode 100644 aerospike-tls/vendor-aerospike-client-go/go.sum delete mode 100644 aerospike-tls/vendor-aerospike-client-go/helper_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_operation.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/host.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/host_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/index_collection_type.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/index_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/index_type.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/info.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/info_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/key.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/key_bench_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/key_helper.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/key_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/language.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/load_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/logger/logger.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/login_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/marshal.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/metrics_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/multi_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/multi_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/node.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/node_stats.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/node_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/node_validator.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/operate_args.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/operate_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/operation.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/packer.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/packer_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/packing_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partition.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_filter.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_parser.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_status.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partition_tracker.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/partitions.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/peers.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/peers_parser.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/privilege.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_commands.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_conv.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_context_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_duration.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_executor.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_partition_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/query_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/random_operation_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_header_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/record.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/record_exists_action.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/recordset.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/recordset_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/replica_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/role.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_executor.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_policy.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/scan_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/security_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/server_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/single_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/statement.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/task.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/task_drop_index.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/task_index.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/task_register.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/task_remove.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua delete mode 100644 aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua delete mode 100644 aerospike-tls/vendor-aerospike-client-go/test_utils_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/touch_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/truncate_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/epoc.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/message.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/pool/tiered_buffer.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/result_code.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/types.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/types/types_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/udf.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/udf_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/unpacker.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/user_roles.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/value.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/value_helpers.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/value_reflect.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/value_test.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/werrgroup.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/write_command.go delete mode 100644 aerospike-tls/vendor-aerospike-client-go/write_policy.go diff --git a/aerospike-tls/README.md b/aerospike-tls/README.md index 91341157..40718511 100644 --- a/aerospike-tls/README.md +++ b/aerospike-tls/README.md @@ -39,8 +39,7 @@ aerospike-tls/ │ ├── test-set-1/ # /parallel: shared client, n = 4..24 │ └── test-set-2/ # /multiclient + /freshclient ├── MOCKS_FLOW.md # annotated walk-through of test-set-0's mocks.yaml -├── stunnel/ # (referenced by docker-compose for TLS termination) -└── vendor-aerospike-client-go/ # local patch — see "Why the vendor dir" +└── stunnel/ # (referenced by docker-compose for TLS termination) ``` ## Endpoints @@ -139,15 +138,21 @@ startup — five clients warming in parallel produces hundreds of concurrent TLS dials and starves stunnel's fork rate. The retry wrapper covers their first burst instead. -## Why the vendor dir - -`vendor-aerospike-client-go/` is a local copy of the upstream -`aerospike-client-go/v7` with one behavior changed: it stops -trying to discover `peers-tls-std` / `service-tls-std`, which -Aerospike CE doesn't answer. Without the patch, the client floods -the cluster discovery loop with unanswered info commands during -TLS-only bring-up. `go.mod` pins to the vendored copy via a local -`replace` directive. +## A note on Aerospike CE vs EE for TLS discovery + +The upstream `aerospike-client-go/v7` driver assumes the cluster +answers Enterprise-only info commands (`service-tls-std` / +`peers-tls-std`) during topology discovery on a TLS connection. +Aerospike Community Edition replies `ERROR:25:enterprise only`, +which fails node validation even though the TLS handshake itself +succeeded. + +For replay (`keploy test`) that doesn't matter — Keploy serves the +recorded discovery responses from `mocks.yaml`. For live record +against CE, the cleanest options are to point at Aerospike +Enterprise, or to apply the two-line `serviceString` / +`peersString` override locally before recording. The bundled +test-sets in this repo were recorded with that override in place. ## What `MOCKS_FLOW.md` is for diff --git a/aerospike-tls/go.mod b/aerospike-tls/go.mod index 89bc8caa..8aab0883 100644 --- a/aerospike-tls/go.mod +++ b/aerospike-tls/go.mod @@ -4,10 +4,6 @@ go 1.26 require github.com/aerospike/aerospike-client-go/v7 v7.7.3 -// Local patch — see vendor-aerospike-client-go/client_policy.go for -// the reason (CE doesn't answer peers-tls-std / service-tls-std). -replace github.com/aerospike/aerospike-client-go/v7 => ./vendor-aerospike-client-go - require ( github.com/yuin/gopher-lua v1.1.1 // indirect golang.org/x/net v0.26.0 // indirect diff --git a/aerospike-tls/vendor-aerospike-client-go/.build.yml b/aerospike-tls/vendor-aerospike-client-go/.build.yml deleted file mode 100644 index 4c74ee52..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.build.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: aerospike-client-go -dir: src/github.com/aerospike/aerospike-client-go - -container: - - base: - - docker.qe.aerospike.com/build/golang:1.11 - -build: - - name: build - script: - - go get -v github.com/aerospike/aerospike-client-go - - go build -v -x github.com/aerospike/aerospike-client-go - - go install -v -x github.com/aerospike/aerospike-client-go/tools/cli - - go install -v -x github.com/aerospike/aerospike-client-go/tools/benchmark - - go install -v -x github.com/aerospike/aerospike-client-go/tools/asinfo diff --git a/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml b/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml deleted file mode 100644 index bb1436e4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.github/workflows/build.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Aerospike Go Client Tests -"on": - push: - pull_request: - -env: - AEROSPIKE_HOSTS: "127.0.0.1:3000" -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - go-version: - - "1.20" - - "1.21" - - "1.22" - steps: - - uses: actions/checkout@v3 - - name: "Setup Go ${{ matrix.go-version }}" - uses: actions/setup-go@v3 - with: - go-version: "${{ matrix.go-version }}" - cache: true - - name: Display Go version - run: go version - - name: Set up Aerospike Database - uses: reugn/github-action-aerospike@v1 - - name: Test Lua Code - run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites internal/lua - - name: Test types package - run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites types - - name: Test pkg tests - run: go run github.com/onsi/ginkgo/v2/ginkgo -cover -race -r -keep-going -succinct -randomize-suites pkg - - name: Build Benchmark tool - run: cd tools/benchmark | go build -tags as_proxy -o benchmark . - - name: Build asinfo tool - run: cd tools/asinfo | go build -o asinfo . - - name: Build cli tool - run: cd tools/cli | go build -o cli . - - name: Build example files - run: find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build - - name: Build with Reflection code removed - run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_performance" . - - name: Build for Google App Engine (unsafe package removed) - run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="app_engine" . - - name: Build for DBAAS (proxy mode) - run: go run github.com/onsi/ginkgo/v2/ginkgo build -tags="as_proxy" . - - name: Run the tests - run: go run github.com/onsi/ginkgo/v2/ginkgo -coverprofile=./cover_native.out -covermode=atomic -coverpkg=./... -race -keep-going -succinct -randomize-suites -skip="HyperLogLog" - - name: Combine Cover Profiles - run: go run github.com/wadey/gocovmerge cover_*.out > cover_all.out - - name: Check Code Coverage - uses: vladopajic/go-test-coverage@v2 - with: - # Configure action using config file (option 1) - config: ./.testcoverage.yml diff --git a/aerospike-tls/vendor-aerospike-client-go/.gitignore b/aerospike-tls/vendor-aerospike-client-go/.gitignore deleted file mode 100644 index a81cd81e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -*.prof -*.test -*.coverprofile* -tools/benchmark/benchmark -tools/asinfo/asinfo -debug/ -_debug/ -tmp/ -.DS_Store -TODO -PLAN.todo -.go_metalinter -.go_style -.golangci.yml -.travis/read-write-udf.ldif -.travis/people.ldif -.travis/modify.ldif -.travis/badwan.ldif -.travis/access.ldif -tools/ -cmd/ -.revive.toml -Makefile -testdata/ -Dockerfile* -.dockerignore -docker-compose.yml -golangci.yml -cover*.out -.vscode/settings.json diff --git a/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml b/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml deleted file mode 100644 index 5d2da411..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.testcoverage.yml +++ /dev/null @@ -1,69 +0,0 @@ -# (mandatory) -# Path to coverprofile file (output of `go test -coverprofile` command). -# -# For cases where there are many coverage profiles, such as when running -# unit tests and integration tests separately, you can combine all those -# profiles into one. In this case, the profile should have a comma-separated list -# of profile files, e.g., 'cover_unit.out,cover_integration.out'. -profile: cover_all.out - -# (optional; but recommended to set) -# When specified reported file paths will not contain local prefix in the output -local-prefix: "github.com/aerospike/aerospike-client-go/v7" - -# Holds coverage thresholds percentages, values should be in range [0-100] -threshold: - # (optional; default 0) - # The minimum coverage that each file should have - file: 0 - - # (optional; default 0) - # The minimum coverage that each package should have - package: 0 - - # (optional; default 0) - # The minimum total coverage project should have - total: 0 - -# Holds regexp rules which will override thresholds for matched files or packages -# using their paths. -# -# First rule from this list that matches file or package is going to apply -# new threshold to it. If project has multiple rules that match same path, -# override rules should be listed in order from specific to more general rules. -override: - # Increase coverage threshold to 100% for `foo` package - # (default is 80, as configured above in this example) - #- threshold: 100 - # path: ^pkg/lib/foo$ - -# Holds regexp rules which will exclude matched files or packages -# from coverage statistics -exclude: - # Exclude files or packages matching their paths - paths: - # - \.pb\.go$ # excludes all protobuf generated files - - proto/* - - ^pkg/* # exclude package `pkg/bar` - - client_builder.go - - info_policy.go - - commit_policy.go - - generation_policy.go - - privilege.go - - read_mode_ap.go - - read_mode_sc.go - - record_exists_action.go - - replica_policy.go - - generics.go - - proxy_auth_interceptor.go - - proxy_client.go - - proxy_client_reflect.go - - proxy_query_partition_command.go - - proxy_scan_command.go - - login_command.go - - types/histogram/histogram.go - - types/rand/xor_shift128.go - - internal/atomic/array.go -# NOTES: -# - symbol `/` in all path regexps will be replaced by current OS file path separator -# to properly work on Windows diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis.yml b/aerospike-tls/vendor-aerospike-client-go/.travis.yml deleted file mode 100644 index 37cb70d4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.travis.yml +++ /dev/null @@ -1,75 +0,0 @@ -language: go -os: -- linux -dist: xenial -go: -- "1.13" -- "1.14" -- "1.15" -- "1.16" -- tip -matrix: - allow_failures: - - go: tip -install: -- ifconfig -- if [ -d "$HOME/gopath/src/github.com/citrusleaf" ]; then mv $HOME/gopath/src/github.com/citrusleaf - $HOME/gopath/src/github.com/aerospike; fi -- export PATH=$PATH:$HOME/gopath/bin -- go get github.com/onsi/ginkgo/ginkgo -- go get github.com/onsi/gomega -- go get . -- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; - fi -- wget -O aerospike-server.tgz http://www.aerospike.com/download/server/latest/artifact/tgz -- tar xvzf aerospike-server.tgz -- cp -f .travis/aerospike.conf ./aerospike-server/share/etc -- cd aerospike-server -- mkdir instance1 -- mkdir instance2 -- ./bin/aerospike init --home instance1 --instance 1 --service-port 3000 -- ./bin/aerospike init --home instance2 --instance 2 --service-port 3010 -- cd instance1 -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../.. -- pwd -script: -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites internal/lua -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites types -- ginkgo -cover -race -r -keepGoing -succinct -randomizeSuites pkg -#- find tools -name "*.go" -type f -print0 | xargs -0 -n1 go build -- cd tools/benchmark | go build -o benchmark . -- cd tools/asinfo | go build -o asinfo . -- chmod +x asinfo -- cd tools/cli | go build -o cli . -- find examples -name "*.go" -type f -print0 | xargs -0 -n1 go build -- ginkgo build -tags="as_performance" . -- ginkgo build -tags="app_engine" . -- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" -- cd aerospike-server/instance1 -- sudo ./bin/aerospike stop -- cat /dev/null > var/log/aerospike.log -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../instance2 -- sudo ./bin/aerospike start -- ../../.travis/wait_for_node.sh var/log/aerospike.log -- cd ../.. -- ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -- -use-replicas -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="as_performance" -# - ginkgo -race -keepGoing -succinct -randomizeSuites -slowSpecThreshold=15 -tags="app_engine" -- .travis/proxy_check.sh -notifications: - hipchat: - rooms: - secure: mGFpOr8JWxK0bYj6wK3ur5+qtsfK+Im1njfPgoQ2b/Sudlii/mr2QiHyQRHtstw7tr79nyoMYgQ1lc53pTxUNAVSI/PkTJTBaDE4ZkyUG5+UW8NgMsC6FYhRfgu0xq+SBNn5a6KbrL8puQq0FH6fjEDYC00QqmN5L/967WCxF8g= - email: - - qe-notices@aerospike.com - - qe-notices-clients@aerospike.com - slack: - secure: FwRNnmQZLVD3ygwu66ujNTsy1rHKFAV01wZJCad+L0r5I54lxFWZxsO0JtRbhFyZ0yb4fhls4dPpczTqQrtlRgUzWW55u2i5T/bkTWxOik8QPJW35n9EvSOMYgiTQs1PQeSYwRmiqn0aDd8Fu1RAvB71nLKeyccYbVMHGyhpAq8= diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf b/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf deleted file mode 100644 index f9483ad8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.travis/aerospike.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Aerospike database configuration file. - -# This stanza must come first. -service { - user ${user} - group ${group} - run-as-daemon - paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. - pidfile ${home}/var/run/aerospike.pid -# transaction-queues 8 -# transaction-threads-per-queue 8 - proto-fd-max 10000 - work-directory ${home}/var -} - -logging { - # Log file must be an absolute path. - file ${home}/var/log/aerospike.log { - context any info - } -} - -mod-lua { -# system-path ${home}/share/udf/lua - user-path ${home}/var/udf/lua -} - -network { - service { - address ${service_addr} - port ${service_port} -# reuse-address -# network-interface-name venet0 - } - - heartbeat { - mode multicast - multicast-group ${multicast_addr} - port ${multicast_port} - - interval 150 - timeout 10 - } - - fabric { - port ${fabric_port} - } - - info { - port ${info_port} - } -} - -namespace test { - replication-factor 1 - memory-size 1G - default-ttl 30d # 30 days, use 0 to never expire/evict. - storage-engine memory - allow-ttl-without-nsup true -} diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh b/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh deleted file mode 100644 index 843745a4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.travis/proxy_check.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -./asinfo -p 3000 -v "namespace/test" | grep -q ";client_proxy_complete=0;" -if [ $? -ne 0 ] -then - exit 1 -fi - -./asinfo -p 3010 -v "namespace/test" | grep -q ";client_proxy_complete=0;" -if [ $? -ne 0 ] -then - exit 1 -fi - -exit 0 \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh b/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh deleted file mode 100644 index 71513c45..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/.travis/wait_for_node.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright 2013-2020 Aerospike, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -################################################################################ - -LOG=$1 -if [ ! -f $LOG ]; then - echo "A log file does not exist at $LOG" - exit 1 -fi - -i=0 -while [ $i -le 12 ] -do - sleep 1 - grep -i "there will be cake" $LOG - if [ $? == 0 ]; then - exit 0 - else - i=$(($i + 1)) - echo -n "." - fi -done -echo "the cake is a lie!" -tail -n 1000 $LOG -exit 2 \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md b/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md deleted file mode 100644 index 6ae33281..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/CHANGELOG.md +++ /dev/null @@ -1,2331 +0,0 @@ -# Change History - -## November 29 2024: v7.7.3 - - Minor fix release. - -- **Fixes** - - [CLIENT-3196] Parse nil keys properly in scan/query operations. - -## November 1 2024: v7.7.2 - - Minor fix release. - -- **Fixes** - - [CLIENT-3156] Fix an issue where rack policy always returns the master node. Resolves #455 - -## September 18 2024: v7.7.1 - - Hot Fix release. This version fixes a major bug introduced in v7.7.0. You should use this release instead. - -- **Fixes** - - [CLIENT-3122] Fix `nil` dereference in the tend logic. - -## September 13 2024: v7.7.0 - - Minor improvement release. - -- **Improvements** - - [CLIENT-3112] Correctly handle new error messages/error codes returned by AS 7.2. - - [CLIENT-3102] Add "XDR key busy" error code 32. - - [CLIENT-3119] Use Generics For a General Code Clean Up - Uses several new generic containers to simplify concurrent access in the client. - Uses a Guard as a monitor for the tend connection. This encapsulates synchronized tend connection management using said Guard. - - Add documentation about client.WarmUp to the client initialization API. - -- **Fixes** - - [CLIENT-3082] BatchGet with empty Keys raises gRPC EOF error. - -## August 12 2024: v7.6.1 - - Minor improvement release. - -- **Improvements** - - [CLIENT-3071] Increase info command max response buffer size to 64 MiB. - -## July 19 2024: v7.6.0 - - Minor fix release. - -- **Improvements** - - [CLIENT-3045] Move proxy client build behind a build flag. - This removes the GRPC compilation and potential namespace conflict from the default build and moves it behind the compiler build flag "as_proxy". - -- **Fixes** - - [CLIENT-3022] `Close()` throws a `nil` pointer error on `ProxyClient` without Authentication. - - [CLIENT-3044] Circular reference in between `Client`<->`Cluster` causes memory leak when the client is not closed manually. - - [CLIENT-3046] Wrong return type in Single Key Batch Operations with Multiple Ops per Bin. - - [CLIENT-3047] Fix pointer value assignment in baseMultiCommand.parseKey (#443). - - [CLIENT-3048] Use precomputed ops variable in batchIndexCommandGet.executeSingle (#442). - - [CLIENT-3049] Use a specialized pool for grpc conns to prevent premature reaping. - -## July 1 2024: v7.5.0 - - This a minor feature and fix release. - -- **New Features** - - [CLIENT-2968] Support new v7.1 proxy server features: - - `Info` command. - - `QueryPolicy.QueryDuration` - - [CLIENT-3012] Support new server 7.1 info command error response strings. - -- **Improvements** - - [CLIENT-2997] Scans should work in a mixed cluster of v5.7 and v6.4 server nodes. - - [CLIENT-3020] Change `ReadModeSC` doc from server to client perspective. - -- **Fixes** - - [CLIENT-3019] Prevent Goroutine leak in `AuthInterceptor` for the Proxy Client. - -## May 20 2024: v7.4.0 - - This a minor fix release. We strongly suggest you upgrade to this version over the v7.3.0 if you use the `Client.BatchGetOperate` API. - -- **Improvements** - - Add code coverage tests to the Github Actions workflow. - - Call the `CancelFunc` for the `context.WithTimeout` per linter suggestions in grpc calls. - - Minor clean up and remove dead code. - -- **Fixes** - - [CLIENT-2943] `Client.BatchGetOperate` does not consider ops in single key transforms. - - [CLIENT-2704] Client dev tests failing with new server map key restrictions. - - Fix `as_performance` and `app_engine` build tags. - -## May 3 2024: v7.3.0 - -> [!WARNING] -> Do not use this version if you are using the `Client.BatchGetOperate` API. - -This is a major feature release of the Go client and touches some of the fundamental aspects of the inner workings of it. -We suggest complete testing of your application before using it in production. - -- **New Features** - - [CLIENT-2238] Convert batch calls with just one key per node in sub-batches to Get requests. - If the number keys for a sub-batch to a node is equal or less then the value set in BatchPolicy.DirectGetThreshold, the client use direct get instead of batch commands to reduce the load on the server. - - - [CLIENT-2274] Use constant sized connection buffers and resize the connection buffers over time. - - The client would use a single buffer on the connection and would grow it - per demand in case it needed a bigger buffer, but would not shrink it. - This helped with avoiding using buffer pools and the associated - synchronization, but resulted in excessive memory use in case there were a - few large records in the results, even if they were infrequent. - This changeset does two things: - 1. Will use a memory pool for large records only. Large records - are defined as records bigger than `aerospike.PoolCutOffBufferSize`. - This is a tiered pool with different buffer sizes. The pool - uses `sync.Pool` under the cover, releasing unused buffers back to the - runtime. - 2. By using bigger `aerospike.DefaultBufferSize` values, the user can - imitate the old behavior, so no memory pool is used most of the time. - 3. Setting `aerospike.MinBufferSize` will prevent the pool using buffer sizes too small, - having to grow them frequently. - 4. Buffers are resized every 5 seconds to the median size of buffers used over the previous period, - within the above limits. - - This change should result in much lower memory use by the client. - - - [CLIENT-2702] Support Client Transaction Metrics. The native client can now track transaction latencies using histograms. Enable using the `Client.EnableMetrics` API. - -- **Improvements** - - [CLIENT-2862] Use default batch policies when the record level batch policy is nil. - - [CLIENT-2889] Increase grpc `MaxRecvMsgSize` to handle big records for the proxy client. - - [CLIENT-2891] Export various batch operation struct fields. Resolves #247. - - Remove dependency on `xrand` sub-package since the native API is fast enough. - - Linter Clean up. - - `WritePolicy.SendKey` documentation, thanks to [Rishabh Sairawat](https://github.com/rishabhsairawat) - - Replaced the deprecated `ioutil.ReadFile` with `os.ReadFile`. PR #430, thanks to [Swarit Pandey](https://github.com/swarit-pandey) - -- **Fixes** - - [CLIENT-2905] Fix inconsistency of handling in-doubt flag in errors. - - [CLIENT-2890] Support `[]MapPair` return in reflection. - This fix supports unmarshalling ordered maps into `map[K]V` and `[]MapPair` in the structs. - -## April 10 2024: v7.2.1 - -This release updates the dependencies to mitigate security issues. - -- **Fixes** - - [CLIENT-2869] Update modules. Fix Allocation of Resources Without Limits or Throttling for `golang.org/x/net/http2`. - -## March 28 2024: v7.2.0 - -This is a major update. Please test your code thoroughly before using in production. - -- **New Features** - - [CLIENT-2766] Support `RawBlobValue` in the Go client. - - [CLIENT-2767] Support Persistent List Indexes. - - [CLIENT-2823] Support `QueryDuration`. - - [CLIENT-2831] Support `ReadPolicy.ReadTouchTTLPercent`. - - [CLIENT-2240] Add more client statistics. - - Adds the following statistics: - - `circuit-breaker-hits`: Number of times circuit breaker was hit. - - `connections-error-other`: Connection errors other than timeouts. - - `connections-error-timeout`: Connection Timeout errors. - - `connections-idle-dropped`: The connection was idle and dropped. - - `connections-pool-overflow`: The command offered the connection to the pool, but .the pool was full and the connection was closed - - `exceeded-max-retries`: Number of transactions where exceeded maximum number of retries specified in the policy - - `exceeded-total-timeout`: Number of transactions that exceeded the specified total timeout - - `total-nodes`: Total number of nodes in the cluster - - Export private fields in `PartitionStatus` and add `Recordset.BVal`. - -- **Improvements** - - [CLIENT-2784] Do not use batch repeat flag on batch writes when `policy.SendKey` is set to `true`. - - [CLIENT-2442] Document that Only `string`, `integer`, `bytes` are allowed as map key types; `Policy.SendKey` clarification. - - Reduce the required Go version to 1.20 to support EL9; Update the dependencies. - - Update `ExpCond()` doc to say that all action expressions must return the same type. - -- **Fixes** - - [CLIENT-2811] `RespondPerEachOp` doesn't work for list operation. To allow backwards compatibility, this change will change the default value of `RespondPerEachOp` to `true`. - - [CLIENT-2818] Fix return type for `ExpListRemoveByValueRange`. - - Update the proto grpc files to resolve namespace issues. - - Improve the tests for `BatchOperations` to run on Github Actions. - - Fix tests that relied on the server nsup-period setting to be larger than zero. - - Fix Truncate test on slow servers. - -## January 25 2024: v7.1.0 - -- **New Features** - - Add `TaskId()` to `ExecuteTask`. - - [CLIENT-2721] Make `PartitionFilter.Retry` public. - -- **Improvements** - - - Clean up documentation and remove dependency of examples to the v6 version of the client. - -- **Fixes** - - - [CLIENT-2725] `QueryExecute` (background query) doesn't work without operations. - - [CLIENT-2726] Proxy doesn't handle invalid filter expression error in query. - - [CLIENT-2727] Go proxy: Query Pagination never complete. - - [CLIENT-2728] Fix an issue where Bin names were ignored if a FilterExpression was passed to the Query. - - [CLIENT-2732] Go proxy: Not able to multiple query calls with the same statement. - - [CLIENT-2759] Go proxy: Background query with Expression doesn't filter records. - -## December 11 2023: v7.0.0 - -> [!CAUTION] -> This is a breaking release. It is required to allow upgrading your programs to the Aerospike Server v7. This program upgrade process required as a prerequisite to upgrading your cluster, otherwise seemless cluster upgrade will not be possible. The changes and their rationale are documented in the following section. - -- **Breaking Changes** - - - [CLIENT-2713] Handle Normalized Integers in Maps and Lists. - Aerospike Server v7 normalizes all positive integers in Maps and Lists into unsigned values for various efficiency reasons, and returns them as uint64. This effectively means that the type of positive `int64` values will be lost. Go client supported `uint64` types in lists and maps, and this change breaks that functionality by normalizing the values and removing the sign bits in case they are not needed. To support all versions of the server before and after the v7 consistently, the Go client will now behave like other Aerospike smart clients and automatically convert all unsigned int64 values inside maps and lists into signed values. This means a `math.MaxUint64` value in a List or Map will return as two's compliment: -1. - Example: - - ```go - client.Put(wpolicy, key, BinMap{"map": map[any]any{"max": uint64(math.MaxUint64), "typed": uint64(0)}}) - ``` - - will return as: - - ```go - rec, err := client.Get(rpolicy, key) - // rec.Bins will be: - // BinMap{"map": map[any]any{"max": int64(-1), "typed": int64(0)}} - ``` - - This will break all code that used to cast `rec.Bins["map"].(map[any]any)["max].(uin64)`. As a result, all such code should cast to int64 and then convert back to `uint64` via a sign switch. - If you didn't use `uint64` values in Maps ans Lists, you should not be affected by this change. - All the test cases that depended on the old behavior have been adapted to the new behavior. - - [CLIENT-2719] Typed `GeoJSON` and `HLL` deserialization. - The Go client would read GeoJSON and HLL values back as `string` and `[]byte` respectively. So if you read a record with bins of these types and wrote it directly back to the database, the type of these fields would be lost. - The new version addresses this issue, but could be a breaking change if you have code that casts the values to the old `string` and `[]byte`. You now need to cast these values to `GeoJSONValue` and `HLLValue` types respectively. - - [CLIENT-2484] Add `returnType` to supported `ExpMapRemoveBy*` and `ExpListRemoveBy*` methods. - - - [CLIENT-2319] Revise BatchReadAPIs to accept BatchReadPolicy argument. `NewBatchReadOps` no longer takes `binNames` and changes ops parameter to variadic for consistency. - - Changes the following Public API: - - ```go - func NewBatchRead(key *Key, binNames []string) *BatchRead { - func NewBatchReadOps(key *Key, binNames []string, ops []*Operation) *BatchRead { - func NewBatchReadHeader(key *Key) *BatchRead { - ``` - - to - - ```go - func NewBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) *BatchRead { - func NewBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) *BatchRead { - func NewBatchReadHeader(policy *BatchReadPolicy, key *Key) *BatchRead { - ``` - - - Replace `WritePolicy` with `InfoPolicy` in `client.Truncate`. - - Remove the deprecated `ClientPolicy.RackId`. Use `Policy.RackIds` instead. - -- **New Features** - - - [CLIENT-2712] [CLIENT-2710] Support read replica policy in scan/query. - This includes `PREFER_RACK` which allows scan/query to be directed at local rack nodes when possible. - - [CLIENT-2434] Use 'sindex-exists' command in `DropIndexTask`. - - [CLIENT-2573] Support `ExpRecordSize()`. - - [CLIENT-2588] SINDEX Support for 'Blob' Type Elements. - - [CLIENT-2721] Make PartitionFilter.Retry public. - - Add TaskId() to ExecuteTask. - -- **Improvements** - - [CLIENT-2694] Use RawURLEncoding instead of RawStdEncoding in proxy authenticator. - - [CLIENT-2616] Update dependencies to the latest, require Go 1.21 - - Remove HyperLogLog tests from the Github Actions suite - - Remove Go v1.18-v1.20 from the Github Actions Matrix - - Rename grpc proto definition files due to compiler limitations. Resolves #414 - -- **Fixes** - - [CLIENT-2318] Fixes an issue where Expression in `BatchPolicy` takes precedence rather than `BatchDeletePolicy` in `BatchDelete`. - - -## November 1 2023: v6.14.1 - - Hotfix. - -- **Fixes** - - - [CLIENT-2624] `BatchGetOperate` triggering SIGSEGV nil pointer in the Go client. - Caching of the operation is faulty and causes race conditions when used concurrently. - This commit removes the caching which included a useless allocation and rarely, if ever, had any practical influence on performance. - - -## August 2023: v6.14.0 - -- **New Features** - - - Adds support for the AerospikeProxy and DBAAS service. - - -## July 28 2023: v6.13.0 - -- **New Features** - - - Add `ClientPolicy.SeedOnlyCluster` in clientPolicy for using only seedNodes for connection. (Github #407) thanks to [Sudhanshu Ranjan](https://github.com/sud82) - - [CLIENT-2307] Add ExpInfinityValue() and ExpWildCardValue() - - [CLIENT-2316], [CLIENT-2317] BatchResult Err and ResultCode are not always set on errors, Incorrect in-doubt flag handling during batch operation. - -- **Improvements** - - - [CLIENT-2317] Better handle setting the Error.InDoubt flag in commands - - [CLIENT-2379] Fix returning overall batch error - - Move particle type outside of internal and back to `types/` dir. - - Updated dependencies to address security advisories. - - Improve tests in slow environments. - - Remove atomic integer operations, move to Mutex. - - [CLIENT-2315] Use BatchReadPolicy in BatchRead instead of BatchPolicy. - - [CLIENT-2312] Remove support for old-style queries. - - [CLIENT-2265] Increase the required Go version to 1.17 to be able to compile a dependency which itself was updated due to security issues. - - -- **Fixes** - - - Removes race condition from the client, resolves #399. - - [CLIENT-2339] Developer tests detecting race condition after updating query protocol. - - Assign DefaultInfoPolicy on Client initialization. - - Fixed panics in Read Command Reflection API. (Github #402) thanks to [Yegor Myskin](https://github.com/un000) - - [CLIENT-2283] Set correct return types in list/map read expressions. - - -## March 20 2023: v6.12.0 - -- **Improvements** - - - [CLIENT-2235] Minor documentation cleanup. Formatting, clarification and TODOs for next major version. - - [CLIENT-2234] Export `BatchRead.Policy` - - Update Ginkgo and Gomega to the latest version to avoid security issues. - -- **Fixes** - - - [CLIENT-2230] The first row of batch records represented a server error instead of the over error in call. - - [CLIENT-2233] Wrong FilterExpression size calculation in BatchOperate commands - -## March 9 2023: v6.11.0 - -- **Improvements** - - - [CLIENT-2116] Check for completion/cancellation of the Scan/Query before firing off commands to nodes. - -- **Fixes** - - - [CLINET-2227] PARAMETER_ERROR using expressions and batch write. Wire protocol was violated when the estimateExpressionSize was called. - -## February 8 2023: v6.10.0 - -- **New Features** - - - [CLIENT-2170] Export `MapReturnTypes`, `MapOrderTypes` and `MapWriteModes`. - - [CLIENT-2129], [CLIENT-2035] Adds `Expression.Base64()` and `ExpFromBase64()` to allow for serialization of expressions. - -## January 23 2023: v6.9.1 - - Hotfix release. - -- **Fixes** - - Mark `PartitionStatus.unavailable` and `PartitionStatus.replicaIndex` as transient in `PartitionFilter.EncodeCursor`. - -## January 23 2023: v6.9.0 - - NOTICE: This release is redacted. Please use v6.9.1. - -- **New Features** - - [CLIENT-2138] Allow PartitionFilter to persist its cursor, and retrieve the encoded cursor back to allow pagination. While the Go client supported pagination, it did not export the necessary data structures to allow that cursor to be persisted by the user. These data structures remain private, but two methods (`PartitionFilter.EncodeCursor` and `PartitionFilter.DecodeCursor`) are exported on the PartitionFilter to allow this mechanism to work. - -## January 10 2023: v6.8.0 - -- **New Features** - - - [CLIENT-1988] dded base64 encoding functions `CDTContextToBase64` and `Base64ToCDTContext` for `CDTContext`. - -- **Improvements** - - - Added an example for regexp expressions in Queries. - -- **Fixes** - - - [CLIENT-1204] Retry logic will keep retrying on `KEY_NOT_FOUND` errors until `policy.MaxRetries` is hit or record is returned to the client. - -## December 5 2022: v6.7.0 - -This is a minor improvement and fix release. - -- **Improvements** - - - Improves testing for float64 precision formatting between amd64 and aarch64. - -- **Fixes** - - - [CLIENT-2019] Write Batch operation with an invalid namespace record causes all batch transactions to fail. - - [CLIENT-2020] Support `QueryPartitions` with non-nil filter (secondary index query) - -## November 8 2022: v6.6.0 - -This is a minor improvement and fix release. - -- **Improvements** - - - [CLIENT-1959] Retry a foreground scan/query partition to a different replica when a partition unavailable error occurs. - - [CLIENT-1957] Handle Query, QueryExecute and QueryAggregate on non-existing sets without timing out. - - [CLIENT-1956] Return an error when a read operation is used in a background query. - -- **Fixes** - - - [CLIENT-1958] Prevent division by zero if the node array is empty in `Cluster.GetRandomNode()`. - - [CLIENT-1955] Allow `BatchPolicy.SendKey` to be applied to all batch keys in all batch commands. Batch commands used in `BatchOperate` take an independent policy object. We used to ignore the `SendKey` attribute in those policies. - -## October 26 2022: v6.5.0 - -This is a Minor feature and fix release. We recommend you update your client if you are using batch operate API. - -- **New Features** - - - [CLIENT-1852] Add `ListSetWithPolicyOp` to list operations. - -- **Fixes** - - - [CLIENT-1852] Fix `ListRemoveByIndexRangeOp` index param type. - - [CLIENT-1855] Fix an issue where `ListGetByValueRangeOp`, `ListRemoveByValueRangeOp` with `nil` end value return empty slice. - - [CLIENT-1867] Fix an issue where `BatchOperate` returns unexpected `ResultCode` for successful records when a record within a batch returns an error. - -## September 16 2022: v6.4.0 - -This is a Major fix release. We recommend you update to this version ASAP. - -- **Fixes** - - - [CLIENT-1827] IdleTimeout new default 0 may be missing tend thread reaping. - - [CLIENT-1822] Scan/Query/Other streaming commands, including some Batch could put a faulty connection back to the pool after a cluster event where in certain conditions its buffer contents would end up in another scan and mix the results. - - Update go.mod, redact buggy versions and update required Go version to v1.16 - -- **Improvements** - - - Update the examples for the new retriable scan/queries - - Avoid indirection for `[]byte` conversion during reflection. Resolves #382. - - Change v5 to v6 in some documentation. - -## August 29 2022: v6.3.0 - -[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. - -- **New Features** - - - [CLIENT-1802] Support creating an secondary index on elements within a CDT using context. Supported by server v6.1+. - - [CLIENT-1773] Change client configuration defaults: - - Set `ClientPolicy.ConnectionQueueSize` from 256 to 100. - - Set `ClientPolicy.IdleTimeout` from 55 to 0 secs. - - Set `ClientPolicy.MaxErrorRate` from 0 to 100. - - Set `Policy.TotalTimeout from` 0 to 1000ms for all commands except scan/query. - -- **Fixes** - - - Fixed a few Linter warnings. - -- **Improvements** - - - Documented a few constraints in HLL API docs. - - Documented that PartitionFilter is both a filter and a cursor in the API docs. - -## July 27 2022: v6.2.1 - -[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. - -This is mostly a re-release of v6.2.0, with one added minor change. It seems that we bungled the github tag somehow for that release. Upgrade from v6.2.0 to this version for the changes in that version to be applied to your code. - -- **Fixes** - - - Add a nil check for error in batch retry to be on the safe side. - -## June 30 2022: v6.2.0 - -[**IMPORTANT NOTE**] A bug might occur when a client performing a scan hits a “Partition Unavailable” during an unstable cluster (in both high availability (AP) and strong consistency (CP) modes). Previous versions of the client aborted the scan and put the connection back into the pool, which might cause unprocessed results to be sent to a different transaction (of the same client), possibly resulting in incorrect application behavior. This has been fixed by Go Client v5.10.0 and v6.4.0. - -NOTE: It seems that the tag reference for this release was incorrect on Github, or we somehow confused the `Go mod`. Do not use this version. Use v6.2.1 instead. - -This is a major fix release. We recommend upgrading to this release if you are using `BatchOperate` or `Scan/Queries`. - -- **Fixes** - - - [CLIENT-1783] Client crashes when tracker is `nil` during Scan/Queries. - - [CLIENT-1782] `BatchOperate` doesn't return error `BATCH_MAX_REQUESTS_EXCEEDED`. - - [CLIENT-1781] Fix `BatchOperate`: use offset index to pick correct record. - -## June 23 2022: v6.1.0 - -NOTE: This release contains a bug in `BatchOperate` command. If you are using that command, we strongly recommend you upgrade to v6.2.1. - -This is a minor feature and bug fix release version. - -- **New Features** - - - [CLIENT-1747] Add `EXISTS` return type for CDT read operations. - -- **Fixes** - - - [CLIENT-1754] Go SDK doesn't support MapIncrementOp for batch write. - - [CLIENT-1770] Assume background query is complete when the server 6.0+ returns 'not found' in 'query-show' info command. For the old servers, the client will check if it has already observed the job before. If it has, it will also assume the job has finished. - -## April 7 2022: v6.0.0 - -NOTE: This release contains a bug in `BatchOperate` command. If you are using that command, we strongly recommend you upgrade to v6.2.1. - -This is a major feature release. It adds several new features supported by the server v6, and drops supports for Predicate Expressions. - -- **New Features** - - - [CLIENT-1699] Support New v6 Queries. - - [CLIENT-1700] Support New Server v6 Roles and Privileges. - - [CLIENT-1701] Support New Batch Writes. - - [CLIENT-1702] Remove PredExp feature from the client. - -## April 7 2022: v5.8.0 - -This is a major fix release. We recommend upgrading to this release if you are using authentication. - -- **Improvements** - - - Adds notices regarding Auth issue to CHANGELOG and clarifies how to change code for an old breaking change in v3. - - Forward compatibility with Server v6 regarding queries and scans not sending a fresh message header per partition. - -- **Fixes** - - - [CLIENT-1695] Fixes a potential `nil` deference in `sessionInfo.isValid()` method. - - Fixes an issue where with default policies and after certain errors the replica node was not selected on retry. - -## December 6 2021: v5.7.0 - -- **Improvements** - - - Improve `Policy.deadline()` logic to use `MaxRetries` and `SocketTimeout` to calculate `TotalTimeout` when it is not set. - - [CLIENT-1635] Allow Preventing Retries on Exhausted Connection Pools. - - Do not test `PredExp` for server v5.8+. - - Explicitly remove departed nodes from the partition map on cluster change. - -## September 17 2021: v5.6.0 - -- **Fixes** - - - [CLIENT-1605] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. This fix invalidates the Session Token on unsuccessful login, Copy token from the connection buffer, and will consider tend interval in session expiration calculations. - -## September 6 2021: v5.5.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -- **New Features** - - - [CLIENT-1586] Support Batch Read Operations. - -- **Improvements** - - - Add authentication to info example. - -- **Fixes** - - - Fix the worng udf name in predexp test. - -## August 16 2021: v5.4.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -- **New Features** - - - [CLIENT-1576] Support a list of preferred racks rather than a single rack when replica is `PREFER_RACK`. - - [CLIENT-1577] Support PKI authentication where the TLS certificate's common name (CN) specifies the Aerospike user name. - - [CLIENT-1578] Support `scan-show` and `query-show` info commands. - -- **Improvements** - - - Run fewer iterations for CDT RSHIFTEX and LSHIFTEX. - - Add PKI authentication to the benchmark utility. - -## August 2 2021: v5.3.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -- **Improvements** - - - Improve seeding of cluster nodes in tend. All seeds are discovered and added on the first step. - - Add `-hosts` flag to test command arguments. - -- **Fixes** - - - Fix where Bin names were not sent to the server in GetXXX commands and all bins were retrieved. - -## June 28 2021: v5.2.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -Major fix release. We recommend updating to this version immediately. - -- **New Features** - - - Add support for boolean bins in expressions (`ExpBoolBin`). - - Add `Node.PeersGeneration`, `Node.PartitionGeneration`, `Node.RebalanceGeneration`. - - Support TLS connections in benchmark tool. Resolves #313. - - Expose Partition Health API to the user (`Cluster.Healthy()`). Resolves #334. - -- **Improvements** - - - Do not keep connection on all client-side errors - - Refactor batch commands to better reflect that keys are not created on batch requests. - - Mention List/Map WriteFlags in List/Map Policy constructors. - - Fix `ClientPolicy.ErrorRateWindow` documentation. - - Fix benchmark document. Thanks to [Koji Miyata](https://github.com/miyatakoji) - - Fix unidiomatic variable naming. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) - -- **Fixes** - - - Fix an issue where batch commands for a single node were not retried. Resolves #355. - -## June 10 2021: v5.1.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -Major fix release. We recommend updating to this version immediately. - -- **Improvements** - - - Set the error node on transaction failures. - - Add compression and minConnsPerNode to benchmark tool options. - -- **Fixes** - - - Add missing Compress commands. - - Check if error is not `nil` before chaining. Resolves issue #353. - - Handle `nil` case in `Node.String()`. - - Correctly handle errors in `Connection.Read` and `Connection.Write`. Avoids shadowing of the error. Resolves issue #352. - -## May 30 2021: v5.0.2 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -Minor fix release. - -- **Fixes** - - - Improve handling and chaining of errors in `BatchCommand` retries. - - Don't wrap in `chainErrors` if outer is `nil` and the inner error is of type `Error`. - - Support reading back keys with original `List` values. - -## May 27 2021: v5.0.1 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -Minor fix release. - -- **Fixes** - - - Handle lack of key digests in `BatchExists` command. - - Allow and handle nil arguments for `chainError`. - - Avoid race condition in chaining prefined errors. - -## May 10 2021: v5.0.0 - -[**IMPORTANT NOTE**] An authentication bug was introduced in Go client 5.0.0. As a result, the client may fail to refresh its session token after it expires, requiring the client to be restarted. If you are using password-based authentication, we highly recommend that you upgrade your client to version 5.6.0+, which you can do safely. - -This is a major feature release. It is also a major breaking release. We have adopted Go's module system as recommended by the Go authors, so the new release moves the active branch to `v5`. -As such, the import path changes to `github.com/aerospike/aerospike-client-go/v5`. The `master` branch remains in place to allow maintenance for the older v4 classic version until most users -get the chance to upgrade. - -This release also changes the way errors work in the client, and invalidates the old way. This allows the client to support Go's somewhat new `errors.Is` and `errors.As` API, and properly -chain errors together. - -Also note that the Go Client now requires server version 4.9+ and will not work properly with older versions. - -- **New Features** - - - Adopts module system and changes the import paths to `github.com/aerospike/aerospike-client-go/v5` - - [CLIENT-1476] Support new expressions introduced in server version 5.6, including `ExpReadOp` and `ExpWriteOp`. - - [CLIENT-1463] Support boolean particle type and make it opt-in for reflection API via `UseNativeBoolTypeInReflection`. - - [CLIENT-1522] Support user quotas and statistics. - - [CLIENT-1492] Remove ability to use old authentication protocol. This works behind the scenes and doesn't have any impact on user code. - - [CLIENT-1081] Adds `Error` interface, changes all API signature to return `Error`. - - Exports `AdminCommand` and its `QueryXXX` API. - -- **Breaking Changes** - - - Limits keys to `int`, `string` and `[]byte` types. The old `ListValue` arrays as types are not supported anymore. - - Remove TLS code support for golang v1.8 and before. - - Moves `AerospikeError` from `/types` to the root of the package, and removes all other error type like `NodeError` - - [CLIENT-1526] Removes `Policy.Priority`, `ScanPolicy.ScanPercent` and `ScanPolicy.FailOnClusterChange` - - Removes `Recordset.Read()` and avoids multiplexing of `Records` channel in `Recordset.Results()`, and unexports the `Error` channel. - - Remove legacy client code for old servers. Go client now requires server version 4.9+ - - Remove `Statement.PredExp`, and only use the `Policy.PredExp` to avoid confusion. `PredExp` has been deprecated and replaced by `Expression`. - - Renames type `FilterExpression` to `Expression`. - - `Client.GetBatchXXX()` will return `ErrFilteredOut` if an expression is passed to the API and some records were filtered out, regardless of `BatchPolicy.AllowPartialResults`. - - `Client.CreateRole()` now requires quota information in the param list. - - Removed `Connection.Authenticate()` API. - - Renamed `GetOpForBin()` to `GetBinOp()` - - Removed `ScanPolicy.ConcurrentNodes`. Now only uses `.MaxConcurrentNodes` to avoid confusion. - - Moves the `RequestInfo()` under `Connection`. - -- **Improvements** - - - Implement `GomegaStringer` interface to prevent very long error messages in tests. - - Adds `ResultCode.String()`. - -## April 9 2021: v4.5.0 - -Minor feature and fix release. - -- **New Features** - - - Allows reading of boolean types from the server, supported in Aerospike server v5.6. The current client will not support writing boolean type to the server. That features will be supported in the upcoming Go client v5. - -- **Improvements** - - - [CLIENT-1495] Tentatively check if a connection is allowed to avoid launching too many goroutines. - -- **Fixes** - - - Implements correct and re-triable Scans for the Reflection API. - - Fixes an obscure var shadowing bug in TLS connection handshake error logging. - -## March 12 2021: v4.4.0 - -Minor fix and improvements release. - -- **Fixes** - - - Fixes an issue where the client's reflection API expected certain `int` value types returned from the database. That assumption was wrong for `CDT`s and free form `List`s and `Map`s. The client will now convert types to each other per Go's conversion rules where possible. - -- **Improvements** - - - Use a global TLS setting everywhere in tests. - -## March 1 2021: v4.3.0 - -Minor feature and fix and major clean up release. While there aren't many user facing changes, the quality of the code has been markedly improved. -This release puts us on a good footing for the next few bigger releases. - -- **New Features**: - - - [CLIENT-1457] Support scan pagination through `ScanPartitions()` with `PartitionFilter` - -- **Fixes** - - - Fixes an issue where if errors and filtered records happened at the same time in Batch requests, no error would be returned to the user. - -- **Improvements** - - - Makes the code samples more readable in the docs. - - Fixes a lot of code samples in documentation, along with typos, etc. - - Fixes copy/paste naming errors in the documentation. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) - - Removes a few unreachable lines from the code. Thanks to [Yevgeny Rizhkov](https://github.com/reugn) - - Handles a few TLS connection related issues in tests. - -## February 12 2021: v4.2.0 - -Major feature and improvements release. - -- **New Features**: - - - [CLIENT-1192] Adds Support for partition scans. Queries which lack a `Statement.Filter` will be automatically converted to partition scans. If the cluster supports partition scans, all Scans and Queries will use the new protocol to allow retrying in case of some errors. - - [CLIENT-1237] Adds Support for `MultiPolicy.MaxRecords` in scans and queries without `Statement.Filter`. - - Adds `NewHosts` convenience function. (Github #320) thanks to [Yegor Myskin](https://github.com/un000) - -- **Improvements** - - - Adds a few missing error checks. - - Moves examples files to dedicated folders to avoid `multiple main function` errors for new users. - - Some documentation clean up. (Github #314) thanks to [Shin Uozumi](https://github.com/sinozu) - - Fix typo in example `NewKey()`. (Github #331) thanks to [Patrick Kuca](https://github.com/pkuca) - - Adds an example to list operations (using operate and list policy). - - Runs the XDR tests only when XDR is configured on the server. - - Add TLS config to test params. - - Mark `NewPredExpXXX` return value as the PredExp interface instead of concrete type. It will now group them under the `PredExp` interface in the docs. - -- **Changes** - - Only use `Policy.Priority` and `MultiPolicy.FailOnClusterChange` on server versions < 4.9. `Priority` is now deprecated and replaced with `MultiPolicy.RecordPerSecond`. - - `Statement.TaskID` is deprecated and will be removed in the next major version. - - `ScanPolicy.ConcurrentNodes` is deprecated and will be removed in the next major version. - -… versions < 4.9 - -## January 25 2021: v4.1.0 - -Major feature release. - -- **New Features**: - - - [CLIENT-1417] Adds Circuit-Breaker. Rejects command when assigned node's error rate exceeds `ClientPolicy.MaxErrorRate` over `ClientPolicy.ErrorRateWindow`. - - [CLIENT-1410] Adds `Client.SetXDRFilter()`. - - [CLIENT-1433] Adds `ExpMemorySize()` to expression filters. - -- **Fixes** - - - Fixes an issue where remainder miscalculation would cause the connection pool to be smaller than it should have been. (Github #332) thanks to [ShawnZhang](https://github.com/xqzhang2015) - -- **Improvements** - - - [CLIENT-1434] Reset peers, partition and rebalance generations on node tend errors. - - Use named fields in `LimitedReader` initialization. - - Skip `device_total_bytes` tests in Expressions for memory-only namespaces - - Change unexported field check in marshaller in anticipation of go 1.16 changes - -- **Changes** - - - Pack byte array header with string header codes when using msgpack to be consistent with server. - - Adds `ResultCode.LOST_CONFLICT` - - Change log level from Debug to Error for partition validation failures - -- **Fixes** - - - Fix remainder calculation in `ConnectionHeap`. - -## November 27 2020: v4.0.0 - -Major feature release. Deprecates `PredExp` filters and replaces them with the far more capable Expressions. - -- **New Features**: - - - [CLIENT-1361] Replace predicate filters with new Aerospike Expressions. - -- **Fixes** - - - Allows unmarshalling of bool fields to sub objects in reflection API. (Github #325) - - Fixes an issue where BatchIndexGet commands were not retried in some circumstances. - -- **Incompatible changes**: - - - Changes the `BitResizeFlagsXXX` enum types to `BitResizeFlags` type. This should not affect any code if the enums were used. - - Changes the `ListSortFlagsXXX` enum types to`ListSortFlags` are now typed. This should not affect any code if the enums were used. - -## November 9 2020: v3.1.1 - -Hotfix release. We recommend upgrading to this version, or cherry-picking the changeset to your vendored version if possible. - -- **Fixes** - - - Handle cleanup cases in `Offer` and `DropIdleTail` for `singleConnectionHeap`. (Github #318) - - Unlock the mutex in `singleConnectionHeap.Poll` if called after cleanup. (Github #323) thanks to [linchuan4028](https://github.com/linchuan4028) - -- **Changes** - - - Removes support for versions prior to Go v1.12 due to incompatibility in the testing library we use. Go v1.9+ should still work, though they will not be tested in our tests. - -## September 10 2020: v3.1.0 - -Minor fix release. - -- **Fixes** - - - Fixes an issue where initial tend was not adhering to the `ClientPolicy.Timeout`. (CLIENT-1344) - -## August 19 2020: v3.0.5 - -Minor fix release. - -- **Fixes** - - - Corrects the maximum bin name size in error message. - - Fixes geo coordinates in predexp tests due to more strict server validation. - - Fixes misspelled words and doc links. PR #311, thanks to [Abhay](https://github.com/pnutmath) - -## July 7 2020: v3.0.4 - -Minor fix release. - -- **Fixes** - - - Fixes `Client.SetWhitelist` API. - - Fixes an issue where `Whilelist` was not set during `QueryRole`. - -## July 3 2020: v3.0.3 - -Minor fix release. - -- **Fixes** - - - Resolves an issue where batch retry could return some nil records in some situations. - -## June 24 2020: v3.0.2 - -Minor improvement release. - -- **Fixes** - - - Fixes an issue where if a slice was pre-assigned on a struct, the data would not be allocated to it in reflection API. PR #302, thanks to [gdm85](https://github.com/gdm85) - - Fixes an issue where `Node.GetConnection()` could in rare circumstances return no connection without an `error`. This would potentially cause a panic in VERY slow production servers. - -- **Improvements** - - - Converts a few panics to errors in wire protocol encoding/decoding. Resolves issue #304. - -## June 17 2020: v3.0.1 - -Minor bug fix release. - -- **Fixes** - - - Fixes caching of embedded structs with options in alias. Resolves issue #301. - -## June 8 2020: v3.0.0 - -Major feature release. There are a few minor breaking API changes. See `ClientPolicy`. - -Note: There has been significant changes to clustering code. We recommend extensive testing before using in production. - -- **New Features** - - - Adds support for Relaxed Strong Consistency mode. `ClientPolicy.LinearizeRead = true` has been removed and should be replaced with `policy.ReadModeSC = as.ReadModeSCLinearize`. - - Adds support for whitelists in Roles. - -## May 28 2020: v2.12.0 - -Minor feature release. - -- **New Features** - - - Adds `MapCreateOp` and `ListCreateOp` in `Context` for CDTs. - -## May 27 2020: v2.11.0 - -Major feature release. - -- **New Features** - - - Adds HyperLogLog support. - -- **Improvements** - - - Exports `estimateSize` on `Value` Datastructure. PR #299, thanks to [Sainadh Devireddy](https://github.com/sainadh-d) - - Adds more detail regarding `ClientPolicy.IdleTimeout` in the documentation, and changes the default value to 55 seconds. - -## May 12 2020: v2.10.0 - -Minor feature release. - -- **New Features** - - - Adds `ClientPolicy.MinConnectionsPerNode`. - -- **Improvements** - - - Returns distinct error when empty slice is passed to BatchGetObjects. PR #297, thanks to [Mohamed Osama](https://github.com/oss92) - -## March 14 2020: v2.9.0 - -Minor feature release. - -- **New Features** - - - Supports use of anonymous structs in reflection API. PR #287, thanks to [小马哥](https://github.com/andot) - -## March 4 2020: v2.8.2 - -Hotfix. - -- **Fixes** - - - Fixes a race condition introduced in the last release. - -## March 4 2020: v2.8.1 - -Minor fix and improvements. - -- **Improvements** - - - Uses a `sync.Pool` to preserve the connection buffers on close to remove pressure from the allocator and the GC during connection churns. - -- **Fixes** - - - Cleanup the data structure cross refs on Cluster.Close to help GC free the objects. - -## February 28 2020: v2.8.0 - -Minor feature release. - -- **New Features** - - - Allows `,omitempty` tag to be used in struct tags. It behaves the same as the stdlib json. Note that there should be no whitespace between the comma and the rest of the tag. - -## January 30 2020: v2.7.2 - -Minor fix release. - -- **Fixes** - - - Resolves an issue where an invalid/malformed compressed header could cause a panic by reporting wrong compressed data size. Resolves #280. - -## January 20 2020: v2.7.1 - -Minor fix release. - -- **Fixes** - - - Fixes an issue where an error was not checked after a read in `multi_command.go` and would cause a panic. Resolves #280. - -## December 24 2019: v2.7.0 - -Minor feature and fix release. - -- **New Features** - - - Adds support for client/server wire transport compression. - - Adds support for descending CDT list order. - -- **Fixes** - - - Fixes an issue where unpacking `Value` objects would cause an infinite loop. PR #273, thanks to [small-egg](https://github.com/small-egg) - -## November 25 2019: v2.6.0 - -Minor feature release. - -- **New Features** - - - Supports correct Query/Scans via `Scan/QueryPolicy.FailOnClusterChange` - -- **Fixes** - - - Fixes an issue where the client using multiple seeds via DNS or Load Balancer would fail to connect if more than one of them were unreachable. - -## November 8 2019: v2.5.0 - -Major feature release. - -- **New Features** - - - Adds support for predicate expressions in all transactions. See `Policy.Predexp`. - -## October 29 2019: v2.4.0 - -Major feature release. - -- **New Features** - - - Adds support for bitwise operations. - - Adds support for nested CDTs. - -## October 17 2019: v2.3.0 - -Major feature release. - -- **New Features** - - - Adds support for mixed security modes in cluster to enable rolling upgrade with security changes. - - Adds support for delete record operation `DeleteOp()` in `Client.Operate()`. - - Adds support for write operations in background scan/query. - - Adds support for `Scan/QueryPolicy.RecordsPerSecond` field to limit throughput. - -## August 13 2019: v2.2.1 - -Minor improvement release. - -- **Improvements** - - - Supports the `Write` role in server v4.6.0.2+ - -## May 21 2019: v2.2.0 - -Minor Fixes and improvements release. - -- **Fixes** - - - Fixes an issue where an empty connection pool would cause a lock contention that would in turn lead to high CPU load. - - Fixes an issue where in some circumstances connection pool would be depleted of connections. - - Fixes an issue where the replica node would not be selected in case of master-node failure in `Policy.ReplicaPolicy.SEQUENCE` for reads. - -- **Improvements** - - - Transactions will not count a lack of connection in the node's connection pool as an iteration anymore. - -## April 25 2019: v2.1.1 - -Minor Fixes and improvements release. - -- **Fixes** - - - Fixes an issue where meta tags were ignored in reflection API for `ScanAllObjects`/`QueryObjects`/`BatchGetObjects`. Resolves #260. - -- **Improvements** - - - Tend won't send `rack:` command to the nodes if `ClientPolicy.RackAware` is not set. PR #259, thanks to [Dmitry Maksimov](https://github.com/kolo) - - Adds a new GeoJson example. - -## April 11 2019: v2.1.0 - -Minor Feature and Improvements release. - -- **New Features** - - - Adds `WarmUp` method for `Client`, `Cluster` and `Node`. This method will fill the connection queue to ensure maximum and smooth performance on start up. - -- **Improvements** - - - Simplify connection Timeout calculation and floor the min timeout to 1ms. - - Simplify resetting server timeout for each iteration. - - Adds a few pre-defined errors to avoid allocating them during runtime. - -- **Changes** - - - Adds a TLS connection example. - - Adds `Cap` method to `connectionHeap`. - -## March 19 2019: v2.0.0 - -Major release. There are some breaking changes, both syntactically and semantically. -Most changes are minor, and can be fixed with relative ease. -The only major issue is that the behavior of the client when a key does not exist has changed. -It used to return no error, but `nil` `Record.Bins`. Now it returns `ErrKeyNotFound` error. -This is a significant changes, and you should search your code for all instances of `Bins == nil` and adapt the code accordingly. - -- **Major**: - - - Optimizes connection creation out of the transaction pipeline and makes it async. - - Put a threshold on the number of connections allowed to open simultaneously. Controlled via `ClientPolicy.OpeningConnectionThreshold`. - - Do not clear partition map entry when a node reports that it no longer owns that partition entry. - - Uses rolling timeout instead of strict timeout for connections. - - Remove `ToValueArray` and `ToValueSlice` methods to discourage such suboptimal use. Changes `QueryAggregate` signature to remove the need for those methods. - - Remove unnecessary conversion from BinMap to Bins in reflection API to speedup the command an avoid unnecessary memory allocations. - - Use shorter intervals with exponential back-off for tasks. - -- **Breaking**: - - - `Get`/`Put`/`Touch`/`Operate` and `ExecuteUDF` commands will return an `ErrKeyNotFound` error when the key does not exist in the database. The old behavior used to be not to return an error, but have an empty `Record.Bins`. - - Renames `Statement.Addfilter` to `Statement.SetFilter`, change the name and type of `Statement.Filters` to `Statement.Filter`. - - Remove `ClientPolicy.RequestProleReplicas`. THe client will always request them. - - Removes `ScanPolicy.ServerSocketTimeout` and `QueryPolicy.ServerSocketTimeout` in favor of the already existing `Policy.SocketTimeout`. - - Renames `Policy.Timeout` to `Policy.TotalTimeout` to make the naming consistent with other clients. - - Moves `atomic` package to internal. - - Moves `ParticleType` package to internal. - - Moves `RequestNodeInfo` and `RequestNodeStats` to methods on Node object, and adds `InfoPolicy` to the relevant API signatures. - - Removes `WaitUntilMigrationIsFinished` from `Scan`/`Query` policies. - - Changes `NewConnection` method signature, makes `LoginCommand` private. - - Makes `OperationType` private. - - Remove long deprecated method for pool management. - - Removes unused `ReadN` method in `Connection`. - - Embeds Policies as values and not pointers inside `MultiPolicy`, `ScanPolicy`, `QueryPolicy` - -- **Minor**: - - Fixes a race condition in the `AdminCommand`. - - Synchronize the `XORShift` to avoid race conditions. - - Completely removes deprecated LDT code. - -## March 11 2019: v1.39.0 - -Major improvements Release. - -- **Improvements** - - - Significantly improves `Batch`/`Scan`/`Query`/`UDF`/`QueryAggregate` performance, up to 10x depending on the number of records. - -- **Changes** - - - Removes `BatchPolicy.UseBatchDirect` from the code since it is not supported on the server anymore. - -## February 21 2019: v1.38.0 - -- **New Features** - - - Support new server `truncate-namespace` command via `Client.Truncate` when `set` is not specified. - -- **Improvements** - - - The client will not clear a partition map entry when a node reports that it no longer owns that partition entry until another node claims ownership. - - Adapt UDF test for new server changes. The server will not return an error after `RemoveUDF` if the UDF did not exist. - - Improves a few tests and relaxes tolerances in tests to accommodate slower cloud test environments. - -- **Fixes** - - - Fixes a race condition in XOR shift RNG. - - Fixes a race condition in the AdminCommand. - -## December 3 2018: v1.37.0 - -- **New Features** - - - Support lut-now parameter for Client.Truncate() in servers that support and require it. - - Added support for CDT Map Relative Ops: `MapGetByKeyRelativeIndexRangeOp`, `MapGetByKeyRelativeIndexRangeCountOp`, `MapGetByValueRelativeRankRangeOp`, `MapGetByValueRelativeRankRangeCountOp`, `MapRemoveByKeyRelativeIndexRangeOp`, `MapRemoveByKeyRelativeIndexRangeCountOp`. - - Added support for CDT List Relative Ops: `ListGetByValueRelativeRankRangeOp`, `ListGetByValueRelativeRankRangeCountOp`, `ListRemoveByValueRelativeRankRangeOp`, `ListRemoveByValueRelativeRankRangeCountOp`. - - Added `INFINITY` and `WILDCARD` values for use in CDT map/list comparators. - -- **Improvements** - - - Increase default `Policy.SocketTimeout` to 30s. If `SocketTimeout` is longer than `Timeout`, `Timeout` will be used instead silently. This change is done for the client to perform more intuitively in cloud environments. - - Never return a random node if a node was not found in the partition map. - - Return more descriptive error messages on various partition map and other node related errors. - -- **Changes** - - - Remove the ability to force old batch direct protocol on the client because the server will be removing support for the old batch direct protocol. - - Update admin message version to 2. - - Remove unused error codes. - - Remove Go 1.7 and 1.8 from travis tests due to incompatibility with the test framework. - -## November 1 2018: v1.36.0 - -Feature Release. - -- **New Features** - - - Support rackaware feature. You need to set the `ClientPolicy.RackAware = true`, and set the `ClientPolicy.RackId`. All read operations will try to choose a node on the same rack if `Policy.ReplicaPolicy = PREFER_RACK`. This feature is especially useful when the app/cluster are on the cloud and network throughput over different zones are price differently. - -- **Improvements** - - - Update Operate command documentation. - - Improve an expectation in a CDT Map test. - - Move UDF object test to the proper file. - - Support float64 struct fields when the value of the field has been changed inside lua and set to int - will only affect clusters which support float. - - Fixes an issue where key value was sent and cause server PARAMETER_ERROR via the operate command if policy.SendKey was set but no write operations were passed. - - Updated README example with clarification. - -- **Fixes** - - - Fixes an issue where multiple operation results for a bin would be appended to the first result if it was a list. - -## October 2 2018: v1.35.2 - -Improvement release. - -- **Improvements** - - - Do not allocate a partition map on each tend unless needed. - - Adds `ConnectionsClosed` stat and sets the connection and dataBuffer to nil in a few places to help the GC. - - Use a heap data structure for connection pooling instead of a queue. - This allows better management of connections after a surge, since it keeps the unused connection in the bottom of the heap to close. - It also helps with performance a bit due to better caching of the data structure in CPU. - -## September 18 2018: v1.35.1 - -Hot fix release. We recommend updating to this version if you are using authentication. - -- **Fixes** - - - Fixes a regression to avoid hashing passwords per each login, using the cached password. - -- **Changes** - - - Minor code clean up and dead code removal. - -## August 29 2018: v1.35.0 - -- **New Features** - - - Support for external authentication (LDAP). - - Support Map and List WriteFlags: `NoFail` and `Partial`. - - Support load balancers as seed node. - -- **Changes** - - - Change default Scan/Query `ServerSocketTimeout` to 30s. - -- **Improvements** - - - Adds `QueryPolicy.ServerSocketTimeout` and `QueryPolicy.FailOnClusterChange` for when the queries are automatically converted to scans. - - Minor documentation improvements. - - Synchronize logging at all situations. - - Add -debug switch to allow logging at debug level in tests. - - Allow the user to define the namespace for tests to run on. - -- **Fixes** - - - Fix a few go vet errors for Go 1.11. - - Fixes minor unsigned length conversions for admin command. - -## August 29 2018: v1.34.2 - -Fix release. - -- **Fixes** - - - Use pointer receiver for `AerospikeError.SetInDoubt` and `AerospikeError.MarkInDoubt`. - - Remove unused variable in truncate test. - -- **Changes** - - - Add Go 1.11 to Travis' test versions. - - Use the last error code in MaxRetries timeout errors for Go 1.11. - -## August 9 2018: v1.34.1 - -Hot fix release. We recommend updating to this version asap, especially if you are using the Strong Consistency feature. - -- **Fixes** - - - Fixes an issue where a race condition was preventing the partition table to form correctly. (CLIENT-1028) - -## July 17 2018: v1.34.0 - -- **Changes** - - - Removed the LDT code completely. - - Adds build tag `app_engine` for compatibility with Google's App Engine. Query Aggregate features are not available in this mode due to lua limitations. - -- **Improvements** - - - Document how to use AerospikeError type in the code. - - Allow Task.OnComplete() to be listened to by multiple goroutines. Thanks to [HArmen](https://github.com/alicebob) - -- **Fixes** - - - Fixes an issue where `ClientPolicy.FailIfNotConnected` flag was not respected. - - Fixes a merging issue for PartitionMap, and add a naive validation for partition maps. (CLIENT-1027) - -## June 11 2018: v1.33.0 - -- **New Features** - - - Adds `BatchPolicy.AllowPartialResults` flag to allow the batch command return partial records returned from the cluster. - - Adds `INVERTED` flag to the `MapReturnType`. Take a look at INVERTED test in `cdt_map_test.go` to see how to use it. - - Adds a lot of new Ordered Map and List operations and brings the client up to date with the latest server API. - -- **Changes** - - - Use the default values for `BasePolicy` in `BatchPolicy` to keep the behavior consistent with the older releases. - -- **Improvements** - - - Adds a recover to the tend goroutine to guarantee the client will recover from internal crashes. - - Removes unneeded type casts. - - Uses the new stat name for migrations check. - -- **Fixes** - - - Fixes TTL in `GetObject` and `BatchGetObject` reflection API. - - Handle extension marker in List headers. - -## March 15 2018: v1.32.0 - -Major feature release. - -- **New Features** - - - Support for _Strong Consistency_ mode in Aerospike Server v4. You will need to set the `policy.LinearizeRead` to `true`. Adds `AerospikeError.InDoubt()` method. - - Set the resulting `Record.Key` value in Batch Operations to the Original User-Provided Key to preserve the original namespace/set/userValue and avoid memory allocation. - -- **Changes** - - - Does not retry on writes by default, and put a 100ms timeout on all transactions by default. - - Changed some warn logs to debug level. - - Add missing stats counters to improve statistics reports. - - Uses sync.Once instead of sync.Mutex for `Connection.close` method. - - Added `DefaultBufferSize` for initial buffer size for connections. - -- **Fixes** - - - Fix the tests for object marshalling to account for monotonic time in Go v1.8+. - - Stops the ongoing tends on initial connection errors. - -## November 29 2017: v1.31.0 - -Feature release. - -- **New Features** - - - Support for newer Batch Protocol. Add `BatchGetComplex` for complex batch queries. Old batch API upgraded to automatically support the new protocol under the hood, unless `BatchPolicy.UseBatchDirect` flag is set to `true`. - -- **Changes** - - - Renames ResultCode `NO_XDS` to `ALWAYS_FORBIDDEN`. - - Makes `SERVER_NOT_AVAILABLE` a client generated error. - -## October 12 2017: v1.30.0 - -Fix and improvements release. - -- **Changes** - - - Deprecated LDTs and removed them from the official build. - - Change supported go versions to 1.7+ due to gopher-lua requiring `Context`. - -- **Improvements** - - - Get socket timeout once per command execution, do not redefine err var in command execution loop. PR #211, thanks to [Maxim Krasilnikov](https://github.com/chapsuk) - - Allow running a UDF on a specific node only. - - Close cluster only once. PR #208, thanks to [Jun Kimura](https://github.com/bluele) - - Use actual cluster name in tests instead of assuming `null`. - - Check for the type of error as well in Duplicate Index Creation. - - Update description for error code 21. PR #207, thanks to [Maxim Krasilnikov](https://github.com/chapsuk) - -## September 5 2017: v1.29.0 - -Feature and improvements release. - -- **New Features** - - - Added `ListIncrementOp` to the CDT list operations. - - Added `SEQUENCE` to replica policies. - -- **Improvements** - - - Tweaked node removal algorithm to cover more corner cases. - - Make `predExp` interface public. Closes issue #205. - - Added more stats to the `Client.Stats()`. - -## August 17 2017: v1.28.0 - -Feature, Performance improvements and bug fix release. - -- **New Features** - - - Added `Client.Stats()` method to get client's internal statistics. - - Added `Policy.SocketTimeout` to differentiate between network timeouts and the total transaction timeouts. - - Support `policy.IncludeBinData` for queries. Only for servers that support this feature. - - Minor documentation updates. - - Return key not found exception (instead of returning nil record) for Operate() command where operations include a write. - -- **Improvements** - - - Close the tend connection when closing node connections. - - Added Connection finalizer to make sure all connections are closed eventually. - - Automatically retry failed info requests on async tasks before returning an error. - - Updated build instructions for the benchmark tool. - - Make digest_modulo test deterministic. - - Relax predexp_modulo test a bit to avoid occasional failures. - -- **Fixes** - - - Indirect CAS ops to prevent the compiler from optimizing them out. - - Return errors instead of nil. - -## April 25 2017: v1.27.0 - -Feature, Performance improvements and bug fix release. - -- **New Features** - - - Added `BatchGetObjects` method. - - Added Exponential Backoff by introducing `BasePolicy.SleepMultiplier`. Only Values > 1.0 are effective. PR #192, thanks to [Venil Noronha](https://github.com/venilnoronha) - -- **Improvements** - - - Packer tries to see if it can use generic data types before using reflection. - - Operations, including CDTs do not allocate a buffer anymore, unless reused. - -- **Incompatible changes**: - - - `BinName` and `BinValue` are not exported in `Operation` anymore. These fields shouldn't have been used anyway since `Operation`s used to cache their internal command. - -- **Fixes** - - - Documentation Fixes. Thanks to [Nassor Paulino da Silva](https://github.com/nassor) and [HArmen](https://github.com/alicebob) - -## April 5 2017: v1.26.0 - -Feature, Performance improvements and bug fix release. - -- **New Features** - - - Predicate API is supported (for server v3.12+) - - Added `Truncate` method to quickly remove all data from namespaces or sets (for server v3.12+). - - Support `ScanPolicy.ServerSocketTimeout` (for server v3.12+). - - Support `ClientPolicy.IgnoreOtherSubnetAliases` to ignore hosts from other subnets. PR #182, thanks to [wedi-dev](https://github.com/wedi-dev) - -- **Improvements** - - - Added a lot of predefined generic slice and map types in `NewValue` method to avoid hitting reflection as much as possible. - - Fix `go vet` complaints. - -- **Fixes** - - - Allow streaming commands (scan/query/aggregation) to retry unless the error occurs during parsing of the results. Fixes issue #187 - - Use `net.JoinHostPort` to concatinate host and port values instead of doing it directly. Fixes some issues in IPv6 connection strings. - - Improved initial Tend run. - - Fixes `cluster-name` checking bug. - -## March 8 2017: v1.25.1 - -Hot fix release. Updating the client is recommended. - -- **Fixes** - - - Fixed an issue where errors in Scan/Query unmarshalling would be duplicated and could cause a deadlock. - -## February 28 2017: v1.25.0 - -Performance improvements and fix release. - -- **Improvements** - - - Check tend duration and compare it to tend interval, and warn the user if tend takes longer than tend interval. - - Seed the cluster concurrently, and return as soon as any of the seeds is validated. - - Tend the cluster concurrently. Allows use of very big clusters with no delay. - - Partitions the connection queue to avoid contention. - - Cluster partition map is merged from all node fragments and updated only once per tend to reduce contention to absolute minimum. - -- **Fixes** - - - Fixed an issue where a valid but unreachable seed could timeout and stall connecting and tending the cluster.. - - Fix result code comments. - -## January 11 2017: v1.24.0 - -Minor feature and fix release. - -- **New Features** - - - TLS/SSL connections are now officially supported. - - Added Role/Privilege API. - -- **Improvements** - - - Return a client-side error when no ops are passed to the operate command. - - Export error attribute in `NodeError` - - Do not attempt to refresh peers if it is not supported by the nodes. - -- **Fixes** - - - Use namespace default-ttl for tests instead of assuming 30d - - Always drain scan connections after parsing the records. - - Fix panic in GetObject() if all bins in result is nil. PR #172, thanks to [Hamper](https://github.com/hamper) - - Fix WritePolicy usage with UDF. PR #174, thanks to [Bertrand Paquet](https://github.com/bpaquet) - - Close connection right when it has an io error and don't wait for the caller. - -## December 20 2016 : v1.23.0 - -Minor feature and fix release. - -- **New Features** - - - Exposes the internal `client.Cluster` object to the users. - - Added New API for high-performance complex data type packing, and removed the old API. - -- **Improvements** - - - Only update the partition map if the partition generatio has changed. - - Use tend connection for user management commands. - - Marks LargeList as deprecated. Use CDT methods instead. - - Always validate the message header to avoid reading the remainder of other command buffers. - - Removes GeoJson from key helper. - - Improves tend algorthm to allow complete disconnection from the cluster if none of the clusters are accessible. - - `PutObject` method will now accept objects as well. PR #156, thanks to [Sarath S Pillai](https://github.com/sarathsp06) - -- **Fixes** - - - Do not attemp to add a node which were unaccessible to avoid panic. - - Fix invalid connectionCount. PR #168, thanks to [Jun Kimura](https://github.com/bluele) - - Fixes minor bug that didn't return the error on reading from the connection during scans. - -## November 29 2016 : v1.22.0 - -Hot fix release. Please upgrade if you have been using other aerospike clients with your database parallel to Go. - -- **Fixes** - - - Fixes an issue where short strings in Lists and Maps wouldn't unpack correctly. Resolves #161. - -## November 16 2016 : v1.21.0 - -Minor fix release. - -- **New Features** - - - Added new constants for expiration in `WritePolicy`: `TTLServerDefault`, `TTLDontExpire`, `TTLDontUpdate` - -- **Improvements** - - - Corrects typos in the code. PR #142, thanks to [Muyiwa Olurin ](https://github.com/muyiwaolurin) - - Use the tend connection for `RequestInfo` commands. - -- **Fixes** - - - Fixes an issue where TTL values were calcualted wrongly when they were set not to expire. - - Fixes an issue where `PutObjects` would marshal `[]byte` to `List` in database. PR #152, thanks to [blide](https://github.com/blide) - - Fixes an issue where `Recordset` could leak goroutines. PR #153, thanks to [Deepak Prabhakara](https://github.com/deepakprabhakara) - -## October 25 2016 : v1.20.0 - -Major improvements release. There has been major changes in the library. Please test rigorously before upgrading to the new version. - -- **New Features** - - - Let user define the desired tag for bin names in structs using `SetAerospikeTag` function. - - Added `as_performance` build tag to avoid including the slow convenience API which uses reflections in the client code. - To use this feature, you should include -tags="as_performance" when building your project. - - _NOTICE_: Keep in mind that your code may not compile using this flag. That is by design. - -- **Improvements** - - - Added special packer for map[string]interface{} in `NewValue` method. - - Avoid allocating memory for Map and List values. - - Allocate commands on the stack to avoid heap allcations. - - Avoid allocating memory for `packer`. - - Avoid Allocating memory in computeHash for keys. - - Avoid allocating memory in Ripe160MD digest. - - Removed BufferPool and moved buffers to `Connection` objects to remove lock contention. - - Added `ListIter` and `MapIter` interfaces to support passing Maps and Lists to the client without using reflection. - -## October 14 2016 : v1.19.0 - -Major feature and improvement release. - -- **New Features** - - - Support TLS secured connections. (Feature will be supported in coming server releases.) - - - Support IPv6 protocol. Supported by Aerospike Server 3.10+. - - - Support `cluster-name` verification. Supported by Aerospike Server 3.10+. - - - Support new peers info protocol. Supported by Aerospike Server 3.10+. - -- **Improvements** - - - Will retry the operation even when reading from the buffer. Set `Policy.MaxRetries = 0` to avoid this behavior. PR #143, thanks to [Hector Jusforgues](https://github.com/hectorj) - - - Much improved cluster management algorithm. Will now handle the case where multiple nodes go down simultaneously, still protecting against split brain rogue nodes. - -- **Fixes** - - - Try all alias IPs in node validator. Resolves #144. - - - Updated job status check for execute tasks. - -## August 19 2016 : v1.18.0 - -Minor improvements release. - -- **New Features** - - - Support 'Durable Deletes' for the next version of Aerospike Server Enterprise. - -- **Improvements** - - - Don't run tests for features that are not supported by the server. - - - Added new server error codes. - -## July 27 2016 : v1.17.1 - -Minor improvements release. - -- **Improvements** - - - Add `TaskId()` method for `Recordset`. - - - Cleanup indexes after test cases. - - - Keep connections on recoverable server errors. - - - Return the error on unexpected keys in `BatchCommandGet/Header`. - - - Use the same client object in tests and support using replicas on travis. - -## July 19 2016 : v1.17.0 - -Major feature and improvement release. - -- **New Features** - - - Client now supports distributing reads from Replicas using `ClientPolicy.RequestProleReplicas` and `Policy.ReplicaPolicy` - -- **Improvements** - - - `Cluster.GetConnection` will now retry to acquire a connection until timeout. - - - `Client.DropIndex` method now blocks until all nodes report the index is dropped. - - - Async tasks like `CreateIndex` will retry a few times before deciding a non-existing job means it has finished. - - - Don't use math.MaxInt64, it breaks 32-bit builds. PR #139, thanks to [Cameron Sparr](https://github.com/sparrc) - -- **Fixes** - - - Maps with 0 elements will automatically shortcut to unordered empty maps. - - - Return the error in BatchCommandGet on parse error. - -## June 28 2016 : v1.16.3 - -Major bugfix release. Update recommended. - -- **Improvements** - - - Skip LDT tests if LDT is not enabled. - - - Returns last error after all retry attempts to run a command are exhausted. - - - Reserves a connection for tend operation to avoid dropping a node when high load prevents acquiring a proper connection. - - - Added Finalizers to `Client` and `Recordset`. Both will be automatically closed by the GC. - -- **Fixes** - - - Fixes an issue where `services-alternate` wasn't used in `Node.addFriends()` when instructed so in the policy. - - - Fixes an issue where object metadata wasn't cached if `QueryObjects` was called before `PutObject`. - - - Fixes an issue where idle connections were not dropped. - - - Fixes an issue where requested buffer sizes were not guarded against negative numbers. - -## June 7 2016 : v1.16.2 - -Minor bugfix release. - -- **Fixes** - - - Fixes an issue where empty unordered maps were confused with CDT maps. - -## June 6 2016 : v1.16.1 - -Minor bugfix release. - -- **Fixes** - - - Fixes an issue where complex maps and lists weren't unmarshalled correctly in `GetObject` method. - -## June 2 2016 : v1.16 - -Major feature and improvements release. - -> NOTICE: Due to the relatively extensive code overhaul, upgrade with caution. - -- **New Features** - - - Added CDT Ordered Map API. (Requires server v3.8.3+) - -- **Improvements** - - - Removed mutexes from `Cluster` and `Node` code. - - - Improved code quality using various linters. - -## May 27 2016 : v1.15 - -Minor fixes and improvements release. - -- **Fixes** - - - Fixed an issue where unmarshalling embedded structs and pointers didn't work properly if they were tagged. - -## May 16 2016 : v1.14 - -Minor fixes and improvements release. - -- **Fixes** - - - Fixed an issue in which go-routines were leaked in `Results()` method of `Recordset` on cancellation. Based on PR #128, thanks to [Noel Cower](https://github.com/nilium) - - - Fixed issues regarding leaked goroutines in `Cluster.WaitTillStablized()`, `Cluster.MigrationInProgress()`, and `Cluster.WaitUntillMigrationIsFinished()` methods. PR #126, thanks to [Anton](https://github.com/yiiton) - -- **Improvements** - - - Improved cluster `tend()` logic. - - - Added `Recordset.Read()` method. - - - Minor fixes in docs and code formatting. Thanks to [Andrew Murray](https://github.com/radarhere) and [Erik Dubbelboer](https://github.com/erikdubbelboer) - -## April 1 2016 : v1.13 - -Minor features and improvements release. - -- **New Features** - - - Added `NewGeoWithinRegionForCollectionFilter`, `NewGeoRegionsContainingPointForCollectionFilter`, `NewGeoWithinRadiusForCollectionFilter` for queries on collection bins. - -- **Fixes** - - - Fixed an issue in which bounded byte arrays were silently being dropped as map keys. - -- **Improvements** - - - Removed and fixed unused assignments and variables. - - - Fixed typos in the comments. - - - Minor changes and formatting. PR #124, thanks to [Harmen](https://github.com/alicebob) - -## March 8 2016 : v1.12 - -Minor features and improvements release. - -- **New Features** - - - Support Metadata in struct tags to fetch TTL and Generation via `GetObject`. - Notice: Metadata attributes in an struct are considered transient, and won't be persisted. - - Example: - - ```go - type SomeStruct struct { - TTL uint32 `asm:"ttl"` // record time-to-live in seconds - Gen uint32 `asm:"gen"` // record generation - A int - Self *SomeStruct - } - - key, _ := as.NewKey("ns", "set", value) - err := client.PutObject(nil, key, obj) - // handle error here - - rObj := &OtherStruct{} - err = client.GetObject(nil, key, rObj) - ``` - - - GeoJSON support in Lists and Maps - -- **Improvements** - - - Use `ClientPolicy.timeout` for connection timeout when refreshing nodes - - - Added new server error codes - - - Protect RNG pool against low-precision clocks during init - - - Better error message distingushing between timeout because of reaching deadline and exceeding maximum retries - -- **Fixes** - - - Fixed object mapping cache for anonymous structs. PR #115, thanks to [Moshe Revah](https://github.com/zippoxer) - - - Fixed an issue where `Execute()` method wasn't observing the `SendKey` flag in Policy. - -## February 9 2016 : v1.11 - -Minor features and improvements release. - -- **New Features** - - - Can now use `services-alternate` for cluster tend. - - - New CDT List API: `ListGetRangeFromOp`, `ListRemoveRangeFromOp`, `ListPopRangeFromOp` - -- **Improvements** - - - Improves marshalling of data types into and out of the Lua library and avoids marshalling values before they are needed. - - - Returns error for having more than one Filter on client-side to avoid confusion. - - - Increases default `ClientPolicy.Timeout` and return a meaningful error message when the client is not fully connected to the cluster after `waitTillStabilized` call - -## January 13 2016 : v1.10 - -Major release. Adds Aggregation. - -- **New Features** - - - Added `client.QueryAggregate` method. - - - For examples regarding how to use this feature, look at the examples directory. - - - You can find more documentation regarding the [Aggregation Feature on Aerospike Website](http://www.aerospike.com/docs/guide/aggregation.html) - -- **Improvements** - - - Improve Query/Scan performance by reading from the socket in bigger chunks - -## December 14 2015 : v1.9 - -Major release. Adds new features. - -- **New Features** - - - Added CDT List operations. - - - Added `NewGeoWithinRadiusFilter` filter for queries. - -- **Changes** - - - Renamed `NewGeoPointsWithinRegionFilter` to `NewGeoWithinRegionFilter` - -## December 1 2015 : v1.8 - -Major release. Adds new features and fixes important bugs. - -- **New Features** - - - Added `ScanAllObjects`, `ScanNodeObjects`, `QueryObjects` and `QueryNodeObjects` to the client, to facilitate automatic unmarshalling of data similar to `GetObject`. - - - NOTICE: This feature and its API are experimental, and may change in the future. Please test your code throughly, and provide feedback via Github. - - - Added `ScanPolicy.IncludeLDT` option (Usable with yet to be released server v 3.7.0) - - - Added `LargeList.Exist` method. - -- **Improvements** - - - Makes Generation and Expiration values consistent for WritePolicy and Record. - - - NOTICE! BREAKING CHANGE: Types of `Record.Generation` and `Record.Expiration`, and also `WritePolicy.Generation` and `WritePolicy.Expiration` have changed, and may require casting in older code. - - - Refactor tools/asinfo to be more idiomatic Go. PR #86, thanks to [Tyler Gibbons](https://github.com/Kavec) - - - Many documentation fixes thanks to [Charl Matthee](https://github.com/charl) and [Tyler Gibbons](https://github.com/Kavec) - -- **Fixes** - - - Changed the `KeepConnection` logic from black-list to white-list, to drop all - - - Fix RemoveNodesCopy logic error. - - - Add missing send on recordset Error channel. PR #99, thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - - - Fix skipping of errors/records in (\*recordset).Results() select after cancellation. PR #99, thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - -## October 16 2015 : v1.7 - -Major release. Adds new features and fixes important bugs. - -- **New Features** - - - Added support for Geo spatial queries. - - - Added support for creating indexes on List and Map bins, and querying them. - - - Added support for native floating point values. - - - Added `ClientPolicy.IpMap` to use IP translation for alias recognition. PR #81, Thanks to [Christopher Guiney](https://github.com/chrisguiney) - -- **Improvements** - - - Cosmetic change to improve code consistency for `PackLong` in `packer.go`. PR #78, Thanks to [Erik Dubbelboer](https://github.com/ErikDubbelboer) - -- **Fixes** - - - Fixes an issue when the info->services string was malformed and caused the client to panic. - - - Fixes an issue with unmarshalling maps of type map[ANY]struct{} into embedded structs. - - - Fixes issue with unmarshalling maps of type map[ANY]struct{} into embedded structs. - - - Fixes an issue with bound checking. PR #85, Thanks to [Tait Clarridge](https://github.com/oldmantaiter) - - - Fixes aa few typos in the docs. PR #76, Thanks to [Charl Matthee](https://github.com/charl) - -## August 2015 : v1.6.5 - -Minor maintenance release. - -- **Improvements** - - - Export `MaxBufferSize` to allow tweaking of maximum buffer size allowed to read a record. If a record is bigger than this size (e.g: A lot of LDT elements in scan), this setting wil allow to tweak the buffer size. - -## July 16 2015 : v1.6.4 - -Hot fix release. - -- **Fixes** - - - Fix panic when a scan/query fails and the connection is not dropped. - -## July 9 2015 : v1.6.3 - -Minor fix release. - -- **Improvements** - - - Improved documentation. PR #64 and #68. Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - -- **Fixes** - - - Fix a bunch of golint notices. PR #69, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - - - Connection.Read() total bytes count on error. PR #71, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - - - Fixed a race condition on objectMappings map. PR #72, Thanks to [Geert-Johan Riemer](https://github.com/GeertJohan) - - - Fixed a few uint -> int convertions. - -## June 11 2015 : v1.6.2 - -Minor fix release. - -- **Improvements** - - - Improved documentation. Replaced all old API references regarding Recordset/Query/Scan to newer, more elegant API. - -- **Fixes** - - - Fixed an issue where erroring out on Scan would result a panic. - - - Fixed an issue where `Statement.TaskId` would be negative. converted `Statement.TaskId` to `uint64` - -## June 9 2015 : v1.6.1 - -Minor fix release. - -- **Fixes** - - - Fixed an issue where marshaller wouldn't marshal some embedded structs. - - - Fixed an issue where querying/scanning empty sets wouldn't drain the socket before return. - -## May 30 2015 : v1.6.0 - -There's an important performance regression bug fix in this release. We recommend everyone to upgrade. - -- **New Features** - - - Added New LargeList API. - - - NOTICE! BREAKING CHANGE: New LargeList API on the Go Client uses the New API defined on newer server versions. As Such, it has changed some signatures in LargeList. - -- **Fixes** - - - Fixed an issue where connections where not put back to the pool on some non-critical errors. - - - Fixed an issue where Object Unmarshaller wouldn't extend a slice. - - - Decode RegisterUDF() error message from base64 - - - Fixed invalid connection handling on node connections (thanks to @rndive) - -## May 15 2015 : v1.5.2 - -Hotfix release. - -- **Fixes** - - - Fixed a branch-merge mistake regarding error handling during connection authentication. - -## May 15 2015 : v1.5.1 - -Major maintenance release. - -NOTICE: All LDTs on server other than LLIST have been deprecated, and will be removed in the future. As Such, all API regarding those features are considered deprecated and will be removed in tandem. - -- **Improvements** - - - Introduces `ClientPolicy.IdleTimeout` to close stale connections to the server. Thanks to Mário Freitas (@imkira). PR #57 - - - Use type alias instead of struct for NullValue. - - - Removed workaround regarding filtering bin names on the client for `BatchGet`. Issue #60 - -- **Fixes** - - - Fixed a few race conditions. - - - Fixed #58 regarding race condition accessing `Cluster.password`. - - - Fixed minor bugs regarding handling of nulls in structs for `GetObj()` and `PutObj()`. - - - Fixed a bug regarding setting TaskIds on the client. - -- ** Other Changes ** - - - Removed deprecated `ReplaceRoles()` method. - - - Removed deprecated `SetCapacity()` and `GetCapacity()` methods for LDTs. - -## April 13 2015 : v1.5.0 - -This release includes potential BREAKING CHANGES. - -- **New Features** - - - Introduces `ClientPolicy.LimitConnectionsToQueueSize`. If set to true, the client won't attemp to create new connections to the node if the total number of pooled connections to the node is equal or more than the pool size. The client will retry to poll a connection from the queue until a timeout occurs. If no timeout is set, it will only retry for ten times. - -- **Improvements** - - - BREAKING CHANGE: | - Uses type aliases instead of structs in several XXXValue methods. This removes a memory allocation per `Value` usage. - Since every `Put` operation uses at list one value object, this has the potential to improve application performance. - Since the signature of several `NewXXXValue` methods have changed, this might break some existing code if you have used the value objects directly. - - - Improved `Logger` so that it will accept a generalized `Logger` interface. Any Logger with a `Printf(format string, values ...interface{})` method can be used. Examples include Logrus. - - - Improved `Client.BatchGet()` performance. - -- **Fixes** - - - Bin names were ignored in BatchCommands. - - - `BatchCommandGet.parseRecord()` returned wrong values when `BinNames` was empty but not nil. - -## March 31 2015 : v1.4.2 - -Maintenance release. - -- **Improvements** - - - Replace channel-based queue system with a lock-based algorithm. - - Marshaller now supports arrays of arbitrary types. - - `Client.GetObject()` now returns an error when the object is not found. - - Partition calculation uses a trick that is twice as fast. - -- **Improvements** - - - Unpacking BLOBs resulted in returning references to pooled buffers. Now copies are returned. - -## March 12 2015 : v1.4.1 - -This is a minor release to help improve the compatibility of the client on Mac OS, and to make cross compilation easier. - -- **Improvements** - - - Node validator won't call net.HostLookup if an IP is passed as a seed to it. - -## Feb 17 2015 : v1.4.0 - -This is a major release, and makes using the client much easier to develop applications. - -- **New Features** - - - Added Marshalling Support for Put and Get operations. Refer to [Marshalling Test](client_object_test.go) to see how to take advantage. - Same functionality for other APIs will follow soon. - Example: - - ```go - type SomeStruct struct { - A int `as:"a"` // alias the field to a - Self *SomeStruct `as:"-"` // will not persist the field - } - - type OtherStruct struct { - i interface{} - OtherObject *OtherStruct - } - - obj := &OtherStruct { - i: 15, - OtherObject: OtherStruct {A: 18}, - } - - key, _ := as.NewKey("ns", "set", value) - err := client.PutObject(nil, key, obj) - // handle error here - - rObj := &OtherStruct{} - err = client.GetObject(nil, key, rObj) - ``` - - - Added `Recordset.Results()`. Consumers of a recordset do not have to implement a select anymore. Instead of: - - ```go - recordset, err := client.ScanAll(...) - L: - for { - select { - case r := <-recordset.Record: - if r == nil { - break L - } - // process record here - case e := <-recordset.Errors: - // handle error here - } - } - ``` - - one should only range on `recordset.Results()`: - - ```go - recordset, err := client.ScanAll(...) - for res := range recordset.Results() { - if res.Err != nil { - // handle error here - } else { - // process record here - fmt.Println(res.Record.Bins) - } - } - ``` - - Use of the old pattern is discouraged and deprecated, and direct access to recordset.Records and recordset.Errors will be removed in a future release. - -- **Improvements** - - - Custom Types are now allowed as bin values. - -## Jan 26 2015 : v1.3.1 - -- **Improvements** - - - Removed dependency on `unsafe` package. - -## Jan 20 2015 : v1.3.0 - -- **Breaking Changes** - - - Removed `Record.Duplicates` and `GenerationPolicy/DUPLICATE` - -- **New Features** - - - Added Security Features: Please consult [Security Docs](https://www.aerospike.com/docs/guide/security.html) on Aerospike website. - - - `ClientPolicy.User`, `ClientPolicy.Password` - - `Client.CreateUser()`, `Client.DropUser()`, `Client.ChangePassword()` - - `Client.GrantRoles()`, `Client.RevokeRoles()`, `Client.ReplaceRoles()` - - `Client.QueryUser()`, `Client.QueryUsers` - - - Added `Client.QueryNode()` - - - Added `ClientPolicy.TendInterval` - -- **Improvements** - - - Cleaned up Scan/Query/Recordset concurrent code - -- **Fixes** - - - Fixed a bug in `tools/cli/cli.go`. - - - Fixed a bug when `GetHeaderOp()` would always translate into `GetOp()` - -## Dec 29 2014: v1.2.0 - -- **New Features** - - - Added `NewKeyWithDigest()` method. You can now create keys with custom digests, or only using digests without - knowing the original value. (Useful when you are getting back results with Query and Scan) - -## Dec 22 2014 - -- **New Features** - - - Added `ConsistencyLevel` to `BasePolicy`. - - - Added `CommitLevel` to `WritePolicy`. - - - Added `LargeList.Range` and `LargeList.RangeThenFilter` methods. - - - Added `LargeMap.Exists` method. - -- **Improvements** - - - We use a pooled XORShift RNG to produce random numbers in the client. It is FAST. - -## Dec 19 2014 - -- **Fixes** - - - `Record.Expiration` wasn't converted to TTL values on `Client.BatchGet`, `Client.Scan` and `Client.Query`. - -## Dec 10 2014 - -- **Fixes**: - - - Fixed issue when the size of key field would not be estimated correctly when WritePolicy.SendKey was set. - -## Nov 27 2014 - -Major Performance Enhancements. Minor new features and fixes. - -- **Improvements** - - - Go client is much faster and more memory efficient now. - In some workloads, it competes and wins against C and Java clients. - - - Complex objects are now de/serialized much faster. - -- **New Features** - - - Added Default Policies for Client object. - Instead of creating a new policy when the passed policy is nil, default policies will be used. - -## Nov 24 2014 - -- **Fixes**: - - - Fixed issue when WritePolicy.SendKey = true was not respected in Touch() and Operate() - -## Nov 22 2014 - -Hotfix in unpacker. Update strongly recommended for everyone using Complex objects, LDTs and UDFs. - -- **Fixes**: - - - When Blob, ByteArray or String size has a bit sign set, unpacker reads it wrong. - Note: This bug only affects unpacking of these objects. Packing was unaffected, and data in the database is valid. - -## Nov 2 2014 - -Minor, but very impoortant fix. - -- **Fixes**: - - - Node selection in partition map was flawed on first refresh. - -- **Incompatible changes**: - - - `Expiration` and `Generation` in `WritePolicy` are now `int32` - - `TaskId` in `Statement` is now always set in the client, and is `int64` - -- **New Features**: - - - float32, float64 and bool are now supported in map and array types - -## Oct 15 2014 (Beta 2) - -- **Hot fix**: - - - Fixed pack/unpack for uint64 - -## Aug 20 2014 (Beta 1) - -Major changes and improvements. - -- **New Features**: - - - Added client.Query() - - Added client.ScanNode()/All() - - Added client.Operate() - - Added client.CreateIndex() - - Added client.DropIndex() - - Added client.RegisterUDF() - - Added client.RegisterUDFFromFile() - - Added client.Execute() - - Added client.ExecuteUDF() - - Added client.BatchGet() - - Added client.BatchGetHeader() - - Added client.BatchExists() - - Added LDT implementation - - Added `Node` and `Key` references to the Record - -- **Changes**: - - - Many minor and major bug fixes - - Potentially breaking change: Reduced Undocumented API surface - - Fixed a few places where error results were not checked - - Breaking Change: Convert Key.namespace & Key.setName from pointer to string; affects Key API - - Renamed all `this` receivers to appropriate names - - Major performance improvements (~2X improvements in speed and memory consumption): - - - better memory management for commands; won't allocate if capacity is big enough - - better hash management in key; avoids two redundant memory allocs - - use a buffer pool to reduce GC load - - fine-grained, customizable and deterministic buffer pool implementation for command - - - Optimizations for Key & Digest - - - changed digest implementation, removed an allocation - - Added RIPEMD160 hash files from crypto to lib - - pool hash objects - - - Various Benchmark tool improvements - - now profileable using localhost:6060 - - minor bug fixes - -## Jul 26 2014 (Alpha) - -- Initial Release. diff --git a/aerospike-tls/vendor-aerospike-client-go/LICENSE b/aerospike-tls/vendor-aerospike-client-go/LICENSE deleted file mode 100644 index d76ea4a6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014-2020 Aerospike, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/aerospike-tls/vendor-aerospike-client-go/README.md b/aerospike-tls/vendor-aerospike-client-go/README.md deleted file mode 100644 index c6e6de09..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/README.md +++ /dev/null @@ -1,189 +0,0 @@ -# Aerospike Go Client v7 - -[![Aerospike Client Go](https://goreportcard.com/badge/github.com/aerospike/aerospike-client-go/v7)](https://goreportcard.com/report/github.com/aerospike/aerospike-client-go/v7) -[![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7) -[![Tests](https://github.com/aerospike/aerospike-client-go/actions/workflows/build.yml/badge.svg?branch=v7&event=push)](github.com/aerospike/aerospike-client-go/actions) - -An Aerospike library for Go. - -This library is compatible with Go 1.20+ and supports the following operating systems: Linux, Mac OS X (Windows builds are possible, but untested). - -Up-to-date documentation is available in the [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go/v7?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). - -You can refer to the test files for idiomatic use cases. - -Please refer to [`CHANGELOG.md`](CHANGELOG.md) for release notes, or if you encounter breaking changes. - -- [Aerospike Go Client v7](#aerospike-go-client-v7) - - [Usage](#usage) - - [Prerequisites](#prerequisites) - - [Installation](#installation) - - [Some Hints:](#some-hints) - - [Performance Tweaking](#performance-tweaking) - - [Tests](#tests) - - [Examples](#examples) - - [Tools](#tools) - - [Benchmarks](#benchmarks) - - [API Documentation](#api-documentation) - - [Google App Engine](#google-app-engine) - - [Reflection, and Object API](#reflection-and-object-api) - - [Proxy Client / DBAAS](#proxy-client--dbaas) - - [License](#license) - -## Usage - -The following is a very simple example of CRUD operations in an Aerospike database. - -```go -package main - -import ( - "fmt" - - aero "github.com/aerospike/aerospike-client-go/v7" -) - -// This is only for this example. -// Please handle errors properly. -func panicOnError(err error) { - if err != nil { - panic(err) - } -} - -func main() { - // define a client to connect to - client, err := aero.NewClient("127.0.0.1", 3000) - panicOnError(err) - - key, err := aero.NewKey("test", "aerospike", "key") - panicOnError(err) - - // define some bins with data - bins := aero.BinMap{ - "bin1": 42, - "bin2": "An elephant is a mouse with an operating system", - "bin3": []interface{}{"Go", 2009}, - } - - // write the bins - err = client.Put(nil, key, bins) - panicOnError(err) - - // read it back! - rec, err := client.Get(nil, key) - panicOnError(err) - - // delete the key, and check if key exists - existed, err := client.Delete(nil, key) - panicOnError(err) - fmt.Printf("Record existed before delete? %v\n", existed) -} -``` - -More examples illustrating the use of the API are located in the -[`examples`](examples) directory. - -Details about the API are available in the [`docs`](docs) directory. - - -## Prerequisites - -[Go](http://golang.org) version v1.20+ is required. - -To install the latest stable version of Go, visit -[http://golang.org/dl/](http://golang.org/dl/) - - -Aerospike Go client implements the wire protocol, and does not depend on the C client. -It is goroutine friendly, and works asynchronously. - -Supported operating systems: - -- Major Linux distributions (Ubuntu, Debian, Red Hat) -- Mac OS X -- Windows (untested) - - -## Installation - -1. Install Go 1.21+ and setup your environment as [Documented](http://golang.org/doc/code.html#GOPATH) here. -2. Get the client in your ```GOPATH``` : ```go get github.com/aerospike/aerospike-client-go/v7``` - - To update the client library: ```go get -u github.com/aerospike/aerospike-client-go/v7``` - -Using [gopkg.in](https://gopkg.in/) is also supported: `go get -u gopkg.in/aerospike/aerospike-client-go.v7` - -### Some Hints: - -- To run a go program directly: ```go run ``` -- to build: ```go build -o ``` -- example: ```go build -tags as_proxy -o benchmark tools/benchmark/benchmark.go``` - - -## Performance Tweaking - -We are bending all efforts to improve the client's performance. In our reference benchmarks, Go client performs almost as good as the C client. - -To read about performance variables, please refer to [`docs/performance.md`](docs/performance.md) - - -## Tests - -This library is packaged with a number of tests. Tests require Ginkgo and Gomega library. - -Before running the tests, you need to update the dependencies: - - $ go get . - -To run all the test cases with race detection: - - $ ginkgo -r -race - - - -## Examples - -A variety of example applications are provided in the [`examples`](examples) directory. - - -### Tools - -A variety of clones of original tools are provided in the [`tools`](tools) directory. -They show how to use more advanced features of the library to re-implement the same functionality in a more concise way. - - -## Benchmarks - -Benchmark utility is provided in the [`tools/benchmark`](tools/benchmark) directory. -See the [`tools/benchmark/README.md`](tools/benchmark/README.md) for details. - - -## API Documentation - -A simple API documentation is available in the [`docs`](docs/README.md) directory. The latest up-to-date docs can be found in [![Godoc](https://godoc.org/github.com/aerospike/aerospike-client-go?status.svg)](https://pkg.go.dev/github.com/aerospike/aerospike-client-go/v7). - - -## Google App Engine - -To build the library for App Engine, build it with the build tag `app_engine`. Aggregation functionality is not available in this build. - - - -## Reflection, and Object API - -To make the library both flexible and fast, we had to integrate the reflection API (methods with `[Get/Put/...]Object` names) tightly in the library. In case you wanted to avoid mixing those API in your app inadvertently, you can use the build tag `as_performance` to remove those APIs from the build. - - - -## Proxy Client / DBAAS - -To compile the client for the proxy server in our database-as-a-service (dbaas) environment, pass `-tags as_proxy` to the compiler on build. - - -## License - -The Aerospike Go Client is made available under the terms of the Apache License, Version 2, as stated in the file `LICENSE`. - -Individual files may be made available under their own specific license, -all compatible with Apache License, Version 2. Please see individual files for details. - diff --git a/aerospike-tls/vendor-aerospike-client-go/admin_command.go b/aerospike-tls/vendor-aerospike-client-go/admin_command.go deleted file mode 100644 index ca1e7077..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/admin_command.go +++ /dev/null @@ -1,742 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use acmd file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "encoding/binary" - "fmt" - "time" - - "github.com/aerospike/aerospike-client-go/v7/pkg/bcrypt" - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -const ( - // Commands - _AUTHENTICATE byte = 0 - _CREATE_USER byte = 1 - _DROP_USER byte = 2 - _SET_PASSWORD byte = 3 - _CHANGE_PASSWORD byte = 4 - _GRANT_ROLES byte = 5 - _REVOKE_ROLES byte = 6 - _QUERY_USERS byte = 9 - _CREATE_ROLE byte = 10 - _DROP_ROLE byte = 11 - _GRANT_PRIVILEGES byte = 12 - _REVOKE_PRIVILEGES byte = 13 - _SET_WHITELIST byte = 14 - _SET_QUOTAS byte = 15 - _QUERY_ROLES byte = 16 - _LOGIN byte = 20 - - // Field IDs - _USER byte = 0 - _PASSWORD byte = 1 - _OLD_PASSWORD byte = 2 - _CREDENTIAL byte = 3 - _CLEAR_PASSWORD byte = 4 - _SESSION_TOKEN byte = 5 - _SESSION_TTL byte = 6 - _ROLES byte = 10 - _ROLE byte = 11 - _PRIVILEGES byte = 12 - _WHITELIST byte = 13 - _READ_QUOTA byte = 14 - _WRITE_QUOTA byte = 15 - _READ_INFO byte = 16 - _WRITE_INFO byte = 17 - _CONNECTIONS byte = 18 - - // Misc - _MSG_VERSION int64 = 2 - _MSG_TYPE int64 = 2 - - _HEADER_SIZE int = 24 - _HEADER_REMAINING int = 16 - _RESULT_CODE int = 9 - _QUERY_END int = 50 -) - -// AdminCommand allows managing user access to the server -type AdminCommand struct { - dataBuffer []byte - dataOffset int -} - -// NewAdminCommand returns an AdminCommand object. -func NewAdminCommand(buf []byte) *AdminCommand { - if buf == nil { - buf = make([]byte, 10*1024) - } - return &AdminCommand{ - dataBuffer: buf, - dataOffset: 8, - } -} - -func (acmd *AdminCommand) createUser(conn *Connection, policy *AdminPolicy, user string, password []byte, roles []string) Error { - acmd.writeHeader(_CREATE_USER, 3) - acmd.writeFieldStr(_USER, user) - acmd.writeFieldBytes(_PASSWORD, password) - acmd.writeRoles(roles) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) dropUser(conn *Connection, policy *AdminPolicy, user string) Error { - acmd.writeHeader(_DROP_USER, 1) - acmd.writeFieldStr(_USER, user) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) setPassword(conn *Connection, policy *AdminPolicy, user string, password []byte) Error { - acmd.writeHeader(_SET_PASSWORD, 2) - acmd.writeFieldStr(_USER, user) - acmd.writeFieldBytes(_PASSWORD, password) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) changePassword(conn *Connection, policy *AdminPolicy, user string, oldPass, newPass []byte) Error { - acmd.writeHeader(_CHANGE_PASSWORD, 3) - acmd.writeFieldStr(_USER, user) - acmd.writeFieldBytes(_OLD_PASSWORD, oldPass) - acmd.writeFieldBytes(_PASSWORD, newPass) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) grantRoles(conn *Connection, policy *AdminPolicy, user string, roles []string) Error { - acmd.writeHeader(_GRANT_ROLES, 2) - acmd.writeFieldStr(_USER, user) - acmd.writeRoles(roles) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) revokeRoles(conn *Connection, policy *AdminPolicy, user string, roles []string) Error { - acmd.writeHeader(_REVOKE_ROLES, 2) - acmd.writeFieldStr(_USER, user) - acmd.writeRoles(roles) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) createRole(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { - fieldCount := 1 - if len(privileges) > 1 { - fieldCount++ - } - - if len(whitelist) > 1 { - fieldCount++ - } - - if readQuota > 0 { - fieldCount++ - } - - if writeQuota > 0 { - fieldCount++ - } - - acmd.writeHeader(_CREATE_ROLE, fieldCount) - acmd.writeFieldStr(_ROLE, roleName) - - if len(privileges) > 0 { - if err := acmd.writePrivileges(privileges); err != nil { - return err - } - } - - if len(whitelist) > 0 { - acmd.writeWhitelist(whitelist) - } - - if readQuota > 0 { - acmd.writeFieldUint32(_READ_QUOTA, readQuota) - } - - if writeQuota > 0 { - acmd.writeFieldUint32(_WRITE_QUOTA, writeQuota) - } - - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) dropRole(conn *Connection, policy *AdminPolicy, roleName string) Error { - acmd.writeHeader(_DROP_ROLE, 1) - acmd.writeFieldStr(_ROLE, roleName) - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) grantPrivileges(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege) Error { - acmd.writeHeader(_GRANT_PRIVILEGES, 2) - acmd.writeFieldStr(_ROLE, roleName) - if err := acmd.writePrivileges(privileges); err != nil { - return err - } - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) revokePrivileges(conn *Connection, policy *AdminPolicy, roleName string, privileges []Privilege) Error { - acmd.writeHeader(_REVOKE_PRIVILEGES, 2) - acmd.writeFieldStr(_ROLE, roleName) - if err := acmd.writePrivileges(privileges); err != nil { - return err - } - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) setWhitelist(conn *Connection, policy *AdminPolicy, roleName string, whitelist []string) Error { - fieldCount := 1 - if len(whitelist) > 0 { - fieldCount++ - } - acmd.writeHeader(_SET_WHITELIST, fieldCount) - acmd.writeFieldStr(_ROLE, roleName) - if len(whitelist) > 0 { - acmd.writeWhitelist(whitelist) - } - return acmd.executeCommand(conn, policy) -} - -func (acmd *AdminCommand) setQuotas(conn *Connection, policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { - acmd.writeHeader(_SET_QUOTAS, 3) - acmd.writeFieldStr(_ROLE, roleName) - acmd.writeFieldUint32(_READ_QUOTA, readQuota) - acmd.writeFieldUint32(_WRITE_QUOTA, writeQuota) - return acmd.executeCommand(conn, policy) -} - -// QueryUser returns user information. -func (acmd *AdminCommand) QueryUser(conn *Connection, policy *AdminPolicy, user string) (*UserRoles, Error) { - acmd.writeHeader(_QUERY_USERS, 1) - acmd.writeFieldStr(_USER, user) - list, err := acmd.readUsers(conn, policy) - if err != nil { - return nil, err - } - - if len(list) > 0 { - return list[0], nil - } - - return nil, nil -} - -// QueryUsers returns user information for all users. -func (acmd *AdminCommand) QueryUsers(conn *Connection, policy *AdminPolicy) ([]*UserRoles, Error) { - acmd.writeHeader(_QUERY_USERS, 0) - list, err := acmd.readUsers(conn, policy) - if err != nil { - return nil, err - } - return list, nil -} - -// QueryRole returns role information. -func (acmd *AdminCommand) QueryRole(conn *Connection, policy *AdminPolicy, roleName string) (*Role, Error) { - acmd.writeHeader(_QUERY_ROLES, 1) - acmd.writeFieldStr(_ROLE, roleName) - list, err := acmd.readRoles(conn, policy) - if err != nil { - return nil, err - } - - if len(list) > 0 { - return list[0], nil - } - - return nil, nil -} - -// QueryRoles returns role information for all roles. -func (acmd *AdminCommand) QueryRoles(conn *Connection, policy *AdminPolicy) ([]*Role, Error) { - acmd.writeHeader(_QUERY_ROLES, 0) - list, err := acmd.readRoles(conn, policy) - if err != nil { - return nil, err - } - return list, nil -} - -func (acmd *AdminCommand) writeRoles(roles []string) { - offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) - acmd.dataBuffer[offset] = byte(len(roles)) - offset++ - - for _, role := range roles { - len := copy(acmd.dataBuffer[offset+1:], role) - acmd.dataBuffer[offset] = byte(len) - offset += len + 1 - } - - size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) - acmd.writeFieldHeader(_ROLES, size) - acmd.dataOffset = offset -} - -func (acmd *AdminCommand) writePrivileges(privileges []Privilege) Error { - offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) - acmd.dataBuffer[offset] = byte(len(privileges)) - offset++ - - for _, privilege := range privileges { - code := privilege.code() - - acmd.dataBuffer[offset] = byte(code) - offset++ - - if privilege.canScope() { - - if len(privilege.SetName) > 0 && len(privilege.Namespace) == 0 { - return newError(types.INVALID_PRIVILEGE, fmt.Sprintf("Admin privilege '%v' has a set scope with an empty namespace.", privilege)) - } - - acmd.dataBuffer[offset] = byte(len(privilege.Namespace)) - offset++ - copy(acmd.dataBuffer[offset:], privilege.Namespace) - offset += len(privilege.Namespace) - - acmd.dataBuffer[offset] = byte(len(privilege.SetName)) - offset++ - copy(acmd.dataBuffer[offset:], privilege.SetName) - offset += len(privilege.SetName) - } else { - if len(privilege.Namespace) > 0 || len(privilege.SetName) > 0 { - return newError(types.INVALID_PRIVILEGE, fmt.Sprintf("Admin global rivilege '%v' can't have a namespace or set.", privilege)) - } - } - } - - size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) - acmd.writeFieldHeader(_PRIVILEGES, size) - acmd.dataOffset = offset - - return nil -} - -func (acmd *AdminCommand) writeWhitelist(whitelist []string) { - offset := acmd.dataOffset + int(_FIELD_HEADER_SIZE) - - comma := false - for _, address := range whitelist { - if comma { - acmd.dataBuffer[offset] = ',' - offset++ - } else { - comma = true - } - - offset += copy(acmd.dataBuffer[offset:], address) - } - - size := offset - acmd.dataOffset - int(_FIELD_HEADER_SIZE) - acmd.writeFieldHeader(_WHITELIST, size) - acmd.dataOffset = offset -} - -func (acmd *AdminCommand) writeSize() { - // Write total size of message which is the current offset. - var size = int64(acmd.dataOffset-8) | (_MSG_VERSION << 56) | (_MSG_TYPE << 48) - binary.BigEndian.PutUint64(acmd.dataBuffer[0:], uint64(size)) -} - -func (acmd *AdminCommand) writeHeader(command byte, fieldCount int) { - // Authenticate header is almost all zeros - for i := acmd.dataOffset; i < acmd.dataOffset+16; i++ { - acmd.dataBuffer[i] = 0 - } - acmd.dataBuffer[acmd.dataOffset+2] = command - acmd.dataBuffer[acmd.dataOffset+3] = byte(fieldCount) - acmd.dataOffset += 16 -} - -func (acmd *AdminCommand) writeFieldStr(id byte, str string) { - len := copy(acmd.dataBuffer[acmd.dataOffset+int(_FIELD_HEADER_SIZE):], str) - acmd.writeFieldHeader(id, len) - acmd.dataOffset += len -} - -func (acmd *AdminCommand) writeFieldBytes(id byte, bytes []byte) { - copy(acmd.dataBuffer[acmd.dataOffset+int(_FIELD_HEADER_SIZE):], bytes) - acmd.writeFieldHeader(id, len(bytes)) - acmd.dataOffset += len(bytes) -} - -func (acmd *AdminCommand) writeFieldUint32(id byte, size uint32) { - acmd.writeFieldHeader(id, 4) - binary.BigEndian.PutUint32(acmd.dataBuffer[acmd.dataOffset:], size) - acmd.dataOffset += 4 -} - -func (acmd *AdminCommand) writeFieldHeader(id byte, size int) { - // Buffer.Int32ToBytes(int32(size+1), acmd.dataBuffer, acmd.dataOffset) - binary.BigEndian.PutUint32(acmd.dataBuffer[acmd.dataOffset:], uint32(size+1)) - - acmd.dataOffset += 4 - acmd.dataBuffer[acmd.dataOffset] = id - acmd.dataOffset++ -} - -func (acmd *AdminCommand) executeCommand(conn *Connection, policy *AdminPolicy) Error { - acmd.writeSize() - timeout := 1 * time.Second - if policy != nil && policy.Timeout > 0 { - timeout = policy.Timeout - } - - if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { - return err - } - - if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { - return err - } - - if _, err := conn.Read(acmd.dataBuffer, _HEADER_SIZE); err != nil { - return err - } - - result := acmd.dataBuffer[_RESULT_CODE] - if result != 0 { - if conn.node != nil { - return newCustomNodeError(conn.node, types.ResultCode(result)) - } - return newError(types.ResultCode(result)) - } - - return nil -} - -func (acmd *AdminCommand) readUsers(conn *Connection, policy *AdminPolicy) ([]*UserRoles, Error) { - acmd.writeSize() - timeout := 1 * time.Second - if policy != nil && policy.Timeout > 0 { - timeout = policy.Timeout - } - - if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { - return nil, err - } - - if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { - return nil, err - } - - status, list, err := acmd.readUserBlocks(conn) - if err != nil { - return nil, err - } - - if status > 0 { - if conn.node != nil { - return nil, newCustomNodeError(conn.node, types.ResultCode(status)) - } - return nil, newError(types.ResultCode(status)) - } - return list, nil -} - -func (acmd *AdminCommand) readUserBlocks(conn *Connection) (status int, rlist []*UserRoles, err Error) { - - var list []*UserRoles - - for status == 0 { - if _, err = conn.Read(acmd.dataBuffer, 8); err != nil { - return -1, nil, err - } - - size := Buffer.BytesToInt64(acmd.dataBuffer, 0) - receiveSize := (size & 0xFFFFFFFFFFFF) - - if receiveSize > 0 { - if receiveSize > int64(len(acmd.dataBuffer)) { - acmd.dataBuffer = make([]byte, receiveSize) - } - if _, err = conn.Read(acmd.dataBuffer, int(receiveSize)); err != nil { - return -1, nil, err - } - status, list, err = acmd.parseUsers(int(receiveSize)) - if err != nil { - return -1, nil, err - } - rlist = append(rlist, list...) - } else { - break - } - } - return status, rlist, nil -} - -func (acmd *AdminCommand) parseUsers(receiveSize int) (int, []*UserRoles, Error) { - acmd.dataOffset = 0 - list := make([]*UserRoles, 0, 100) - - for acmd.dataOffset < receiveSize { - resultCode := int(acmd.dataBuffer[acmd.dataOffset+1]) - - if resultCode != 0 { - if resultCode == _QUERY_END { - return -1, nil, nil - } - return resultCode, nil, nil - } - - userRoles := &UserRoles{} - fieldCount := int(acmd.dataBuffer[acmd.dataOffset+3]) - acmd.dataOffset += _HEADER_REMAINING - - for i := 0; i < fieldCount; i++ { - flen := int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) - acmd.dataOffset += 4 - id := acmd.dataBuffer[acmd.dataOffset] - acmd.dataOffset++ - flen-- - - switch id { - case _USER: - userRoles.User = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+flen]) - acmd.dataOffset += flen - case _ROLES: - acmd.parseRoles(userRoles) - case _READ_INFO: - userRoles.ReadInfo = acmd.parseInfo() - case _WRITE_INFO: - userRoles.WriteInfo = acmd.parseInfo() - case _CONNECTIONS: - userRoles.ConnsInUse = int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) - acmd.dataOffset += flen - default: - acmd.dataOffset += flen - } - } - - if userRoles.User == "" && userRoles.Roles == nil { - continue - } - - if userRoles.Roles == nil { - userRoles.Roles = make([]string, 0) - } - list = append(list, userRoles) - } - - return 0, list, nil -} - -func (acmd *AdminCommand) parseRoles(userRoles *UserRoles) { - size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - userRoles.Roles = make([]string, 0, size) - - for i := 0; i < size; i++ { - len := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - role := string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) - acmd.dataOffset += len - userRoles.Roles = append(userRoles.Roles, role) - } -} - -func (acmd *AdminCommand) parseInfo() []int { - size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - list := make([]int, 0, size) - - for i := 0; i < size; i++ { - val := int(Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset)) - acmd.dataOffset += 4 - list = append(list, val) - } - return list -} - -func hashPassword(password string) ([]byte, Error) { - // Hashing the password with the cost of 10, with a static salt - const salt = "$2a$10$7EqJtq98hPqEX7fNZaFWoO" - hashedPassword, err := bcrypt.Hash(password, salt) - if err != nil { - return nil, newCommonError(err) - } - return []byte(hashedPassword), nil -} - -func (acmd *AdminCommand) readRoles(conn *Connection, policy *AdminPolicy) ([]*Role, Error) { - acmd.writeSize() - timeout := 1 * time.Second - if policy != nil && policy.Timeout > 0 { - timeout = policy.Timeout - } - - if err := conn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { - return nil, err - } - - if _, err := conn.Write(acmd.dataBuffer[:acmd.dataOffset]); err != nil { - return nil, err - } - - status, list, err := acmd.readRoleBlocks(conn) - if err != nil { - return nil, err - } - - if status > 0 { - if conn.node != nil { - return nil, newCustomNodeError(conn.node, types.ResultCode(status)) - } - return nil, newError(types.ResultCode(status)) - } - return list, nil -} - -func (acmd *AdminCommand) readRoleBlocks(conn *Connection) (status int, rlist []*Role, err Error) { - - var list []*Role - - for status == 0 { - if _, err = conn.Read(acmd.dataBuffer, 8); err != nil { - return -1, nil, err - } - - size := Buffer.BytesToInt64(acmd.dataBuffer, 0) - receiveSize := int(size & 0xFFFFFFFFFFFF) - - if receiveSize > 0 { - if receiveSize > len(acmd.dataBuffer) { - acmd.dataBuffer = make([]byte, receiveSize) - } - if _, err = conn.Read(acmd.dataBuffer, receiveSize); err != nil { - return -1, nil, err - } - status, list, err = acmd.parseRolesFull(receiveSize) - if err != nil { - return -1, nil, err - } - rlist = append(rlist, list...) - } else { - break - } - } - return status, rlist, nil -} - -func (acmd *AdminCommand) parseRolesFull(receiveSize int) (int, []*Role, Error) { - acmd.dataOffset = 0 - - var list []*Role - for acmd.dataOffset < receiveSize { - resultCode := int(acmd.dataBuffer[acmd.dataOffset+1]) - - if resultCode != 0 { - if resultCode == _QUERY_END { - return -1, nil, nil - } - return resultCode, nil, nil - } - - role := &Role{} - fieldCount := int(acmd.dataBuffer[acmd.dataOffset+3]) - acmd.dataOffset += _HEADER_REMAINING - - for i := 0; i < fieldCount; i++ { - len := int(Buffer.BytesToInt32(acmd.dataBuffer, acmd.dataOffset)) - acmd.dataOffset += 4 - id := acmd.dataBuffer[acmd.dataOffset] - acmd.dataOffset++ - len-- - - switch id { - case _ROLE: - role.Name = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) - acmd.dataOffset += len - case _PRIVILEGES: - acmd.parsePrivileges(role) - case _WHITELIST: - role.Whitelist = acmd.parseWhitelist(len) - case _READ_QUOTA: - role.ReadQuota = Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset) - acmd.dataOffset += len - case _WRITE_QUOTA: - role.WriteQuota = Buffer.BytesToUint32(acmd.dataBuffer, acmd.dataOffset) - acmd.dataOffset += len - default: - acmd.dataOffset += len - } - } - - if len(role.Name) == 0 && len(role.Privileges) == 0 { - continue - } - - if role.Privileges == nil { - role.Privileges = []Privilege{} - } - list = append(list, role) - } - return 0, list, nil -} - -func (acmd *AdminCommand) parsePrivileges(role *Role) { - size := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - role.Privileges = make([]Privilege, 0, size) - - for i := 0; i < size; i++ { - priv := Privilege{} - priv.Code = privilegeFrom(acmd.dataBuffer[acmd.dataOffset]) - acmd.dataOffset++ - - if priv.canScope() { - len := int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - priv.Namespace = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) - acmd.dataOffset += len - - len = int(acmd.dataBuffer[acmd.dataOffset] & 0xFF) - acmd.dataOffset++ - priv.SetName = string(acmd.dataBuffer[acmd.dataOffset : acmd.dataOffset+len]) - acmd.dataOffset += len - } - role.Privileges = append(role.Privileges, priv) - } -} - -func (acmd *AdminCommand) parseWhitelist(length int) []string { - list := []string{} - begin := acmd.dataOffset - max := begin + length - - for acmd.dataOffset < max { - if acmd.dataBuffer[acmd.dataOffset] == ',' { - l := acmd.dataOffset - begin - if l > 0 { - s := string(acmd.dataBuffer[begin : begin+l]) - list = append(list, s) - } - acmd.dataOffset++ - begin = acmd.dataOffset - } else { - acmd.dataOffset++ - } - } - - l := acmd.dataOffset - begin - if l > 0 { - s := string(acmd.dataBuffer[begin : begin+l]) - list = append(list, s) - } - - return list -} diff --git a/aerospike-tls/vendor-aerospike-client-go/admin_policy.go b/aerospike-tls/vendor-aerospike-client-go/admin_policy.go deleted file mode 100644 index 31a8bc6d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/admin_policy.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "time" - -// AdminPolicy contains attributes used for user administration commands. -type AdminPolicy struct { - - // User administration command socket timeout. - // Default is 2 seconds. - Timeout time.Duration -} - -// NewAdminPolicy generates a new AdminPolicy with default values. -func NewAdminPolicy() *AdminPolicy { - return &AdminPolicy{ - Timeout: _DEFAULT_TIMEOUT, - } -} - -func (ap *AdminPolicy) deadline() (deadline time.Time) { - if ap != nil && ap.Timeout > 0 { - deadline = time.Now().Add(ap.Timeout) - } - - return deadline -} - -func (ap *AdminPolicy) timeout() time.Duration { - if ap != nil && ap.Timeout > 0 { - return ap.Timeout - } - - return _DEFAULT_TIMEOUT -} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike.go b/aerospike-tls/vendor-aerospike-client-go/aerospike.go deleted file mode 100644 index 819b7766..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/aerospike.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package aerospike provides a client to connect and interact with an Aerospike cluster. -// This is the official Go implementation of the Aerospike Client. -package aerospike diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go deleted file mode 100644 index 7e96d6a6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_reflect_test.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "runtime" - - as "github.com/aerospike/aerospike-client-go/v7" - - "testing" -) - -func benchGetObj(times int, client *as.Client, key *as.Key, obj interface{}) { - for i := 0; i < times; i++ { - if err = client.GetObject(nil, key, obj); err != nil { - panic(err) - } - } -} - -func benchPutObj(times int, client *as.Client, key *as.Key, wp *as.WritePolicy, obj interface{}) { - for i := 0; i < times; i++ { - if err = client.PutObject(wp, key, obj); err != nil { - panic(err) - } - } -} - -func Benchmark_GetObject(b *testing.B) { - client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) - if err != nil { - b.Fail() - } - - key, _ := as.NewKey(*namespace, "databases", "Aerospike") - - obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1, 2, 3, 4, 5, 6}} - client.PutObject(nil, key, obj) - - b.N = 1 - runtime.GC() - b.ResetTimer() - benchGetObj(b.N, client, key, obj) -} - -func Benchmark_PutObject(b *testing.B) { - client, err := as.NewClient(*host, *port) - if err != nil { - b.Fail() - } - - // obj := &OBJECT{198, "Jack Shaftoe and Company", []byte(bytes.Repeat([]byte{32}, 1000))} - obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1, 2, 3, 4, 5, 6}} - key, _ := as.NewKey(*namespace, "databases", "Aerospike") - writepolicy := as.NewWritePolicy(0, 0) - - b.N = 100 - runtime.GC() - b.ResetTimer() - benchPutObj(b.N, client, key, writepolicy, obj) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go deleted file mode 100644 index 0374bf9d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/aerospike_bench_test.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "runtime" - - as "github.com/aerospike/aerospike-client-go/v7" - - "testing" -) - -var r *as.Record -var rs []*as.Record -var err error - -type OBJECT struct { - Price int - DBName string - // Blob []byte - Blob []int64 -} - -func benchGet(times int, client *as.Client, key *as.Key) { - for i := 0; i < times; i++ { - if r, err = client.Get(nil, key); err != nil { - panic(err) - } - } -} - -func benchBatchGet(times int, client *as.Client, keys []*as.Key) { - for i := 0; i < times; i++ { - if rs, err = client.BatchGet(nil, keys); err != nil { - panic(err) - } - } -} - -func benchPut(times int, client *as.Client, key *as.Key, wp *as.WritePolicy) { - dbName := as.NewBin("dbname", "CouchDB") - price := as.NewBin("price", 0) - keywords := as.NewBin("keywords", []string{"concurrent", "fast"}) - for i := 0; i < times; i++ { - if err = client.PutBins(wp, key, dbName, price, keywords); err != nil { - panic(err) - } - } -} - -func Benchmark_Get(b *testing.B) { - client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) - if err != nil { - b.Fail() - } - - key, _ := as.NewKey(*namespace, "test", "Aerospike") - // obj := &OBJECT{198, "Jack Shaftoe and Company", []byte(bytes.Repeat([]byte{32}, 1000))} - // obj := &OBJECT{198, "Jack Shaftoe and Company", []int64{1}} - client.Delete(nil, key) - client.PutBins(nil, key, as.NewBin("b", []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, "a", "b"})) - // client.PutBins(nil, key, as.NewBin("b", 1)) - // client.PutObject(nil, key, &obj) - - b.N = 100 - runtime.GC() - b.ResetTimer() - benchGet(b.N, client, key) -} - -func Benchmark_Put(b *testing.B) { - client, err := as.NewClient(*host, *port) - if err != nil { - b.Fail() - } - - key, _ := as.NewKey(*namespace, "test", "Aerospike") - writepolicy := as.NewWritePolicy(0, 0) - - b.N = 100 - runtime.GC() - b.ResetTimer() - benchPut(b.N, client, key, writepolicy) -} - -func Benchmark_BatchGet(b *testing.B) { - client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) - if err != nil { - b.Fail() - } - - var keys []*as.Key - for i := 0; i < 10; i++ { - key, _ := as.NewKey(*namespace, "test", i) - if err := client.PutBins(nil, key, as.NewBin("b", 1)); err == nil { - keys = append(keys, key) - } - } - - b.N = 1e4 - runtime.GC() - b.ResetTimer() - benchBatchGet(b.N, client, keys) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go b/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go deleted file mode 100644 index 478c46d4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/aerospike_suite_test.go +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "bytes" - "crypto/tls" - "crypto/x509" - "encoding/pem" - "flag" - "fmt" - "log" - "math/rand" - "os" - "regexp" - "strconv" - "strings" - "testing" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - asl "github.com/aerospike/aerospike-client-go/v7/logger" - ast "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var ( - hosts = flag.String("hosts", "", "Comma separated Aerospike server seed hostnames or IP addresses and ports. eg: s1:3000,s2:3000,s3:3000") - host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") - nativeHosts = flag.String("nh", "127.0.0.1:3000", "Native Aerospike server seed hostnames or IP addresses, used in tests for GRPC to support unsupported API") - port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") - user = flag.String("U", "", "Username.") - password = flag.String("P", "", "Password.") - authMode = flag.String("A", "internal", "Authentication mode: internal | external") - useReplicas = flag.Bool("use-replicas", false, "Aerospike will use replicas as well as master partitions.") - debug = flag.Bool("debug", false, "Will set the logging level to DEBUG.") - proxy = flag.Bool("proxy", false, "Will use Proxy Client.") - dbaas = flag.Bool("dbaas", false, "Will run the tests for a dbaas environment.") - namespace = flag.String("n", "test", "Namespace") - - certFile = flag.String("cert_file", "", "Certificate file name.") - keyFile = flag.String("key_file", "", "Key file name.") - keyFilePassphrase = flag.String("key_file_passphrase", "", "Key file's pass phrase.") - nodeTLSName = flag.String("node_tls_name", "", "Node's TLS name.") - rootCA = flag.String("root_ca", "", "Root certificate.") - - tlsConfig *tls.Config - clientPolicy *as.ClientPolicy - client as.ClientIfc - nativeClient *as.Client -) - -func initTestVars() { - var buf bytes.Buffer - var err error - - log.SetFlags(log.LstdFlags | log.Lshortfile) - logger := log.New(&buf, "", log.LstdFlags|log.Lshortfile) - logger.SetOutput(os.Stdout) - asl.Logger.SetLogger(logger) - - // dbaas implies a proxy client, albeit with no access to a native client for test setup. - if *dbaas { - *proxy = true - } - - if *debug { - asl.Logger.SetLevel(asl.DEBUG) - } - - clientPolicy = as.NewClientPolicy() - if *user != "" { - clientPolicy.User = *user - clientPolicy.Password = *password - } - - *authMode = strings.ToLower(strings.TrimSpace(*authMode)) - if *authMode != "internal" && *authMode != "external" { - log.Fatalln("Invalid auth mode: only `internal` and `external` values are accepted.") - } - - if *authMode == "external" { - clientPolicy.AuthMode = as.AuthModeExternal - } - - // setup TLS - tlsConfig = initTLS() - clientPolicy.TlsConfig = tlsConfig - - var dbHosts []*as.Host - - if len(strings.TrimSpace(*hosts)) > 0 { - dbHosts, err = as.NewHosts(strings.Split(*hosts, ",")...) - if err != nil { - log.Fatal(err.Error()) - } - } else { - dbHost := as.NewHost(*host, *port) - dbHost.TLSName = *nodeTLSName - - dbHosts = append(dbHosts, dbHost) - } - - log.Println("Connecting to seeds:", dbHosts) - if *proxy { - client, err = as.CreateClientWithPolicyAndHost(as.CTProxy, clientPolicy, dbHosts[0]) - if err != nil { - log.Fatal(err.Error()) - } - } else { - nclient, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHosts...) - if err != nil { - log.Fatal(err.Error()) - } - client = nclient - nativeClient = nclient - } - - if *proxy && !*dbaas { - hosts, err := as.NewHosts(*nativeHosts) - if err != nil { - log.Fatalln(err) - } - nativeClient, err = as.NewClientWithPolicyAndHost(clientPolicy, hosts...) - if err != nil { - log.Fatal("Error connecting the native client to the cluster", err.Error()) - } - } - - defaultBatchPolicy := as.NewBatchPolicy() - defaultBatchPolicy.TotalTimeout = 15 * time.Second - defaultBatchPolicy.SocketTimeout = 5 * time.Second - defaultWritePolicy := as.NewWritePolicy(0, 0) - defaultWritePolicy.TotalTimeout = 15 * time.Second - defaultWritePolicy.SocketTimeout = 5 * time.Second - defaultScanPolicy := as.NewScanPolicy() - defaultScanPolicy.TotalTimeout = 15 * time.Second - defaultScanPolicy.SocketTimeout = 5 * time.Second - defaultQueryPolicy := as.NewQueryPolicy() - defaultQueryPolicy.TotalTimeout = 15 * time.Second - defaultQueryPolicy.SocketTimeout = 5 * time.Second - defaultAdminPolicy := as.NewAdminPolicy() - defaultAdminPolicy.Timeout = 15 * time.Second - defaultInfoPolicy := as.NewInfoPolicy() - defaultInfoPolicy.Timeout = 15 * time.Second - - if nativeClient != nil { - nativeClient.SetDefaultBatchPolicy(defaultBatchPolicy) - nativeClient.SetDefaultBatchPolicy(defaultBatchPolicy) - nativeClient.SetDefaultWritePolicy(defaultWritePolicy) - nativeClient.SetDefaultWritePolicy(defaultWritePolicy) - nativeClient.SetDefaultScanPolicy(defaultScanPolicy) - nativeClient.SetDefaultScanPolicy(defaultScanPolicy) - nativeClient.SetDefaultQueryPolicy(defaultQueryPolicy) - nativeClient.SetDefaultQueryPolicy(defaultQueryPolicy) - nativeClient.SetDefaultAdminPolicy(defaultAdminPolicy) - nativeClient.SetDefaultInfoPolicy(defaultInfoPolicy) - } - - client.SetDefaultBatchPolicy(defaultBatchPolicy) - client.SetDefaultBatchPolicy(defaultBatchPolicy) - client.SetDefaultWritePolicy(defaultWritePolicy) - client.SetDefaultWritePolicy(defaultWritePolicy) - client.SetDefaultScanPolicy(defaultScanPolicy) - client.SetDefaultScanPolicy(defaultScanPolicy) - client.SetDefaultQueryPolicy(defaultQueryPolicy) - client.SetDefaultQueryPolicy(defaultQueryPolicy) - client.SetDefaultAdminPolicy(defaultAdminPolicy) - client.SetDefaultInfoPolicy(defaultInfoPolicy) - - // set default policies - if *useReplicas { - p := client.GetDefaultPolicy() - p.ReplicaPolicy = as.MASTER_PROLES - client.SetDefaultPolicy(p) - } -} - -func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) - flag.Parse() - - // setup the client object - initTestVars() - os.Exit(m.Run()) -} - -func TestAerospike(t *testing.T) { - // TestMain will be called here, no need to do more - - gm.RegisterFailHandler(gg.Fail) - gg.RunSpecs(t, "Aerospike Client Library Suite") -} - -func featureEnabled(feature string) bool { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - node := nativeClient.GetNodes()[0] - infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "features") - if err != nil { - log.Fatal("Failed to connect to aerospike: err:", err) - } - - return strings.Contains(infoMap["features"], feature) -} - -func isEnterpriseEdition() bool { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - node := nativeClient.GetNodes()[0] - infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "edition") - if err != nil { - log.Fatal("Failed to connect to aerospike: err:", err) - } - - return strings.Contains(infoMap["edition"], "Enterprise") -} - -func securityEnabled() bool { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if !isEnterpriseEdition() { - return false - } - - _, err := nativeClient.QueryRoles(nil) - return err == nil -} - -func xdrEnabled() bool { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - res := info(nativeClient, "get-config:context=xdr") - return len(res) > 0 && !strings.HasPrefix(res, "ERROR") -} - -func nsInfo(ns string, feature string) string { - node := nativeClient.GetNodes()[0] - infoMap, err := node.RequestInfo(as.NewInfoPolicy(), "namespace/"+ns) - if err != nil { - log.Fatal("Failed to connect to aerospike: err:", err) - } - - infoStr := infoMap["namespace/"+ns] - infoPairs := strings.Split(infoStr, ";") - for _, pairs := range infoPairs { - pair := strings.Split(pairs, "=") - if pair[0] == feature { - return pair[1] - } - } - - return "" -} - -func info(client *as.Client, feature string) string { - node := client.GetNodes()[0] - infoMap, err := node.RequestInfo(as.NewInfoPolicy(), feature) - if err != nil { - if !err.Matches(ast.TIMEOUT, ast.NETWORK_ERROR) { - return err.Error() - } else { - log.Fatal("Failed to connect to aerospike: err:", err) - } - } - - return infoMap[feature] -} - -func initTLS() *tls.Config { - if len(*rootCA) == 0 && len(*certFile) == 0 && len(*keyFile) == 0 { - if *dbaas { - // if testing in dbaas environment, still enable the default TLS config - return &tls.Config{} - } - return nil - } - - // Try to load system CA certs, otherwise just make an empty pool - serverPool, err := x509.SystemCertPool() - if serverPool == nil || err != nil { - log.Printf("Adding system certificates to the cert pool failed: %s", err) - serverPool = x509.NewCertPool() - } - - if len(*rootCA) > 0 { - // Try to load system CA certs and add them to the system cert pool - caCert, err := readFromFile(*rootCA) - if err != nil { - log.Fatal(err) - } - - log.Printf("Adding CA certificate to the pool...") - serverPool.AppendCertsFromPEM(caCert) - } - - var clientPool []tls.Certificate - if len(*certFile) > 0 || len(*keyFile) > 0 { - - // Read cert file - certFileBytes, err := readFromFile(*certFile) - if err != nil { - log.Fatal(err) - } - - // Read key file - keyFileBytes, err := readFromFile(*keyFile) - if err != nil { - log.Fatal(err) - } - - // Decode PEM data - keyBlock, _ := pem.Decode(keyFileBytes) - certBlock, _ := pem.Decode(certFileBytes) - - if keyBlock == nil || certBlock == nil { - log.Fatalf("Failed to decode PEM data for key or certificate") - } - - // Check and Decrypt the the Key Block using passphrase - if x509.IsEncryptedPEMBlock(keyBlock) { - decryptedDERBytes, err := x509.DecryptPEMBlock(keyBlock, []byte(*keyFilePassphrase)) - if err != nil { - log.Fatalf("Failed to decrypt PEM Block: `%s`", err) - } - - keyBlock.Bytes = decryptedDERBytes - keyBlock.Headers = nil - } - - // Encode PEM data - keyPEM := pem.EncodeToMemory(keyBlock) - certPEM := pem.EncodeToMemory(certBlock) - - if keyPEM == nil || certPEM == nil { - log.Fatalf("Failed to encode PEM data for key or certificate") - } - - cert, cerr := tls.X509KeyPair(certPEM, keyPEM) - if cerr != nil { - log.Fatalf("Failed to add client certificate and key to the pool: `%s`", cerr) - } - - log.Printf("Adding client certificate and key to the pool...") - clientPool = append(clientPool, cert) - } - - tlsConfig := &tls.Config{ - Certificates: clientPool, - RootCAs: serverPool, - InsecureSkipVerify: false, - PreferServerCipherSuites: true, - } - tlsConfig.BuildNameToCertificate() - - return tlsConfig -} - -// Read content from file -func readFromFile(filePath string) ([]byte, error) { - dataBytes, err := os.ReadFile(filePath) - if err != nil { - return nil, fmt.Errorf("Failed to read from file `%s`: `%v`", filePath, err) - } - - data := bytes.TrimSuffix(dataBytes, []byte("\n")) - - return data, nil -} - -/* - - Version Comparison Code - -*/ - -type versionStatus string - -const ( - vsNewer versionStatus = "newer" - vsOlder versionStatus = "older" - vsEqual versionStatus = "equal" -) - -func nsupPeriod(ns string) int { - if *proxy || *dbaas { - return 0 - } - - var pattern = `nsup-period=(?P\d+)` - var vmeta = regexp.MustCompile(pattern) - - vs := info(nativeClient, "namespace/"+ns) - server := findNamedMatches(vmeta, vs) - - if len(server) > 0 { - return server[0] - } - return 0 -} - -func cmpServerVersion(v string) versionStatus { - var pattern = `(?P\d+)(\.(?P\d+)(\.(?P\d+)(\.(?P\d+))?)?)?.*` - var vmeta = regexp.MustCompile(pattern) - - vs := info(nativeClient, "build") - - server := findNamedMatches(vmeta, vs) - req := findNamedMatches(vmeta, v) - - for i := 0; i < 4; i++ { - if req[i] < server[i] { - return vsNewer - } else if req[i] > server[i] { - return vsOlder - } - } - - return vsEqual -} - -func serverIsOlderThan(v string) bool { - return cmpServerVersion(v) == vsOlder -} - -func serverIsNewerThan(v string) bool { - return cmpServerVersion(v) != vsOlder -} - -func findNamedMatches(regex *regexp.Regexp, str string) []int { - match := regex.FindStringSubmatch(str) - names := regex.SubexpNames() - results := make([]int, len(names)) - - j := 0 - for i, vstr := range match { - if len(names[i]) > 0 { - vr, _ := strconv.Atoi(vstr) - results[j] = vr - j++ - } - } - return results[:j] -} - -func dropUser( - policy *as.AdminPolicy, - user string, -) { - err := nativeClient.DropUser(policy, user) - gm.Expect(err).ToNot(gm.HaveOccurred()) -} - -func dropIndex( - policy *as.WritePolicy, - namespace string, - setName string, - indexName string, -) { - gm.Expect(nativeClient.DropIndex(policy, namespace, setName, indexName)).ToNot(gm.HaveOccurred()) - - // time.Sleep(time.Second) -} - -func createIndex( - policy *as.WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType as.IndexType, -) { - idxTask, err := nativeClient.CreateIndex(policy, namespace, setName, indexName, binName, indexType) - if err != nil { - if !err.Matches(ast.INDEX_FOUND) { - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - return // index already exists - } - - // time.Sleep(time.Second) - - // wait until index is created - gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) -} - -func createComplexIndex( - policy *as.WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType as.IndexType, - indexCollectionType as.IndexCollectionType, - ctx ...*as.CDTContext, -) { - // queries only work on indices - idxTask1, err := nativeClient.CreateComplexIndex(policy, namespace, setName, indexName, binName, indexType, indexCollectionType, ctx...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until index is created - gm.Expect(<-idxTask1.OnComplete()).ToNot(gm.HaveOccurred()) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go b/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go deleted file mode 100644 index 4b889bb4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/anonymous_fields_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Aerospike", func() { - - gg.Describe("PutObject and GetObject with anonymous fields", func() { - // connection data - var err error - var ns = *namespace - var set = randString(50) - - type anonymousStructA struct { - A int `as:"a"` - TTL uint32 `asm:"ttl"` - GEN uint32 `asm:"gen"` - } - - type anonymousStructB struct { - B string `as:"b"` - TTL uint32 `asm:"ttl"` - GEN uint32 `asm:"gen"` - } - - type anonymousStructABC struct { - anonymousStructA - anonymousStructB - A bool `as:"ace"` - B int `as:"bce"` - C float64 `as:"c"` - TTL1, TTL2 uint32 `asm:"ttl"` - GEN1, GEN2 uint32 `asm:"gen"` - } - - type anonymousStructABCD struct { - ABC *anonymousStructABC - D bool `as:"d"` - } - - type testStruct struct { - anonymousStructABC - anonymousStructABCD - } - - makeTestObject := func() *testStruct { - obj := &testStruct{} - obj.A = true - obj.B = 20 - obj.anonymousStructA.A = 10 - obj.anonymousStructB.B = "Hello" - obj.C = 3.14159 - obj.ABC = &anonymousStructABC{} - obj.ABC.A = false - obj.ABC.B = 42 - obj.ABC.anonymousStructA.A = 28 - obj.ABC.anonymousStructB.B = "World!" - obj.ABC.C = 2.17828 - obj.D = true - return obj - } - - gg.Context("PutObject & GetObject operations", func() { - gg.It("must save an object with anonymous fields", func() { - as.UseNativeBoolTypeInReflection = false - - key, _ := as.NewKey(ns, set, randString(50)) - expected := makeTestObject() - err = client.PutObject(nil, key, expected) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - actual := &testStruct{} - err = client.GetObject(nil, key, actual) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - // make sure the returned BinMap here reflects what you - // expect the final marshalled object should be. - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{ - "ABC": map[interface{}]interface{}{ - "b": "World!", - "ace": 0, - "bce": 42, - "c": 2.17828, - "a": 28, - }, - "d": 1, - "a": 10, - "b": "Hello", - "ace": 1, - "bce": 20, - "c": 3.14159, - })) - - gm.Expect(actual.TTL1).NotTo(gm.Equal(uint32(0))) - gm.Expect(actual.TTL1).To(gm.Equal(actual.TTL2)) - gm.Expect(actual.TTL1).To(gm.Equal(actual.anonymousStructA.TTL)) - gm.Expect(actual.TTL1).To(gm.Equal(actual.anonymousStructB.TTL)) - - gm.Expect(actual.GEN1).To(gm.Equal(uint32(1))) - gm.Expect(actual.GEN2).To(gm.Equal(uint32(1))) - gm.Expect(actual.anonymousStructA.GEN).To(gm.Equal(uint32(1))) - gm.Expect(actual.anonymousStructB.GEN).To(gm.Equal(uint32(1))) - - }) - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/auth_mode.go b/aerospike-tls/vendor-aerospike-client-go/auth_mode.go deleted file mode 100644 index fcf28c09..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/auth_mode.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// AuthMode determines authentication mode. -type AuthMode int - -const ( - // AuthModeInternal uses internal authentication only when user/password defined. Hashed password is stored - // on the server. Do not send clear password. This is the default. - AuthModeInternal AuthMode = iota - - // AuthModeExternal uses external authentication (like LDAP) when user/password defined. Specific external authentication is - // configured on server. If TLSConfig is defined, sends clear password on node login via TLS. - // Will return an error if TLSConfig is not defined. - AuthModeExternal - - // AuthModePKI allows authentication and authorization based on a certificate. No user name or - // password needs to be configured. Requires TLS and a client certificate. - // Requires server version 5.7.0+ - AuthModePKI -) diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_attr.go b/aerospike-tls/vendor-aerospike-client-go/batch_attr.go deleted file mode 100644 index b5bc8503..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_attr.go +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type batchAttr struct { - filterExp *Expression - readAttr int - writeAttr int - infoAttr int - expiration uint32 - generation uint32 - hasWrite bool - sendKey bool -} - -func newBatchAttr(policy *BatchPolicy, rattr int) *batchAttr { - res := &batchAttr{} - res.setRead(policy) - res.readAttr |= rattr - - return res -} - -func newBatchAttrOps(rp *BatchPolicy, wp *BatchWritePolicy, ops []*Operation) { - res := &batchAttr{} - readAllBins := false - readHeader := false - hasRead := false - hasWriteOp := false - - for _, op := range ops { - switch op.opType { - case _READ_HEADER: - readHeader = true - hasRead = true - case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: - // _Read all bins if no bin is specified. - if op.binName == "" { - readAllBins = true - } - hasRead = true - - default: - hasWriteOp = true - } - } - - if hasWriteOp { - res.setBatchWrite(wp) - - if hasRead { - res.readAttr |= _INFO1_READ - - if readAllBins { - res.readAttr |= _INFO1_GET_ALL - } else if readHeader { - res.readAttr |= _INFO1_NOBINDATA - } - } - } else { - res.setRead(rp) - - if readAllBins { - res.readAttr |= _INFO1_GET_ALL - } else if readHeader { - res.readAttr |= _INFO1_NOBINDATA - } - } -} - -func (ba *batchAttr) setRead(rp *BatchPolicy) { - ba.filterExp = nil - ba.readAttr = _INFO1_READ - - if rp.ReadModeAP == ReadModeAPAll { - ba.readAttr |= _INFO1_READ_MODE_AP_ALL - } - - ba.writeAttr = 0 - - switch rp.ReadModeSC { - default: - case ReadModeSCSession: - ba.infoAttr = 0 - case ReadModeSCLinearize: - ba.infoAttr = _INFO3_SC_READ_TYPE - case ReadModeSCAllowReplica: - ba.infoAttr = _INFO3_SC_READ_RELAX - case ReadModeSCAllowUnavailable: - ba.infoAttr = _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX - } - ba.expiration = uint32(rp.ReadTouchTTLPercent) - ba.generation = 0 - ba.hasWrite = false - ba.sendKey = false -} - -func (ba *batchAttr) setBatchRead(rp *BatchReadPolicy) { - ba.filterExp = rp.FilterExpression - ba.readAttr = _INFO1_READ - - if rp.ReadModeAP == ReadModeAPAll { - ba.readAttr |= _INFO1_READ_MODE_AP_ALL - } - - ba.writeAttr = 0 - - switch rp.ReadModeSC { - default: - case ReadModeSCSession: - ba.infoAttr = 0 - case ReadModeSCLinearize: - ba.infoAttr = _INFO3_SC_READ_TYPE - case ReadModeSCAllowReplica: - ba.infoAttr = _INFO3_SC_READ_RELAX - case ReadModeSCAllowUnavailable: - ba.infoAttr = _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX - } - ba.expiration = uint32(rp.ReadTouchTTLPercent) - ba.generation = 0 - ba.hasWrite = false - ba.sendKey = false -} - -func (ba *batchAttr) adjustRead(ops []*Operation) { - readAllBins := false - readHeader := false - - for _, op := range ops { - switch op.opType { - case _READ_HEADER: - readHeader = true - case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: - // Read all bins if no bin is specified. - if op.binName == "" { - readAllBins = true - } - default: - } - } - - if readAllBins { - ba.readAttr |= _INFO1_GET_ALL - } else if readHeader { - ba.readAttr |= _INFO1_NOBINDATA - } -} - -func (ba *batchAttr) adjustReadForAllBins(readAllBins bool) { - if readAllBins { - ba.readAttr |= _INFO1_GET_ALL - } else { - ba.readAttr |= _INFO1_NOBINDATA - } -} - -func (ba *batchAttr) setBatchWrite(wp *BatchWritePolicy) { - ba.filterExp = wp.FilterExpression - ba.readAttr = 0 - ba.writeAttr = _INFO2_WRITE | _INFO2_RESPOND_ALL_OPS - ba.infoAttr = 0 - ba.expiration = wp.Expiration - ba.hasWrite = true - ba.sendKey = wp.SendKey - - switch wp.GenerationPolicy { - default: - fallthrough - case NONE: - ba.generation = 0 - - case EXPECT_GEN_EQUAL: - ba.generation = wp.Generation - ba.writeAttr |= _INFO2_GENERATION - - case EXPECT_GEN_GT: - ba.generation = wp.Generation - ba.writeAttr |= _INFO2_GENERATION_GT - } - - switch wp.RecordExistsAction { - case UPDATE: - case UPDATE_ONLY: - ba.infoAttr |= _INFO3_UPDATE_ONLY - case REPLACE: - ba.infoAttr |= _INFO3_CREATE_OR_REPLACE - case REPLACE_ONLY: - ba.infoAttr |= _INFO3_REPLACE_ONLY - case CREATE_ONLY: - ba.writeAttr |= _INFO2_CREATE_ONLY - } - - if wp.DurableDelete { - ba.writeAttr |= _INFO2_DURABLE_DELETE - } - - if wp.CommitLevel == COMMIT_MASTER { - ba.infoAttr |= _INFO3_COMMIT_MASTER - } -} - -func (ba *batchAttr) adjustWrite(ops []*Operation) { - readAllBins := false - readHeader := false - hasRead := false - - for _, op := range ops { - switch op.opType { - case _READ_HEADER: - readHeader = true - hasRead = true - case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ, _CDT_READ, _READ: - // _Read all bins if no bin is specified. - if op.binName == "" { - readAllBins = true - } - hasRead = true - - default: - } - } - - if hasRead { - ba.readAttr |= _INFO1_READ - - if readAllBins { - ba.readAttr |= _INFO1_GET_ALL - } else if readHeader { - ba.readAttr |= _INFO1_NOBINDATA - } - } -} - -func (ba *batchAttr) setBatchUDF(up *BatchUDFPolicy) { - ba.filterExp = up.FilterExpression - ba.readAttr = 0 - ba.writeAttr = _INFO2_WRITE - ba.infoAttr = 0 - ba.expiration = up.Expiration - ba.generation = 0 - ba.hasWrite = true - ba.sendKey = up.SendKey - - if up.DurableDelete { - ba.writeAttr |= _INFO2_DURABLE_DELETE - } - - if up.CommitLevel == COMMIT_MASTER { - ba.infoAttr |= _INFO3_COMMIT_MASTER - } -} - -func (ba *batchAttr) setBatchDelete(dp *BatchDeletePolicy) { - ba.filterExp = dp.FilterExpression - ba.readAttr = 0 - ba.writeAttr = _INFO2_WRITE | _INFO2_RESPOND_ALL_OPS | _INFO2_DELETE - ba.infoAttr = 0 - ba.expiration = 0 - ba.hasWrite = true - ba.sendKey = dp.SendKey - - switch dp.GenerationPolicy { - default: - case NONE: - ba.generation = 0 - case EXPECT_GEN_EQUAL: - ba.generation = dp.Generation - ba.writeAttr |= _INFO2_GENERATION - case EXPECT_GEN_GT: - ba.generation = dp.Generation - ba.writeAttr |= _INFO2_GENERATION_GT - } - - if dp.DurableDelete { - ba.writeAttr |= _INFO2_DURABLE_DELETE - } - - if dp.CommitLevel == COMMIT_MASTER { - ba.infoAttr |= _INFO3_COMMIT_MASTER - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command.go b/aerospike-tls/vendor-aerospike-client-go/batch_command.go deleted file mode 100644 index 1d2c55f2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -type batcher interface { - command - - cloneBatchCommand(batch *batchNode) batcher - filteredOut() int - - retryBatch(ifc batcher, cluster *Cluster, deadline time.Time, iteration int) (bool, Error) - generateBatchNodes(*Cluster) ([]*batchNode, Error) - setSequence(int, int) - - executeSingle(clientIfc) Error -} - -type clientIfc interface { - ClientIfc - - operate(*WritePolicy, *Key, bool, ...*Operation) (*Record, Error) - execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) -} - -type batchCommand struct { - baseMultiCommand - - client clientIfc - batch *batchNode - policy *BatchPolicy - sequenceAP int - sequenceSC int - - splitRetry bool - - filteredOutCnt int -} - -func (cmd *batchCommand) prepareRetry(ifc command, isTimeout bool) bool { - if !(cmd.policy.ReplicaPolicy == SEQUENCE || cmd.policy.ReplicaPolicy == PREFER_RACK) { - // Perform regular retry to same node. - return true - } - - cmd.sequenceAP++ - - if !isTimeout || cmd.policy.ReadModeSC != ReadModeSCLinearize { - cmd.sequenceSC++ - } - return false -} - -func (cmd *batchCommand) retryBatch(ifc batcher, cluster *Cluster, deadline time.Time, iteration int) (bool, Error) { - // Retry requires keys for this node to be split among other nodes. - // This is both recursive and exponential. - batchNodes, err := ifc.generateBatchNodes(cluster) - if err != nil { - return false, err - } - - if len(batchNodes) == 1 && batchNodes[0].Node == cmd.batch.Node { - // Batch node is the same. Go through normal retry. - return false, nil - } - - // Run batch requests sequentially in same thread. - var ferr Error - for _, batchNode := range batchNodes { - command := ifc.cloneBatchCommand(batchNode) - command.setSequence(cmd.sequenceAP, cmd.sequenceSC) - if err := command.executeAt(command, cmd.policy.GetBasePolicy(), deadline, iteration); err != nil { - ferr = chainErrors(err, ferr) - if !cmd.policy.AllowPartialResults { - return false, ferr - } - } - } - - return true, ferr -} - -func (cmd *batchCommand) setSequence(ap, sc int) { - cmd.sequenceAP, cmd.sequenceSC = ap, sc -} - -func (cmd *batchCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *batchCommand) transactionType() transactionType { - return ttNone -} - -func (cmd *batchCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *batchCommand) filteredOut() int { - return cmd.filteredOutCnt -} - -func (cmd *batchCommand) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - panic(unreachable) -} - -func (cmd *batchCommand) cloneBatchCommand(batch *batchNode) batcher { - panic(unreachable) -} - -func (cmd *batchCommand) writeBuffer(ifc command) Error { - panic(unreachable) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go deleted file mode 100644 index 28bb0e87..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_delete.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type batchCommandDelete struct { - batchCommand - - batchDeletePolicy *BatchDeletePolicy - keys []*Key - records []*BatchRecord - attr *batchAttr -} - -func newBatchCommandDelete( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - batchDeletePolicy *BatchDeletePolicy, - keys []*Key, - records []*BatchRecord, - attr *batchAttr, -) *batchCommandDelete { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchCommandDelete{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, false), - policy: policy, - batch: batch, - }, - batchDeletePolicy: batchDeletePolicy, - keys: keys, - records: records, - attr: attr, - } - return res -} - -func (cmd *batchCommandDelete) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.node = batch.Node - res.batch = batch - - return &res -} - -func (cmd *batchCommandDelete) writeBuffer(ifc command) Error { - return cmd.setBatchOperate(cmd.policy, cmd.keys, cmd.batch, nil, nil, cmd.attr) -} - -// Parse all results in the batch. Add records to shared list. -// If the record was not found, the bins will be nil. -func (cmd *batchCommandDelete) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - //Parse each message response and add it to the result array - cmd.dataOffset = 0 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - // The only valid server return codes are "ok" and "not found" and "filtered out". - // If other return codes are received, then abort the batch. - if resultCode != 0 { - if resultCode != types.KEY_NOT_FOUND_ERROR { - if resultCode == types.FILTERED_OUT { - cmd.filteredOutCnt++ - } - } - - if resultCode != types.KEY_NOT_FOUND_ERROR && resultCode != types.FILTERED_OUT { - return false, newCustomNodeError(cmd.node, resultCode) - } - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - err := cmd.skipKey(fieldCount) - if err != nil { - return false, err - } - - if resultCode == 0 { - if err = cmd.parseRecord(cmd.records[batchIndex], cmd.keys[batchIndex], opCount, generation, expiration); err != nil { - return false, err - } - } else { - cmd.records[batchIndex].Err = chainErrors(newCustomNodeError(cmd.node, resultCode), cmd.records[batchIndex].Err) - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - } - } - return true, nil -} - -// Parses the given byte buffer and populate the result object. -// Returns the number of bytes that were parsed from the given buffer. -func (cmd *batchCommandDelete) parseRecord(rec *BatchRecord, key *Key, opCount int, generation, expiration uint32) Error { - bins := make(BinMap, opCount) - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return err - } - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return err - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return err - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - return err - } - - if cmd.isOperation { - if prev, ok := bins[name]; ok { - if prev2, ok := prev.(OpResults); ok { - bins[name] = append(prev2, value) - } else { - bins[name] = OpResults{prev, value} - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - rec.setRecord(newRecord(cmd.node, key, bins, generation, expiration)) - return nil -} - -func (cmd *batchCommandDelete) transactionType() transactionType { - return ttBatchWrite -} - -func (cmd *batchCommandDelete) executeSingle(client clientIfc) Error { - policy := cmd.batchDeletePolicy.toWritePolicy(cmd.policy) - for i, key := range cmd.keys { - res, err := client.Operate(policy, key, DeleteOp()) - cmd.records[i].setRecord(res) - if err != nil { - cmd.records[i].setRawError(err) - - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - return err - } - } - return nil -} - -func (cmd *batchCommandDelete) Execute() Error { - if len(cmd.keys) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchCommandDelete) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go deleted file mode 100644 index faa7d957..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_exists.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type batchCommandExists struct { - batchCommand - - keys []*Key - existsArray []bool -} - -func newBatchCommandExists( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - keys []*Key, - existsArray []bool, -) *batchCommandExists { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchCommandExists{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, false), - policy: policy, - batch: batch, - }, - keys: keys, - existsArray: existsArray, - } - return res -} - -func (cmd *batchCommandExists) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.node = batch.Node - res.batch = batch - - return &res -} - -func (cmd *batchCommandExists) writeBuffer(ifc command) Error { - return cmd.setBatchRead(cmd.policy, cmd.keys, cmd.batch, nil, nil, _INFO1_READ|_INFO1_NOBINDATA) -} - -// Parse all results in the batch. Add records to shared list. -// If the record was not found, the bins will be nil. -func (cmd *batchCommandExists) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - //Parse each message response and add it to the result array - cmd.dataOffset = 0 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - // The only valid server return codes are "ok" and "not found". - // If other return codes are received, then abort the batch. - if resultCode != 0 && resultCode != types.KEY_NOT_FOUND_ERROR { - if resultCode == types.FILTERED_OUT { - cmd.filteredOutCnt++ - } else { - return false, newCustomNodeError(cmd.node, resultCode) - } - } - - info3 := cmd.dataBuffer[3] - - // If cmd is the end marker of the response, do not proceed further - if (int(info3) & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - - if opCount > 0 { - return false, newCustomNodeError(cmd.node, types.PARSE_ERROR, "Received bins that were not requested!") - } - - err := cmd.skipKey(fieldCount) - if err != nil { - return false, err - } - - // only set the results to true; as a result, no synchronization is needed - cmd.existsArray[batchIndex] = resultCode == 0 - } - return true, nil -} - -func (cmd *batchCommandExists) transactionType() transactionType { - return ttBatchRead -} - -func (cmd *batchCommandExists) executeSingle(client clientIfc) Error { - var err Error - for _, offset := range cmd.batch.offsets { - cmd.existsArray[offset], err = client.Exists(&cmd.policy.BasePolicy, cmd.keys[offset]) - if err != nil { - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - return err - } - } - return nil -} - -func (cmd *batchCommandExists) Execute() Error { - if len(cmd.batch.offsets) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchCommandExists) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go deleted file mode 100644 index 1acd449c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_get.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type batchCommandGet struct { - batchCommand - - keys []*Key - binNames []string // binNames are mutually exclusive with ops - ops []*Operation // ops are mutually exclusive with binNames - records []*Record - indexRecords []*BatchRead - readAttr int - key Key - - // pointer to the object that's going to be unmarshalled - objects []*reflect.Value - objectsFound []bool -} - -type batchObjectParsetIfc interface { - buf() []byte - readBytes(int) Error - object(int) *reflect.Value -} - -// this method uses reflection. -// Will not be set if performance flag is passed for the build. -var batchObjectParser func( - cmd batchObjectParsetIfc, - offset int, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error - -func newBatchCommandGet( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - keys []*Key, - binNames []string, - ops []*Operation, - records []*Record, - readAttr int, - isOperation bool, -) *batchCommandGet { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchCommandGet{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, isOperation), - policy: policy, - batch: batch, - }, - keys: keys, - ops: ops, - binNames: binNames, - records: records, - readAttr: readAttr, - } - return res -} - -func (cmd *batchCommandGet) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.node = batch.Node - res.batch = batch - - return &res -} - -func (cmd *batchCommandGet) buf() []byte { - return cmd.dataBuffer -} - -func (cmd *batchCommandGet) object(index int) *reflect.Value { - return cmd.objects[index] -} - -func (cmd *batchCommandGet) writeBuffer(ifc command) Error { - return cmd.setBatchRead(cmd.policy, cmd.keys, cmd.batch, cmd.binNames, cmd.ops, cmd.readAttr) -} - -// Parse all results in the batch. Add records to shared list. -// If the record was not found, the bins will be nil. -func (cmd *batchCommandGet) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - //Parse each message response and add it to the result array - cmd.dataOffset = 0 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - // The only valid server return codes are "ok" and "not found" and "filtered out". - // If other return codes are received, then abort the batch. - if resultCode != 0 && resultCode != types.KEY_NOT_FOUND_ERROR { - if resultCode == types.FILTERED_OUT { - cmd.filteredOutCnt++ - } else { - return false, newCustomNodeError(cmd.node, resultCode) - } - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - err := cmd.skipKey(fieldCount) - if err != nil { - return false, err - } - - if cmd.indexRecords != nil { - if len(cmd.indexRecords) > 0 { - if resultCode == 0 { - if cmd.indexRecords[batchIndex].Record, err = cmd.parseRecord(cmd.indexRecords[batchIndex].Key, opCount, generation, expiration); err != nil { - return false, err - } - } - } - } else { - if resultCode == 0 { - if cmd.objects == nil { - if cmd.records[batchIndex], err = cmd.parseRecord(cmd.keys[batchIndex], opCount, generation, expiration); err != nil { - return false, err - } - } else if batchObjectParser != nil { - // mark it as found - cmd.objectsFound[batchIndex] = true - if err := batchObjectParser(cmd, batchIndex, opCount, fieldCount, generation, expiration); err != nil { - return false, err - } - } - } - } - } - return true, nil -} - -// Parses the given byte buffer and populate the result object. -// Returns the number of bytes that were parsed from the given buffer. -func (cmd *batchCommandGet) parseRecord(key *Key, opCount int, generation, expiration uint32) (*Record, Error) { - bins := make(BinMap, opCount) - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return nil, err - } - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return nil, err - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return nil, err - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - return nil, err - } - - if cmd.isOperation { - if prev, ok := bins[name]; ok { - if prev2, ok := prev.(OpResults); ok { - bins[name] = append(prev2, value) - } else { - bins[name] = OpResults{prev, value} - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - return newRecord(cmd.node, key, bins, generation, expiration), nil -} - -func (cmd *batchCommandGet) transactionType() transactionType { - return ttBatchRead -} - -func (cmd *batchCommandGet) executeSingle(client clientIfc) Error { - for _, offset := range cmd.batch.offsets { - var err Error - if len(cmd.ops) > 0 { - // Validate that all operations are read - for i := range cmd.ops { - if cmd.ops[i].opType.isWrite { - return newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read").setNode(cmd.node) - } - } - cmd.records[offset], err = client.operate(cmd.policy.toWritePolicy(), cmd.keys[offset], true, cmd.ops...) - } else if (cmd.readAttr & _INFO1_NOBINDATA) == _INFO1_NOBINDATA { - cmd.records[offset], err = client.GetHeader(&cmd.policy.BasePolicy, cmd.keys[offset]) - } else { - cmd.records[offset], err = client.Get(&cmd.policy.BasePolicy, cmd.keys[offset], cmd.binNames...) - } - if err != nil { - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - return err - } - } - return nil -} - -func (cmd *batchCommandGet) Execute() Error { - if cmd.objects == nil && len(cmd.batch.offsets) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchCommandGet) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go deleted file mode 100644 index cee4a09c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_get_reflect.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// if this file is included in the build, it will include this method -func init() { - batchObjectParser = parseBatchObject -} - -func parseBatchObject( - cmd batchObjectParsetIfc, - offset int, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error { - if opCount > 0 { - rv := *cmd.object(offset) - - if rv.Kind() != reflect.Ptr { - return ErrInvalidObjectType.err() - } - rv = rv.Elem() - - if !rv.CanAddr() { - return ErrInvalidObjectType.err() - } - - if rv.Kind() != reflect.Struct { - return ErrInvalidObjectType.err() - } - - // find the name based on tag mapping - iobj := indirect(rv) - mappings := objectMappings.getMapping(iobj.Type()) - - if err := setObjectMetaFields(iobj, expiration, generation); err != nil { - return err - } - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return err - } - opSize := int(Buffer.BytesToUint32(cmd.buf(), 0)) - particleType := int(cmd.buf()[5]) - nameSize := int(cmd.buf()[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return err - } - name := string(cmd.buf()[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return err - } - value, err := bytesToParticle(particleType, cmd.buf(), 0, particleBytesSize) - if err != nil { - return err - } - if err := setObjectField(mappings, iobj, name, value); err != nil { - return err - } - } - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go deleted file mode 100644 index b0502787..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_operate.go +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type batchCommandOperate struct { - batchCommand - - attr *batchAttr - records []BatchRecordIfc - - // pointer to the object that's going to be unmarshalled - objects []*reflect.Value - objectsFound []bool -} - -func newBatchCommandOperate( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - records []BatchRecordIfc, -) *batchCommandOperate { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchCommandOperate{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, true), - policy: policy, - batch: batch, - }, - records: records, - } - return res -} - -func (cmd *batchCommandOperate) buf() []byte { - return cmd.dataBuffer -} - -func (cmd *batchCommandOperate) object(index int) *reflect.Value { - return cmd.objects[index] -} - -func (cmd *batchCommandOperate) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.node = batch.Node - res.batch = batch - - return &res -} - -func (cmd *batchCommandOperate) writeBuffer(ifc command) Error { - attr, err := cmd.setBatchOperateIfc(cmd.client, cmd.policy, cmd.records, cmd.batch) - cmd.attr = attr - return err -} - -func (cmd *batchCommandOperate) isRead() bool { - return cmd.attr != nil && !cmd.attr.hasWrite -} - -// Parse all results in the batch. Add records to shared list. -// If the record was not found, the bins will be nil. -func (cmd *batchCommandOperate) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - //Parse each message response and add it to the result array - cmd.dataOffset = 0 - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if resultCode == 0 && (info3&_INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - - err := cmd.skipKey(fieldCount) - if err != nil { - return false, err - } - - if resultCode != 0 { - if resultCode == types.FILTERED_OUT { - cmd.filteredOutCnt++ - } - - // If it looks like the error is on the first record and the message is marked as last part, - // the error is for the whole command and not just for the first batchIndex - lastMessage := (info3&_INFO3_LAST) == _INFO3_LAST || cmd.grpcEOS - if resultCode != 0 && lastMessage && receiveSize == int(_MSG_REMAINING_HEADER_SIZE) { - return false, newError(resultCode).setNode(cmd.node) - } - - if resultCode == types.UDF_BAD_RESPONSE { - rec, err := cmd.parseRecord(cmd.records[batchIndex].key(), opCount, generation, expiration) - if err != nil { - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - return false, err - } - - // for UDF failures - var msg interface{} - if rec != nil { - msg = rec.Bins["FAILURE"] - } - - // Need to store record because failure bin contains an error message. - cmd.records[batchIndex].setRecord(rec) - if msg, ok := msg.(string); ok && len(msg) > 0 { - cmd.records[batchIndex].setErrorWithMsg(cmd.node, resultCode, msg, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - } else { - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - } - - // If cmd is the end marker of the response, do not proceed further - // if (info3 & _INFO3_LAST) == _INFO3_LAST { - if lastMessage { - return false, nil - } - continue - } - - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - continue - } - - // Do not process records after grpc stream has ended. - // This is a special case due to proxy server shortcomings. - if resultCode == 0 && !cmd.grpcEOS { - if cmd.objects == nil { - rec, err := cmd.parseRecord(cmd.records[batchIndex].key(), opCount, generation, expiration) - if err != nil { - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - return false, err - } - cmd.records[batchIndex].setRecord(rec) - } else if batchObjectParser != nil { - // mark it as found - cmd.objectsFound[batchIndex] = true - if err := batchObjectParser(cmd, batchIndex, opCount, fieldCount, generation, expiration); err != nil { - return false, err - - } - } - } - } - - return true, nil -} - -// Parses the given byte buffer and populate the result object. -// Returns the number of bytes that were parsed from the given buffer. -func (cmd *batchCommandOperate) parseRecord(key *Key, opCount int, generation, expiration uint32) (*Record, Error) { - bins := make(BinMap, opCount) - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return nil, err - } - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return nil, err - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return nil, err - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - return nil, err - } - - if cmd.isOperation { - if prev, ok := bins[name]; ok { - if prev2, ok := prev.(OpResults); ok { - bins[name] = append(prev2, value) - } else { - bins[name] = OpResults{prev, value} - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - return newRecord(cmd.node, key, bins, generation, expiration), nil -} - -func (cmd *batchCommandOperate) executeSingle(client clientIfc) Error { - var res *Record - var err Error - for _, br := range cmd.records { - - switch br := br.(type) { - case *BatchRead: - ops := br.Ops - if br.headerOnly() { - ops = append(ops, GetHeaderOp()) - } else if len(br.BinNames) > 0 { - for i := range br.BinNames { - ops = append(ops, GetBinOp(br.BinNames[i])) - } - } else if len(ops) == 0 { - ops = append(ops, GetOp()) - } - res, err = client.operate(cmd.client.getUsableBatchReadPolicy(br.Policy).toWritePolicy(cmd.policy), br.Key, true, ops...) - case *BatchWrite: - policy := cmd.client.getUsableBatchWritePolicy(br.Policy).toWritePolicy(cmd.policy) - policy.RespondPerEachOp = true - res, err = client.operate(policy, br.Key, true, br.Ops...) - case *BatchDelete: - policy := cmd.client.getUsableBatchDeletePolicy(br.Policy).toWritePolicy(cmd.policy) - res, err = client.operate(policy, br.Key, true, DeleteOp()) - case *BatchUDF: - policy := cmd.client.getUsableBatchUDFPolicy(br.Policy).toWritePolicy(cmd.policy) - policy.RespondPerEachOp = true - res, err = client.execute(policy, br.Key, br.PackageName, br.FunctionName, br.FunctionArgs...) - } - - br.setRecord(res) - if err != nil { - br.BatchRec().setRawError(err) - - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - - return err - } - } - return nil -} - -func (cmd *batchCommandOperate) Execute() Error { - if cmd.objects == nil && len(cmd.records) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchCommandOperate) transactionType() transactionType { - if cmd.isRead() { - return ttBatchRead - } - return ttBatchWrite -} - -func (cmd *batchCommandOperate) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchOperateNodeListIfcRetry(cluster, cmd.policy, cmd.records, cmd.sequenceAP, cmd.sequenceSC, cmd.batch) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go deleted file mode 100644 index 9ce42a79..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_reflect.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// this function will only be set if the performance flag is not passed for build -func init() { - multiObjectParser = batchParseObject - prepareReflectionData = concretePrepareReflectionData -} - -func concretePrepareReflectionData(cmd *baseMultiCommand) { - // if a channel is assigned, assign its value type - if cmd.recordset != nil && !cmd.recordset.objChan.IsNil() { - // this channel must be of type chan *T - cmd.resObjType = cmd.recordset.objChan.Type().Elem().Elem() - cmd.resObjMappings = objectMappings.getMapping(cmd.recordset.objChan.Type().Elem().Elem()) - - cmd.selectCases = []reflect.SelectCase{ - {Dir: reflect.SelectSend, Chan: cmd.recordset.objChan}, - {Dir: reflect.SelectRecv, Chan: reflect.ValueOf(cmd.recordset.cancelled)}, - } - } -} - -func batchParseObject( - cmd *baseMultiCommand, - obj reflect.Value, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error { - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - err = newNodeError(cmd.node, err) - return err - } - - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - err = newNodeError(cmd.node, err) - return err - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - err = newNodeError(cmd.node, err) - return err - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - err = newNodeError(cmd.node, err) - return err - } - - iobj := indirect(obj) - if err := setObjectField(cmd.resObjMappings, iobj, name, value); err != nil { - return err - } - - if err := setObjectMetaFields(obj, expiration, generation); err != nil { - return err - } - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go b/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go deleted file mode 100644 index b8b9c445..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_command_udf.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type batchCommandUDF struct { - batchCommand - - batchUDFPolicy *BatchUDFPolicy - keys []*Key - packageName string - functionName string - args ValueArray - records []*BatchRecord - attr *batchAttr -} - -func newBatchCommandUDF( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - batchUDFPolicy *BatchUDFPolicy, - keys []*Key, - packageName, - functionName string, - args ValueArray, - records []*BatchRecord, - attr *batchAttr, -) *batchCommandUDF { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchCommandUDF{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, false), - policy: policy, - batch: batch, - }, - batchUDFPolicy: batchUDFPolicy, - keys: keys, - records: records, - packageName: packageName, - functionName: functionName, - args: args, - attr: attr, - } - return res -} - -func (cmd *batchCommandUDF) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.node = batch.Node - res.batch = batch - - return &res -} - -func (cmd *batchCommandUDF) writeBuffer(ifc command) Error { - return cmd.setBatchUDF(cmd.policy, cmd.keys, cmd.batch, cmd.packageName, cmd.functionName, cmd.args, cmd.attr) -} - -// Parse all results in the batch. Add records to shared list. -// If the record was not found, the bins will be nil. -func (cmd *batchCommandUDF) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - //Parse each message response and add it to the result array - cmd.dataOffset = 0 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - // The only valid server return codes are "ok" and "not found" and "filtered out". - // If other return codes are received, then abort the batch. - if resultCode != 0 { - if resultCode != types.KEY_NOT_FOUND_ERROR { - if resultCode == types.FILTERED_OUT { - cmd.filteredOutCnt++ - } - } - - if resultCode != types.KEY_NOT_FOUND_ERROR && resultCode != types.FILTERED_OUT { - return false, newCustomNodeError(cmd.node, resultCode) - } - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - batchIndex := int(Buffer.BytesToUint32(cmd.dataBuffer, 14)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - err := cmd.skipKey(fieldCount) - if err != nil { - return false, err - } - - if resultCode == 0 { - if err = cmd.parseRecord(cmd.records[batchIndex], cmd.keys[batchIndex], opCount, generation, expiration); err != nil { - return false, err - } - } else { - cmd.records[batchIndex].Err = chainErrors(newCustomNodeError(cmd.node, resultCode), cmd.records[batchIndex].Err) - cmd.records[batchIndex].setError(cmd.node, resultCode, cmd.batchInDoubt(cmd.attr.hasWrite, cmd.commandSentCounter)) - } - } - return true, nil -} - -// Parses the given byte buffer and populate the result object. -// Returns the number of bytes that were parsed from the given buffer. -func (cmd *batchCommandUDF) parseRecord(rec *BatchRecord, key *Key, opCount int, generation, expiration uint32) Error { - bins := make(BinMap, opCount) - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return err - } - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return err - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return err - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - return err - } - - if cmd.isOperation { - if prev, ok := bins[name]; ok { - if prev2, ok := prev.(OpResults); ok { - bins[name] = append(prev2, value) - } else { - bins[name] = OpResults{prev, value} - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - rec.setRecord(newRecord(cmd.node, key, bins, generation, expiration)) - return nil -} - -func (cmd *batchCommandUDF) isRead() bool { - return !cmd.attr.hasWrite -} - -func (cmd *batchCommandUDF) executeSingle(client clientIfc) Error { - for i, key := range cmd.keys { - policy := cmd.batchUDFPolicy.toWritePolicy(cmd.policy) - policy.RespondPerEachOp = true - res, err := client.execute(policy, key, cmd.packageName, cmd.functionName, cmd.args...) - cmd.records[i].setRecord(res) - if err != nil { - cmd.records[i].setRawError(err) - - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - return err - } - } - return nil -} - -func (cmd *batchCommandUDF) Execute() Error { - if len(cmd.keys) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchCommandUDF) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchNodeListKeys(cluster, cmd.policy, cmd.keys, nil, cmd.sequenceAP, cmd.sequenceSC, cmd.batch, false) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_delete.go b/aerospike-tls/vendor-aerospike-client-go/batch_delete.go deleted file mode 100644 index 6886d129..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_delete.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -var _ BatchRecordIfc = &BatchDelete{} - -// BatchDelete encapsulates a batch delete operation. -type BatchDelete struct { - BatchRecord - - // Policy os the optional write Policy. - Policy *BatchDeletePolicy -} - -func (bd *BatchDelete) hasWrite() bool { - return bd.BatchRecord.hasWrite -} - -func (bd *BatchDelete) key() *Key { - return bd.Key -} - -// NewBatchDelete creates a batch delete operation. -func NewBatchDelete(policy *BatchDeletePolicy, key *Key) *BatchDelete { - return &BatchDelete{ - BatchRecord: *newSimpleBatchRecord(key, true), - Policy: policy, - } -} - -// newBatchDelete creates a batch delete operation. -func newBatchDelete(policy *BatchDeletePolicy, key *Key) (*BatchDelete, *BatchRecord) { - bd := &BatchDelete{ - BatchRecord: *newSimpleBatchRecord(key, true), - Policy: policy, - } - return bd, &bd.BatchRecord -} - -// Return batch command type. -func (bd *BatchDelete) getType() batchRecordType { - return _BRT_BATCH_DELETE -} - -// Optimized reference equality check to determine batch wire protocol repeat flag. -// For internal use only. -func (bd *BatchDelete) equals(obj BatchRecordIfc) bool { - other, ok := obj.(*BatchDelete) - if !ok { - return false - } - - return bd.Policy == other.Policy -} - -// Return wire protocol size. For internal use only. -func (bd *BatchDelete) size(parentPolicy *BasePolicy) (int, Error) { - size := 2 // gen(2) = 2 - - if bd.Policy != nil { - if bd.Policy.FilterExpression != nil { - if sz, err := bd.Policy.FilterExpression.size(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) - } - } - - if bd.Policy.SendKey || parentPolicy.SendKey { - if sz, err := bd.Key.userKey.EstimateSize(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - } - } else if parentPolicy.SendKey { - sz, err := bd.Key.userKey.EstimateSize() - if err != nil { - return -1, err - } - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - - return size, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go deleted file mode 100644 index d73b10de..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_delete_policy.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BatchDeletePolicy is used in batch delete commands. -type BatchDeletePolicy struct { - // FilterExpression is optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key - // request is not performed and BatchRecord.ResultCode is set to type.FILTERED_OUT. - // Default: nil - FilterExpression *Expression - - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - // Default: CommitLevel.COMMIT_ALL - CommitLevel CommitLevel //= COMMIT_ALL - - // Qualify how to handle record deletes based on record generation. The default (NONE) - // indicates that the generation is not used to restrict deletes. - // Default: GenerationPolicy.NONE - GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; - - // Expected generation. Generation is the number of times a record has been modified - // (including creation) on the server. This field is only relevant when generationPolicy - // is not NONE. - // Default: 0 - Generation uint32 - - // If the transaction results in a record deletion, leave a tombstone for the record. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition only. - // Default: false (do not tombstone deleted records). - DurableDelete bool - - // Send user defined key in addition to hash digest. - // If true, the key will be stored with the tombstone record on the server. - // Default: false (do not send the user defined key) - SendKey bool -} - -// NewBatchDeletePolicy returns a default BatchDeletePolicy. -func NewBatchDeletePolicy() *BatchDeletePolicy { - return &BatchDeletePolicy{ - CommitLevel: COMMIT_ALL, - GenerationPolicy: NONE, - } -} - -func (bdp *BatchDeletePolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { - wp := bp.toWritePolicy() - - if bdp != nil { - if bdp.FilterExpression != nil { - wp.FilterExpression = bdp.FilterExpression - } - wp.CommitLevel = bdp.CommitLevel - wp.GenerationPolicy = bdp.GenerationPolicy - wp.Generation = bdp.Generation - wp.DurableDelete = bdp.DurableDelete - wp.SendKey = bdp.SendKey - } - return wp -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_executer.go b/aerospike-tls/vendor-aerospike-client-go/batch_executer.go deleted file mode 100644 index 45d9c5a7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_executer.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// batchExecute Uses werrGroup to run commands using multiple goroutines, -// and waits for their return -func (clnt *Client) batchExecute(policy *BatchPolicy, batchNodes []*batchNode, cmd batcher) (int, Error) { - maxConcurrentNodes := policy.ConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(batchNodes) - } - - // we need this list to count the number of filtered out records - list := make([]batcher, 0, len(batchNodes)) - - weg := newWeightedErrGroup(maxConcurrentNodes) - for _, batchNode := range batchNodes { - newCmd := cmd.cloneBatchCommand(batchNode) - list = append(list, newCmd) - weg.execute(newCmd) - } - - errs := weg.wait() - - // count the filtered out records - filteredOut := 0 - for i := range list { - filteredOut += list[i].filteredOut() - } - - return filteredOut, errs -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go b/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go deleted file mode 100644 index f840b04a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_index_command_get.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type batchIndexCommandGet struct { - batchCommandGet -} - -func newBatchIndexCommandGet( - client clientIfc, - batch *batchNode, - policy *BatchPolicy, - records []*BatchRead, - isOperation bool, -) *batchIndexCommandGet { - var node *Node - if batch != nil { - node = batch.Node - } - - res := &batchIndexCommandGet{ - batchCommandGet{ - batchCommand: batchCommand{ - client: client, - baseMultiCommand: *newMultiCommand(node, nil, isOperation), - policy: policy, - batch: batch, - }, - records: nil, - indexRecords: records, - }, - } - return res -} - -func (cmd *batchIndexCommandGet) cloneBatchCommand(batch *batchNode) batcher { - res := *cmd - res.batch = batch - res.node = batch.Node - - return &res -} - -func (cmd *batchIndexCommandGet) writeBuffer(ifc command) Error { - return cmd.setBatchIndexRead(cmd.policy, cmd.indexRecords, cmd.batch) -} - -func (cmd *batchIndexCommandGet) Execute() Error { - if len(cmd.batch.offsets) == 1 { - return cmd.executeSingle(cmd.client) - } - return cmd.execute(cmd) -} - -func (cmd *batchIndexCommandGet) executeSingle(client clientIfc) Error { - for i, br := range cmd.indexRecords { - var ops []*Operation - if br.headerOnly() { - ops = []*Operation{GetHeaderOp()} - } else if len(br.BinNames) > 0 { - for i := range br.BinNames { - ops = append(ops, GetBinOp(br.BinNames[i])) - } - } else { - ops = br.Ops - } - res, err := client.operate(cmd.policy.toWritePolicy(), br.Key, true, ops...) - cmd.indexRecords[i].setRecord(res) - if err != nil { - cmd.indexRecords[i].setRawError(err) - - // Key not found is NOT an error for batch requests - if err.resultCode() == types.KEY_NOT_FOUND_ERROR { - continue - } - - if err.resultCode() == types.FILTERED_OUT { - cmd.filteredOutCnt++ - continue - } - - if cmd.policy.AllowPartialResults { - continue - } - return err - } - } - return nil -} - -func (cmd *batchIndexCommandGet) generateBatchNodes(cluster *Cluster) ([]*batchNode, Error) { - return newBatchNodeListRecords(cluster, cmd.policy, cmd.indexRecords, cmd.sequenceAP, cmd.sequenceSC, cmd.batch) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_node.go b/aerospike-tls/vendor-aerospike-client-go/batch_node.go deleted file mode 100644 index fa459979..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_node.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "fmt" - -type batchNode struct { - Node *Node - offsets []int -} - -func newBatchNode(node *Node, capacity int, offset int) *batchNode { - res := &batchNode{ - Node: node, - offsets: make([]int, 1, capacity), - } - - res.offsets[0] = offset - return res -} - -func (bn *batchNode) AddKey(offset int) { - bn.offsets = append(bn.offsets, offset) -} - -func (bn *batchNode) String() string { - return fmt.Sprintf("Node: %s, Offsets: %v", bn.Node.String(), bn.offsets) - -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go b/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go deleted file mode 100644 index 7ecd66a6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_node_list.go +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -func newBatchNodeList(cluster *Cluster, policy *BatchPolicy, keys []*Key, records []*BatchRecord, hasWrite bool) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(keys) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - var errs Error - for i := range keys { - var node *Node - var err Error - if hasWrite { - node, err = GetNodeBatchWrite(cluster, keys[i], replicaPolicy, nil, 0) - } else { - node, err = GetNodeBatchRead(cluster, keys[i], replicaPolicy, replicaPolicySC, nil, 0, 0) - } - - if err != nil { - if len(records) > 0 { - records[i].Err = chainErrors(err, records[i].Err) - } else { - errs = chainErrors(err, errs) - } - // return nil, err - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) - } else { - batchNode.AddKey(i) - } - } - - return batchNodes, errs -} - -func newBatchNodeListKeys(cluster *Cluster, policy *BatchPolicy, keys []*Key, records []*BatchRecord, sequenceAP, sequenceSC int, batchSeed *batchNode, hasWrite bool) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(keys) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - var errs Error - for _, offset := range batchSeed.offsets { - var node *Node - var err Error - if hasWrite { - node, err = GetNodeBatchWrite(cluster, keys[offset], replicaPolicy, batchSeed.Node, sequenceAP) - } else { - node, err = GetNodeBatchRead(cluster, keys[offset], replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) - } - - if err != nil { - errs = chainErrors(err, errs) - // return nil, err - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) - } else { - batchNode.AddKey(offset) - } - } - return batchNodes, errs -} - -func newBatchNodeListRecords(cluster *Cluster, policy *BatchPolicy, records []*BatchRead, sequenceAP, sequenceSC int, batchSeed *batchNode) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(batchSeed.offsets) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - for _, offset := range batchSeed.offsets { - node, err := GetNodeBatchRead(cluster, records[offset].Key, replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) - if err != nil { - return nil, err - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) - } else { - batchNode.AddKey(offset) - } - } - return batchNodes, nil -} - -func newBatchIndexNodeList(cluster *Cluster, policy *BatchPolicy, records []*BatchRead) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(records) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - for i := range records { - node, err := GetNodeBatchRead(cluster, records[i].Key, replicaPolicy, replicaPolicySC, nil, 0, 0) - if err != nil { - return nil, err - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) - } else { - batchNode.AddKey(i) - } - } - return batchNodes, nil -} - -func newBatchOperateNodeListIfcRetry(cluster *Cluster, policy *BatchPolicy, records []BatchRecordIfc, sequenceAP, sequenceSC int, batchSeed *batchNode) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(records) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - var errs Error - for _, offset := range batchSeed.offsets { - b := records[offset] - - if b.resultCode() != types.NO_RESPONSE { - // Do not retry keys that already have a response. - continue - } - - var node *Node - var err Error - if b.isWrite() { - node, err = GetNodeBatchWrite(cluster, b.key(), replicaPolicy, batchSeed.Node, sequenceAP) - } else { - node, err = GetNodeBatchRead(cluster, b.key(), replicaPolicy, replicaPolicySC, batchSeed.Node, sequenceAP, sequenceSC) - } - - if err != nil { - errs = chainErrors(err, errs) - // return nil, err - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, offset)) - } else { - batchNode.AddKey(offset) - } - } - return batchNodes, errs -} - -func newBatchOperateNodeListIfc(cluster *Cluster, policy *BatchPolicy, records []BatchRecordIfc) ([]*batchNode, Error) { - nodes := cluster.GetNodes() - - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // Create initial key capacity for each node as average + 25%. - keysPerNode := len(records) / len(nodes) - keysPerNode += keysPerNode / 2 - - // The minimum key capacity is 10. - if keysPerNode < 10 { - keysPerNode = 10 - } - - replicaPolicy := policy.ReplicaPolicy - replicaPolicySC := GetReplicaPolicySC(policy.GetBasePolicy()) - - // Split keys by server node. - batchNodes := make([]*batchNode, 0, len(nodes)) - - var errs Error - for i := range records { - b := records[i] - b.prepare() - - var node *Node - var err Error - if b.isWrite() { - node, err = GetNodeBatchWrite(cluster, b.key(), replicaPolicy, nil, 0) - } else { - node, err = GetNodeBatchRead(cluster, b.key(), replicaPolicy, replicaPolicySC, nil, 0, 0) - } - - if err != nil { - records[i].chainError(err) - records[i].setError(node, err.resultCode(), false) - // Don't interrupt the batch request because of INVALID_NAMESPACE error - // These keys will not be sent to the server - if !err.Matches(types.INVALID_NAMESPACE) { - errs = chainErrors(err, errs) - } - continue - } - - if batchNode := findBatchNode(batchNodes, node); batchNode == nil { - batchNodes = append(batchNodes, newBatchNode(node, keysPerNode, i)) - } else { - batchNode.AddKey(i) - } - } - return batchNodes, errs -} - -func newGrpcBatchOperateListIfc(policy *BatchPolicy, records []BatchRecordIfc) (*batchNode, Error) { - // Split keys by server node. - batchNode := new(batchNode) - for i := range records { - b := records[i] - b.prepare() - batchNode.AddKey(i) - } - - return batchNode, nil -} - -func findBatchNode(nodes []*batchNode, node *Node) *batchNode { - for i := range nodes { - // Note: using pointer equality for performance. - if nodes[i].Node == node { - return nodes[i] - } - } - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_policy.go deleted file mode 100644 index e07d8793..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_policy.go +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BatchPolicy encapsulates parameters for policy attributes used in write operations. -// This object is passed into methods where database writes can occur. -type BatchPolicy struct { - BasePolicy - - // Maximum number of concurrent batch request goroutines to server nodes at any point in time. - // If there are 16 node/namespace combinations requested and ConcurrentNodes is 8, - // then batch requests will be made for 8 node/namespace combinations in concurrent goroutines. - // When a request completes, a new request will be issued until all 16 goroutines are complete. - // - // Values: - // 1: Issue batch requests sequentially. This mode has a performance advantage for small - // to medium sized batch sizes because requests can be issued in the main transaction goroutine. - // This is the default. - // 0: Issue all batch requests in concurrent goroutines. This mode has a performance - // advantage for extremely large batch sizes because each node can process the request - // immediately. The downside is extra goroutines will need to be created (or taken from - // a goroutine pool). - // > 0: Issue up to ConcurrentNodes batch requests in concurrent goroutines. When a request - // completes, a new request will be issued until all goroutines are complete. This mode - // prevents too many concurrent goroutines being created for large cluster implementations. - // The downside is extra goroutines will still need to be created (or taken from a goroutine pool). - ConcurrentNodes int // = 1 - - // Allow batch to be processed immediately in the server's receiving thread when the server - // deems it to be appropriate. If false, the batch will always be processed in separate - // transaction goroutines. This field is only relevant for the new batch index protocol. - // - // For batch exists or batch reads of smaller sized records (<= 1K per record), inline - // processing will be significantly faster on "in memory" namespaces. The server disables - // inline processing on disk based namespaces regardless of this policy field. - // - // Inline processing can introduce the possibility of unfairness because the server - // can process the entire batch before moving onto the next command. - AllowInline bool //= true - - // Allow batch to be processed immediately in the server's receiving thread for SSD - // namespaces. If false, the batch will always be processed in separate service threads. - // Server versions before 6.0 ignore this field. - // - // Inline processing can introduce the possibility of unfairness because the server - // can process the entire batch before moving onto the next command. - // - // Default: false - AllowInlineSSD bool // = false - - // Should all batch keys be attempted regardless of errors. This field is used on both - // the client and server. The client handles node specific errors and the server handles - // key specific errors. - // - // If true, every batch key is attempted regardless of previous key specific errors. - // Node specific errors such as timeouts stop keys to that node, but keys directed at - // other nodes will continue to be processed. - // - // If false, the server will stop the batch to its node on most key specific errors. - // The exceptions are types.KEY_NOT_FOUND_ERROR and types.FILTERED_OUT which never stop the batch. - // The client will stop the entire batch on node specific errors for sync commands - // that are run in sequence (MaxConcurrentThreads == 1). The client will not stop - // the entire batch for async commands or sync commands run in parallel. - // - // Server versions < 6.0 do not support this field and treat this value as false - // for key specific errors. - // - // Default: true - RespondAllKeys bool //= true; - - // AllowPartialResults determines if the results for some nodes should be returned in case - // some nodes encounter an error. The result for the unreceived records will be nil. - // The returned records will be safe to use, since only fully received data will be parsed - // and set. - // - // This flag is only supported for BatchGet and BatchGetHeader methods. BatchGetComplex always returns - // partial results by design. - AllowPartialResults bool //= false -} - -// NewBatchPolicy initializes a new BatchPolicy instance with default parameters. -func NewBatchPolicy() *BatchPolicy { - return &BatchPolicy{ - BasePolicy: *NewPolicy(), - ConcurrentNodes: 1, - AllowInline: true, - AllowPartialResults: false, - RespondAllKeys: true, - } -} - -// NewReadBatchPolicy initializes a new BatchPolicy instance for reads. -func NewReadBatchPolicy() *BatchPolicy { - return NewBatchPolicy() -} - -// NewWriteBatchPolicy initializes a new BatchPolicy instance for writes. -func NewWriteBatchPolicy() *BatchPolicy { - res := NewBatchPolicy() - res.MaxRetries = 0 - return res -} - -func (p *BatchPolicy) toWritePolicy() *WritePolicy { - wp := NewWritePolicy(0, 0) - if p != nil { - wp.BasePolicy = p.BasePolicy - } - return wp -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_read.go b/aerospike-tls/vendor-aerospike-client-go/batch_read.go deleted file mode 100644 index aac921f7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_read.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// BatchRead specifies the Key and bin names used in batch read commands -// where variable bins are needed for each key. -type BatchRead struct { - BatchRecord - - // Optional read policy. - Policy *BatchReadPolicy - - // BinNames specifies the Bins to retrieve for this key. - // BinNames are mutually exclusive with Ops. - BinNames []string - - // ReadAllBins defines what data should be read from the record. - // If true, ignore binNames and read all bins. - // If false and binNames are set, read specified binNames. - // If false and binNames are not set, read record header (generation, expiration) only. - ReadAllBins bool //= false - - // Ops specifies the operations to perform for every key. - // Ops are mutually exclusive with BinNames. - // A binName can be emulated with `GetOp(binName)` - // Supported by server v5.6.0+. - Ops []*Operation -} - -// NewBatchRead defines a key and bins to retrieve in a batch operation. -func NewBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) *BatchRead { - return &BatchRead{ - BatchRecord: *newSimpleBatchRecord(key, false), - Policy: policy, - BinNames: binNames, - ReadAllBins: len(binNames) == 0, - } -} - -// newBatchRead defines a key and bins to retrieve in a batch operation. -func newBatchRead(policy *BatchReadPolicy, key *Key, binNames []string) (*BatchRead, *BatchRecord) { - res := &BatchRead{ - BatchRecord: *newSimpleBatchRecord(key, false), - Policy: policy, - BinNames: binNames, - ReadAllBins: len(binNames) == 0, - } - - return res, &res.BatchRecord -} - -// NewBatchReadOps defines a key and bins to retrieve in a batch operation, including expressions. -func NewBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) *BatchRead { - res := &BatchRead{ - BatchRecord: *newSimpleBatchRecord(key, false), - Policy: policy, - Ops: ops, - } - - return res -} - -// NewBatchReadOps defines a key and bins to retrieve in a batch operation, including expressions. -func newBatchReadOps(policy *BatchReadPolicy, key *Key, ops ...*Operation) (*BatchRead, *BatchRecord) { - // since binNames is mutually exclusive with ops parameter. - res := &BatchRead{ - BatchRecord: *newSimpleBatchRecord(key, false), - Policy: policy, - Ops: ops, - } - - res.ReadAllBins = true - - return res, &res.BatchRecord -} - -// NewBatchReadHeader defines a key to retrieve the record headers only in a batch operation. -func NewBatchReadHeader(policy *BatchReadPolicy, key *Key) *BatchRead { - return &BatchRead{ - BatchRecord: *newSimpleBatchRecord(key, false), - Policy: policy, - ReadAllBins: false, - } -} - -// Return batch command type. -func (br *BatchRead) getType() batchRecordType { - return _BRT_BATCH_READ -} - -// Optimized reference equality check to determine batch wire protocol repeat flag. -// For internal use only. -func (br *BatchRead) equals(obj BatchRecordIfc) bool { - other, ok := obj.(*BatchRead) - if !ok { - return false - } - - return &br.BinNames == &other.BinNames && &br.Ops == &other.Ops && br.Policy == other.Policy && br.ReadAllBins == other.ReadAllBins -} - -// Return wire protocol size. For internal use only. -func (br *BatchRead) size(parentPolicy *BasePolicy) (int, Error) { - size := 0 - - if br.Policy != nil { - if br.Policy.FilterExpression != nil { - if sz, err := br.Policy.FilterExpression.size(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) - } - } - } - - for i := range br.BinNames { - size += len(br.BinNames[i]) + int(_OPERATION_HEADER_SIZE) - } - - for i := range br.Ops { - if br.Ops[i].opType.isWrite { - return -1, newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read") - } - sz, err := br.Ops[i].size() - if err != nil { - return -1, err - } - size += sz - } - - return size, nil -} - -// String implements the Stringer interface. -func (br *BatchRead) String() string { - return fmt.Sprintf("%s: %v", br.Key, br.BinNames) -} - -func (br *BatchRead) headerOnly() bool { - return len(br.Ops) == 0 && len(br.BinNames) == 0 && !br.ReadAllBins -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go deleted file mode 100644 index a65b4b9a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_read_policy.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BatchReadPolicy attributes used in batch read commands. -type BatchReadPolicy struct { - // FilterExpression is the optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key - // request is not performed and BatchRecord.ResultCode is set to types.FILTERED_OUT. - // - // Default: nil - FilterExpression *Expression - - // ReadModeAP indicates read policy for AP (availability) namespaces. - ReadModeAP ReadModeAP //= ONE - - // ReadModeSC indicates read policy for SC (strong consistency) namespaces. - ReadModeSC ReadModeSC //= SESSION; - - // ReadTouchTTLPercent determines how record TTL (time to live) is affected on reads. When enabled, the server can - // efficiently operate as a read-based LRU cache where the least recently used records are expired. - // The value is expressed as a percentage of the TTL sent on the most recent write such that a read - // within this interval of the record’s end of life will generate a touch. - // - // For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to - // 80, the next read within 8 hours of the record's end of life (equivalent to 2 hours after the most - // recent write) will result in a touch, resetting the TTL to another 10 hours. - // - // Values: - // - // 0 : Use server config default-read-touch-ttl-pct for the record's namespace/set. - // -1 : Do not reset record TTL on reads. - // 1 - 100 : Reset record TTL on reads when within this percentage of the most recent write TTL. - // Default: 0 - ReadTouchTTLPercent int32 -} - -// NewBatchReadPolicy returns a policy instance for BatchRead commands. -func NewBatchReadPolicy() *BatchReadPolicy { - return &BatchReadPolicy{ - ReadModeAP: ReadModeAPOne, - ReadModeSC: ReadModeSCSession, - } -} - -func (brp *BatchReadPolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { - wp := bp.toWritePolicy() - - if brp != nil { - if brp.FilterExpression != nil { - wp.FilterExpression = brp.FilterExpression - } - - wp.ReadModeAP = brp.ReadModeAP - wp.ReadModeSC = brp.ReadModeSC - wp.ReadTouchTTLPercent = brp.ReadTouchTTLPercent - } - return wp -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_record.go b/aerospike-tls/vendor-aerospike-client-go/batch_record.go deleted file mode 100644 index e08a32a4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_record.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type batchRecordType byte - -// Batch command type. -const ( - _BRT_INVALID batchRecordType = iota - _BRT_BATCH_READ - _BRT_BATCH_WRITE - _BRT_BATCH_DELETE - _BRT_BATCH_UDF -) - -// BatchRecordIfc is the interface type to encapsulate BatchRead, BatchWrite and BatchUDF commands. -type BatchRecordIfc interface { - // Returns the BatchRecord - BatchRec() *BatchRecord - - key() *Key - resultCode() types.ResultCode - isWrite() bool - - prepare() - setRecord(record *Record) - setError(node *Node, resultCode types.ResultCode, inDoubt bool) - setErrorWithMsg(node *Node, resultCode types.ResultCode, msg string, inDoubt bool) - chainError(err Error) - String() string - getType() batchRecordType - size(parentPolicy *BasePolicy) (int, Error) - equals(BatchRecordIfc) bool -} - -// BatchRecord encasulates the Batch key and record result. -type BatchRecord struct { - // Key. - Key *Key - - // Record result after batch command has completed. Will be nil if record was not found - // or an error occurred. See ResultCode. - Record *Record - - // ResultCode for this returned record. See types.ResultCode. - // If not OK, the record will be nil. - ResultCode types.ResultCode - - // Err encapsulates the possible error chain for this key - Err Error - - // InDoubt signifies the possiblity that the write transaction may have completed even though an error - // occurred for this record. This may be the case when a client error occurs (like timeout) - // after the command was sent to the server. - InDoubt bool - - // Does this command contain a write operation. For internal use only. - hasWrite bool -} - -func newSimpleBatchRecord(key *Key, hasWrite bool) *BatchRecord { - return &BatchRecord{ - Key: key, - ResultCode: types.NO_RESPONSE, - hasWrite: hasWrite, - } -} - -func newBatchRecord(key *Key, record *Record, resultCode types.ResultCode, inDoubt, hasWrite bool) *BatchRecord { - return &BatchRecord{ - Key: key, - Record: record, - ResultCode: resultCode, - InDoubt: inDoubt, - hasWrite: hasWrite, - } -} - -// BatchRec returns the embedded batch record in the interface. -func (br *BatchRecord) BatchRec() *BatchRecord { - return br -} - -func (br *BatchRecord) chainError(e Error) { - br.Err = chainErrors(e, br.Err) -} - -func (br *BatchRecord) isWrite() bool { - return br.hasWrite -} - -func (br *BatchRecord) key() *Key { - return br.Key -} - -func (br *BatchRecord) resultCode() types.ResultCode { - return br.ResultCode -} - -// Prepare for upcoming batch call. Reset result fields because this instance might be -// reused. For internal use only. -func (br *BatchRecord) prepare() { - br.Record = nil - br.ResultCode = types.NO_RESPONSE - br.Err = nil - br.InDoubt = false -} - -// Set record result. For internal use only. -func (br *BatchRecord) setRecord(record *Record) { - br.Record = record - br.ResultCode = types.OK - br.Err = nil -} - -// Set error result directly. -func (br *BatchRecord) setRawError(err Error) { - br.ResultCode = err.resultCode() - br.InDoubt = err.IsInDoubt() - br.Err = err -} - -// Set error result. For internal use only. -func (br *BatchRecord) setError(node *Node, resultCode types.ResultCode, inDoubt bool) { - br.ResultCode = resultCode - br.InDoubt = inDoubt - br.Err = newError(br.ResultCode).setNode(node).markInDoubtIf(inDoubt) -} - -// Set error result. For internal use only. -func (br *BatchRecord) setErrorWithMsg(node *Node, resultCode types.ResultCode, msg string, inDoubt bool) { - br.ResultCode = resultCode - br.InDoubt = inDoubt - br.Err = newError(br.ResultCode, msg).setNode(node).markInDoubtIf(inDoubt) -} - -// String implements the Stringer interface. -func (br *BatchRecord) String() string { - return fmt.Sprintf("Key: %s, Record: %s, ResultCode: %s, InDoubt: %t, Err: %v", br.Key, br.Record, br.ResultCode.String(), br.InDoubt, br.Err) -} - -func (br *BatchRecord) equals(other BatchRecordIfc) bool { - return false -} - -// Return batch command type. For internal use only. -func (br *BatchRecord) getType() batchRecordType { - return _BRT_INVALID -} - -// Return wire protocol size. For internal use only. -func (br *BatchRecord) size(parentPolicy *BasePolicy) (int, Error) { - panic(unreachable) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_test.go b/aerospike-tls/vendor-aerospike-client-go/batch_test.go deleted file mode 100644 index f03b726f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_test.go +++ /dev/null @@ -1,941 +0,0 @@ -//go:build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "math/rand" - "strings" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - - gg.Describe("BatchGetOperate operations", func() { - var ns = *namespace - var set = randString(50) - - gg.It("must return the result with same ordering", func() { - for _, keyCount := range []int{256, 5, 4, 3, 2, 1} { - var keys []*as.Key - for i := 0; i < keyCount; i++ { - key, _ := as.NewKey(ns, set, i) - client.PutBins(nil, key, as.NewBin("i", i), as.NewBin("j", i)) - - keys = append(keys, key) - } - - ops := []*as.Operation{as.GetBinOp("i"), as.PutOp(as.NewBin("h", 1))} - _, err := client.BatchGetOperate(nil, keys, ops...) - gm.Expect(err).To(gm.HaveOccurred()) - - ops = []*as.Operation{as.GetBinOp("i")} - recs, err := client.BatchGetOperate(nil, keys, ops...) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - for i, rec := range recs { - gm.Expect(len(rec.Bins)).To(gm.Equal(1)) - gm.Expect(rec.Bins["i"]).To(gm.Equal(i)) - } - - } - }) // it - - }) // describe - - gg.Describe("Batch Write operations", func() { - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - var rpolicy = as.NewPolicy() - var bpolicy = as.NewBatchPolicy() - var bdpolicy = as.NewBatchDeletePolicy() - // bpolicy.AllowInline = true - - wpolicy.TotalTimeout = 45 * time.Second - wpolicy.SocketTimeout = 15 * time.Second - rpolicy.TotalTimeout = 45 * time.Second - rpolicy.SocketTimeout = 15 * time.Second - bpolicy.TotalTimeout = 45 * time.Second - bpolicy.SocketTimeout = 15 * time.Second - - if *useReplicas { - rpolicy.ReplicaPolicy = as.MASTER_PROLES - } - - gg.BeforeEach(func() { - bpolicy.FilterExpression = nil - }) - - gg.Context("Batch Delete operations", func() { - const keyCount = 1000 - var exists []bool - var ekeys []*as.Key - var dkeys []*as.Key - - gg.BeforeEach(func() { - bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) - ekeys = []*as.Key{} - dkeys = []*as.Key{} - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - - // if key shouldExist == true, put it in the DB - if i%2 == 0 { - ekeys = append(ekeys, key) - } else { - dkeys = append(dkeys, key) - } - } - }) - - gg.It("must return the result with same ordering", func() { - res, err := client.BatchDelete(bpolicy, bdpolicy, dkeys) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res).NotTo(gm.BeNil()) - gm.Expect(len(res)).To(gm.Equal(len(dkeys))) - for _, br := range res { - gm.Expect(br.ResultCode).To(gm.Equal(types.OK)) - } - - // true case - exists, err = client.BatchExists(bpolicy, ekeys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(exists)).To(gm.Equal(len(ekeys))) - for _, keyExists := range exists { - gm.Expect(keyExists).To(gm.BeTrue()) - } - - // false case - exists, err = client.BatchExists(bpolicy, dkeys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(exists)).To(gm.Equal(len(dkeys))) - for _, keyExists := range exists { - gm.Expect(keyExists).To(gm.BeFalse()) - } - }) - - gg.It("must return the result with same ordering for s single key", func() { - keys := []*as.Key{ekeys[0]} - res, err := client.BatchDelete(bpolicy, bdpolicy, keys) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res).NotTo(gm.BeNil()) - gm.Expect(len(res)).To(gm.Equal(len(keys))) - for _, br := range res { - gm.Expect(br.ResultCode).To(gm.Equal(types.OK)) - gm.Expect(br.Record.Bins).To(gm.Equal(as.BinMap{})) - } - - // true case - exists, err = client.BatchExists(bpolicy, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(exists)).To(gm.Equal(len(keys))) - for _, keyExists := range exists { - gm.Expect(keyExists).To(gm.BeFalse()) - } - }) - - gg.It("must return prioritize BatchDeletePolicy over BatchPolicy", func() { - set := randString(10) - - var keys []*as.Key - for i := 0; i < 5; i++ { - key, _ := as.NewKey(ns, set, i) - if i == 0 { - keys = append(keys, key) - } - bin0 := as.NewBin("count", i) - err := client.PutBins(nil, key, bin0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - bdp := as.NewBatchDeletePolicy() - bdp.FilterExpression = as.ExpEq( - as.ExpIntBin("count"), - as.ExpIntVal(0)) - - bp := as.NewBatchPolicy() - bp.FilterExpression = as.ExpEq( - as.ExpIntBin("count"), - as.ExpIntVal(999)) - records, err := client.BatchDelete(bp, bdp, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(records)).To(gm.BeNumerically(">", 0)) - - for _, br := range records { - bri := br.BatchRec() - gm.Expect(bri.ResultCode).To(gm.Equal(types.ResultCode(0))) - gm.Expect(bri.Record).NotTo(gm.BeNil()) - } - - // scanning - rs, err := client.ScanAll(nil, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - gm.Expect(res.Record.Bins["count"]).ToNot(gm.Equal(0)) - cnt++ - } - gm.Expect(cnt).To(gm.Equal(4)) - }) - }) - - gg.Context("BatchOperate operations", func() { - gg.It("must return the result with same ordering", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - key1, _ := as.NewKey(ns, set, 1) - op1 := as.NewBatchWrite(nil, key1, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b"))) - op3 := as.NewBatchRead(nil, key1, []string{"bin2"}) - - key2, _ := as.NewKey(ns, set, 2) - op5 := as.NewBatchWrite(nil, key2, as.PutOp(as.NewBin("bin1", "a"))) - - brecs := []as.BatchRecordIfc{op1, op3, op5} - err := client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Since the ops will run out of order, there is always a chance that - // the read operation will run first and return a KEY_NOT_FOUND error. - // As a result we run the operate command twice. - err = client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1": nil, "bin2": nil})) - gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) - - // gm.Expect(op2.BatchRec().Err).ToNot(gm.HaveOccurred()) - // gm.Expect(op2.BatchRec().ResultCode).To(gm.Equal(types.OK)) - // gm.Expect(op2.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": nil})) - // gm.Expect(op2.BatchRec().InDoubt).To(gm.BeFalse()) - - gm.Expect(op3.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op3.BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(op3.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": "b"})) - gm.Expect(op3.BatchRec().InDoubt).To(gm.BeFalse()) - - // gm.Expect(op4.BatchRec().Err).ToNot(gm.HaveOccurred()) - // gm.Expect(op4.BatchRec().ResultCode).To(gm.Equal(types.OK)) - // gm.Expect(op4.BatchRec().InDoubt).To(gm.BeFalse()) - - // make sure the delete case actually ran - // exists, err := client.Exists(nil, key1) - // gm.Expect(exists).To(gm.BeFalse()) - - // make sure the delete case actually ran - exists, err := client.Exists(nil, key2) - gm.Expect(exists).To(gm.BeTrue()) - }) - - gg.It("must successfully execute a BatchRead with empty ops", func() { - var batchRecords []as.BatchRecordIfc - for i := 0; i < 5; i++ { - key, _ := as.NewKey(ns, set, i) - client.PutBins(nil, key, as.NewBin("i", i), as.NewBin("j", 5-i)) - - if i == 0 { - batchRead := as.NewBatchRead(nil, key, nil) - batchRead.ReadAllBins = true - batchRecords = append(batchRecords, - batchRead, - ) - } - } - - err := client.BatchOperate(nil, batchRecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - op1 := batchRecords[0].BatchRec() - gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"i": 0, "j": 5})) - gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) - - }) - - gg.It("must successfully execute a BatchOperate for many keys", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - gm.Expect(err).ToNot(gm.HaveOccurred()) - bwPolicy := as.NewBatchWritePolicy() - bdPolicy := as.NewBatchDeletePolicy() - - var keys []*as.Key - for i := 0; i < 64; i++ { - key, _ := as.NewKey(ns, set, i) - if i == 0 { - keys = append(keys, key) - } - bin0 := as.NewBin("count", i) - err := client.PutBins(nil, key, bin0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - for _, sendKey := range []bool{true, false} { - bwPolicy.SendKey = sendKey - bdPolicy.SendKey = sendKey - bpolicy.SendKey = !sendKey - - var brecs []as.BatchRecordIfc - for _, key := range keys { - brecs = append(brecs, as.NewBatchWrite(bwPolicy, key, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b")))) - brecs = append(brecs, as.NewBatchDelete(bdPolicy, key)) - brecs = append(brecs, as.NewBatchRead(nil, key, []string{"bin2"})) - } - - err := client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - gg.It("must successfully execute a delete op", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - gm.Expect(err).ToNot(gm.HaveOccurred()) - bwPolicy := as.NewBatchWritePolicy() - bdPolicy := as.NewBatchDeletePolicy() - - for _, sendKey := range []bool{true, false} { - bwPolicy.SendKey = sendKey - bdPolicy.SendKey = sendKey - bpolicy.SendKey = !sendKey - - key1, _ := as.NewKey(ns, set, 1) - op1 := as.NewBatchWrite(bwPolicy, key1, as.PutOp(as.NewBin("bin1", "a")), as.PutOp(as.NewBin("bin2", "b"))) - op2 := as.NewBatchDelete(bdPolicy, key1) - op3 := as.NewBatchRead(nil, key1, []string{"bin2"}) - - brecs := []as.BatchRecordIfc{op1, op3} - err := client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(op1.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op1.BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(op1.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1": nil, "bin2": nil})) - gm.Expect(op1.BatchRec().InDoubt).To(gm.BeFalse()) - - brecs = []as.BatchRecordIfc{op1, op3} - err = client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // There is no guarantee for the order of execution for different commands - gm.Expect(op3.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op3.BatchRec().Record).ToNot(gm.BeNil()) - gm.Expect(op3.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin2": "b"})) - - exists, err := client.Exists(nil, key1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.BeTrue()) - - brecs = []as.BatchRecordIfc{op2} - err = client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(op2.BatchRec().Err).ToNot(gm.HaveOccurred()) - gm.Expect(op2.BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(op2.BatchRec().Record.Bins).To(gm.Equal(as.BinMap{})) - gm.Expect(op2.BatchRec().InDoubt).To(gm.BeFalse()) - - exists, err = client.Exists(nil, key1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.BeFalse()) - } - }) - - gg.It("must successfully execute ops with policies", func() { - key1, _ := as.NewKey(ns, set, randString(50)) - err := client.Put(nil, key1, as.BinMap{"bin1": 1, "bin2": 2}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Create the policy - writePolicy := as.NewBatchWritePolicy() - writePolicy.FilterExpression = as.ExpLess(as.ExpIntBin("bin1"), as.ExpIntVal(1)) - - // Create write operation - record := as.NewBatchWrite(writePolicy, key1, - as.PutOp(as.NewBin("bin3", 3)), - as.PutOp(as.NewBin("bin4", 4)), - ) - - records := []as.BatchRecordIfc{record} - - err = client.BatchOperate(nil, records) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.ResultCode).To(gm.Equal(types.FILTERED_OUT)) - - rec, err := client.Get(nil, key1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(rec.Bins)).To(gm.Equal(2)) - - // remove the filter - - writePolicy.FilterExpression = nil - err = client.BatchOperate(nil, records) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.ResultCode).To(gm.Equal(types.OK)) - - rec, err = client.Get(nil, key1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(rec.Bins)).To(gm.Equal(4)) - }) - }) - - gg.Context("BatchOperate operations", func() { - - gg.It("Should return the error for entire operation", func() { - key, _ := as.NewKey(*namespace, set, 0) - var batchRecords []as.BatchRecordIfc - for i := 0; i < 2000000; i++ { - batchRecords = append(batchRecords, as.NewBatchReadHeader(nil, key)) - } - bp := as.NewBatchPolicy() - bp.RespondAllKeys = true - bp.TotalTimeout = 10 * time.Second - bp.SocketTimeout = 10 * time.Second - err := client.BatchOperate(bp, batchRecords) - gm.Expect(err).To(gm.HaveOccurred()) - // gm.Expect(err.Matches(types.BATCH_MAX_REQUESTS_EXCEEDED)).To(gm.BeTrue()) - }) - - gg.It("Overall command error should be reflected in API call error and not BatchRecord error", func() { - if *dbaas || *proxy { - gg.Skip("Not supported in DBAAS or PROXY environments") - } - - var batchRecords []as.BatchRecordIfc - key, _ := as.NewKey(*namespace, set, 0) - for i := 0; i < len(nativeClient.Cluster().GetNodes())*2000000; i++ { - batchRecords = append(batchRecords, as.NewBatchReadHeader(nil, key)) - } - - err := client.BatchOperate(nil, batchRecords) - gm.Expect(err).To(gm.HaveOccurred()) - // gm.Expect(err.Matches(types.BATCH_MAX_REQUESTS_EXCEEDED)).To(gm.BeTrue()) - - for _, bri := range batchRecords { - gm.Expect(bri.BatchRec().ResultCode).To(gm.Equal(types.NO_RESPONSE)) - } - }) - - gg.It("ListGetByValueRangeOp and ListRemoveByValueRangeOp with nil arguments correctly", func() { - const binName = "int_bin" - - key, err := as.NewKey(ns, set, "list_key1") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - l := []int{7, 6, 5, 8, 9, 10} - err = client.PutBins(wpolicy, key, as.NewBin(binName, l)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Get - op1 := as.ListGetByValueRangeOp(binName, as.NewValue(7), as.NewValue(9), as.ListReturnTypeValue) - op2 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeIndex) - op3 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeValue) - op4 := as.ListGetByValueRangeOp(binName, as.NewValue(7), nil, as.ListReturnTypeRank) - op5 := as.ListGetByValueRangeOp(binName, nil, as.NewValue(9), as.ListReturnTypeValue) - r, err := client.Operate(wpolicy, key, op1, op2, op3, op4, op5) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binName]).To(gm.Equal([]interface{}{[]interface{}{7, 8}, []interface{}{0, 3, 4, 5}, []interface{}{7, 8, 9, 10}, []interface{}{2, 3, 4, 5}, []interface{}{7, 6, 5, 8}})) - - // Remove - op6 := as.ListRemoveByValueRangeOp(binName, as.ListReturnTypeIndex, as.NewValue(7), nil) - r2, err2 := client.Operate(wpolicy, key, op6) - gm.Expect(err2).ToNot(gm.HaveOccurred()) - gm.Expect(r2.Bins[binName]).To(gm.Equal([]interface{}{0, 3, 4, 5})) - - r3, err3 := client.Get(nil, key) - gm.Expect(err3).ToNot(gm.HaveOccurred()) - gm.Expect(r3.Bins[binName]).To(gm.Equal([]interface{}{6, 5})) - }) - - gg.It("must return the result with same ordering", func() { - const keyCount = 50 - keys := []*as.Key{} - - for i := 0; i < keyCount; i++ { - bin := as.NewBin("i", i) - - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - - keys = append(keys, key) - } - - for i, key := range keys { - op1 := as.NewBatchWrite(nil, key, as.PutOp(as.NewBin("bin1", "a"))) - op2 := as.NewBatchWrite(nil, key, as.PutOp(as.NewBin("bin2", "b"))) - op3 := as.NewBatchRead(nil, key, []string{"bin2"}) - - bpolicy.FilterExpression = as.ExpLess( - as.ExpIntBin("i"), - as.ExpIntVal(3), - ) - - brecs := []as.BatchRecordIfc{op1, op2, op3} - err := client.BatchOperate(bpolicy, brecs) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for _, rec := range brecs { - if i < 3 { - gm.Expect(rec.BatchRec().ResultCode).To(gm.Equal(types.OK)) - } else { - gm.Expect(rec.BatchRec().ResultCode).To(gm.Equal(types.FILTERED_OUT)) - } - } - } - }) - }) - - gg.Context("BatchRead operations with TTL", func() { - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if serverIsOlderThan("7") { - gg.Skip("Not supported in server before v7.1") - } - }) - - gg.It("Reset Read TTL", func() { - if nsupPeriod(ns) == 0 { - gg.Skip("Not supported with nsup-period == 0") - } - - key, _ := as.NewKey(ns, set, "expirekey3") - bin := as.NewBin("expireBinName", "expirevalue") - - // Specify that record expires 2 seconds after it's written. - writePolicy := as.NewWritePolicy(0, 2) - err := client.PutBins(writePolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Read the record before it expires and reset read ttl. - time.Sleep(1 * time.Second) - readPolicy := as.NewPolicy() - readPolicy.ReadTouchTTLPercent = 80 - record, err := client.Get(readPolicy, key, bin.Name) - gm.Expect(record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - - // Read the record again, but don't reset read ttl. - time.Sleep(1 * time.Second) - readPolicy.ReadTouchTTLPercent = -1 - record, err = client.Get(readPolicy, key, bin.Name) - gm.Expect(record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - - // Read the record after it expires, showing it's gone. - time.Sleep(2 * time.Second) - record, err = client.Get(nil, key, bin.Name) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(types.KEY_NOT_FOUND_ERROR)).To(gm.BeTrue()) - }) - - gg.It("BatchRead TTL", func() { - // WARNING: This test takes a long time to run due to sleeps. - // Define keys - key1, _ := as.NewKey(ns, set, 88888) - key2, _ := as.NewKey(ns, set, 88889) - - // Write keys with ttl. - bwp := as.NewBatchWritePolicy() - bwp.Expiration = 10 - bw1 := as.NewBatchWrite(bwp, key1, as.PutOp(as.NewBin("a", 1))) - bw2 := as.NewBatchWrite(bwp, key2, as.PutOp(as.NewBin("a", 1))) - - list := []as.BatchRecordIfc{bw1, bw2} - err := client.BatchOperate(nil, list) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Read records before they expire and reset read ttl on one record. - time.Sleep(8 * time.Second) - brp1 := as.NewBatchReadPolicy() - brp1.ReadTouchTTLPercent = 80 - - brp2 := as.NewBatchReadPolicy() - brp2.ReadTouchTTLPercent = -1 - - br1 := as.NewBatchRead(brp1, key1, []string{"a"}) - br2 := as.NewBatchRead(brp2, key2, []string{"a"}) - - list = []as.BatchRecordIfc{br1, br2} - - err = client.BatchOperate(nil, list) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(types.OK, br1.ResultCode) - gm.Expect(types.OK, br2.ResultCode) - - // Read records again, but don't reset read ttl. - time.Sleep(3 * time.Second) - brp1.ReadTouchTTLPercent = -1 - brp2.ReadTouchTTLPercent = -1 - - br1 = as.NewBatchRead(brp1, key1, []string{"a"}) - br2 = as.NewBatchRead(brp2, key2, []string{"a"}) - - list = []as.BatchRecordIfc{br1, br2} - - err = client.BatchOperate(nil, list) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Key 2 should have expired. - gm.Expect(types.OK, br1.ResultCode) - gm.Expect(types.KEY_NOT_FOUND_ERROR, br2.ResultCode) - - // Read record after it expires, showing it's gone. - time.Sleep(8 * time.Second) - err = client.BatchOperate(nil, list) - gm.Expect(types.KEY_NOT_FOUND_ERROR, br1.ResultCode) - gm.Expect(types.KEY_NOT_FOUND_ERROR, br2.ResultCode) - }) - }) - - gg.Context("BatchUDF operations", func() { - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - gg.It("must return the results for single BatchUDF vs multiple", func() { - luaCode := `-- Create a record - function rec_create(rec, bins) - return bins - end` - - removeUDF("test_ops.lua") - registerUDF(luaCode, "test_ops.lua") - - for _, keyCount := range []int{10, 1} { - nativeClient.Truncate(nil, ns, set, nil) - batchRecords := []as.BatchRecordIfc{} - - for k := 0; k < keyCount; k++ { - key, _ := as.NewKey(ns, set, k) - args := make(map[interface{}]interface{}) - args["bin1_str"] = "a" - batchRecords = append(batchRecords, as.NewBatchUDF( - nil, - key, - "test_ops", - "rec_create", - as.NewMapValue(args), - )) - } - bp := as.NewBatchPolicy() - err := client.BatchOperate(bp, batchRecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for i := 0; i < keyCount; i++ { - gm.Expect(batchRecords[i].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[i].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[i].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"SUCCESS": map[interface{}]interface{}{"bin1_str": "a"}})) - } - } - }) - - gg.It("must return the results when one operation is against an invalid namespace", func() { - luaCode := `-- Create a record - function rec_create(rec, bins) - if bins ~= nil then - for b, bv in map.pairs(bins) do - rec[b] = bv - end - end - status = aerospike:create(rec) - return status - end` - - removeUDF("test_ops.lua") - registerUDF(luaCode, "test_ops.lua") - - batchRecords := []as.BatchRecordIfc{} - - key1, _ := as.NewKey(randString(10), set, 1) - args := make(map[interface{}]interface{}) - args["bin1_str"] = "a" - batchRecords = append(batchRecords, as.NewBatchUDF( - nil, - key1, - "test_ops", - "rec_create", - as.NewMapValue(args), - )) - - key2, _ := as.NewKey(ns, set, 2) - batchRecords = append(batchRecords, as.NewBatchWrite( - nil, - key2, - as.PutOp(as.NewBin("bin1_str", "aa")), - )) - - key3, _ := as.NewKey(ns, set, 3) - batchRecords = append(batchRecords, as.NewBatchWrite( - nil, - key3, - as.PutOp(as.NewBin("bin1_str", "aaa")), - )) - - batchRecords = append(batchRecords, as.NewBatchRead( - nil, - key1, - []string{"bin1_str"}, - )) - - batchRecords = append(batchRecords, as.NewBatchRead( - nil, - key2, - []string{"bin1_str"}, - )) - - batchRecords = append(batchRecords, as.NewBatchRead( - nil, - key3, - []string{"bin1_str"}, - )) - - bp := as.NewBatchPolicy() - bp.RespondAllKeys = false - err := client.BatchOperate(bp, batchRecords) - err = client.BatchOperate(bp, batchRecords) - // gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(batchRecords[0].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) - gm.Expect(batchRecords[0].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) - - gm.Expect(batchRecords[1].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[1].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[1].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) - - gm.Expect(batchRecords[2].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[2].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[2].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) - - gm.Expect(batchRecords[3].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) - gm.Expect(batchRecords[3].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) - - gm.Expect(batchRecords[4].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[4].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[4].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aa"})) - - gm.Expect(batchRecords[5].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[5].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[5].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aaa"})) - - bp.RespondAllKeys = true - err = client.BatchOperate(bp, batchRecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(batchRecords[0].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) - gm.Expect(batchRecords[0].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) - - gm.Expect(batchRecords[1].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[1].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[1].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) - - gm.Expect(batchRecords[2].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[2].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[2].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": nil})) - - gm.Expect(batchRecords[3].BatchRec().Err.Matches(types.INVALID_NAMESPACE)).To(gm.BeTrue()) - gm.Expect(batchRecords[3].BatchRec().ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) - - gm.Expect(batchRecords[4].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[4].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[4].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aa"})) - - gm.Expect(batchRecords[5].BatchRec().Err).To(gm.BeNil()) - gm.Expect(batchRecords[5].BatchRec().ResultCode).To(gm.Equal(types.OK)) - gm.Expect(batchRecords[5].BatchRec().Record.Bins).To(gm.Equal(as.BinMap{"bin1_str": "aaa"})) - }) - - gg.It("must return correct errors", func() { - - nativeClient.Truncate(nil, ns, set, nil) - - udf := `function wait_and_update(rec, bins, n) - info("WAIT_AND_WRITE BEGIN") - sleep(n) - info("WAIT FINISHED") - if bins ~= nil then - for b, bv in map.pairs(bins) do - rec[b] = bv - end - end - status = aerospike:update(rec) - return status - end - - function rec_create(rec, bins) - if bins ~= nil then - for b, bv in map.pairs(bins) do - rec[b] = bv - end - end - status = aerospike:create(rec) - return status - end` - - registerUDF(udf, "test_ops.lua") - - var batchRecords []as.BatchRecordIfc - for i := 0; i < 100; i++ { - key, _ := as.NewKey(ns, set+"1", i) - client.PutBins(nil, key, as.NewBin("i", 1)) - - bin := make(map[string]int, 0) - bin["bin"] = i - batchRecords = append(batchRecords, - as.NewBatchUDF(nil, key, "test_ops", "wait_and_update", as.NewValue(bin), as.NewValue(2)), - ) - } - - bp := as.NewBatchPolicy() - bp.TotalTimeout = 10000 * time.Millisecond - bp.SocketTimeout = 1000 * time.Millisecond - bp.MaxRetries = 5 - err = client.BatchOperate(bp, batchRecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for _, bri := range batchRecords { - br := bri.BatchRec() - gm.Expect(br.InDoubt).To(gm.BeFalse()) - gm.Expect(br.ResultCode).To(gm.Equal(types.UDF_BAD_RESPONSE)) - gm.Expect(br.Err.Matches(types.UDF_BAD_RESPONSE)).To(gm.Equal(true)) - gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) - } - - if nsInfo(ns, "storage-engine") == "device" { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - writeBlockSize := 1048576 - bigBin := make(map[string]string, 0) - bigBin["big_bin"] = strings.Repeat("a", writeBlockSize) - smallBin := make(map[string]string, 0) - smallBin["small_bin"] = strings.Repeat("a", 1000) - key1, _ := as.NewKey(ns, set, 0) - key2, _ := as.NewKey(ns, set, 1) - key3, _ := as.NewKey(ns+"1", set, 2) - batchRecords = []as.BatchRecordIfc{ - as.NewBatchUDF(nil, key1, "test_ops", "rec_create", as.NewValue(bigBin)), - as.NewBatchUDF(nil, key2, "test_ops", "rec_create", as.NewValue(bigBin)), - as.NewBatchUDF(nil, key3, "test_ops", "rec_create", as.NewValue(smallBin)), - } - - err = client.BatchOperate(nil, batchRecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - br := batchRecords[0].BatchRec() - gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) - gm.Expect(br.ResultCode).To(gm.Equal(types.RECORD_TOO_BIG)) - gm.Expect(br.Err.Matches(types.RECORD_TOO_BIG)).To(gm.Equal(true)) - gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) - - br = batchRecords[1].BatchRec() - gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) - gm.Expect(br.ResultCode).To(gm.Equal(types.RECORD_TOO_BIG)) - gm.Expect(br.Err.Matches(types.RECORD_TOO_BIG)).To(gm.Equal(true)) - gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) - - br = batchRecords[2].BatchRec() - gm.Expect(br.Err.IsInDoubt()).To(gm.BeFalse()) - gm.Expect(br.ResultCode).To(gm.Equal(types.INVALID_NAMESPACE)) - gm.Expect(br.Err.Matches(types.INVALID_NAMESPACE)).To(gm.Equal(true)) - gm.Expect(br.Err.IsInDoubt()).To(gm.Equal(false)) - } - }) - - gg.It("must return the result with same ordering", func() { - registerUDF(udfBody, "udf1.lua") - for _, keyCount := range []int{50, 1} { - keys := []*as.Key{} - for i := 0; i < keyCount; i++ { - bin := as.NewBin("bin1", i*6) - - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - - keys = append(keys, key) - } - - brecs, err := client.BatchExecute(bpolicy, nil, keys, "udf1", "testFunc1", as.NewValue(2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for _, rec := range brecs { - gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.ResultCode).To(gm.Equal(types.OK)) - gm.Expect(rec.InDoubt).To(gm.BeFalse()) - gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[interface{}]interface{}{"status": "OK"})) - } - - recs, err := client.BatchGet(nil, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(recs)).To(gm.Equal(len(keys))) - for i, rec := range recs { - gm.Expect(rec.Bins["bin2"].(int)).To(gm.Equal(i * 3)) - } - } - }) - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_udf.go b/aerospike-tls/vendor-aerospike-client-go/batch_udf.go deleted file mode 100644 index 6eced59e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_udf.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -var _ BatchRecordIfc = &BatchUDF{} - -// BatchUDF encapsulates a batch user defined function operation. -type BatchUDF struct { - BatchRecord - - // Policy is the optional UDF Policy. - Policy *BatchUDFPolicy - - // PackageName specify the lua module name. - PackageName string - - // FunctionName specify Lua function name. - FunctionName string - - // FunctionArgs specify optional arguments to lua function. - FunctionArgs []Value - - // Wire protocol bytes for function args. For internal use only. - argBytes []byte -} - -// NewBatchUDF creates a batch UDF operation. -func NewBatchUDF(policy *BatchUDFPolicy, key *Key, packageName, functionName string, functionArgs ...Value) *BatchUDF { - return &BatchUDF{ - BatchRecord: *newSimpleBatchRecord(key, true), - Policy: policy, - PackageName: packageName, - FunctionName: functionName, - FunctionArgs: functionArgs, - } -} - -// newBatchUDF creates a batch UDF operation. -func newBatchUDF(policy *BatchUDFPolicy, key *Key, packageName, functionName string, functionArgs ...Value) (*BatchUDF, *BatchRecord) { - res := &BatchUDF{ - BatchRecord: *newSimpleBatchRecord(key, true), - Policy: policy, - PackageName: packageName, - FunctionName: functionName, - FunctionArgs: functionArgs, - } - return res, &res.BatchRecord -} - -func (bu *BatchUDF) isWrite() bool { - return bu.hasWrite -} - -func (bu *BatchUDF) key() *Key { - return bu.Key -} - -// Return batch command type. -func (bu *BatchUDF) getType() batchRecordType { - return _BRT_BATCH_UDF -} - -// Optimized reference equality check to determine batch wire protocol repeat flag. -// For internal use only. -func (bu *BatchUDF) equals(obj BatchRecordIfc) bool { - if other, ok := obj.(*BatchUDF); !ok { - return false - } else { - return bu.FunctionName == other.FunctionName && &bu.FunctionArgs == &other.FunctionArgs && - bu.PackageName == other.PackageName && bu.Policy == other.Policy - } -} - -// Return wire protocol size. For internal use only. -func (bu *BatchUDF) size(parentPolicy *BasePolicy) (int, Error) { - size := 2 // gen(2) = 2 - - if bu.Policy != nil { - if bu.Policy.FilterExpression != nil { - sz, err := bu.Policy.FilterExpression.size() - if err != nil { - return -1, err - } - size += sz + int(_FIELD_HEADER_SIZE) - } - - if bu.Policy.SendKey || parentPolicy.SendKey { - if sz, err := bu.Key.userKey.EstimateSize(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - } - } else if parentPolicy.SendKey { - sz, err := bu.Key.userKey.EstimateSize() - if err != nil { - return -1, err - } - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - - size += len(bu.PackageName) + int(_FIELD_HEADER_SIZE) - size += len(bu.FunctionName) + int(_FIELD_HEADER_SIZE) - - packer := newPacker() - sz, err := packValueArray(packer, bu.FunctionArgs) - if err != nil { - return -1, err - } - - bu.argBytes = packer.Bytes() - - size += sz + int(_FIELD_HEADER_SIZE) - return size, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go deleted file mode 100644 index f6c7ec8e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_udf_policy.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BatchUDFPolicy attributes used in batch UDF execute commands. -type BatchUDFPolicy struct { - // Optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key - // request is not performed and BatchRecord.ResultCode is set to types.FILTERED_OUT. - // - // Default: nil - FilterExpression *Expression - - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - // - // Default: CommitLevel.COMMIT_ALL - CommitLevel CommitLevel //= COMMIT_ALL - - // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). - // Seconds record will live before being removed by the server. - // Expiration values: - // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. - // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server - // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 - // > 0: Actual expiration in seconds. - Expiration uint32 - - // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition 3.10+ only. - DurableDelete bool - - // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. - // If true and the UDF writes a record, the key will be stored with the record on the server. - // The default is to not send the user defined key. - SendKey bool // = false -} - -// NewBatchUDFPolicy returns a policy instance for Batch UDF commands. -func NewBatchUDFPolicy() *BatchUDFPolicy { - return &BatchUDFPolicy{ - CommitLevel: COMMIT_ALL, - } -} - -func (bup *BatchUDFPolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { - wp := bp.toWritePolicy() - - if bup != nil { - if bup.FilterExpression != nil { - wp.FilterExpression = bup.FilterExpression - } - wp.CommitLevel = bup.CommitLevel - wp.Expiration = bup.Expiration - wp.DurableDelete = bup.DurableDelete - wp.SendKey = bup.SendKey - } - return wp -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_write.go b/aerospike-tls/vendor-aerospike-client-go/batch_write.go deleted file mode 100644 index cac051f9..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_write.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -var _ BatchRecordIfc = &BatchWrite{} - -// BatchWrite encapsulates a batch key and read/write operations with write policy. -type BatchWrite struct { - BatchRecord - - // Policy is an optional write Policy. - Policy *BatchWritePolicy - - // Ops specify required operations for this key. - Ops []*Operation -} - -// NewBatchWrite initializesa policy, batch key and read/write operations. -// ANy GetOp() is not allowed because it returns a variable number of bins and -// makes it difficult (sometimes impossible) to lineup operations with results. Instead, -// use GetBinOp(string) for each bin name. -func NewBatchWrite(policy *BatchWritePolicy, key *Key, ops ...*Operation) *BatchWrite { - return &BatchWrite{ - BatchRecord: *newSimpleBatchRecord(key, true), - Ops: ops, - Policy: policy, - } -} - -func (bw *BatchWrite) isWrite() bool { - return bw.hasWrite -} - -func (bw *BatchWrite) key() *Key { - return bw.Key -} - -// Return batch command type. -func (bw *BatchWrite) getType() batchRecordType { - return _BRT_BATCH_WRITE -} - -// Optimized reference equality check to determine batch wire protocol repeat flag. -// For internal use only. -func (bw *BatchWrite) equals(obj BatchRecordIfc) bool { - other, ok := obj.(*BatchWrite) - if !ok { - return false - } - - return &bw.Ops == &other.Ops && bw.Policy == other.Policy && (bw.Policy == nil || !bw.Policy.SendKey) -} - -// Return wire protocol size. For internal use only. -func (bw *BatchWrite) size(parentPolicy *BasePolicy) (int, Error) { - size := 2 // gen(2) = 2 - - if bw.Policy != nil { - if bw.Policy.FilterExpression != nil { - if sz, err := bw.Policy.FilterExpression.size(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) - } - } - - if bw.Policy.SendKey || parentPolicy.SendKey { - if sz, err := bw.Key.userKey.EstimateSize(); err != nil { - return -1, err - } else { - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - } - } else if parentPolicy.SendKey { - sz, err := bw.Key.userKey.EstimateSize() - if err != nil { - return -1, err - } - size += sz + int(_FIELD_HEADER_SIZE) + 1 - } - - hasWrite := false - - for _, op := range bw.Ops { - if op.opType.isWrite { - hasWrite = true - } - sz, err := op.size() - if err != nil { - return -1, err - } - size += sz - } - - if !hasWrite { - return -1, newError(types.PARAMETER_ERROR, "Batch write operations do not contain a write") - } - return size, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go b/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go deleted file mode 100644 index 606f2d2c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/batch_write_policy.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BatchWritePolicy attributes used in batch write commands. -type BatchWritePolicy struct { - // FilterExpression is optional expression filter. If FilterExpression exists and evaluates to false, the specific batch key - // request is not performed and BatchRecord#resultCode is set to types.FILTERED_OUT. - // - // Default: nil - FilterExpression *Expression - - // RecordExistsAction qualifies how to handle writes where the record already exists. - RecordExistsAction RecordExistsAction //= RecordExistsAction.UPDATE; - - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - // - // Default: CommitLevel.COMMIT_ALL - CommitLevel CommitLevel //= COMMIT_ALL - - // GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) - // indicates that the generation is not used to restrict writes. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: GenerationPolicy.NONE - // indicates that the generation is not used to restrict writes. - GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; - - // Expected generation. Generation is the number of times a record has been modified - // (including creation) on the server. If a write operation is creating a record, - // the expected generation would be 0. This field is only relevant when - // generationPolicy is not NONE. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: 0 - Generation uint32 - - // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). - // Seconds record will live before being removed by the server. - // Expiration values: - // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. - // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server - // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 - // > 0: Actual expiration in seconds. - Expiration uint32 - - // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition 3.10+ only. - DurableDelete bool - - // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - // The default is to not send the user defined key. - SendKey bool // = false -} - -// NewBatchWritePolicy returns a policy instance for BatchWrite commands. -func NewBatchWritePolicy() *BatchWritePolicy { - return &BatchWritePolicy{ - RecordExistsAction: UPDATE, - GenerationPolicy: NONE, - CommitLevel: COMMIT_ALL, - } -} - -func (bwp *BatchWritePolicy) toWritePolicy(bp *BatchPolicy) *WritePolicy { - wp := bp.toWritePolicy() - - if bwp != nil { - if bwp.FilterExpression != nil { - wp.FilterExpression = bwp.FilterExpression - } - wp.RecordExistsAction = bwp.RecordExistsAction - wp.CommitLevel = bwp.CommitLevel - wp.GenerationPolicy = bwp.GenerationPolicy - wp.Generation = bwp.Generation - wp.Expiration = bwp.Expiration - wp.DurableDelete = bwp.DurableDelete - wp.SendKey = bwp.SendKey - } - - return wp -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go deleted file mode 100644 index 83fbe865..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_batchget_test.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math/rand" - "runtime" - "strings" - "testing" - - _ "net/http/pprof" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func makeDataForBatchGetBench(set string, bins []*as.Bin) { - for i := 0; i < 1000; i++ { - key, _ := as.NewKey(*namespace, set, i) - client.PutBins(nil, key, bins...) - } -} - -func doBatchGet(policy *as.BatchPolicy, set string, b *testing.B) { - var err error - var keys []*as.Key - for i := 0; i < 1000; i++ { - key, _ := as.NewKey(*namespace, set, i) - keys = append(keys, key) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, err = client.BatchGet(policy, keys) - if err != nil { - panic(err) - } - } -} - -func Benchmark_BatchGet_________Int64(b *testing.B) { - set := "batch_get_bench_integer" - bins := []*as.Bin{as.NewBin("b", rand.Int63())} - makeDataForBatchGetBench(set, bins) - b.N = 1000 - runtime.GC() - b.ResetTimer() - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_________Int32(b *testing.B) { - set := "batch_get_bench_integer" - bins := []*as.Bin{as.NewBin("b", rand.Int31())} - makeDataForBatchGetBench(set, bins) - b.N = 1000 - runtime.GC() - b.ResetTimer() - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String______1(b *testing.B) { - set := "batch_get_bench_str_1" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String_____10(b *testing.B) { - set := "batch_get_bench_str_10" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String____100(b *testing.B) { - set := "batch_get_bench_str_100" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 100))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String___1000(b *testing.B) { - set := "batch_get_bench_str_1000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1000))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String__10000(b *testing.B) { - set := "batch_get_bench_str_10000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_String_100000(b *testing.B) { - set := "batch_get_bench_str_10000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_Complex_Array(b *testing.B) { - set := "batch_get_bench_str_10000" - // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} - bins := []*as.Bin{as.NewBin("b", []interface{}{rand.Int63()})} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} - -func Benchmark_BatchGet_Complex_Map(b *testing.B) { - set := "batch_get_bench_str_10000" - // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} - bins := []*as.Bin{as.NewBin("b", map[interface{}]interface{}{rand.Int63(): rand.Int63()})} - b.N = 1000 - runtime.GC() - b.ResetTimer() - makeDataForBatchGetBench(set, bins) - - policy := as.NewBatchPolicy() - doBatchGet(policy, set, b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go deleted file mode 100644 index d231256c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_cdt_list_test.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "runtime" - "testing" - - // "time" - _ "net/http/pprof" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var list []as.Value - -// func doOperate(set string, ops []*as.Operation, b *testing.B) { -// var err error -// policy := NewWritePolicy(0, 0) -// buffer := make([]byte, 1*1024*1024) - -// runtime.GC() -// b.ResetTimer() -// b.SetBytes(0) - -// key, _ := NewKey(*namespace, set, 1000) - -// for i := 0; i < b.N; i++ { -// command := newOperateCommand(nil, policy, key, ops) -// command.baseCommand.dataBuffer = buffer -// err = command.writeBuffer(&command) -// if err != nil { -// b.Fatal(err) -// } -// } -// } - -func doOperate(set string, ops []*as.Operation, b *testing.B) { - var err error - - runtime.GC() - b.ResetTimer() - b.SetBytes(0) - - key, _ := as.NewKey(*namespace, set, 1000) - - for i := 0; i < b.N; i++ { - _, err = client.Operate(nil, key, ops...) - if err != nil { - b.Fatal(err) - } - } -} - -func Benchmark_CDT_List_Append_10_10x10(b *testing.B) { - set := "Benchmark_CDT_List_Append_10_10x10" - ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:10])} - - doOperate(set, ops, b) -} - -func Benchmark_CDT_List_Append_100_10x10(b *testing.B) { - set := "Benchmark_CDT_List_Append_10_10x10" - ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:100])} - - doOperate(set, ops, b) -} - -func Benchmark_CDT_List_Append_1000_10x10(b *testing.B) { - set := "Benchmark_CDT_List_Append_10_10x10" - ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list[:1000])} - - doOperate(set, ops, b) -} - -func Benchmark_CDT_List_Append_10000_10x10(b *testing.B) { - set := "Benchmark_CDT_List_Append_10000_10x10" - ops := []*as.Operation{as.ListClearOp("appendOp"), as.ListAppendOp("appendOp", list)} - - doOperate(set, ops, b) -} - -func init() { - const cnt = 10000 - values := make([]as.Value, 0, cnt) - for i := 0; i < cnt/5; i++ { - values = append(values, - as.IntegerValue(i), - as.FloatValue(1.0), - as.StringValue("String Value"), - as.ListValue([]interface{}{1, "s", 1.0, true}), - as.MapValue(map[interface{}]interface{}{1: "s", 2.0: true}), - ) - } - list = values -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go deleted file mode 100644 index 66f2ca08..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_get_test.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math/rand" - "runtime" - "strings" - "testing" - - _ "net/http/pprof" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func makeDataForGetBench(set string, bins []*as.Bin) { - key, _ := as.NewKey(*namespace, set, 0) - client.PutBins(nil, key, bins...) -} - -func doGet(set string, b *testing.B) { - var err error - key, _ := as.NewKey(*namespace, set, 0) - for i := 0; i < b.N; i++ { - _, err = client.Get(nil, key) - if err != nil { - panic(err) - } - } -} - -func Benchmark_Get_________Int64(b *testing.B) { - set := "get_bench_integer" - bins := []*as.Bin{as.NewBin("b", rand.Int63())} - makeDataForGetBench(set, bins) - runtime.GC() - b.ResetTimer() - doGet(set, b) -} - -func Benchmark_Get_________Int32(b *testing.B) { - set := "get_bench_integer" - bins := []*as.Bin{as.NewBin("b", rand.Int31())} - makeDataForGetBench(set, bins) - runtime.GC() - b.ResetTimer() - doGet(set, b) -} - -func Benchmark_Get_String______1(b *testing.B) { - set := "get_bench_str_1" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_String_____10(b *testing.B) { - set := "get_bench_str_10" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_String____100(b *testing.B) { - set := "get_bench_str_100" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 100))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_String___1000(b *testing.B) { - set := "get_bench_str_1000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 1000))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_String__10000(b *testing.B) { - set := "get_bench_str_10000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_String_100000(b *testing.B) { - set := "get_bench_str_10000" - bins := []*as.Bin{as.NewBin("b", strings.Repeat("s", 10000))} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_Complex_Array(b *testing.B) { - set := "get_bench_str_10000" - // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} - bins := []*as.Bin{as.NewBin("b", []interface{}{rand.Int63()})} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func Benchmark_Get_Complex_Map(b *testing.B) { - set := "get_bench_str_10000" - // bins := []*as.Bin{as.NewBin("b", []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}})} - bins := []*as.Bin{as.NewBin("b", map[interface{}]interface{}{rand.Int63(): rand.Int63()})} - runtime.GC() - b.ResetTimer() - makeDataForGetBench(set, bins) - doGet(set, b) -} - -func doPut(set string, value interface{}, b *testing.B) { - var err error - // key, _ := as.NewKey(*namespace, set, 0) - for i := 0; i < b.N; i++ { - bin := as.NewBin("b", value) - // err = client.PutBins(nil, key, bin) - if err != nil || bin == nil { - panic(err) - } - } -} - -func Benchmark_Put_Complex_ArrayFloat64(b *testing.B) { - set := "Benchmark_Put_Complex_ArrayInt2Int" - a := make([]float64, 1000) - for i := range a { - a[i] = float64(i) - } - - runtime.GC() - b.ResetTimer() - doPut(set, a, b) -} - -func Benchmark_Put_Complex_MapFloat642Float64(b *testing.B) { - set := "Benchmark_Put_Complex_MapFloat642Float64" - a := make(map[float64]float64, 1000) - for i := 0; i < 1000; i++ { - a[float64(i)] = float64(i) - } - runtime.GC() - b.ResetTimer() - doPut(set, a, b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go deleted file mode 100644 index 209a2eb9..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_interface_allocs_test.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "runtime" - "strings" - "testing" -) - -type T interface { - size() int -} - -// //////////////////////////////// -type S string - -func (s *S) size() int { - return len(*s) -} - -// //////////////////////////////// -type I int - -func (i I) size() int { - return 8 -} - -// /////////////////////////////////////////////// - -func estimateSize(v T) int { - return v.size() -} - -func estimateSizeStr(v S) int { - return v.size() -} - -func estimateSizeInt(v I) int { - return v.size() -} - -func estimateSizePtr(v *string) int { - return len(*v) -} - -// /////////////////////////////////////////////// - -var n int - -func Benchmark_EstimateSizeStringGeneric(b *testing.B) { - value := S(strings.Repeat("s", 16)) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - n += estimateSize(&value) - } -} - -func Benchmark_EstimateSizeStringSpecialized(b *testing.B) { - value := S(strings.Repeat("s", 16)) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - n += estimateSizeStr(value) - } -} - -func Benchmark_EstimateSizeStringPtr(b *testing.B) { - value := strings.Repeat("s", 16) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - n += estimateSizePtr(&value) - } -} - -func Benchmark_EstimateSizeIntGeneric(b *testing.B) { - value := I(16) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - n += estimateSize(value) - } -} - -func Benchmark_EstimateSizeIntSpecialized(b *testing.B) { - value := I(16) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - n += estimateSizeInt(value) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go deleted file mode 100644 index f845ed07..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_key_test.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "strings" - "testing" - - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" -) - -var str = strings.Repeat("abcd", 128) -var strVal = as.NewValue(str) -var buffer = []byte(str) -var key *as.Key - -var res []byte - -// func hash_key_baseline(str string) { -// hash := ripemd160.New() -// for i := 0; i < b.N; i++ { -// hash.Reset() -// hash.Write(buffer) -// res = hash.Sum(nil) -// } -// } - -func Benchmark_Key_Hash_BaseLine(b *testing.B) { - hash := ripemd160.New() - for i := 0; i < b.N; i++ { - hash.Reset() - hash.Write(buffer) - res = hash.Sum(nil) - } -} - -func Benchmark_Key_NewKey(b *testing.B) { - for i := 0; i < b.N; i++ { - key, _ = as.NewKey(str, str, str) - res = key.Digest() - } -} - -func Benchmark_K_ComputeDigest_Raw(b *testing.B) { - h := ripemd160.New() - setName := []byte(str) - keyType := []byte{byte(ParticleType.STRING)} - keyVal := []byte(str) - for i := 0; i < b.N; i++ { - h.Reset() - - // write will not fail; no error checking necessary - h.Write(setName) - h.Write(keyType) - h.Write(keyVal) - - res = h.Sum(nil) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go deleted file mode 100644 index c57d3c53..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_packing_test.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "encoding/binary" - "math" - "math/rand" - "runtime" - "strings" - "testing" - - // "time" - - _ "net/http/pprof" -) - -var buf *benchBuffer - -func init() { - buf = &benchBuffer{dataBuffer: make([]byte, 1024*1024), dataOffset: 0} -} - -func Benchmark_Pack_binary_Write(b *testing.B) { - buf := new(bytes.Buffer) - for i := 0; i < b.N; i++ { - buf.Reset() - binary.Write(buf, binary.BigEndian, int64(0)) - } -} - -func Benchmark_Pack_binary_PutUint64(b *testing.B) { - buf := make([]byte, 8) - for i := 0; i < b.N; i++ { - binary.BigEndian.PutUint64(buf, 0) - } -} - -func doPack(val interface{}, b *testing.B) { - var err error - v := NewValue(val) - runtime.GC() - b.ResetTimer() - for i := 0; i < b.N; i++ { - buf.dataOffset = 0 - _, err = v.pack(buf) - if err != nil { - panic(err) - } - } -} - -func Benchmark_Pack_________Int64(b *testing.B) { - val := rand.Int63() - doPack(val, b) -} - -func Benchmark_Pack_________Int32(b *testing.B) { - val := rand.Int31() - doPack(val, b) -} - -func Benchmark_Pack_String______1(b *testing.B) { - val := strings.Repeat("s", 1) - doPack(val, b) -} - -func Benchmark_Pack_String_____10(b *testing.B) { - val := strings.Repeat("s", 10) - doPack(val, b) -} - -func Benchmark_Pack_String____100(b *testing.B) { - val := strings.Repeat("s", 100) - doPack(val, b) -} - -func Benchmark_Pack_String___1000(b *testing.B) { - val := strings.Repeat("s", 1000) - doPack(val, b) -} - -func Benchmark_Pack_String__10000(b *testing.B) { - val := strings.Repeat("s", 10000) - doPack(val, b) -} - -func Benchmark_Pack_String_100000(b *testing.B) { - val := strings.Repeat("s", 100000) - doPack(val, b) -} - -func Benchmark_Pack_Complex_IfcArray_Direct(b *testing.B) { - val := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} - doPack(val, b) -} - -var _ ListIter = myList([]string{}) - -// supports old generic slices -type myList []string - -func (m myList) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range m { - n, err := packString(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -func (m myList) Len() int { - return len(m) -} - -func Benchmark_Pack_Complex_Array_ListIter(b *testing.B) { - val := myList([]string{strings.Repeat("s", 1), strings.Repeat("s", 2), strings.Repeat("s", 3), strings.Repeat("s", 4), strings.Repeat("s", 5), strings.Repeat("s", 6), strings.Repeat("s", 7), strings.Repeat("s", 8), strings.Repeat("s", 9), strings.Repeat("s", 10)}) - doPack(val, b) -} - -func Benchmark_Pack_Complex_ValueArray(b *testing.B) { - val := []Value{NewValue(1), NewValue(strings.Repeat("s", 100000)), NewValue(1.75), NewValue(nil)} - doPack(val, b) -} - -func Benchmark_Pack_Complex_Map(b *testing.B) { - val := map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - } - doPack(val, b) -} - -func Benchmark_Pack_Complex_JsonMap(b *testing.B) { - val := map[string]interface{}{ - "rand.Int63()": rand.Int63(), - "nil": 1, - "s": 491871, - "15892987": strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - } - doPack(val, b) -} - -// ////////////////////////////////////////////////////////////////////////////////////// -type benchBuffer struct { - dataBuffer []byte - dataOffset int -} - -// Int64ToBytes converts an int64 into slice of Bytes. -func (bb *benchBuffer) WriteInt64(num int64) int { - return bb.WriteUint64(uint64(num)) -} - -// Uint64ToBytes converts an uint64 into slice of Bytes. -func (bb *benchBuffer) WriteUint64(num uint64) int { - binary.BigEndian.PutUint64(bb.dataBuffer[bb.dataOffset:bb.dataOffset+8], num) - bb.dataOffset += 8 - return 8 -} - -// Int32ToBytes converts an int32 to a byte slice of size 4 -func (bb *benchBuffer) WriteInt32(num int32) int { - return bb.WriteUint32(uint32(num)) -} - -// Uint32ToBytes converts an uint32 to a byte slice of size 4 -func (bb *benchBuffer) WriteUint32(num uint32) int { - binary.BigEndian.PutUint32(bb.dataBuffer[bb.dataOffset:bb.dataOffset+4], num) - bb.dataOffset += 4 - return 4 -} - -// Int16ToBytes converts an int16 to slice of bytes -func (bb *benchBuffer) WriteInt16(num int16) int { - return bb.WriteUint16(uint16(num)) -} - -// Int16ToBytes converts an int16 to slice of bytes -func (bb *benchBuffer) WriteUint16(num uint16) int { - binary.BigEndian.PutUint16(bb.dataBuffer[bb.dataOffset:bb.dataOffset+2], num) - bb.dataOffset += 2 - return 2 -} - -func (bb *benchBuffer) WriteFloat32(float float32) int { - bits := math.Float32bits(float) - binary.BigEndian.PutUint32(bb.dataBuffer[bb.dataOffset:bb.dataOffset+4], bits) - bb.dataOffset += 4 - return 4 -} - -func (bb *benchBuffer) WriteFloat64(float float64) int { - bits := math.Float64bits(float) - binary.BigEndian.PutUint64(bb.dataBuffer[bb.dataOffset:bb.dataOffset+8], bits) - bb.dataOffset += 8 - return 8 -} - -func (bb *benchBuffer) WriteBool(b bool) int { - if b { - bb.WriteByte(1) - } else { - bb.WriteByte(0) - } - return 1 -} - -func (bb *benchBuffer) WriteByte(b byte) { - bb.dataBuffer[bb.dataOffset] = b - bb.dataOffset++ -} - -func (bb *benchBuffer) WriteString(s string) (int, Error) { - copy(bb.dataBuffer[bb.dataOffset:bb.dataOffset+len(s)], s) - bb.dataOffset += len(s) - return len(s), nil -} - -func (bb *benchBuffer) Write(b []byte) (int, Error) { - copy(bb.dataBuffer[bb.dataOffset:bb.dataOffset+len(b)], b) - bb.dataOffset += len(b) - return len(b), nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go deleted file mode 100644 index 85493b12..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_rand_gen_test.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - "testing" - "time" - - xor "github.com/aerospike/aerospike-client-go/v7/types/rand" -) - -func Benchmark_math_rand(b *testing.B) { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - for i := 0; i < b.N; i++ { - r.Int63() - } -} - -func Benchmark_xor_rand(b *testing.B) { - r := xor.NewXorRand() - for i := 0; i < b.N; i++ { - r.Int64() - } -} - -func Benchmark_math_rand_with_new(b *testing.B) { - for i := 0; i < b.N; i++ { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - r.Int63() - } -} - -func Benchmark_xor_rand_with_new(b *testing.B) { - for i := 0; i < b.N; i++ { - r := xor.NewXorRand() - r.Int64() - } -} - -func Benchmark_math_rand_synched(b *testing.B) { - for i := 0; i < b.N; i++ { - rand.Int63() - } -} - -func Benchmark_xor_rand_fast_pool(b *testing.B) { - r := xor.NewXorRand() - for i := 0; i < b.N; i++ { - r.Int64() - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go deleted file mode 100644 index d6ea9ce5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_read_command_test.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - "runtime" - "strings" - "testing" - - _ "net/http/pprof" -) - -func doReadCommandWriteBuffer(set string, value interface{}, b *testing.B) { - policy := NewPolicy() - - dataBuffer := make([]byte, 1024*1024) - - binNames := []string{} - key, _ := NewKey("test", set, 1000) - - for i := 0; i < b.N; i++ { - command, err := newReadCommand(nil, policy, key, binNames, nil) - if err != nil { - panic(err) - } - command.baseCommand.dataBuffer = dataBuffer - err = command.writeBuffer(&command) - if err != nil { - panic(err) - } - } -} - -func Benchmark_ReadCommand_________Int64(b *testing.B) { - set := "put_bench_integer" - value := rand.Int63() - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_________Int32(b *testing.B) { - set := "put_bench_integer" - value := rand.Int31() - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String______1(b *testing.B) { - set := "put_bench_str_1" - value := strings.Repeat("s", 1) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String_____10(b *testing.B) { - set := "put_bench_str_10" - value := strings.Repeat("s", 10) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String____100(b *testing.B) { - set := "put_bench_str_100" - value := strings.Repeat("s", 100) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String___1000(b *testing.B) { - set := "put_bench_str_1000" - value := strings.Repeat("s", 1000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String__10000(b *testing.B) { - set := "put_bench_str_10000" - value := strings.Repeat("s", 10000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_String_100000(b *testing.B) { - set := "put_bench_str_10000" - value := strings.Repeat("s", 100000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_Complex_Array(b *testing.B) { - set := "put_bench_str_10000" - value := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_Complex_Map(b *testing.B) { - set := "put_bench_str_10000" - value := map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - } - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} - -func Benchmark_ReadCommand_JSON_Map(b *testing.B) { - set := "put_bench_str_10000" - value := map[string]interface{}{ - strings.Repeat("a", 16): rand.Int63(), - strings.Repeat("b", 16): strings.Repeat("s", 100), - strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - strings.Repeat("d", 16): map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - }, - } - b.N = 1000 - runtime.GC() - b.ResetTimer() - doReadCommandWriteBuffer(set, value, b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go deleted file mode 100644 index 153a9b3b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_recordset_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "runtime" - "testing" - - // "time" - _ "net/http/pprof" - - as "github.com/aerospike/aerospike-client-go/v7" - // _ "github.com/influxdata/influxdb/client" -) - -func doScan(b *testing.B) { - runtime.GC() - b.ResetTimer() - b.SetBytes(0) - - policy := as.NewScanPolicy() - - n := 0 - for i := 0; i < 10; i++ { - results, err := client.ScanAll(policy, *namespace, "test") - if err != nil { - b.Errorf("Scan error: %s", err) - } - - for range results.Results() { - n++ - } - } - b.N = n -} - -func doQuery(b *testing.B) { - var err error - - runtime.GC() - b.ResetTimer() - b.SetBytes(0) - - n := 0 - //queries to aerospike - policy := as.NewQueryPolicy() - stmt := as.NewStatement(*namespace, "test") - - b.ResetTimer() - b.SetBytes(0) - results, err := client.Query(policy, stmt) - if err != nil { - b.Errorf("Query error: %s", err) - } - - for range results.Results() { - n++ - } - - b.N = n -} - -func Benchmark_Scan(b *testing.B) { - initTestVars() - go doScan(b) -} - -func Benchmark_Query(b *testing.B) { - initTestVars() - doQuery(b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go deleted file mode 100644 index cc9ab143..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_values_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "math/rand" - "strings" - "testing" -) - -var sv StringValue -var iv IntegerValue -var lv LongValue -var bav BytesValue - -var __value Value - -func Benchmark_StringValue(b *testing.B) { - b.N = 1e6 - str := strings.Repeat("a", 1000) - for i := 0; i < b.N; i++ { - __value = NewStringValue(str) - } -} - -func Benchmark_IntegerValue(b *testing.B) { - b.N = 1e6 - in := 1091 - for i := 0; i < b.N; i++ { - __value = NewIntegerValue(in) - } -} - -func Benchmark_LongValue(b *testing.B) { - b.N = 1e6 - in := int64(10916927583729485) - for i := 0; i < b.N; i++ { - __value = NewLongValue(in) - } -} - -func Benchmark_BytesValue(b *testing.B) { - b.N = 1e6 - barr := bytes.Repeat([]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, 1000) - for i := 0; i < b.N; i++ { - __value = NewBytesValue(barr) - } -} - -func Benchmark_ListValue(b *testing.B) { - b.N = 1e6 - value := []interface{}{ - rand.Int63(), - strings.Repeat("s", 100), - []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - }, - } - for i := 0; i < b.N; i++ { - __value = NewListValue(value) - } -} - -func Benchmark_JsonMapValue(b *testing.B) { - b.N = 1e6 - value := map[string]interface{}{ - strings.Repeat("a", 16): rand.Int63(), - strings.Repeat("b", 16): strings.Repeat("s", 100), - strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - strings.Repeat("d", 16): map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - }, - } - for i := 0; i < b.N; i++ { - __value = NewValue(value) - } -} - -func Benchmark_IfcMapValue(b *testing.B) { - b.N = 1e6 - value := map[interface{}]interface{}{ - strings.Repeat("a", 16): rand.Int63(), - strings.Repeat("b", 16): strings.Repeat("s", 100), - strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - strings.Repeat("d", 16): map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - }, - } - for i := 0; i < b.N; i++ { - __value = NewValue(value) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go b/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go deleted file mode 100644 index 9f95f995..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bench_write_command_test.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - "runtime" - "strings" - "testing" - - _ "net/http/pprof" -) - -func doPut(set string, value interface{}, b *testing.B) { - policy := NewWritePolicy(0, 0) - - dataBuffer := make([]byte, 1024*1024) - - bins := []*Bin{NewBin("b", value)} - key, _ := NewKey("test", set, 1000) - - for i := 0; i < b.N; i++ { - command, err := newWriteCommand(nil, policy, key, bins, nil, _WRITE) - if err != nil { - panic(err) - } - command.baseCommand.dataBuffer = dataBuffer - err = command.writeBuffer(&command) - if err != nil { - panic(err) - } - } -} - -func Benchmark_WriteCommand_________Int64(b *testing.B) { - set := "put_bench_integer" - value := rand.Int63() - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_________Int32(b *testing.B) { - set := "put_bench_integer" - value := rand.Int31() - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String______1(b *testing.B) { - set := "put_bench_str_1" - value := strings.Repeat("s", 1) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String_____10(b *testing.B) { - set := "put_bench_str_10" - value := strings.Repeat("s", 10) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String____100(b *testing.B) { - set := "put_bench_str_100" - value := strings.Repeat("s", 100) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String___1000(b *testing.B) { - set := "put_bench_str_1000" - value := strings.Repeat("s", 1000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String__10000(b *testing.B) { - set := "put_bench_str_10000" - value := strings.Repeat("s", 10000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_String_100000(b *testing.B) { - set := "put_bench_str_10000" - value := strings.Repeat("s", 100000) - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_Complex_Array(b *testing.B) { - set := "put_bench_str_10000" - value := []interface{}{1, 1, 1, "a simple string", nil, rand.Int63(), []byte{12, 198, 211}} - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_Complex_Map(b *testing.B) { - set := "put_bench_str_10000" - value := map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - } - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} - -func Benchmark_WriteCommand_JSON_Map(b *testing.B) { - set := "put_bench_str_10000" - value := map[string]interface{}{ - strings.Repeat("a", 16): rand.Int63(), - strings.Repeat("b", 16): strings.Repeat("s", 100), - strings.Repeat("c", 16): []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - strings.Repeat("d", 16): map[interface{}]interface{}{ - rand.Int63(): rand.Int63(), - nil: 1, - "s": 491871, - 15892987: strings.Repeat("s", 100), - "s2": []interface{}{"a simple string", nil, rand.Int63(), []byte{12, 198, 211}}, - }, - } - b.N = 1000 - runtime.GC() - b.ResetTimer() - doPut(set, value, b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bin.go b/aerospike-tls/vendor-aerospike-client-go/bin.go deleted file mode 100644 index 92a3abc5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bin.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BinMap is used to define a map of bin names to values. -type BinMap map[string]interface{} - -// Bin encapsulates a field name/value pair. -type Bin struct { - // Bin name. Current limit is 14 characters. - Name string - - // Bin value. - Value Value -} - -// NewBin generates a new Bin instance, specifying bin name and string value. -// For servers configured as "single-bin", enter an empty name. -func NewBin(name string, value interface{}) *Bin { - return &Bin{ - Name: name, - Value: NewValue(value), - } -} - -// String implements Stringer interface. -func (bn *Bin) String() string { - return bn.Name + ":" + bn.Value.String() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go b/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go deleted file mode 100644 index 7e1998ae..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bit_overflow_action.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BitOverflowAction specifies the action to take when bitwise add/subtract results in overflow/underflow. -type BitOverflowAction int - -const ( - // BitOverflowActionFail specifies to fail operation with error. - BitOverflowActionFail BitOverflowAction = 0 - - // BitOverflowActionSaturate specifies that in add/subtract overflows/underflows, set to max/min value. - // Example: MAXINT + 1 = MAXINT - BitOverflowActionSaturate BitOverflowAction = 2 - - // BitOverflowActionWrap specifies that in add/subtract overflows/underflows, wrap the value. - // Example: MAXINT + 1 = -1 - BitOverflowActionWrap BitOverflowAction = 4 -) diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_policy.go b/aerospike-tls/vendor-aerospike-client-go/bit_policy.go deleted file mode 100644 index 63bd9199..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bit_policy.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BitPolicy determines the Bit operation policy. -type BitPolicy struct { - flags int -} - -// DefaultBitPolicy will return the default BitPolicy -func DefaultBitPolicy() *BitPolicy { - return &BitPolicy{BitWriteFlagsDefault} -} - -// NewBitPolicy will return a BitPolicy will provided flags. -func NewBitPolicy(flags int) *BitPolicy { - return &BitPolicy{flags} -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go b/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go deleted file mode 100644 index d9f3f3ce..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bit_resize_flags.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BitResizeFlags specifies the bitwise operation flags for resize. -type BitResizeFlags int - -const ( - // BitResizeFlagsDefault specifies the defalt flag. - BitResizeFlagsDefault BitResizeFlags = 0 - - // BitResizeFlagsFromFront Adds/removes bytes from the beginning instead of the end. - BitResizeFlagsFromFront BitResizeFlags = 1 - - // BitResizeFlagsGrowOnly will only allow the []byte size to increase. - BitResizeFlagsGrowOnly BitResizeFlags = 2 - - // BitResizeFlagsShrinkOnly will only allow the []byte size to decrease. - BitResizeFlagsShrinkOnly BitResizeFlags = 4 -) diff --git a/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go b/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go deleted file mode 100644 index 7ad2e165..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bit_write_flags.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// BitWriteFlags specify bitwise operation policy write flags. - -const ( - // BitWriteFlagsDefault allows create or update. - BitWriteFlagsDefault = 0 - - // BitWriteFlagsCreateOnly specifies that: - // If the bin already exists, the operation will be denied. - // If the bin does not exist, a new bin will be created. - BitWriteFlagsCreateOnly = 1 - - // BitWriteFlagsUpdateOnly specifies that: - // If the bin already exists, the bin will be overwritten. - // If the bin does not exist, the operation will be denied. - BitWriteFlagsUpdateOnly = 2 - - // BitWriteFlagsNoFail specifies not to raise error if operation is denied. - BitWriteFlagsNoFail = 4 - - // BitWriteFlagsPartial allows other valid operations to be committed if this operations is - // denied due to flag constraints. - BitWriteFlagsPartial = 8 -) diff --git a/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go b/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go deleted file mode 100644 index ff4dfd85..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/buffered_connection.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inbc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type bufferedConn struct { - conn *Connection - remaining int - head, tail int -} - -func newBufferedConn(conn *Connection, total int) bufferedConn { - return bufferedConn{ - conn: conn, - remaining: total, - } -} - -// emptyCap returns the empty capacity in the buffer. -func (bc *bufferedConn) emptyCap() int { - return len(bc.buf()) - bc.len() -} - -// len returns the number of unread bytes in the buffer. -func (bc *bufferedConn) len() int { - return bc.tail - bc.head -} - -// buf returns the connection's byte buffer. -func (bc *bufferedConn) buf() []byte { - return bc.conn.dataBuffer -} - -// shiftContentToHead will move the unread bytes to the head of the buffer. -// It will also resize the buffer if there is not enough empty capacity to read -// the minimum number of bytes that are requested. -// If the buffer is empty, head and tail will be reset to the beginning of the buffer. -func (bc *bufferedConn) shiftContentToHead(length int) { - // shift data to the head of the byte slice - if length > bc.emptyCap() { - buf := buffPool.Get(bc.len() + length) - copy(buf, bc.buf()[bc.head:bc.tail]) - bc.conn.dataBuffer = buf - - bc.tail -= bc.head - bc.head = 0 - } else if bc.len() > 0 { - copy(bc.buf(), bc.buf()[bc.head:bc.tail]) - - bc.tail -= bc.head - bc.head = 0 - } else { - bc.tail = 0 - bc.head = 0 - } -} - -// readConn will read the minimum minLength number of bytes from the connection. -// It will read more if it has extra empty capacity in the buffer. -func (bc *bufferedConn) readConn(minLength int) Error { - // Corrupted data streams can result in a huge minLength. - // Do a sanity check here. - if minLength > MaxBufferSize || minLength <= 0 || minLength > bc.remaining { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid readBytes length: %d", minLength)) - } - - bc.shiftContentToHead(minLength) - - toRead := bc.remaining - if ec := bc.emptyCap(); toRead > ec { - toRead = ec - } - - n, err := bc.conn.Read(bc.buf()[bc.tail:], toRead) - bc.tail += n - bc.remaining -= n - - if err != nil { - logger.Logger.Debug("Requested to read %d bytes, but %d was read. (%v)", minLength, n, err) - return err - } - - return nil -} - -func (bc *bufferedConn) read(length int) ([]byte, Error) { - if cl := bc.len(); length > cl { - if err := bc.readConn(length - cl); err != nil { - return nil, err - } - } - - buf := bc.buf()[bc.head : bc.head+length] - bc.head += length - - return buf, nil -} - -func (bc *bufferedConn) drainConn() Error { - if bc.conn.grpcReader != nil { - return nil - } - - if !bc.conn.IsConnected() { - return nil - } - - toRead := 0 - for bc.remaining > 0 { - toRead = bc.remaining - if toRead > len(bc.buf()) { - toRead = len(bc.buf()) - } - - n, err := bc.conn.Read(bc.conn.dataBuffer, toRead) - bc.remaining -= n - if err != nil { - return err - } - } - - return nil -} - -func (bc *bufferedConn) reset(total int) Error { - bc.remaining = total - bc.head = 0 - bc.tail = 0 - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go b/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go deleted file mode 100644 index 2ff42d47..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/bytes_buffer.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "encoding/binary" - "math" -) - -// BufferEx is a specialized buffer interface for aerospike client. -type BufferEx interface { - WriteInt64(num int64) int - WriteUint64(num uint64) int - WriteInt32(num int32) int - WriteUint32(num uint32) int - WriteInt16(num int16) int - WriteUint16(num uint16) int - WriteFloat32(float float32) int - WriteFloat64(float float64) int - WriteBool(b bool) int - WriteByte(b byte) - WriteString(s string) (int, Error) - Write(b []byte) (int, Error) -} - -var _ BufferEx = &bufferEx{} - -type bufferEx struct { - dataBuffer []byte - dataOffset int -} - -func newBuffer(sz int) *bufferEx { - return &bufferEx{ - dataBuffer: make([]byte, sz), - } -} - -// Bytes returns the content of the buffer -func (buf *bufferEx) Bytes() []byte { - return buf.dataBuffer[:buf.dataOffset] -} - -// Int64ToBytes converts an int64 into slice of Bytes. -func (buf *bufferEx) WriteInt64(num int64) int { - return buf.WriteUint64(uint64(num)) -} - -// Uint64ToBytes converts an uint64 into slice of Bytes. -func (buf *bufferEx) WriteUint64(num uint64) int { - binary.BigEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], num) - buf.dataOffset += 8 - return 8 -} - -// Int32ToBytes converts an int32 to a byte slice of size 4 -func (buf *bufferEx) WriteInt32(num int32) int { - return buf.WriteUint32(uint32(num)) -} - -// Uint32ToBytes converts an uint32 to a byte slice of size 4 -func (buf *bufferEx) WriteUint32(num uint32) int { - binary.BigEndian.PutUint32(buf.dataBuffer[buf.dataOffset:buf.dataOffset+4], num) - buf.dataOffset += 4 - return 4 -} - -// Uint32ToBytes converts an uint32 to a byte slice of size 4 -func (buf *bufferEx) WriteUint32At(num uint32, index int) int { - binary.BigEndian.PutUint32(buf.dataBuffer[index:index+4], num) - return 4 -} - -// Int16ToBytes converts an int16 to slice of bytes -func (buf *bufferEx) WriteInt16(num int16) int { - return buf.WriteUint16(uint16(num)) -} - -func (buf *bufferEx) WriteInt16LittleEndian(num uint16) int { - binary.LittleEndian.PutUint16(buf.dataBuffer[buf.dataOffset:buf.dataOffset+2], num) - buf.dataOffset += 2 - return 2 -} - -func (buf *bufferEx) WriteInt64LittleEndian(num uint64) int { - binary.LittleEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], num) - buf.dataOffset += 8 - return 8 -} - -// Int16ToBytes converts an int16 to slice of bytes -func (buf *bufferEx) WriteUint16(num uint16) int { - binary.BigEndian.PutUint16(buf.dataBuffer[buf.dataOffset:buf.dataOffset+2], num) - buf.dataOffset += 2 - return 2 -} - -func (buf *bufferEx) WriteFloat32(float float32) int { - bits := math.Float32bits(float) - binary.BigEndian.PutUint32(buf.dataBuffer[buf.dataOffset:buf.dataOffset+4], bits) - buf.dataOffset += 4 - return 4 -} - -func (buf *bufferEx) WriteFloat64(float float64) int { - bits := math.Float64bits(float) - binary.BigEndian.PutUint64(buf.dataBuffer[buf.dataOffset:buf.dataOffset+8], bits) - buf.dataOffset += 8 - return 8 -} - -func (buf *bufferEx) WriteByte(b byte) { - buf.dataBuffer[buf.dataOffset] = b - buf.dataOffset++ -} - -func (buf *bufferEx) WriteString(s string) (int, Error) { - copy(buf.dataBuffer[buf.dataOffset:buf.dataOffset+len(s)], s) - buf.dataOffset += len(s) - return len(s), nil -} - -func (buf *bufferEx) WriteBool(b bool) int { - if b { - buf.WriteByte(1) - } else { - buf.WriteByte(0) - } - return 1 -} - -func (buf *bufferEx) Write(b []byte) (int, Error) { - copy(buf.dataBuffer[buf.dataOffset:buf.dataOffset+len(b)], b) - buf.dataOffset += len(b) - return len(b), nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt.go b/aerospike-tls/vendor-aerospike-client-go/cdt.go deleted file mode 100644 index 48021e51..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -func newCDTCreateOperationEncoder(op *Operation, packer BufferEx) (int, Error) { - if op.binValue != nil { - if params := op.binValue.(ListValue); len(params) > 0 { - return packCDTIfcParamsAsArray(packer, int16(*op.opSubType), op.ctx, op.binValue.(ListValue)) - } - } - return packCDTParamsAsArray(packer, int16(*op.opSubType), op.ctx) -} - -func newCDTCreateOperationValues2(command int, attributes mapOrderType, binName string, ctx []*CDTContext, value1 interface{}, value2 interface{}) *Operation { - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{value1, value2, IntegerValue(attributes.attr)}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateOperationValues0(command int, typ OperationType, binName string, ctx []*CDTContext) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - // binValue: NewNullValue(), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateOperationValuesN(command int, typ OperationType, binName string, ctx []*CDTContext, values []interface{}, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), ListValue(values)}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateOperationValue1(command int, typ OperationType, binName string, ctx []*CDTContext, value interface{}, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), value}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateOperationIndex(command int, typ OperationType, binName string, ctx []*CDTContext, index int, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), index}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateOperationIndexCount(command int, typ OperationType, binName string, ctx []*CDTContext, index int, count int, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), index, count}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTMapCreateOperationRelativeIndex(command int, typ OperationType, binName string, ctx []*CDTContext, key Value, index int, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), key, index}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTMapCreateOperationRelativeIndexCount(command int, typ OperationType, binName string, ctx []*CDTContext, key Value, index int, count int, returnType mapReturnType) *Operation { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), key, index, count}), - encoder: newCDTCreateOperationEncoder, - } -} - -func newCDTCreateRangeOperation(command int, typ OperationType, binName string, ctx []*CDTContext, begin interface{}, end interface{}, returnType mapReturnType) *Operation { - if end == nil { - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), begin}), - encoder: newCDTCreateOperationEncoder, - } - } - - return &Operation{ - opType: typ, - opSubType: &command, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{IntegerValue(returnType), begin, end}), - encoder: newCDTCreateOperationEncoder, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go deleted file mode 100644 index 17202bae..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise.go +++ /dev/null @@ -1,516 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -// Bit operations. Create bit operations used by client operate command. -// Offset orientation is left-to-right. Negative offsets are supported. -// If the offset is negative, the offset starts backwards from end of the bitmap. -// If an offset is out of bounds, a parameter error will be returned. -// -// Nested CDT operations are supported by optional CTX context arguments. Example: -// bin = [[0b00000001, 0b01000010],[0b01011010]] -// Resize first bitmap (in a list of bitmaps) to 3 bytes. -// BitOperation.resize("bin", 3, BitResizeFlags.DEFAULT, CTX.listIndex(0)) -// bin result = [[0b00000001, 0b01000010, 0b00000000],[0b01011010]] -const ( - _CDT_BITWISE_RESIZE = 0 - _CDT_BITWISE_INSERT = 1 - _CDT_BITWISE_REMOVE = 2 - _CDT_BITWISE_SET = 3 - _CDT_BITWISE_OR = 4 - _CDT_BITWISE_XOR = 5 - _CDT_BITWISE_AND = 6 - _CDT_BITWISE_NOT = 7 - _CDT_BITWISE_LSHIFT = 8 - _CDT_BITWISE_RSHIFT = 9 - _CDT_BITWISE_ADD = 10 - _CDT_BITWISE_SUBTRACT = 11 - _CDT_BITWISE_SET_INT = 12 - _CDT_BITWISE_GET = 50 - _CDT_BITWISE_COUNT = 51 - _CDT_BITWISE_LSCAN = 52 - _CDT_BITWISE_RSCAN = 53 - _CDT_BITWISE_GET_INT = 54 - - _CDT_BITWISE_INT_FLAGS_SIGNED = 1 -) - -// BitResizeOp creates byte "resize" operation. -// Server resizes []byte to byteSize according to resizeFlags (See BitResizeFlags). -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010] -// byteSize = 4 -// resizeFlags = 0 -// bin result = [0b00000001, 0b01000010, 0b00000000, 0b00000000] -func BitResizeOp(policy *BitPolicy, binName string, byteSize int, resizeFlags BitResizeFlags, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_RESIZE, IntegerValue(byteSize), IntegerValue(policy.flags), IntegerValue(resizeFlags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitInsertOp creates byte "insert" operation. -// Server inserts value bytes into []byte bin at byteOffset. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// byteOffset = 1 -// value = [0b11111111, 0b11000111] -// bin result = [0b00000001, 0b11111111, 0b11000111, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -func BitInsertOp(policy *BitPolicy, binName string, byteOffset int, value []byte, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_INSERT, IntegerValue(byteOffset), BytesValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitRemoveOp creates byte "remove" operation. -// Server removes bytes from []byte bin at byteOffset for byteSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// byteOffset = 2 -// byteSize = 3 -// bin result = [0b00000001, 0b01000010] -func BitRemoveOp(policy *BitPolicy, binName string, byteOffset int, byteSize int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_REMOVE, IntegerValue(byteOffset), IntegerValue(byteSize), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitSetOp creates bit "set" operation. -// Server sets value on []byte bin at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 13 -// bitSize = 3 -// value = [0b11100000] -// bin result = [0b00000001, 0b01000111, 0b00000011, 0b00000100, 0b00000101] -func BitSetOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_SET, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitOrOp creates bit "or" operation. -// Server performs bitwise "or" on value and []byte bin at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 17 -// bitSize = 6 -// value = [0b10101000] -// bin result = [0b00000001, 0b01000010, 0b01010111, 0b00000100, 0b00000101] -func BitOrOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_OR, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitXorOp creates bit "exclusive or" operation. -// Server performs bitwise "xor" on value and []byte bin at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 17 -// bitSize = 6 -// value = [0b10101100] -// bin result = [0b00000001, 0b01000010, 0b01010101, 0b00000100, 0b00000101] -func BitXorOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_XOR, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitAndOp creates bit "and" operation. -// Server performs bitwise "and" on value and []byte bin at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 23 -// bitSize = 9 -// value = [0b00111100, 0b10000000] -// bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101] -func BitAndOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value []byte, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_AND, IntegerValue(bitOffset), IntegerValue(bitSize), BytesValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitNotOp creates bit "not" operation. -// Server negates []byte bin starting at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 25 -// bitSize = 6 -// bin result = [0b00000001, 0b01000010, 0b00000011, 0b01111010, 0b00000101] -func BitNotOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_NOT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitLShiftOp creates bit "left shift" operation. -// Server shifts left []byte bin starting at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 32 -// bitSize = 8 -// shift = 3 -// bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00101000] -func BitLShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_LSHIFT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(shift), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitRShiftOp creates bit "right shift" operation. -// Server shifts right []byte bin starting at bitOffset for bitSize. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 0 -// bitSize = 9 -// shift = 1 -// bin result = [0b00000000, 0b11000010, 0b00000011, 0b00000100, 0b00000101] -func BitRShiftOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, shift int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_RSHIFT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(shift), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitAddOp creates bit "add" operation. -// Server adds value to []byte bin starting at bitOffset for bitSize. BitSize must be <= 64. -// Signed indicates if bits should be treated as a signed number. -// If add overflows/underflows, BitOverflowAction is used. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 24 -// bitSize = 16 -// value = 128 -// signed = false -// bin result = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b10000101] -func BitAddOp( - policy *BitPolicy, - binName string, - bitOffset int, - bitSize int, - value int64, - signed bool, - action BitOverflowAction, - ctx ...*CDTContext, -) *Operation { - // return createMathOperation(ADD, policy, binName, ctx, bitOffset, bitSize, value, signed, action) - - actionFlags := action - if signed { - actionFlags |= _CDT_BITWISE_INT_FLAGS_SIGNED - } - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_ADD, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags), IntegerValue(actionFlags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitSubtractOp creates bit "subtract" operation. -// Server subtracts value from []byte bin starting at bitOffset for bitSize. BitSize must be <= 64. -// Signed indicates if bits should be treated as a signed number. -// If add overflows/underflows, BitOverflowAction is used. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 24 -// bitSize = 16 -// value = 128 -// signed = false -// bin result = [0b00000001, 0b01000010, 0b00000011, 0b0000011, 0b10000101] -func BitSubtractOp( - policy *BitPolicy, - binName string, - bitOffset int, - bitSize int, - value int64, - signed bool, - action BitOverflowAction, - ctx ...*CDTContext, -) *Operation { - // return createMathOperation(SUBTRACT, policy, binName, ctx, bitOffset, bitSize, value, signed, action) - - actionFlags := action - if signed { - actionFlags |= _CDT_BITWISE_INT_FLAGS_SIGNED - } - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_SUBTRACT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags), IntegerValue(actionFlags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitSetIntOp creates bit "setInt" operation. -// Server sets value to []byte bin starting at bitOffset for bitSize. Size must be <= 64. -// Server does not return a value. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 1 -// bitSize = 8 -// value = 127 -// bin result = [0b00111111, 0b11000010, 0b00000011, 0b0000100, 0b00000101] -func BitSetIntOp(policy *BitPolicy, binName string, bitOffset int, bitSize int, value int64, ctx ...*CDTContext) *Operation { - // Packer packer = new Packer(); - // init(packer, ctx, SET_INT, 4) - // packer.packInt(bitOffset) - // packer.packInt(bitSize) - // packer.packLong(value) - // packer.packInt(policy.flags) - // return newOperation(_BIT_MODIFY, binName, Value.get(packer.toByteArray())) - return &Operation{ - opType: _BIT_MODIFY, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_SET_INT, IntegerValue(bitOffset), IntegerValue(bitSize), IntegerValue(value), IntegerValue(policy.flags)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitGetOp creates bit "get" operation. -// Server returns bits from []byte bin starting at bitOffset for bitSize. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 9 -// bitSize = 5 -// returns [0b1000000] -func BitGetOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_READ, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_GET, IntegerValue(bitOffset), IntegerValue(bitSize)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitCountOp creates bit "count" operation. -// Server returns integer count of set bits from []byte bin starting at bitOffset for bitSize. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 20 -// bitSize = 4 -// returns 2 -func BitCountOp(binName string, bitOffset int, bitSize int, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_READ, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_COUNT, IntegerValue(bitOffset), IntegerValue(bitSize)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitLScanOp creates bit "left scan" operation. -// Server returns integer bit offset of the first specified value bit in []byte bin -// starting at bitOffset for bitSize. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 24 -// bitSize = 8 -// value = true -// returns 5 -func BitLScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_READ, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_LSCAN, IntegerValue(bitOffset), IntegerValue(bitSize), BoolValue(value)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitRScanOp creates bit "right scan" operation. -// Server returns integer bit offset of the last specified value bit in []byte bin -// starting at bitOffset for bitSize. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 32 -// bitSize = 8 -// value = true -// returns 7 -func BitRScanOp(binName string, bitOffset int, bitSize int, value bool, ctx ...*CDTContext) *Operation { - return &Operation{ - opType: _BIT_READ, - ctx: ctx, - binName: binName, - binValue: ListValue{_CDT_BITWISE_RSCAN, IntegerValue(bitOffset), IntegerValue(bitSize), BoolValue(value)}, - encoder: newCDTBitwiseEncoder, - } -} - -// BitGetIntOp creates bit "get integer" operation. -// Server returns integer from []byte bin starting at bitOffset for bitSize. -// Signed indicates if bits should be treated as a signed number. -// Example: -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 8 -// bitSize = 16 -// signed = false -// returns 16899 -func BitGetIntOp(binName string, bitOffset int, bitSize int, signed bool, ctx ...*CDTContext) *Operation { - binValue := ListValue{_CDT_BITWISE_GET_INT, IntegerValue(bitOffset), IntegerValue(bitSize)} - if signed { - binValue = append(binValue, IntegerValue(_CDT_BITWISE_INT_FLAGS_SIGNED)) - } - return &Operation{ - opType: _BIT_READ, - ctx: ctx, - binName: binName, - binValue: binValue, - encoder: newCDTBitwiseEncoder, - } -} - -func newCDTBitwiseEncoder(op *Operation, packer BufferEx) (int, Error) { - params := op.binValue.(ListValue) - opType := params[0].(int) - if len(op.binValue.(ListValue)) > 1 { - return packCDTBitIfcParamsAsArray(packer, int16(opType), op.ctx, params[1:]) - } - return packCDTBitIfcParamsAsArray(packer, int16(opType), op.ctx, nil) -} - -func packCDTBitIfcParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ListValue) (int, Error) { - return packCDTBitIfcVarParamsAsArray(packer, opType, ctx, []interface{}(params)...) -} - -func packCDTBitIfcVarParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...interface{}) (int, Error) { - size := 0 - n := 0 - var err Error - if len(ctx) > 0 { - if n, err = packArrayBegin(packer, 3); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt64(packer, 0xff); err != nil { - return size + n, err - } - size += n - - if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { - return size + n, err - } - size += n - - for _, c := range ctx { - if n, err = packAInt64(packer, int64(c.Id)); err != nil { - return size + n, err - } - size += n - - if n, err = c.Value.pack(packer); err != nil { - return size + n, err - } - size += n - } - } - - if n, err = packArrayBegin(packer, len(params)+1); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt(packer, int(opType)); err != nil { - return size + n, err - } - size += n - - if len(params) > 0 { - for i := range params { - if n, err = packObject(packer, params[i], false); err != nil { - return size + n, err - } - size += n - } - } - - return size, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go deleted file mode 100644 index 9c4ac6c0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_bitwise_test.go +++ /dev/null @@ -1,966 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -var _ = gg.Describe("CDT Bitwise Test", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var cdtBinName string - - var assertEquals = func(e string, v1, v2 interface{}) { - gm.Expect(v1).To(gm.Equal(v2), e) - } - - var assertBitModifyRegion = func(bin_sz, offset, set_sz int, expected []byte, isInsert bool, ops ...*as.Operation) { - client.Delete(nil, key) - - initial := make([]byte, bin_sz) - - for i := 0; i < bin_sz; i++ { - initial[i] = 0xFF - } - - err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - int_sz := 64 - - if set_sz < int_sz { - int_sz = set_sz - } - - bin_bit_sz := bin_sz * 8 - - if isInsert { - bin_bit_sz += set_sz - } - - full_ops := make([]*as.Operation, len(ops)+7) - copy(full_ops, ops) - full_ops[len(full_ops)-7] = as.BitLScanOp(cdtBinName, offset, set_sz, true) - full_ops[len(full_ops)-6] = as.BitRScanOp(cdtBinName, offset, set_sz, true) - full_ops[len(full_ops)-5] = as.BitGetIntOp(cdtBinName, offset, int_sz, false) - full_ops[len(full_ops)-4] = as.BitCountOp(cdtBinName, offset, set_sz) - full_ops[len(full_ops)-3] = as.BitLScanOp(cdtBinName, 0, bin_bit_sz, false) - full_ops[len(full_ops)-2] = as.BitRScanOp(cdtBinName, 0, bin_bit_sz, false) - full_ops[len(full_ops)-1] = as.BitGetOp(cdtBinName, offset, set_sz) - - record, err := client.Operate(nil, key, full_ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - result_list := record.Bins[cdtBinName].([]interface{}) - lscan1_result := result_list[len(result_list)-7].(int) - rscan1_result := result_list[len(result_list)-6].(int) - getint_result := result_list[len(result_list)-5].(int) - count_result := result_list[len(result_list)-4].(int) - lscan_result := result_list[len(result_list)-3].(int) - rscan_result := result_list[len(result_list)-2].(int) - actual := (result_list[len(result_list)-1]).([]byte) - err_output := fmt.Sprintf("bin_sz %d offset %d set_sz %d", bin_sz, offset, set_sz) - - assertEquals("lscan1 - "+err_output, -1, lscan1_result) - assertEquals("rscan1 - "+err_output, -1, rscan1_result) - assertEquals("getint - "+err_output, 0, getint_result) - assertEquals("count - "+err_output, 0, count_result) - assertEquals("lscan - "+err_output, offset, lscan_result) - assertEquals("rscan - "+err_output, offset+set_sz-1, rscan_result) - assertEquals("op - "+err_output, expected, actual) - } - - var assertBitModifyRegionNotInsert = func(bin_sz, offset, set_sz int, expected []byte, ops ...*as.Operation) { - assertBitModifyRegion(bin_sz, offset, set_sz, expected, false, ops...) - } - - var assertBitModifyInsert = func(bin_sz, offset, set_sz int, expected []byte, ops ...*as.Operation) { - assertBitModifyRegion(bin_sz, offset, set_sz, expected, true, ops...) - } - - var assertBitReadOperation = func(initial []byte, expected []int64, ops ...*as.Operation) { - client.Delete(nil, key) - err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Operate(wpolicy, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[cdtBinName]).To(gm.BeAssignableToTypeOf([]interface{}{})) - binResults := rec.Bins[cdtBinName].([]interface{}) - results := make([]int64, len(binResults)) - for i := range binResults { - results[i] = int64(binResults[i].(int)) - } - - gm.Expect(results).To(gm.Equal(expected)) - } - - var assertBitModifyOperations = func(initial, expected []byte, ops ...*as.Operation) { - client.Delete(nil, key) - - if initial != nil { - err := client.PutBins(wpolicy, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - _, err := client.Operate(nil, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(expected)) - } - - var assertThrows = func(code ast.ResultCode, ops ...*as.Operation) { - _, err := client.Operate(nil, key, ops...) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err).To(gm.BeAssignableToTypeOf(&as.AerospikeError{})) - gm.Expect(err.Matches(code)).To(gm.BeTrue()) - } - - gg.BeforeEach(func() { - if !featureEnabled("blob-bits") { - gg.Skip("CDT Bitwise Tests will not run since feature is not supported by the server.") - return - } - - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtBinName = randString(10) - }) - - gg.Describe("CDT BitWise Operations", func() { - - // const listSize = 10 - - // // make a fresh list before each operation - // gg.BeforeEach(func() { - // list = []interface{}{} - - // for i := 1; i <= listSize; i++ { - // list = append(list, i) - - // sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) - // gm.Expect(err).ToNot(gm.HaveOccurred()) - // gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - // } - // }) - - gg.It("should Set a Bin", func() { - - bit0 := []byte{0x80} - putMode := as.DefaultBitPolicy() - updateMode := as.NewBitPolicy(as.BitWriteFlagsUpdateOnly) - - assertBitModifyOperations( - []byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}, - []byte{0x51, 0x02, 0x03, 0x04, 0x05, 0x06}, - as.BitSetOp(putMode, cdtBinName, 1, 1, bit0), - as.BitSetOp(updateMode, cdtBinName, 3, 1, bit0), - as.BitRemoveOp(updateMode, cdtBinName, 6, 2), - ) - - addMode := as.NewBitPolicy(as.BitWriteFlagsCreateOnly) - bytes1 := []byte{0x0A} - - assertBitModifyOperations( - nil, []byte{0x00, 0x0A}, - as.BitInsertOp(addMode, cdtBinName, 1, bytes1), - ) - - assertThrows(17, - as.BitSetOp(putMode, "b", 1, 1, bit0)) - - assertThrows(4, - as.BitSetOp(addMode, cdtBinName, 1, 1, bit0)) - }) - - gg.It("should Set a Bin's bits", func() { - - putMode := as.DefaultBitPolicy() - bit0 := []byte{0x80} - bits1 := []byte{0x11, 0x22, 0x33} - - assertBitModifyOperations( - []byte{0x01, 0x12, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F, 0x10, 0x11, 0x41}, - []byte{0x41, - 0x13, - 0x11, 0x22, 0x33, - 0x11, 0x22, 0x33, - 0x08, - 0x08, 0x91, 0x1B, - 0x01, 0x12, 0x23, - 0x11, 0x22, 0x11, - 0xc1}, - as.BitSetOp(putMode, cdtBinName, 1, 1, bit0), - as.BitSetOp(putMode, cdtBinName, 15, 1, bit0), - // SUM Offest Size - as.BitSetOp(putMode, cdtBinName, 16, 24, bits1), // Y Y Y - as.BitSetOp(putMode, cdtBinName, 40, 22, bits1), // N Y N - as.BitSetOp(putMode, cdtBinName, 73, 21, bits1), // N N N - as.BitSetOp(putMode, cdtBinName, 100, 20, bits1), // Y N N - as.BitSetOp(putMode, cdtBinName, 120, 17, bits1), // N Y N - - as.BitSetOp(putMode, cdtBinName, 144, 1, bit0), - ) - }) - - gg.It("should LSHIFT bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x01, 0x01, 0x00, 0x80, - 0xFF, 0x01, 0x01, - 0x18, 0x01}, - []byte{0x02, 0x40, 0x01, 0x00, - 0xF8, 0x08, 0x01, - 0x28, 0x01}, - as.BitLShiftOp(putMode, cdtBinName, 0, 8, 1), - as.BitLShiftOp(putMode, cdtBinName, 9, 7, 6), - as.BitLShiftOp(putMode, cdtBinName, 23, 2, 1), - - as.BitLShiftOp(putMode, cdtBinName, 37, 18, 3), - - as.BitLShiftOp(putMode, cdtBinName, 58, 2, 1), - as.BitLShiftOp(putMode, cdtBinName, 64, 4, 7), - ) - - assertBitModifyOperations( - []byte{0xFF, 0xFF, 0xFF}, - []byte{0xF8, 0x00, 0x0F}, - as.BitLShiftOp(putMode, cdtBinName, 0, 20, 15), - ) - }) - - gg.It("should RSHIFT bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x80, 0x40, 0x01, 0x00, - 0xFF, 0x01, 0x01, - 0x18, 0x80}, - []byte{0x40, 0x01, 0x00, 0x80, - 0xF8, 0xE0, 0x21, - 0x14, 0x80}, - as.BitRShiftOp(putMode, cdtBinName, 0, 8, 1), - as.BitRShiftOp(putMode, cdtBinName, 9, 7, 6), - as.BitRShiftOp(putMode, cdtBinName, 23, 2, 1), - - as.BitRShiftOp(putMode, cdtBinName, 37, 18, 3), - - as.BitRShiftOp(putMode, cdtBinName, 60, 2, 1), - as.BitRShiftOp(putMode, cdtBinName, 68, 4, 7), - ) - }) - - gg.It("should OR bits", func() { - - bits1 := []byte{0x11, 0x22, 0x33} - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x80, 0x40, 0x01, 0x00, 0x00, - 0x01, 0x02, 0x03}, - []byte{0x90, 0x48, 0x01, 0x20, 0x11, - 0x11, 0x22, 0x33}, - as.BitOrOp(putMode, cdtBinName, 0, 5, bits1), - as.BitOrOp(putMode, cdtBinName, 9, 7, bits1), - as.BitOrOp(putMode, cdtBinName, 23, 6, bits1), - as.BitOrOp(putMode, cdtBinName, 32, 8, bits1), - - as.BitOrOp(putMode, cdtBinName, 40, 24, bits1), - ) - }) - - gg.It("should XOR bits", func() { - - bits1 := []byte{0x11, 0x22, 0x33} - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x80, 0x40, 0x01, 0x00, 0x00, - 0x01, 0x02, 0x03}, - []byte{0x90, 0x48, 0x01, 0x20, 0x11, 0x10, 0x20, - 0x30}, - as.BitXorOp(putMode, cdtBinName, 0, 5, bits1), - as.BitXorOp(putMode, cdtBinName, 9, 7, bits1), - as.BitXorOp(putMode, cdtBinName, 23, 6, bits1), - as.BitXorOp(putMode, cdtBinName, 32, 8, bits1), - - as.BitXorOp(putMode, cdtBinName, 40, 24, bits1), - ) - }) - - gg.It("should AND bits", func() { - - bits1 := []byte{0x11, 0x22, 0x33} - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x80, 0x40, 0x01, 0x00, 0x00, - 0x01, 0x02, 0x03}, - []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03}, - as.BitAndOp(putMode, cdtBinName, 0, 5, bits1), - as.BitAndOp(putMode, cdtBinName, 9, 7, bits1), - as.BitAndOp(putMode, cdtBinName, 23, 6, bits1), - as.BitAndOp(putMode, cdtBinName, 32, 8, bits1), - - as.BitAndOp(putMode, cdtBinName, 40, 24, bits1), - ) - }) - - gg.It("should NOT bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x80, 0x40, 0x01, 0x00, 0x00, 0x01, 0x02, 0x03}, - []byte{0x78, 0x3F, 0x00, 0xF8, 0xFF, 0xFE, 0xFD, 0xFC}, - as.BitNotOp(putMode, cdtBinName, 0, 5), - as.BitNotOp(putMode, cdtBinName, 9, 7), - as.BitNotOp(putMode, cdtBinName, 23, 6), - as.BitNotOp(putMode, cdtBinName, 32, 8), - - as.BitNotOp(putMode, cdtBinName, 40, 24), - ) - }) - - gg.It("should ADD bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, - 0x00, 0x00, 0x00, - 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03}, - []byte{0x40, 0x20, 0x01, 0xF0, 0x80, - 0x7F, 0x7F, 0x7F, - 0x02, 0x02, 0x01, - 0x02, 0x02, 0x02, - 0x03, 0x03, 0x06, - 0x07, 0x07, 0x07}, - as.BitAddOp(putMode, cdtBinName, 0, 5, 1, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 9, 7, 1, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 23, 6, 0x21, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 32, 8, 1, false, as.BitOverflowActionFail), - - as.BitAddOp(putMode, cdtBinName, 40, 24, 0x7F7F7F, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 64, 20, 0x01010, false, as.BitOverflowActionFail), - - as.BitAddOp(putMode, cdtBinName, 92, 20, 0x10101, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 113, 22, 0x8082, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 136, 23, 0x20202, false, as.BitOverflowActionFail), - ) - - initial := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - i := 0 - - assertBitModifyOperations( - initial, - []byte{0xFE, 0xFE, 0x7F, 0xFF, 0x7F, 0x80}, - as.BitAddOp(putMode, cdtBinName, 8*i, 8, 0xFF, false, as.BitOverflowActionWrap), - as.BitAddOp(putMode, cdtBinName, 8*i, 8, 0xFF, false, as.BitOverflowActionWrap), - - as.BitAddOp(putMode, cdtBinName, 8*(i+1), 8, 0x7F, true, as.BitOverflowActionWrap), - as.BitAddOp(putMode, cdtBinName, 8*(i+1), 8, 0x7F, true, as.BitOverflowActionWrap), - - as.BitAddOp(putMode, cdtBinName, 8*(i+2), 8, 0x80, true, as.BitOverflowActionWrap), - as.BitAddOp(putMode, cdtBinName, 8*(i+2), 8, 0xFF, true, as.BitOverflowActionWrap), - - as.BitAddOp(putMode, cdtBinName, 8*(i+3), 8, 0x80, false, as.BitOverflowActionSaturate), - as.BitAddOp(putMode, cdtBinName, 8*(i+3), 8, 0x80, false, as.BitOverflowActionSaturate), - - as.BitAddOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), - as.BitAddOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), - - as.BitAddOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), - as.BitAddOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), - ) - - err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - assertThrows(26, - as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFF, false, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFF, false, as.BitOverflowActionFail), - ) - - assertThrows(26, - as.BitAddOp(putMode, cdtBinName, 0, 8, 0x7F, true, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 0, 8, 0x02, true, as.BitOverflowActionFail), - ) - - assertThrows(26, - as.BitAddOp(putMode, cdtBinName, 0, 8, 0x81, true, as.BitOverflowActionFail), - as.BitAddOp(putMode, cdtBinName, 0, 8, 0xFE, true, as.BitOverflowActionFail), - ) - }) - - gg.It("should SUB bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, - - 0x80, 0x80, 0x80, - 0x01, 0x01, 0x01, - - 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03}, - []byte{0x30, 0x1E, 0x00, 0xD0, 0x7E, - - 0x7F, 0x7F, 0x7F, - 0x00, 0xF0, 0xF1, - - 0x00, 0x00, 0x00, - 0x01, 0xFD, 0xFE, - 0x00, 0xE0, 0xE1}, - as.BitSubtractOp(putMode, cdtBinName, 0, 5, 0x01, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 9, 7, 0x01, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 23, 6, 0x03, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 32, 8, 0x01, false, as.BitOverflowActionFail), - - as.BitSubtractOp(putMode, cdtBinName, 40, 24, 0x10101, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 64, 20, 0x101, false, as.BitOverflowActionFail), - - as.BitSubtractOp(putMode, cdtBinName, 92, 20, 0x10101, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 113, 21, 0x101, false, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 136, 23, 0x11111, false, as.BitOverflowActionFail), - ) - - initial := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - i := 0 - - assertBitModifyOperations( - initial, - []byte{0xFF, 0xF6, 0x7F, 0x00, 0x80, 0x7F}, - as.BitSubtractOp(putMode, cdtBinName, 8*i, 8, 0x01, false, as.BitOverflowActionWrap), - - as.BitSubtractOp(putMode, cdtBinName, 8*(i+1), 8, 0x80, true, as.BitOverflowActionWrap), - as.BitSubtractOp(putMode, cdtBinName, 8*(i+1), 8, 0x8A, true, as.BitOverflowActionWrap), - - as.BitSubtractOp(putMode, cdtBinName, 8*(i+2), 8, 0x7F, true, as.BitOverflowActionWrap), - as.BitSubtractOp(putMode, cdtBinName, 8*(i+2), 8, 0x02, true, as.BitOverflowActionWrap), - - as.BitSubtractOp(putMode, cdtBinName, 8*(i+3), 8, 0xAA, false, as.BitOverflowActionSaturate), - - as.BitSubtractOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), - as.BitSubtractOp(putMode, cdtBinName, 8*(i+4), 8, 0x77, true, as.BitOverflowActionSaturate), - - as.BitSubtractOp(putMode, cdtBinName, 8*(i+5), 8, 0x81, true, as.BitOverflowActionSaturate), - as.BitSubtractOp(putMode, cdtBinName, 8*(i+5), 8, 0x8F, true, as.BitOverflowActionSaturate), - ) - - err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - assertThrows(26, - as.BitSubtractOp(putMode, cdtBinName, 0, 8, 1, false, as.BitOverflowActionFail), - ) - - assertThrows(26, - as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x7F, true, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x02, true, as.BitOverflowActionFail), - ) - - assertThrows(26, - as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0x81, true, as.BitOverflowActionFail), - as.BitSubtractOp(putMode, cdtBinName, 0, 8, 0xFE, true, as.BitOverflowActionFail), - ) - }) - - gg.It("should SetInt bits", func() { - - putMode := as.DefaultBitPolicy() - - assertBitModifyOperations( - []byte{0x38, 0x1F, 0x00, 0xE8, 0x7F, - - 0x80, 0x80, 0x80, - 0x01, 0x01, 0x01, - - 0x01, 0x01, 0x01, - 0x02, 0x02, 0x02, - 0x03, 0x03, 0x03}, - []byte{0x08, 0x01, 0x00, 0x18, 0x01, - - 0x01, 0x01, 0x01, - 0x00, 0x10, 0x11, - - 0x01, 0x01, 0x01, - 0x00, 0x04, 0x06, - 0x02, 0x22, 0x23}, - as.BitSetIntOp(putMode, cdtBinName, 0, 5, 0x01), - as.BitSetIntOp(putMode, cdtBinName, 9, 7, 0x01), - as.BitSetIntOp(putMode, cdtBinName, 23, 6, 0x03), - as.BitSetIntOp(putMode, cdtBinName, 32, 8, 0x01), - - as.BitSetIntOp(putMode, cdtBinName, 40, 24, 0x10101), - as.BitSetIntOp(putMode, cdtBinName, 64, 20, 0x101), - - as.BitSetIntOp(putMode, cdtBinName, 92, 20, 0x10101), - as.BitSetIntOp(putMode, cdtBinName, 113, 21, 0x101), - as.BitSetIntOp(putMode, cdtBinName, 136, 23, 0x11111), - ) - }) - - gg.It("should Get bits", func() { - - client.Delete(nil, key) - - bytes := []byte{0xC1, 0xAA, 0xAA} - err := client.PutBins(nil, key, as.NewBin(cdtBinName, bytes)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - record, err := client.Operate(nil, key, - as.BitGetOp(cdtBinName, 0, 1), - as.BitGetOp(cdtBinName, 1, 1), - as.BitGetOp(cdtBinName, 7, 1), - as.BitGetOp(cdtBinName, 0, 8), - - as.BitGetOp(cdtBinName, 8, 16), - as.BitGetOp(cdtBinName, 9, 15), - as.BitGetOp(cdtBinName, 9, 14), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record).NotTo(gm.BeNil()) - - expected := [][]byte{ - {0x80}, - {0x80}, - {0x80}, - {0xC1}, - - {0xAA, 0xAA}, - {0x55, 0x54}, - {0x55, 0x54}, - } - - // assertRecordFound(key, record) - - result_list := record.Bins[cdtBinName].([]interface{}) - results := make([][]byte, len(expected)) - - for i := 0; i < len(expected); i++ { - results[i] = result_list[i].([]byte) - } - - gm.Expect(expected).To(gm.Equal(results)) - }) - - gg.It("should Count bits", func() { - - assertBitReadOperation( - []byte{0xC1, 0xAA, 0xAB}, - []int64{1, 1, 1, 3, 9, 8, 7}, - as.BitCountOp(cdtBinName, 0, 1), - as.BitCountOp(cdtBinName, 1, 1), - as.BitCountOp(cdtBinName, 7, 1), - as.BitCountOp(cdtBinName, 0, 8), - - as.BitCountOp(cdtBinName, 8, 16), - as.BitCountOp(cdtBinName, 9, 15), - as.BitCountOp(cdtBinName, 9, 14), - ) - }) - - gg.It("should LSCAN bits", func() { - - assertBitReadOperation( - []byte{0xFF, 0xFF, 0xFF, - 0xFF, 0x00, 0x00, 0x00, 0x00, 0x01}, - []int64{0, 0, 0, - 0, -1, -1, - 39, -1, 0, 0, - 0, 32, - 0, -1}, - as.BitLScanOp(cdtBinName, 0, 1, true), - as.BitLScanOp(cdtBinName, 0, 8, true), - as.BitLScanOp(cdtBinName, 0, 9, true), - - as.BitLScanOp(cdtBinName, 0, 32, true), - as.BitLScanOp(cdtBinName, 0, 32, false), - as.BitLScanOp(cdtBinName, 1, 30, false), - - as.BitLScanOp(cdtBinName, 32, 40, true), - as.BitLScanOp(cdtBinName, 33, 38, true), - as.BitLScanOp(cdtBinName, 32, 40, false), - as.BitLScanOp(cdtBinName, 33, 38, false), - - as.BitLScanOp(cdtBinName, 0, 72, true), - as.BitLScanOp(cdtBinName, 0, 72, false), - - as.BitLScanOp(cdtBinName, -1, 1, true), - as.BitLScanOp(cdtBinName, -1, 1, false), - ) - }) - - gg.It("should RSCAN bits", func() { - - assertBitReadOperation( - []byte{0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x00, 0x00, 0x01}, - []int64{0, 7, 8, - 31, -1, -1, - 39, -1, 38, 37, - 71, 70, - 0, -1}, - as.BitRScanOp(cdtBinName, 0, 1, true), - as.BitRScanOp(cdtBinName, 0, 8, true), - as.BitRScanOp(cdtBinName, 0, 9, true), - - as.BitRScanOp(cdtBinName, 0, 32, true), - as.BitRScanOp(cdtBinName, 0, 32, false), - as.BitRScanOp(cdtBinName, 1, 30, false), - - as.BitRScanOp(cdtBinName, 32, 40, true), - as.BitRScanOp(cdtBinName, 33, 38, true), - as.BitRScanOp(cdtBinName, 32, 40, false), - as.BitRScanOp(cdtBinName, 33, 38, false), - - as.BitRScanOp(cdtBinName, 0, 72, true), - as.BitRScanOp(cdtBinName, 0, 72, false), - - as.BitRScanOp(cdtBinName, -1, 1, true), - as.BitRScanOp(cdtBinName, -1, 1, false), - ) - }) - - gg.It("should GetInt bits", func() { - - assertBitReadOperation( - []byte{0x0F, 0x0F, 0x00}, - []int64{15, -1, - 15, 15, - 8, -8, - 3840, 3840, - 3840, 3840, - 1920, 1920, - 115648, -15424, - 15, -1}, - as.BitGetIntOp(cdtBinName, 4, 4, false), - as.BitGetIntOp(cdtBinName, 4, 4, true), - - as.BitGetIntOp(cdtBinName, 0, 8, false), - as.BitGetIntOp(cdtBinName, 0, 8, true), - - as.BitGetIntOp(cdtBinName, 7, 4, false), - as.BitGetIntOp(cdtBinName, 7, 4, true), - - as.BitGetIntOp(cdtBinName, 8, 16, false), - as.BitGetIntOp(cdtBinName, 8, 16, true), - - as.BitGetIntOp(cdtBinName, 9, 15, false), - as.BitGetIntOp(cdtBinName, 9, 15, true), - - as.BitGetIntOp(cdtBinName, 9, 14, false), - as.BitGetIntOp(cdtBinName, 9, 14, true), - - as.BitGetIntOp(cdtBinName, 5, 17, false), - as.BitGetIntOp(cdtBinName, 5, 17, true), - - as.BitGetIntOp(cdtBinName, -12, 4, false), - as.BitGetIntOp(cdtBinName, -12, 4, true), - ) - }) - - gg.It("should BitSetEx bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 80; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, as.BitSetOp(policy, cdtBinName, offset, set_sz, set_data)) - } - } - }) - - gg.It("should LSHIFTEX bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 4; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - limit := 16 - if set_sz < 16 { - limit = set_sz + 1 - } - - for n_bits := 0; n_bits <= limit; n_bits++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitSetOp(policy, cdtBinName, offset, set_sz, - set_data), - as.BitLShiftOp(policy, cdtBinName, offset, set_sz, - n_bits)) - } - - for n_bits := 63; n_bits <= set_sz; n_bits++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitSetOp(policy, cdtBinName, offset, set_sz, - set_data), - as.BitLShiftOp(policy, cdtBinName, offset, set_sz, - n_bits)) - } - } - } - }) - - gg.It("should RSHIFTEX bits", func() { - - policy := as.DefaultBitPolicy() - partial_policy := as.NewBitPolicy(as.BitWriteFlagsPartial) - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 4; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - limit := 16 - if set_sz < 16 { - limit = set_sz + 1 - } - - for n_bits := 0; n_bits <= limit; n_bits++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitSetOp(policy, cdtBinName, offset, set_sz, - set_data), - as.BitRShiftOp(policy, cdtBinName, offset, set_sz, - n_bits)) - } - - for n_bits := 63; n_bits <= set_sz; n_bits++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitSetOp(policy, cdtBinName, offset, set_sz, - set_data), - as.BitRShiftOp(policy, cdtBinName, offset, set_sz, - n_bits)) - } - } - - // Test Partial - n_bits := 1 - - for offset := bin_bit_sz - set_sz + 1; offset < bin_bit_sz; offset++ { - actual_set_sz := bin_bit_sz - offset - actual_set_data := make([]byte, (actual_set_sz+7)/8) - - assertBitModifyRegionNotInsert(bin_sz, offset, actual_set_sz, - actual_set_data, - as.BitSetOp(partial_policy, cdtBinName, offset, set_sz, - set_data), - as.BitRShiftOp(partial_policy, cdtBinName, offset, set_sz, - n_bits)) - } - } - }) - - gg.It("should AND Ex bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 80; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitAndOp(policy, cdtBinName, offset, set_sz, - set_data)) - } - } - }) - - gg.It("should NOT Ex bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 80; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitNotOp(policy, cdtBinName, offset, set_sz)) - } - } - }) - - gg.It("should INSERT Ex bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - - for set_sz := 1; set_sz <= 10; set_sz++ { - set_data := make([]byte, set_sz) - - for offset := 0; offset <= bin_sz; offset++ { - assertBitModifyInsert(bin_sz, offset*8, set_sz*8, set_data, - as.BitInsertOp(policy, cdtBinName, offset, set_data)) - } - } - }) - - gg.It("should ADD Ex bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 64; set_sz++ { - set_data := make([]byte, (set_sz+7)/8) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, set_data, - as.BitAddOp(policy, cdtBinName, offset, set_sz, 1, - false, as.BitOverflowActionWrap)) - } - } - }) - - gg.It("should SUB Ex bits", func() { - - policy := as.DefaultBitPolicy() - bin_sz := 15 - bin_bit_sz := bin_sz * 8 - - for set_sz := 1; set_sz <= 64; set_sz++ { - expected := make([]byte, (set_sz+7)/8) - value := int64(uint64(0xFFFFffffFFFFffff >> uint(64-set_sz))) - - for offset := 0; offset <= (bin_bit_sz - set_sz); offset++ { - assertBitModifyRegionNotInsert(bin_sz, offset, set_sz, expected, - as.BitSubtractOp(policy, cdtBinName, offset, set_sz, - value, false, as.BitOverflowActionWrap)) - } - } - }) - - gg.It("should LSHIFT bits", func() { - - policy := as.DefaultBitPolicy() - initial := []byte{} - buf := []byte{0x80} - - client.Delete(nil, key) - err := client.PutBins(nil, key, as.NewBin(cdtBinName, initial)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - assertThrows(26, - as.BitSetOp(policy, cdtBinName, 0, 1, buf)) - assertThrows(26, - as.BitOrOp(policy, cdtBinName, 0, 1, buf)) - assertThrows(26, - as.BitXorOp(policy, cdtBinName, 0, 1, buf)) - assertThrows(26, - as.BitAndOp(policy, cdtBinName, 0, 1, buf)) - assertThrows(26, - as.BitNotOp(policy, cdtBinName, 0, 1)) - assertThrows(26, - as.BitLShiftOp(policy, cdtBinName, 0, 1, 1)) - assertThrows(26, - as.BitRShiftOp(policy, cdtBinName, 0, 1, 1)) - // OK for insert. - assertThrows(4, - as.BitRemoveOp(policy, cdtBinName, 0, 1)) - assertThrows(26, - as.BitAddOp(policy, cdtBinName, 0, 1, 1, false, as.BitOverflowActionFail)) - assertThrows(26, - as.BitSubtractOp(policy, cdtBinName, 0, 1, 1, false, as.BitOverflowActionFail)) - assertThrows(26, - as.BitSetIntOp(policy, cdtBinName, 0, 1, 1)) - - assertThrows(26, - as.BitGetOp(cdtBinName, 0, 1)) - assertThrows(26, - as.BitCountOp(cdtBinName, 0, 1)) - assertThrows(26, - as.BitLScanOp(cdtBinName, 0, 1, true)) - assertThrows(26, - as.BitRScanOp(cdtBinName, 0, 1, true)) - assertThrows(26, - as.BitGetIntOp(cdtBinName, 0, 1, false)) - }) - - gg.It("should Resize bits", func() { - - client.Delete(nil, key) - - policy := as.DefaultBitPolicy() - noFail := as.NewBitPolicy(as.BitWriteFlagsNoFail) - record, err := client.Operate(nil, key, - as.BitResizeOp(policy, cdtBinName, 20, as.BitResizeFlagsDefault), - as.BitGetOp(cdtBinName, 19*8, 8), - as.BitResizeOp(noFail, cdtBinName, 10, as.BitResizeFlagsGrowOnly), - as.BitGetOp(cdtBinName, 19*8, 8), - as.BitResizeOp(policy, cdtBinName, 10, as.BitResizeFlagsShrinkOnly), - as.BitGetOp(cdtBinName, 9*8, 8), - as.BitResizeOp(noFail, cdtBinName, 30, as.BitResizeFlagsShrinkOnly), - as.BitGetOp(cdtBinName, 9*8, 8), - as.BitResizeOp(policy, cdtBinName, 19, as.BitResizeFlagsGrowOnly), - as.BitGetOp(cdtBinName, 18*8, 8), - as.BitResizeOp(noFail, cdtBinName, 0, as.BitResizeFlagsGrowOnly), - as.BitResizeOp(policy, cdtBinName, 0, as.BitResizeFlagsShrinkOnly), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - result_list := record.Bins[cdtBinName].([]interface{}) - get0 := result_list[1].([]byte) - get1 := result_list[3].([]byte) - get2 := result_list[5].([]byte) - get3 := result_list[7].([]byte) - get4 := result_list[9].([]byte) - - gm.Expect([]byte{0x00}).To(gm.Equal(get0)) - gm.Expect([]byte{0x00}).To(gm.Equal(get1)) - gm.Expect([]byte{0x00}).To(gm.Equal(get2)) - gm.Expect([]byte{0x00}).To(gm.Equal(get3)) - gm.Expect([]byte{0x00}).To(gm.Equal(get4)) - }) - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_context.go b/aerospike-tls/vendor-aerospike-client-go/cdt_context.go deleted file mode 100644 index 5f5e1265..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_context.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import ( - "encoding/base64" - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const ( - ctxTypeListIndex = 0x10 - ctxTypeListRank = 0x11 - ctxTypeListValue = 0x13 - ctxTypeMapIndex = 0x20 - ctxTypeMapRank = 0x21 - ctxTypeMapKey = 0x22 - ctxTypeMapValue = 0x23 -) - -// CDTContext defines Nested CDT context. Identifies the location of nested list/map to apply the operation. -// for the current level. -// An array of CTX identifies location of the list/map on multiple -// levels on nesting. -type CDTContext struct { - Id int - Value Value -} - -// CDTContextToBase64 converts a []*CDTContext into a base64 encoded string. -func CDTContextToBase64(ctxl []*CDTContext) (string, Error) { - ctx := cdtContextList(ctxl) - sz, err := ctx.packArray(nil) - if err != nil { - return "", err - } - - buf := newBuffer(sz) - _, err = ctx.packArray(buf) - if err != nil { - return "", err - } - - b64 := base64.StdEncoding.EncodeToString(buf.dataBuffer) - return b64, nil -} - -// Base64ToCDTContext converts a b64 encoded string back into a []*CDTContext. -func Base64ToCDTContext(b64 string) ([]*CDTContext, Error) { - msg, err1 := base64.StdEncoding.DecodeString(b64) - if err1 != nil { - return nil, newError(types.PARSE_ERROR, err1.Error()) - } - - unpacker := newUnpacker(msg, 0, len(msg)) - list, err := unpacker.UnpackList() - if err != nil { - return nil, err - } - - if len(list)%2 != 0 { - return nil, newError(types.PARSE_ERROR, "List count must be even") - } - - res := make([]*CDTContext, 0, len(list)/2) - for i := 0; i < len(list); i += 2 { - res = append(res, &CDTContext{Id: list[i].(int), Value: NewValue(list[i+1])}) - } - - return res, nil -} - -// String implements the Stringer interface for CDTContext -func (ctx *CDTContext) String() string { - return fmt.Sprintf("CDTContext{id: %d, value: %s}", ctx.Id, ctx.Value.String()) -} - -func (ctx *CDTContext) pack(cmd BufferEx) (int, Error) { - size := 0 - sz, err := packAInt64(cmd, int64(ctx.Id)) - size += sz - if err != nil { - return size, err - } - - sz, err = ctx.Value.pack(cmd) - size += sz - - return size, err -} - -// cdtContextList is used in FilterExpression API -type cdtContextList []*CDTContext - -func (ctxl cdtContextList) pack(cmd BufferEx) (int, Error) { - size := 0 - for i := range ctxl { - sz, err := ctxl[i].pack(cmd) - size += sz - if err != nil { - return size, err - } - } - - return size, nil -} - -// used in CreateComplexIndex -func (ctxl cdtContextList) packArray(cmd BufferEx) (int, Error) { - size, err := packArrayBegin(cmd, len(ctxl)*2) - if err != nil { - return size, err - } - - for i := range ctxl { - sz, err := ctxl[i].pack(cmd) - size += sz - if err != nil { - return size, err - } - } - - return size, nil -} - -// CtxListIndex defines Lookup list by index offset. -// If the index is negative, the resolved index starts backwards from end of list. -// If an index is out of bounds, a parameter error will be returned. -// Examples: -// 0: First item. -// 4: Fifth item. -// -1: Last item. -// -3: Third to last item. -func CtxListIndex(index int) *CDTContext { - return &CDTContext{ctxTypeListIndex, IntegerValue(index)} -} - -// CtxListIndexCreate list with given type at index offset, given an order and pad. -func CtxListIndexCreate(index int, order ListOrderType, pad bool) *CDTContext { - return &CDTContext{ctxTypeListIndex | cdtListOrderFlag(order, pad), IntegerValue(index)} -} - -// CtxListRank defines Lookup list by rank. -// 0 = smallest value -// N = Nth smallest value -// -1 = largest value -func CtxListRank(rank int) *CDTContext { - return &CDTContext{ctxTypeListRank, IntegerValue(rank)} -} - -// CtxListValue defines Lookup list by value. -func CtxListValue(key Value) *CDTContext { - return &CDTContext{ctxTypeListValue, key} -} - -// CtxMapIndex defines Lookup map by index offset. -// If the index is negative, the resolved index starts backwards from end of list. -// If an index is out of bounds, a parameter error will be returned. -// Examples: -// 0: First item. -// 4: Fifth item. -// -1: Last item. -// -3: Third to last item. -func CtxMapIndex(index int) *CDTContext { - return &CDTContext{ctxTypeMapIndex, IntegerValue(index)} -} - -// CtxMapRank defines Lookup map by rank. -// 0 = smallest value -// N = Nth smallest value -// -1 = largest value -func CtxMapRank(rank int) *CDTContext { - return &CDTContext{ctxTypeMapRank, IntegerValue(rank)} -} - -// CtxMapKey defines Lookup map by key. -func CtxMapKey(key Value) *CDTContext { - return &CDTContext{ctxTypeMapKey, key} -} - -// CtxMapKeyCreate creates map with given type at map key. -func CtxMapKeyCreate(key Value, order mapOrderType) *CDTContext { - return &CDTContext{ctxTypeMapKey | order.flag, key} -} - -// CtxMapValue defines Lookup map by value. -func CtxMapValue(key Value) *CDTContext { - return &CDTContext{ctxTypeMapValue, key} -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go deleted file mode 100644 index f3f70092..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_context_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var _ = gg.Describe("CDTContext Test", func() { - - gg.It("should convert to/from base64", func() { - ctxl := []*as.CDTContext{ - as.CtxMapKey(as.StringValue("key2")), - as.CtxListRank(0), - } - - b, err := as.CDTContextToBase64(ctxl) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(b).ToNot(gm.BeNil()) - - ctxl2, err := as.Base64ToCDTContext(b) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - arraysEqual(ctxl2, ctxl) - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_list.go b/aerospike-tls/vendor-aerospike-client-go/cdt_list.go deleted file mode 100644 index e41e2fb4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_list.go +++ /dev/null @@ -1,882 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// List operations support negative indexing. If the index is negative, the -// resolved index starts backwards from end of list. If an index is out of bounds, -// a parameter error will be returned. If a range is partially out of bounds, the -// valid part of the range will be returned. Index/Range examples: -// -// Index/Range examples: -// -// Index 0: First item in list. -// Index 4: Fifth item in list. -// Index -1: Last item in list. -// Index -3: Third to last item in list. -// Index 1 Count 2: Second and third items in list. -// Index -3 Count 3: Last three items in list. -// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. -// -// Nested CDT operations are supported by optional Ctx context arguments. Examples: -// -// bin = [[7,9,5],[1,2,3],[6,5,4,1]] -// Append 11 to last list. -// ListAppendWithPolicyContextOp(DefaultMapPolicy(), "bin", IntegerValue(11), CtxListIndex(-1)) -// bin result = [[7,9,5],[1,2,3],[6,5,4,1,11]] -// -// bin = {key1:[[7,9,5],[13]], key2:[[9],[2,4],[6,1,9]], key3:[[6,5]]} -// Append 11 to lowest ranked list in map identified by "key2". -// ListAppendWithPolicyContextOp(DefaultMapPolicy(), "bin", IntegerValue(11), CtxMapKey(StringValue("key2")), CtxListRank(0)) -// bin result = {key1:[[7,9,5],[13]], key2:[[9],[2,4,11],[6,1,9]], key3:[[6,5]]} - -const ( - _CDT_LIST_SET_TYPE = 0 - _CDT_LIST_APPEND = 1 - _CDT_LIST_APPEND_ITEMS = 2 - _CDT_LIST_INSERT = 3 - _CDT_LIST_INSERT_ITEMS = 4 - _CDT_LIST_POP = 5 - _CDT_LIST_POP_RANGE = 6 - _CDT_LIST_REMOVE = 7 - _CDT_LIST_REMOVE_RANGE = 8 - _CDT_LIST_SET = 9 - _CDT_LIST_TRIM = 10 - _CDT_LIST_CLEAR = 11 - _CDT_LIST_INCREMENT = 12 - _CDT_LIST_SORT = 13 - _CDT_LIST_SIZE = 16 - _CDT_LIST_GET = 17 - _CDT_LIST_GET_RANGE = 18 - _CDT_LIST_GET_BY_INDEX = 19 - _CDT_LIST_GET_BY_RANK = 21 - _CDT_LIST_GET_BY_VALUE = 22 - _CDT_LIST_GET_BY_VALUE_LIST = 23 - _CDT_LIST_GET_BY_INDEX_RANGE = 24 - _CDT_LIST_GET_BY_VALUE_INTERVAL = 25 - _CDT_LIST_GET_BY_RANK_RANGE = 26 - _CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE = 27 - _CDT_LIST_REMOVE_BY_INDEX = 32 - _CDT_LIST_REMOVE_BY_RANK = 34 - _CDT_LIST_REMOVE_BY_VALUE = 35 - _CDT_LIST_REMOVE_BY_VALUE_LIST = 36 - _CDT_LIST_REMOVE_BY_INDEX_RANGE = 37 - _CDT_LIST_REMOVE_BY_VALUE_INTERVAL = 38 - _CDT_LIST_REMOVE_BY_RANK_RANGE = 39 - _CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE = 40 -) - -// ListOrderType determines the order of returned values in CDT list operations. -type ListOrderType int - -// Map storage order. -const ( - // ListOrderUnordered signifies that list is not ordered. This is the default. - ListOrderUnordered ListOrderType = 0 - - // ListOrderOrdered signifies that list is Ordered. - ListOrderOrdered ListOrderType = 1 -) - -// ListPolicy directives when creating a list and writing list items. -type ListPolicy struct { - attributes ListOrderType - flags int -} - -// NewListPolicy creates a policy with directives when creating a list and writing list items. -// Flags are ListWriteFlags. You can specify multiple by `or`ing them together. -func NewListPolicy(order ListOrderType, flags int) *ListPolicy { - return &ListPolicy{ - attributes: order, - flags: flags, - } -} - -// DefaultListPolicy is the default list policy and can be customized. -var defaultListPolicy = NewListPolicy(ListOrderUnordered, ListWriteFlagsDefault) - -// DefaultListPolicy returns the default policy for CDT list operations. -func DefaultListPolicy() *ListPolicy { - return defaultListPolicy -} - -// ListReturnType determines the returned values in CDT List operations. -type ListReturnType int - -const ( - // ListReturnTypeNone will not return a result. - ListReturnTypeNone ListReturnType = 0 - - // ListReturnTypeIndex will return index offset order. - // 0 = first key - // N = Nth key - // -1 = last key - ListReturnTypeIndex ListReturnType = 1 - - // ListReturnTypeReverseIndex will return reverse index offset order. - // 0 = last key - // -1 = first key - ListReturnTypeReverseIndex ListReturnType = 2 - - // ListReturnTypeRank will return value order. - // 0 = smallest value - // N = Nth smallest value - // -1 = largest value - ListReturnTypeRank ListReturnType = 3 - - // ListReturnTypeReverseRank will return reverse value order. - // 0 = largest value - // N = Nth largest value - // -1 = smallest value - ListReturnTypeReverseRank ListReturnType = 4 - - // ListReturnTypeCount will return count of items selected. - ListReturnTypeCount ListReturnType = 5 - - // ListReturnTypeValue will return value for single key read and value list for range read. - ListReturnTypeValue ListReturnType = 7 - - // ListReturnTypeExists returns true if count > 0. - ListReturnTypeExists ListReturnType = 13 - - // ListReturnTypeInverted will invert meaning of list command and return values. For example: - // ListOperation.getByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED) - // With the INVERTED flag enabled, the items outside of the specified index range will be returned. - // The meaning of the list command can also be inverted. For example: - // ListOperation.removeByIndexRange(binName, index, count, ListReturnType.INDEX | ListReturnType.INVERTED); - // With the INVERTED flag enabled, the items outside of the specified index range will be removed and returned. - ListReturnTypeInverted ListReturnType = 0x10000 -) - -// ListSortFlags detemines sort flags for CDT lists -type ListSortFlags int - -const ( - // ListSortFlagsDefault is the default sort flag for CDT lists, and sort in Ascending order. - ListSortFlagsDefault ListSortFlags = 0 - // ListSortFlagsDescending will sort the contents of the list in descending order. - ListSortFlagsDescending ListSortFlags = 1 - // ListSortFlagsDropDuplicates will drop duplicate values in the results of the CDT list operation. - ListSortFlagsDropDuplicates ListSortFlags = 2 -) - -// ListWriteFlags detemines write flags for CDT lists -// type ListWriteFlags int - -const ( - // ListWriteFlagsDefault is the default behavior. It means: Allow duplicate values and insertions at any index. - ListWriteFlagsDefault = 0 - // ListWriteFlagsAddUnique means: Only add unique values. - ListWriteFlagsAddUnique = 1 - // ListWriteFlagsInsertBounded means: Enforce list boundaries when inserting. Do not allow values to be inserted - // at index outside current list boundaries. - ListWriteFlagsInsertBounded = 2 - // ListWriteFlagsNoFail means: do not raise error if a list item fails due to write flag constraints. - ListWriteFlagsNoFail = 4 - // ListWriteFlagsPartial means: allow other valid list items to be committed if a list item fails due to - // write flag constraints. - ListWriteFlagsPartial = 8 -) - -func listGenericOpEncoder(op *Operation, packer BufferEx) (int, Error) { - args := op.binValue.(ListValue) - if len(args) > 1 { - return packCDTIfcVarParamsAsArray(packer, int16(args[0].(int)), op.ctx, args[1:]...) - } - return packCDTIfcVarParamsAsArray(packer, int16(args[0].(int)), op.ctx) -} - -func packCDTParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...Value) (int, Error) { - size := 0 - n := 0 - var err Error - if len(ctx) > 0 { - if n, err = packArrayBegin(packer, 3); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt64(packer, 0xff); err != nil { - return size + n, err - } - size += n - - if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { - return size + n, err - } - size += n - - for _, c := range ctx { - if n, err = packAInt64(packer, int64(c.Id)); err != nil { - return size + n, err - } - size += n - - if n, err = c.Value.pack(packer); err != nil { - return size + n, err - } - size += n - } - - if n, err = packArrayBegin(packer, len(params)+1); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt(packer, int(opType)); err != nil { - return size + n, err - } - size += n - } else { - if n, err = packShortRaw(packer, opType); err != nil { - return n, err - } - size += n - - if len(params) > 0 { - if n, err = packArrayBegin(packer, len(params)); err != nil { - return size + n, err - } - size += n - } - } - - if len(params) > 0 { - for i := range params { - if n, err = params[i].pack(packer); err != nil { - return size + n, err - } - size += n - } - } - return size, nil -} - -func packCDTIfcParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ListValue) (int, Error) { - return packCDTIfcVarParamsAsArray(packer, opType, ctx, []interface{}(params)...) -} - -func packCDTIfcVarParamsAsArray(packer BufferEx, opType int16, ctx []*CDTContext, params ...interface{}) (int, Error) { - size := 0 - n := 0 - var err Error - if len(ctx) > 0 { - if n, err = packArrayBegin(packer, 3); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt64(packer, 0xff); err != nil { - return size + n, err - } - size += n - - if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { - return size + n, err - } - size += n - - for _, c := range ctx { - if n, err = packAInt64(packer, int64(c.Id)); err != nil { - return size + n, err - } - size += n - - if n, err = c.Value.pack(packer); err != nil { - return size + n, err - } - size += n - } - - if n, err = packArrayBegin(packer, len(params)+1); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt(packer, int(opType)); err != nil { - return size + n, err - } - size += n - } else { - n, err = packShortRaw(packer, opType) - if err != nil { - return n, err - } - size += n - - if len(params) > 0 { - if n, err = packArrayBegin(packer, len(params)); err != nil { - return size + n, err - } - size += n - } - } - - if len(params) > 0 { - for i := range params { - if n, err = packObject(packer, params[i], false); err != nil { - return size + n, err - } - size += n - } - } - - return size, nil -} - -func cdtCreateOpEncoder(op *Operation, packer BufferEx) (int, Error) { - args := op.binValue.(ListValue) - if len(args) > 2 { - return packCDTCreate(packer, int16(args[0].(int)), op.ctx, args[1].(int), args[2:]...) - } - return packCDTCreate(packer, int16(args[0].(int)), op.ctx, args[1].(int)) -} - -func packCDTCreate(packer BufferEx, opType int16, ctx []*CDTContext, flag int, params ...interface{}) (int, Error) { - size := 0 - n := 0 - var err Error - if n, err = packArrayBegin(packer, 3); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt64(packer, 0xff); err != nil { - return size + n, err - } - size += n - - if n, err = packArrayBegin(packer, len(ctx)*2); err != nil { - return size + n, err - } - size += n - - var c *CDTContext - last := len(ctx) - 1 - - for i := 0; i < last; i++ { - c = ctx[i] - if n, err = packAInt64(packer, int64(c.Id)); err != nil { - return size + n, err - } - size += n - - if n, err = c.Value.pack(packer); err != nil { - return size + n, err - } - size += n - } - - c = ctx[last] - if n, err = packAInt64(packer, int64(c.Id|flag)); err != nil { - return size + n, err - } - size += n - - if n, err = c.Value.pack(packer); err != nil { - return size + n, err - } - size += n - - if n, err = packArrayBegin(packer, len(params)+1); err != nil { - return size + n, err - } - size += n - - if n, err = packAInt(packer, int(opType)); err != nil { - return size + n, err - } - size += n - - if len(params) > 0 { - for i := range params { - if n, err = packObject(packer, params[i], false); err != nil { - return size + n, err - } - size += n - } - } - - return size, nil -} - -func cdtListOrderFlag(order ListOrderType, pad bool) int { - if order == 1 { - return 0xc0 - } - - if pad { - return 0x80 - } - return 0x40 -} - -// ListCreateOp creates list create operation. -// Server creates list at given context level. The context is allowed to be beyond list -// boundaries only if pad is set to true. In that case, nil list entries will be inserted to -// satisfy the context position. -func ListCreateOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation { - // If context not defined, the set order for top-level bin list. - if len(ctx) == 0 { - return ListSetOrderOp(binName, listOrder) - } - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, cdtListOrderFlag(listOrder, pad), IntegerValue(listOrder)}, encoder: cdtCreateOpEncoder} -} - -// ListCreateOp creates list create operation with a persisted index. -// A list index improves lookup performance, but requires more storage. -// A list index can be created for a top-level ordered list only. -// Nested and unordered list indexes are not supported. -// -// Server creates list at given context level. The context is allowed to be beyond list -// boundaries only if pad is set to true. In that case, nil list entries will be inserted to -// satisfy the context position. -func ListCreateWithIndexOp(binName string, listOrder ListOrderType, pad bool, ctx ...*CDTContext) *Operation { - // If context not defined, the set order for top-level bin list. - if len(ctx) == 0 { - return ListSetOrderWithIndexOp(binName, listOrder) - } - - // Create nested list. persistIndex does not apply here, so ignore it. - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, cdtListOrderFlag(listOrder, pad), IntegerValue(listOrder)}, encoder: cdtCreateOpEncoder} -} - -// ListSetOrderOp creates a set list order operation. -// Server sets list order. Server returns nil. -func ListSetOrderOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, IntegerValue(listOrder)}, encoder: listGenericOpEncoder} -} - -// ListSetOrderWithIndexOp creates a set list order operation with a persisted index. -// A list index improves lookup performance, but requires more storage. -// A list index can be created for a top-level ordered list only. -// Nested and unordered list indexes are not supported. -// -// Server sets list order. Server returns nil. -func ListSetOrderWithIndexOp(binName string, listOrder ListOrderType, ctx ...*CDTContext) *Operation { - listOrder |= 0x10 - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET_TYPE, IntegerValue(listOrder)}, encoder: listGenericOpEncoder} -} - -// ListAppendOp creates a list append operation. -// Server appends values to end of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListAppendOp(binName string, values ...interface{}) *Operation { - if len(values) == 1 { - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0])}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values)}, encoder: listGenericOpEncoder} -} - -// ListAppendWithPolicyOp creates a list append operation. -// Server appends values to end of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListAppendWithPolicyOp(policy *ListPolicy, binName string, values ...interface{}) *Operation { - switch len(values) { - case 1: - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0]), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - default: - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - } -} - -// ListAppendWithPolicyContextOp creates a list append operation. -// Server appends values to end of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListAppendWithPolicyContextOp(policy *ListPolicy, binName string, ctx []*CDTContext, values ...interface{}) *Operation { - switch len(values) { - case 1: - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_APPEND, NewValue(values[0]), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - default: - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_APPEND_ITEMS, ListValue(values), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - } -} - -// ListInsertOp creates a list insert operation. -// Server inserts value to specified index of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListInsertOp(binName string, index int, values ...interface{}) *Operation { - if len(values) == 1 { - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0])}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values)}, encoder: listGenericOpEncoder} -} - -// ListInsertWithPolicyOp creates a list insert operation. -// Server inserts value to specified index of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListInsertWithPolicyOp(policy *ListPolicy, binName string, index int, values ...interface{}) *Operation { - if len(values) == 1 { - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0]), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} -} - -// ListInsertWithPolicyContextOp creates a list insert operation. -// Server inserts value to specified index of list bin. -// Server returns list size on bin name. -// It will panic is no values have been passed. -func ListInsertWithPolicyContextOp(policy *ListPolicy, binName string, index int, ctx []*CDTContext, values ...interface{}) *Operation { - if len(values) == 1 { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INSERT, IntegerValue(index), NewValue(values[0]), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INSERT_ITEMS, IntegerValue(index), ListValue(values), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} -} - -// ListPopOp creates list pop operation. -// Server returns item at specified index and removes item from list bin. -func ListPopOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListPopRangeOp creates a list pop range operation. -// Server returns items starting at specified index and removes items from list bin. -func ListPopRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { - if count == 1 { - return ListPopOp(binName, index) - } - - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListPopRangeFromOp creates a list pop range operation. -// Server returns items starting at specified index to the end of list and removes items from list bin. -func ListPopRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_POP_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListRemoveOp creates a list remove operation. -// Server removes item at specified index from list bin. -// Server returns number of items removed. -func ListRemoveOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByValueOp creates list remove by value operation. -// Server removes the item identified by value and returns removed data specified by returnType. -func ListRemoveByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE, IntegerValue(returnType), NewValue(value)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByValueListOp creates list remove by value operation. -// Server removes list items identified by value and returns removed data specified by returnType. -func ListRemoveByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_LIST, IntegerValue(returnType), ListValue(values)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByValueRangeOp creates a list remove operation. -// Server removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// Server returns removed data specified by returnType -func ListRemoveByValueRangeOp(binName string, returnType ListReturnType, valueBegin, valueEnd interface{}, ctx ...*CDTContext) *Operation { - // TODO: Inconsistent parameter order - if valueEnd == nil { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(valueBegin)}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(valueBegin), NewValue(valueEnd)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByValueRelativeRankRangeOp creates a list remove by value relative to rank range operation. -// Server removes list items nearest to value and greater by relative rank. -// Server returns removed data specified by returnType. -// -// Examples for ordered list [0,4,5,9,11,15]: -// -// (value,rank) = [removed items] -// (5,0) = [5,9,11,15] -// (5,1) = [9,11,15] -// (5,-1) = [4,5,9,11,15] -// (3,0) = [4,5,9,11,15] -// (3,3) = [11,15] -// (3,-3) = [0,4,5,9,11,15] -func ListRemoveByValueRelativeRankRangeOp(binName string, returnType ListReturnType, value interface{}, rank int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByValueRelativeRankRangeCountOp creates a list remove by value relative to rank range operation. -// Server removes list items nearest to value and greater by relative rank with a count limit. -// Server returns removed data specified by returnType. -// Examples for ordered list [0,4,5,9,11,15]: -// -// (value,rank,count) = [removed items] -// (5,0,2) = [5,9] -// (5,1,1) = [9] -// (5,-1,2) = [4,5] -// (3,0,1) = [4] -// (3,3,7) = [11,15] -// (3,-3,2) = [] -func ListRemoveByValueRelativeRankRangeCountOp(binName string, returnType ListReturnType, value interface{}, rank, count int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListRemoveRangeOp creates a list remove range operation. -// Server removes "count" items starting at specified index from list bin. -// Server returns number of items removed. -func ListRemoveRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { - if count == 1 { - return ListRemoveOp(binName, index) - } - - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListRemoveRangeFromOp creates a list remove range operation. -// Server removes all items starting at specified index to the end of list. -// Server returns number of items removed. -func ListRemoveRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListSetOp creates a list set operation. -// Server sets item value at specified index in list bin. -// Server does not return a result by default. -func ListSetOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET, IntegerValue(index), NewValue(value)}, encoder: listGenericOpEncoder} -} - -// ListSetWithPolicyOp creates a list set operation using a ListPolicy. -// Server sets item value at specified index in list bin. -// Server does not return a result by default. -func ListSetWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SET, IntegerValue(index), NewValue(value), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} -} - -// ListTrimOp creates a list trim operation. -// Server removes items in list bin that do not fall into range specified by index -// and count range. If the range is out of bounds, then all items will be removed. -// Server returns number of elements that were removed. -func ListTrimOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_TRIM, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListClearOp creates a list clear operation. -// Server removes all items in list bin. -// Server does not return a result by default. -func ListClearOp(binName string, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_CLEAR}, encoder: listGenericOpEncoder} -} - -// ListIncrementOp creates a list increment operation. -// Server increments list[index] by value. -// Value should be integer(IntegerValue, LongValue) or float(FloatValue). -// Server returns list[index] after incrementing. -func ListIncrementOp(binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { - val := NewValue(value) - switch val.(type) { - case LongValue, IntegerValue, FloatValue: - default: - panic("Increment operation only accepts Integer or Float values") - } - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), NewValue(value)}, encoder: listGenericOpEncoder} -} - -// ListIncrementByOneOp creates list increment operation with policy. -// Server increments list[index] by 1. -// Server returns list[index] after incrementing. -func ListIncrementByOneOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListIncrementByOneWithPolicyOp creates list increment operation with policy. -// Server increments list[index] by 1. -// Server returns list[index] after incrementing. -func ListIncrementByOneWithPolicyOp(policy *ListPolicy, binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), IntegerValue(1), IntegerValue(policy.attributes), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} -} - -// ListIncrementWithPolicyOp creates a list increment operation. -// Server increments list[index] by value. -// Server returns list[index] after incrementing. -func ListIncrementWithPolicyOp(policy *ListPolicy, binName string, index int, value interface{}, ctx ...*CDTContext) *Operation { - val := NewValue(value) - switch val.(type) { - case LongValue, IntegerValue, FloatValue: - default: - panic("Increment operation only accepts Integer or Float values") - } - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), NewValue(value), IntegerValue(policy.flags)}, encoder: listGenericOpEncoder} -} - -// ListSizeOp creates a list size operation. -// Server returns size of list on bin name. -func ListSizeOp(binName string, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SIZE}, encoder: listGenericOpEncoder} -} - -// ListGetOp creates a list get operation. -// Server returns item at specified index in list bin. -func ListGetOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListGetRangeOp creates a list get range operation. -// Server returns "count" items starting at specified index in list bin. -func ListGetRangeOp(binName string, index int, count int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_RANGE, IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListGetRangeFromOp creates a list get range operation. -// Server returns items starting at specified index to the end of list. -func ListGetRangeFromOp(binName string, index int, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_RANGE, IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListSortOp creates list sort operation. -// Server sorts list according to sortFlags. -// Server does not return a result by default. -func ListSortOp(binName string, sortFlags ListSortFlags, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_SORT, IntegerValue(sortFlags)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByIndexOp creates a list remove operation. -// Server removes list item identified by index and returns removed data specified by returnType. -func ListRemoveByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByIndexRangeOp creates a list remove operation. -// Server removes list items starting at specified index to the end of list and returns removed -// data specified by returnType. -func ListRemoveByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByIndexRangeCountOp creates a list remove operation. -// Server removes "count" list items starting at specified index and returns removed data specified by returnType. -func ListRemoveByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByRankOp creates a list remove operation. -// Server removes list item identified by rank and returns removed data specified by returnType. -func ListRemoveByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByRankRangeOp creates a list remove operation. -// Server removes list items starting at specified rank to the last ranked item and returns removed -// data specified by returnType. -func ListRemoveByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListRemoveByRankRangeCountOp creates a list remove operation. -// Server removes "count" list items starting at specified rank and returns removed data specified by returnType. -func ListRemoveByRankRangeCountOp(binName string, rank int, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_MODIFY, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_REMOVE_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListGetByValueOp creates a list get by value operation. -// Server selects list items identified by value and returns selected data specified by returnType. -func ListGetByValueOp(binName string, value interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE, IntegerValue(returnType), NewValue(value)}, encoder: listGenericOpEncoder} -} - -// ListGetByValueListOp creates list get by value list operation. -// Server selects list items identified by values and returns selected data specified by returnType. -func ListGetByValueListOp(binName string, values []interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_LIST, IntegerValue(returnType), ListValue(values)}, encoder: listGenericOpEncoder} -} - -// ListGetByValueRangeOp creates a list get by value range operation. -// Server selects list items identified by value range (valueBegin inclusive, valueEnd exclusive) -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// Server returns selected data specified by returnType. -func ListGetByValueRangeOp(binName string, beginValue, endValue interface{}, returnType ListReturnType, ctx ...*CDTContext) *Operation { - if endValue == nil { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(beginValue)}, encoder: listGenericOpEncoder} - } - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_INTERVAL, IntegerValue(returnType), NewValue(beginValue), NewValue(endValue)}, encoder: listGenericOpEncoder} -} - -// ListGetByIndexOp creates list get by index operation. -// Server selects list item identified by index and returns selected data specified by returnType -func ListGetByIndexOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListGetByIndexRangeOp creates list get by index range operation. -// Server selects list items starting at specified index to the end of list and returns selected -// data specified by returnType. -func ListGetByIndexRangeOp(binName string, index int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index)}, encoder: listGenericOpEncoder} -} - -// ListGetByIndexRangeCountOp creates list get by index range operation. -// Server selects "count" list items starting at specified index and returns selected data specified -// by returnType. -func ListGetByIndexRangeCountOp(binName string, index, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_INDEX_RANGE, IntegerValue(returnType), IntegerValue(index), count}, encoder: listGenericOpEncoder} -} - -// ListGetByRankOp creates a list get by rank operation. -// Server selects list item identified by rank and returns selected data specified by returnType. -func ListGetByRankOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListGetByRankRangeOp creates a list get by rank range operation. -// Server selects list items starting at specified rank to the last ranked item and returns selected -// data specified by returnType. -func ListGetByRankRangeOp(binName string, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListGetByRankRangeCountOp creates a list get by rank range operation. -// Server selects "count" list items starting at specified rank and returns selected data specified by returnType. -func ListGetByRankRangeCountOp(binName string, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_RANK_RANGE, IntegerValue(returnType), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} -} - -// ListGetByValueRelativeRankRangeOp creates a list get by value relative to rank range operation. -// Server selects list items nearest to value and greater by relative rank. -// Server returns selected data specified by returnType. -// -// Examples for ordered list [0,4,5,9,11,15]: -// -// (value,rank) = [selected items] -// (5,0) = [5,9,11,15] -// (5,1) = [9,11,15] -// (5,-1) = [4,5,9,11,15] -// (3,0) = [4,5,9,11,15] -// (3,3) = [11,15] -// (3,-3) = [0,4,5,9,11,15] -func ListGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank)}, encoder: listGenericOpEncoder} -} - -// ListGetByValueRelativeRankRangeCountOp creates a list get by value relative to rank range operation. -// Server selects list items nearest to value and greater by relative rank with a count limit. -// Server returns selected data specified by returnType. -// -// Examples for ordered list [0,4,5,9,11,15]: -// -// (value,rank,count) = [selected items] -// (5,0,2) = [5,9] -// (5,1,1) = [9] -// (5,-1,2) = [4,5] -// (3,0,1) = [4] -// (3,3,7) = [11,15] -// (3,-3,2) = [] -func ListGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType ListReturnType, ctx ...*CDTContext) *Operation { - return &Operation{opType: _CDT_READ, ctx: ctx, binName: binName, binValue: ListValue{_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE, IntegerValue(returnType), NewValue(value), IntegerValue(rank), IntegerValue(count)}, encoder: listGenericOpEncoder} -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go deleted file mode 100644 index 8a9a1611..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_list_test.go +++ /dev/null @@ -1,816 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "errors" - "math" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var _ = gg.Describe("CDT List Test", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var cdtBinName string - var list []interface{} - - gg.BeforeEach(func() { - - if !featureEnabled("cdt-list") { - gg.Skip("CDT List Tests will not run since feature is not supported by the server.") - return - } - - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtBinName = randString(10) - }) - - gg.It("should create a valid CDT List", func() { - cdtList, err := client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) - gm.Expect(cdtList).To(gm.BeNil()) - - list := []interface{}{} - for i := 1; i <= 100; i++ { - list = append(list, i) - - sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - - sz, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - } - - sz, err := client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 100)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(list)) - - sz, err = client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, list...)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(100 * 2)) - }) - - gg.It("should create a valid CDT List with persisted index", func() { - cdtBinName := "indexedList" - cdtList, err := client.Operate(wpolicy, key, - as.ListCreateWithIndexOp(cdtBinName, as.ListOrderOrdered, false), - as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 1, 2, 3, 4), - as.GetBinOp(cdtBinName), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtList).ToNot(gm.BeNil()) - gm.Expect(cdtList.Bins).ToNot(gm.BeNil()) - gm.Expect(cdtList.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, []interface{}{1, 2, 3, 4}})) - }) - - gg.Describe("CDT List Operations", func() { - - const listSize = 10 - - // make a fresh list before each operation - gg.BeforeEach(func() { - _, err = client.Delete(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - list = []interface{}{} - - for i := 1; i <= listSize; i++ { - list = append(list, i) - - sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - } - }) - - gg.It("should Get the last element", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) - }) - - gg.It("should Get the last element again", func() { - ops := []*as.Operation{as.ListGetOp(cdtBinName, -1)} - cdtListRes, err := client.Operate(wpolicy, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) - - cdtListRes, err = client.Operate(wpolicy, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize)) - }) - - gg.It("should Get the last 3 element", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, -3, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) - }) - - gg.It("should Get the from element #7 till the end of list", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{listSize - 2, listSize - 1, listSize - 0})) - }) - - gg.It("should Get by value", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByValueOp(cdtBinName, 7, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueListOp(cdtBinName, []interface{}{7, 9}, as.ListReturnTypeIndex)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 8})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeIndex)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{4, 5, 6, 7})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByValueRangeOp(cdtBinName, 5, 9, as.ListReturnTypeExists)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(true)) - }) - - gg.It("should Get by index", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByIndexOp(cdtBinName, 7, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(8)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByIndexRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) - }) - - gg.It("should Get by rank", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetByRankOp(cdtBinName, 7, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(8)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeIndex)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{7, 8, 9})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 7, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeOp(cdtBinName, 8, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetByRankRangeCountOp(cdtBinName, 5, 2, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, 7})) - }) - - gg.It("should append an element to the tail", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, math.MaxInt64)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) - }) - - gg.It("should append the same cached element to the tail", func() { - ops := []*as.Operation{as.ListAppendOp(cdtBinName, math.MaxInt64)} - cdtListRes, err := client.Operate(wpolicy, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) - - cdtListRes, err = client.Operate(wpolicy, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 2)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, listSize)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) - }) - - gg.It("should append a few elements to the tail", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} - cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, elems...)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, listSize, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) - }) - - gg.It("should append a few elements to the tail with policy", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} - cdtListRes, err := client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, elems...)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 4)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, listSize, 4)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - elems = append(elems, 0) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) - }) - - gg.It("should prepend an element to the head via ListInsertOp", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertOp(cdtBinName, 0, math.MaxInt64)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) - }) - - gg.It("should prepend an element to the head via ListInsertWithPolicyOp", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, math.MaxInt64)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListInsertWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, math.MaxInt64-1, math.MaxInt64-2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{math.MaxInt64 - 1, math.MaxInt64 - 2, math.MaxInt64, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) - }) - - gg.It("should prepend a few elements to the tail via ListInsertOp", func() { - elems := []interface{}{math.MaxInt64, math.MaxInt64 - 1, math.MaxInt64 - 2} - cdtListRes, err := client.Operate(wpolicy, key, as.ListInsertOp(cdtBinName, 0, elems...)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(listSize + 3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) - }) - - gg.It("should pop elements from the head", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListPopRangeOp(cdtBinName, 0, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:3])) - - cdtListRes, err = client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[3:])) - }) - - gg.It("should pop element range from the index", func() { - for i := listSize; i > 0; i-- { - cdtListRes, err := client.Operate(wpolicy, key, as.ListPopOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[0])) - - list = list[1:] - - // TODO: Remove the IF later when server has changed - if i > 1 { - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - } - } - }) - - gg.It("should pop elements from element #7 to the end of list", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - - cdtPopRes, err := client.Operate(wpolicy, key, as.ListPopRangeFromOp(cdtBinName, 7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtPopRes.Bins[cdtBinName]).To(gm.Equal(list[7:])) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:7])) - - }) - - gg.It("should remove elements from the head", func() { - for i := listSize; i > 0; i-- { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - list = list[1:] - - // TODO: Remove the IF later when server has changed - if i > 1 { - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - } - } - }) - - gg.It("should remove elements from element #7 to the end of list", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - - cdtRemoveRes, err := client.Operate(wpolicy, key, as.ListRemoveRangeFromOp(cdtBinName, 7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtRemoveRes.Bins[cdtBinName]).To(gm.Equal(3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list[:7])) - - }) - - gg.It("should remove elements from the head in increasing numbers", func() { - elemCount := listSize - for i := 1; i <= 4; i++ { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveRangeOp(cdtBinName, 0, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(i)) - - list = list[i:] - elemCount -= i - - // TODO: Remove the IF later when server has changed - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, elemCount)) - if elemCount > 0 { - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - } - } - }) - - gg.It("should remove elements by value", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueListOp(cdtBinName, []interface{}{1, 2, 3, 4, 5, 6, 7}, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4, 5, 6, 7})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueOp(cdtBinName, 9, as.ListReturnTypeCount)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{8, 10})) - }) - - gg.It("should remove elements by value range", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeValue, 1, 5)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{1, 2, 3, 4})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 6, 7, 8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByValueRangeOp(cdtBinName, as.ListReturnTypeCount, 6, 9)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 9, 10})) - }) - - gg.It("should remove elements by index", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListRemoveByIndexOp(cdtBinName, 0, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(4)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByIndexRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) - }) - - gg.It("should remove elements by rank", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListSortOp(cdtBinName, as.ListSortFlagsDefault)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankOp(cdtBinName, 0, as.ListReturnTypeValue)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeOp(cdtBinName, 5, as.ListReturnTypeCount)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(4)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListRemoveByRankRangeCountOp(cdtBinName, 2, 3, as.ListReturnTypeCount)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3})) - }) - - gg.It("should increment elements", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - - elemRes, err := client.Operate(wpolicy, key, as.ListIncrementOp(cdtBinName, 0, 10)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) - - elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) - - elemRes, err = client.Operate(wpolicy, key, as.ListIncrementByOneOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) - - elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) - }) - - gg.It("should increment elements with policy", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(list)) - - elemRes, err := client.Operate(wpolicy, key, as.ListIncrementWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, 10)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) - - elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(11)) - - elemRes, err = client.Operate(wpolicy, key, as.ListIncrementByOneWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) - - elemRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(12)) - }) - - gg.It("should sort elements with policy", func() { - elemRes, err := client.Operate(wpolicy, key, as.ListIncrementWithPolicyOp(as.DefaultListPolicy(), cdtBinName, 0, 100)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(elemRes.Bins[cdtBinName]).To(gm.Equal(101)) - - cdtListRes, err := client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{101, 2, 3, 4, 5, 6, 7, 8, 9, 10})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListSortOp(cdtBinName, as.ListSortFlagsDefault)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeFromOp(cdtBinName, 0)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal([]interface{}{2, 3, 4, 5, 6, 7, 8, 9, 10, 101})) - }) - - gg.It("should set elements", func() { - elems := []interface{}{} - for i := 0; i < listSize; i++ { - cdtListRes, err := client.Operate(wpolicy, key, as.ListSetOp(cdtBinName, i, math.MaxInt64)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins).To(gm.Equal(as.BinMap{})) - - elems = append(elems, math.MaxInt64) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, i+1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) - } - }) - - gg.It("should set the last element", func() { - cdtListRes, err := client.Operate(wpolicy, key, as.ListSetOp(cdtBinName, -1, math.MaxInt64)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins).To(gm.Equal(as.BinMap{})) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetOp(cdtBinName, -1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(math.MaxInt64)) - }) - - gg.It("should trim list elements", func() { - elems := []interface{}{3, 4, 5} - cdtListRes, err := client.Operate(wpolicy, key, as.ListTrimOp(cdtBinName, 2, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(7)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(3)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListGetRangeOp(cdtBinName, 0, 3)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(elems)) - }) - - gg.It("should clear list elements", func() { - for i := 0; i < listSize; i++ { - _, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - cdtListRes, err := client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).NotTo(gm.Equal(0)) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListClearOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.BeNil()) - - cdtListRes, err = client.Operate(wpolicy, key, as.ListSizeOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(0)) - }) - - gg.It("should support ListWriteFlagsPartial & ListWriteFlagsNoFail", func() { - client.Delete(nil, key) - - cdtBinName2 := cdtBinName + "2" - - list := []interface{}{0, 4, 5, 9, 9, 11, 15, 0} - - cdtListPolicy1 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsPartial|as.ListWriteFlagsNoFail) - cdtListPolicy2 := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsNoFail) - record, err := client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy1, cdtBinName, list...), - as.ListAppendWithPolicyOp(cdtListPolicy2, cdtBinName2, list...), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(6)) - gm.Expect(record.Bins[cdtBinName2]).To(gm.Equal(0)) - - list = []interface{}{11, 3} - - record, err = client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy1, cdtBinName, list...), - as.ListAppendWithPolicyOp(cdtListPolicy2, cdtBinName2, list...), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(7)) - gm.Expect(record.Bins[cdtBinName2]).To(gm.Equal(2)) - - }) - - gg.It("should support Relative GetList Ops", func() { - client.Delete(nil, key) - - list := []interface{}{0, 4, 5, 9, 11, 15} - - cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) - record, err := client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, 0, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, 1, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 5, -1, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, 0, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, 3, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeOp(cdtBinName, 3, -3, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, 0, 2, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, 1, 1, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 5, -1, 2, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, 0, 1, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, 3, 7, as.ListReturnTypeValue), - as.ListGetByValueRelativeRankRangeCountOp(cdtBinName, 3, -3, 2, as.ListReturnTypeValue), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{4, 5, 9, 11, 15}, []interface{}{11, 15}, []interface{}{0, 4, 5, 9, 11, 15}, []interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5}, []interface{}{4}, []interface{}{11, 15}, []interface{}{}})) - }) - - gg.It("should support Relative RemoveList Ops", func() { - client.Delete(nil, key) - - list := []interface{}{0, 4, 5, 9, 11, 15} - - cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) - record, err := client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), - as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, 0), - as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, 1), - as.ListRemoveByValueRelativeRankRangeOp(cdtBinName, as.ListReturnTypeValue, 5, -1), - as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 1), - as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 2), - as.ListRemoveByValueRelativeRankRangeCountOp(cdtBinName, as.ListReturnTypeValue, 3, -3, 3), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{5, 9, 11, 15}, []interface{}{}, []interface{}{4}, []interface{}{}, []interface{}{}, []interface{}{0}})) - }) - - gg.It("should support List Infinity Ops", func() { - client.Delete(nil, key) - - list := []interface{}{0, 4, 5, 9, 11, 15} - - cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) - record, err := client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), - as.ListGetByValueRangeOp(cdtBinName, 10, as.NewInfinityValue(), as.ListReturnTypeValue), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{6, []interface{}{11, 15}})) - }) - - gg.It("should support List WildCard Ops", func() { - client.Delete(nil, key) - - list := []interface{}{ - []interface{}{"John", 55}, - []interface{}{"Jim", 95}, - []interface{}{"Joe", 80}, - } - - cdtListPolicy := as.NewListPolicy(as.ListOrderOrdered, as.ListWriteFlagsDefault) - record, err := client.Operate(wpolicy, key, - as.ListAppendWithPolicyOp(cdtListPolicy, cdtBinName, list...), - as.ListGetByValueOp(cdtBinName, []interface{}{"Jim", as.NewWildCardValue()}, as.ListReturnTypeValue), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, []interface{}{[]interface{}{"Jim", 95}}})) - }) - - gg.It("should support Nested List Ops", func() { - client.Delete(nil, key) - - list := []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{1, 2, 3}, - []interface{}{6, 5, 4, 1}, - } - - err := client.Put(wpolicy, key, as.BinMap{cdtBinName: list}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(list)) - - record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxListIndex(-1)}, 11), as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ - 5, - []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{1, 2, 3}, - []interface{}{6, 5, 4, 1, 11}, - }, - })) - }) - - gg.It("should support Nested List Map Ops", func() { - client.Delete(nil, key) - - m := map[interface{}]interface{}{ - "key1": []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{13}, - }, - "key2": []interface{}{ - []interface{}{9}, - []interface{}{2, 4}, - []interface{}{6, 1, 9}, - }, - } - - err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) - - record, err = client.Operate(wpolicy, key, as.ListAppendWithPolicyContextOp(as.DefaultListPolicy(), cdtBinName, []*as.CDTContext{as.CtxMapKey(as.StringValue("key2")), as.CtxListRank(0)}, 11), as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ - 3, - map[interface{}]interface{}{ - "key1": []interface{}{ - []interface{}{7, 9, 5}, - []interface{}{13}, - }, - "key2": []interface{}{ - []interface{}{9}, - []interface{}{2, 4, 11}, - []interface{}{6, 1, 9}, - }, - }})) - }) - - gg.It("should support Create List Ops", func() { - client.Delete(nil, key) - - l1 := []as.Value{as.IntegerValue(7), as.IntegerValue(9), as.IntegerValue(5)} - l2 := []as.Value{as.IntegerValue(1), as.IntegerValue(2), as.IntegerValue(3)} - l3 := []as.Value{as.IntegerValue(6), as.IntegerValue(5), as.IntegerValue(4), as.IntegerValue(1)} - inputList := []interface{}{as.ValueArray(l1), as.ValueArray(l2), as.ValueArray(l3)} - - // Create list. - record, err := client.Operate(nil, key, - as.ListAppendWithPolicyOp(as.NewListPolicy(as.ListOrderOrdered, 0), cdtBinName, inputList...), - as.GetBinOp(cdtBinName), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Append value to new list created after the original 3 lists. - record, err = client.Operate(nil, key, - as.ListAppendWithPolicyContextOp(as.NewListPolicy(as.ListOrderOrdered, 0), cdtBinName, []*as.CDTContext{as.CtxListIndexCreate(3, as.ListOrderOrdered, false)}, as.IntegerValue(2)), - as.GetBinOp(cdtBinName), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - results := record.Bins[cdtBinName].([]interface{}) - - count := results[0] - gm.Expect(count).To(gm.Equal(1)) - - list := results[1].([]interface{}) - gm.Expect(len(list)).To(gm.Equal(4)) - - // Test last nested list. - list = list[1].([]interface{}) - gm.Expect(len(list)).To(gm.Equal(1)) - gm.Expect(list[0]).To(gm.Equal(2)) - }) - - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_map.go b/aerospike-tls/vendor-aerospike-client-go/cdt_map.go deleted file mode 100644 index 5e3c84c4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_map.go +++ /dev/null @@ -1,753 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -// Unique key map bin operations. Create map operations used by the client operate command. -// The default unique key map is unordered. -// -// The default unique key map is unordered. Valid map key types are: -// String -// Integer -// []byte -// -// The server will validate map key types in an upcoming release. -// -// All maps maintain an index and a rank. The index is the item offset from the start of the map, -// for both unordered and ordered maps. The rank is the sorted index of the value component. -// Map supports negative indexing for index and rank. -// -// Index examples: -// -// Index 0: First item in map. -// Index 4: Fifth item in map. -// Index -1: Last item in map. -// Index -3: Third to last item in map. -// Index 1 Count 2: Second and third items in map. -// Index -3 Count 3: Last three items in map. -// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. -// -// -// Rank examples: -// -// Rank 0: Item with lowest value rank in map. -// Rank 4: Fifth lowest ranked item in map. -// Rank -1: Item with highest ranked value in map. -// Rank -3: Item with third highest ranked value in map. -// Rank 1 Count 2: Second and third lowest ranked items in map. -// Rank -3 Count 3: Top three ranked items in map. -// -// -// Nested CDT operations are supported by optional CTX context arguments. Examples: -// -// bin = {key1:{key11:9,key12:4}, key2:{key21:3,key22:5}} -// Set map value to 11 for map key "key21" inside of map key "key2". -// MapOperation.put(MapPolicy.Default, "bin", StringValue("key21"), IntegerValue(11), CtxMapKey(StringValue("key2"))) -// bin result = {key1:{key11:9,key12:4},key2:{key21:11,key22:5}} -// -// bin : {key1:{key11:{key111:1},key12:{key121:5}}, key2:{key21:{"key211":7}}} -// Set map value to 11 in map key "key121" for highest ranked map ("key12") inside of map key "key1". -// MapPutOp(DefaultMapPolicy(), "bin", StringValue("key121"), IntegerValue(11), CtxMapKey(StringValue("key1")), CtxMapRank(-1)) -// bin result = {key1:{key11:{key111:1},key12:{key121:11}}, key2:{key21:{"key211":7}}} - -const ( - cdtMapOpTypeSetType = 64 - cdtMapOpTypeAdd = 65 - cdtMapOpTypeAddItems = 66 - cdtMapOpTypePut = 67 - cdtMapOpTypePutItems = 68 - cdtMapOpTypeReplace = 69 - cdtMapOpTypeReplaceItems = 70 - cdtMapOpTypeIncrement = 73 - cdtMapOpTypeDecrement = 74 - cdtMapOpTypeClear = 75 - cdtMapOpTypeRemoveByKey = 76 - cdtMapOpTypeRemoveByIndex = 77 - cdtMapOpTypeRemoveByRank = 79 - cdtMapOpTypeRemoveKeyList = 81 - cdtMapOpTypeRemoveByValue = 82 - cdtMapOpTypeRemoveValueList = 83 - cdtMapOpTypeRemoveByKeyInterval = 84 - cdtMapOpTypeRemoveByIndexRange = 85 - cdtMapOpTypeRemoveByValueInterval = 86 - cdtMapOpTypeRemoveByRankRange = 87 - cdtMapOpTypeRemoveByKeyRelIndexRange = 88 - cdtMapOpTypeRemoveByValueRelRankRange = 89 - cdtMapOpTypeSize = 96 - cdtMapOpTypeGetByKey = 97 - cdtMapOpTypeGetByIndex = 98 - cdtMapOpTypeGetByRank = 100 - cdtMapOpTypeGetByValue = 102 - cdtMapOpTypeGetByKeyInterval = 103 - cdtMapOpTypeGetByIndexRange = 104 - cdtMapOpTypeGetByValueInterval = 105 - cdtMapOpTypeGetByRankRange = 106 - cdtMapOpTypeGetByKeyList = 107 - cdtMapOpTypeGetByValueList = 108 - cdtMapOpTypeGetByKeyRelIndexRange = 109 - cdtMapOpTypeGetByValueRelRankRange = 110 -) - -type mapOrderType struct { - attr int - flag int -} - -// MapOrder defines map storage order. -var MapOrder = struct { - // Map is not ordered. This is the default. - UNORDERED mapOrderType // 0 - - // Order map by key. - KEY_ORDERED mapOrderType // 1 - - // Order map by key, then value. - KEY_VALUE_ORDERED mapOrderType // 3 -}{mapOrderType{0, 0x40}, mapOrderType{1, 0x80}, mapOrderType{3, 0xc0}} - -type mapReturnType int - -// MapReturnTypes exports the type of individual MapReturnType values -type MapReturnTypes = mapReturnType - -// MapOrderTypes exports the type of individual MapOrderType values -type MapOrderTypes = mapOrderType - -// MapWriteModes exports the type of individual MapWriteMode values -type MapWriteModes = mapWriteMode - -// MapReturnType defines the map return type. -// Type of data to return when selecting or removing items from the map. -var MapReturnType = struct { - // NONE will will not return a result. - NONE mapReturnType - - // INDEX will return key index order. - // - // 0 = first key - // N = Nth key - // -1 = last key - INDEX mapReturnType - - // REVERSE_INDEX will return reverse key order. - // - // 0 = last key - // -1 = first key - REVERSE_INDEX mapReturnType - - // RANK will return value order. - // - // 0 = smallest value - // N = Nth smallest value - // -1 = largest value - RANK mapReturnType - - // REVERSE_RANK will return reverse value order. - // - // 0 = largest value - // N = Nth largest value - // -1 = smallest value - REVERSE_RANK mapReturnType - - // COUNT will return count of items selected. - COUNT mapReturnType - - // KEY will return key for single key read and key list for range read. - KEY mapReturnType - - // VALUE will return value for single key read and value list for range read. - VALUE mapReturnType - - // KEY_VALUE will return key/value items. The possible return types are: - // - // map[interface{}]interface{} : Returned for unordered maps - // []MapPair : Returned for range results where range order needs to be preserved. - KEY_VALUE mapReturnType - - // EXISTS returns true if count > 0. - EXISTS mapReturnType - - // UNORDERED_MAP returns an unordered map. - UNORDERED_MAP mapReturnType - - // ORDERED_MAP returns an ordered map. - ORDERED_MAP mapReturnType - - // INVERTED will invert meaning of map command and return values. For example: - // MapRemoveByKeyRange(binName, keyBegin, keyEnd, MapReturnType.KEY | MapReturnType.INVERTED) - // With the INVERTED flag enabled, the keys outside of the specified key range will be removed and returned. - INVERTED mapReturnType -}{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 13, 16, 17, 0x10000, -} - -// Unique key map write type. -type mapWriteMode struct { - itemCommand int - itemsCommand int -} - -// MapWriteMode should only be used for server versions < 4.3. -// MapWriteFlags are recommended for server versions >= 4.3. -var MapWriteMode = struct { - // If the key already exists, the item will be overwritten. - // If the key does not exist, a new item will be created. - UPDATE *mapWriteMode - - // If the key already exists, the item will be overwritten. - // If the key does not exist, the write will fail. - UPDATE_ONLY *mapWriteMode - - // If the key already exists, the write will fail. - // If the key does not exist, a new item will be created. - CREATE_ONLY *mapWriteMode -}{ - &mapWriteMode{cdtMapOpTypePut, cdtMapOpTypePutItems}, - &mapWriteMode{cdtMapOpTypeReplace, cdtMapOpTypeReplaceItems}, - &mapWriteMode{cdtMapOpTypeAdd, cdtMapOpTypeAddItems}, -} - -/** - * Map write bit flags. - * Requires server versions >= 4.3. - */ -const ( - // MapWriteFlagsDefault is the Default. Allow create or update. - MapWriteFlagsDefault = 0 - - // MapWriteFlagsCreateOnly means: If the key already exists, the item will be denied. - // If the key does not exist, a new item will be created. - MapWriteFlagsCreateOnly = 1 - - // MapWriteFlagsUpdateOnly means: If the key already exists, the item will be overwritten. - // If the key does not exist, the item will be denied. - MapWriteFlagsUpdateOnly = 2 - - // MapWriteFlagsNoFail means: Do not raise error if a map item is denied due to write flag constraints. - MapWriteFlagsNoFail = 4 - - // MapWriteFlagsPartial means: Allow other valid map items to be committed if a map item is denied due to - // write flag constraints. - MapWriteFlagsPartial = 8 -) - -// MapPolicy directives when creating a map and writing map items. -type MapPolicy struct { - attributes mapOrderType - flags int - itemCommand int - itemsCommand int -} - -// NewMapPolicy creates a MapPolicy with WriteMode. Use with servers before v4.3. -func NewMapPolicy(order mapOrderType, writeMode *mapWriteMode) *MapPolicy { - return &MapPolicy{ - attributes: order, - flags: MapWriteFlagsDefault, - itemCommand: writeMode.itemCommand, - itemsCommand: writeMode.itemsCommand, - } -} - -// NewMapPolicyWithFlags creates a MapPolicy with WriteFlags. Use with servers v4.3+. -// Flags are MapWriteFlags. You can specify multiple flags by 'or'ing them together. -func NewMapPolicyWithFlags(order mapOrderType, flags int) *MapPolicy { - return &MapPolicy{ - attributes: order, - flags: flags, - itemCommand: MapWriteMode.UPDATE.itemCommand, - itemsCommand: MapWriteMode.UPDATE.itemsCommand, - } -} - -// NewMapPolicyWithFlagsAndPersistedIndex creates a MapPolicy with WriteFlags that persists -// the map index. A map index improves lookup performance, but requires more storage. A map -// index can be created for a top-level ordered map only. Nested and unordered map indexes -// are not supported. -// Use with servers v7+. -// Flags are MapWriteFlags. You can specify multiple flags by 'or'ing them together. -func NewMapPolicyWithFlagsAndPersistedIndex(order mapOrderType, flags int) *MapPolicy { - // set the persistIndex flag - order.attr |= 0x10 - return &MapPolicy{ - attributes: order, - flags: flags, - itemCommand: MapWriteMode.UPDATE.itemCommand, - itemsCommand: MapWriteMode.UPDATE.itemsCommand, - } -} - -// DefaultMapPolicy returns the default map policy -func DefaultMapPolicy() *MapPolicy { - return NewMapPolicy(MapOrder.UNORDERED, MapWriteMode.UPDATE) -} - -func newMapSetPolicyEncoder(op *Operation, packer BufferEx) (int, Error) { - return packCDTParamsAsArray(packer, cdtMapOpTypeSetType, op.ctx, op.binValue.(IntegerValue)) -} - -func newMapSetPolicy(binName string, attributes mapOrderType, ctx []*CDTContext) *Operation { - // Remove persistIndex flag for nested maps. - if len(ctx) > 0 && (attributes.attr&0x10) != 0 { - attributes.attr &= ^0x10 - } - - return &Operation{ - opType: _MAP_MODIFY, - binName: binName, - binValue: IntegerValue(attributes.attr), - ctx: ctx, - encoder: newMapSetPolicyEncoder, - } -} - -func newMapCreatePutEncoder(op *Operation, packer BufferEx) (int, Error) { - return packCDTIfcParamsAsArray(packer, int16(*op.opSubType), op.ctx, op.binValue.(ListValue)) -} - -///////////////////////// - -// MapCreateOp creates a map create operation. -// Server creates map at given context level. -func MapCreateOp(binName string, order mapOrderType, ctx []*CDTContext) *Operation { - // If context not defined, the set order for top-level bin map. - if len(ctx) == 0 { - return MapSetPolicyOp(NewMapPolicyWithFlags(order, 0), binName) - } - - return &Operation{ - opType: _MAP_MODIFY, - binName: binName, - binValue: ListValue([]interface{}{cdtMapOpTypeSetType, order.flag, IntegerValue(order.attr)}), - ctx: ctx, - encoder: cdtCreateOpEncoder, - } -} - -// MapCreateWithIndexOp creates a map create operation that persists its index. -// Server creates map at given context level. -// A map index improves lookup performance but requires more storage. -// A map index can be created for a top-level ordered map only. -// Nested and unordered map indexes are not supported. -func MapCreateWithIndexOp(binName string, order mapOrderType) *Operation { - // If context not defined, the set order for top-level bin map. - // set index persistence flag - order.attr |= 0x10 - return MapSetPolicyOp(NewMapPolicyWithFlags(order, 0), binName) -} - -// MapSetPolicyOp creates set map policy operation. -// Server sets map policy attributes. Server returns nil. -// -// The required map policy attributes can be changed after the map is created. -func MapSetPolicyOp(policy *MapPolicy, binName string, ctx ...*CDTContext) *Operation { - return newMapSetPolicy(binName, policy.attributes, ctx) -} - -// MapPutOp creates map put operation. -// Server writes key/value item to map bin and returns map size. -// -// The required map policy dictates the type of map to create when it does not exist. -// The map policy also specifies the mode used when writing items to the map. -func MapPutOp(policy *MapPolicy, binName string, key interface{}, value interface{}, ctx ...*CDTContext) *Operation { - if policy.flags != 0 { - ops := cdtMapOpTypePut - - // Replace doesn't allow map attributes because it does not create on non-existing key. - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &ops, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{key, value, IntegerValue(policy.attributes.attr), IntegerValue(policy.flags)}), - encoder: newMapCreatePutEncoder, - } - } - - if policy.itemCommand == cdtMapOpTypeReplace { - // Replace doesn't allow map attributes because it does not create on non-existing key. - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &policy.itemCommand, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{key, value}), - encoder: newMapCreatePutEncoder, - } - } - - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &policy.itemCommand, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{key, value, IntegerValue(policy.attributes.attr)}), - encoder: newMapCreatePutEncoder, - } -} - -// MapPutItemsOp creates map put items operation -// Server writes each map item to map bin and returns map size. -// -// The required map policy dictates the type of map to create when it does not exist. -// The map policy also specifies the mode used when writing items to the map. -func MapPutItemsOp(policy *MapPolicy, binName string, amap map[interface{}]interface{}, ctx ...*CDTContext) *Operation { - if policy.flags != 0 { - ops := cdtMapOpTypePutItems - - // Replace doesn't allow map attributes because it does not create on non-existing key. - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &ops, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{amap, IntegerValue(policy.attributes.attr), IntegerValue(policy.flags)}), - encoder: newCDTCreateOperationEncoder, - } - } - - if policy.itemsCommand == int(cdtMapOpTypeReplaceItems) { - // Replace doesn't allow map attributes because it does not create on non-existing key. - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &policy.itemsCommand, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{MapValue(amap)}), - encoder: newCDTCreateOperationEncoder, - } - } - - return &Operation{ - opType: _MAP_MODIFY, - opSubType: &policy.itemsCommand, - ctx: ctx, - binName: binName, - binValue: ListValue([]interface{}{MapValue(amap), IntegerValue(policy.attributes.attr)}), - encoder: newCDTCreateOperationEncoder, - } -} - -// MapIncrementOp creates map increment operation. -// Server increments values by incr for all items identified by key and returns final result. -// Valid only for numbers. -// -// The required map policy dictates the type of map to create when it does not exist. -// The map policy also specifies the mode used when writing items to the map. -func MapIncrementOp(policy *MapPolicy, binName string, key interface{}, incr interface{}, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValues2(cdtMapOpTypeIncrement, policy.attributes, binName, ctx, key, incr) -} - -// MapDecrementOp creates map decrement operation. -// Server decrements values by decr for all items identified by key and returns final result. -// Valid only for numbers. -// -// The required map policy dictates the type of map to create when it does not exist. -// The map policy also specifies the mode used when writing items to the map. -func MapDecrementOp(policy *MapPolicy, binName string, key interface{}, decr interface{}, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValues2(cdtMapOpTypeDecrement, policy.attributes, binName, ctx, key, decr) -} - -// MapClearOp creates map clear operation. -// Server removes all items in map. Server returns nil. -func MapClearOp(binName string, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValues0(cdtMapOpTypeClear, _MAP_MODIFY, binName, ctx) -} - -// MapRemoveByKeyOp creates map remove operation. -// Server removes map item identified by key and returns removed data specified by returnType. -func MapRemoveByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByKey, _MAP_MODIFY, binName, ctx, key, returnType) -} - -// MapRemoveByKeyListOp creates map remove operation. -// Server removes map items identified by keys and returns removed data specified by returnType. -func MapRemoveByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveKeyList, _MAP_MODIFY, binName, ctx, keys, returnType) -} - -// MapRemoveByKeyRangeOp creates map remove operation. -// Server removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). -// If keyBegin is nil, the range is less than keyEnd. -// If keyEnd is nil, the range is greater than equal to keyBegin. -// -// Server returns removed data specified by returnType. -func MapRemoveByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByKeyInterval, _MAP_MODIFY, binName, ctx, keyBegin, keyEnd, returnType) -} - -// MapRemoveByValueOp creates map remove operation. -// Server removes map items identified by value and returns removed data specified by returnType. -func MapRemoveByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByValue, _MAP_MODIFY, binName, ctx, value, returnType) -} - -// MapRemoveByValueListOp creates map remove operation. -// Server removes map items identified by values and returns removed data specified by returnType. -func MapRemoveByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValuesN(cdtMapOpTypeRemoveValueList, _MAP_MODIFY, binName, ctx, values, returnType) -} - -// MapRemoveByValueRangeOp creates map remove operation. -// Server removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// -// Server returns removed data specified by returnType. -func MapRemoveByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByValueInterval, _MAP_MODIFY, binName, ctx, valueBegin, valueEnd, returnType) -} - -// MapRemoveByValueRelativeRankRangeOp creates a map remove by value relative to rank range operation. -// Server removes map items nearest to value and greater by relative rank. -// Server returns removed data specified by returnType. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// (value,rank) = [removed items] -// (11,1) = [{0=17}] -// (11,-1) = [{9=10},{5=15},{0=17}] -func MapRemoveByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateRangeOperation(cdtMapOpTypeRemoveByValueRelRankRange, _MAP_MODIFY, binName, ctx, value, rank, returnType) -} - -// MapRemoveByValueRelativeRankRangeCountOp creates a map remove by value relative to rank range operation. -// Server removes map items nearest to value and greater by relative rank with a count limit. -// Server returns removed data specified by returnType (See MapReturnType). -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// (value,rank,count) = [removed items] -// (11,1,1) = [{0=17}] -// (11,-1,1) = [{9=10}] -func MapRemoveByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeRemoveByValueRelRankRange, _MAP_MODIFY, binName, ctx, NewValue(value), rank, count, returnType) -} - -// MapRemoveByIndexOp creates map remove operation. -// Server removes map item identified by index and returns removed data specified by returnType. -func MapRemoveByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByIndex, _MAP_MODIFY, binName, ctx, index, returnType) -} - -// MapRemoveByIndexRangeOp creates map remove operation. -// Server removes map items starting at specified index to the end of map and returns removed -// data specified by returnType. -func MapRemoveByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByIndexRange, _MAP_MODIFY, binName, ctx, index, returnType) -} - -// MapRemoveByIndexRangeCountOp creates map remove operation. -// Server removes "count" map items starting at specified index and returns removed data specified by returnType. -func MapRemoveByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationIndexCount(cdtMapOpTypeRemoveByIndexRange, _MAP_MODIFY, binName, ctx, index, count, returnType) -} - -// MapRemoveByRankOp creates map remove operation. -// Server removes map item identified by rank and returns removed data specified by returnType. -func MapRemoveByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeRemoveByRank, _MAP_MODIFY, binName, ctx, rank, returnType) -} - -// MapRemoveByRankRangeOp creates map remove operation. -// Server removes map items starting at specified rank to the last ranked item and returns removed -// data specified by returnType. -func MapRemoveByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationIndex(cdtMapOpTypeRemoveByRankRange, _MAP_MODIFY, binName, ctx, rank, returnType) -} - -// MapRemoveByRankRangeCountOp creates map remove operation. -// Server removes "count" map items starting at specified rank and returns removed data specified by returnType. -func MapRemoveByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationIndexCount(cdtMapOpTypeRemoveByRankRange, _MAP_MODIFY, binName, ctx, rank, count, returnType) -} - -// MapRemoveByKeyRelativeIndexRangeOp creates a map remove by key relative to index range operation. -// Server removes map items nearest to key and greater by index. -// Server returns removed data specified by returnType. -// -// Examples for map [{0=17},{4=2},{5=15},{9=10}]: -// -// (value,index) = [removed items] -// (5,0) = [{5=15},{9=10}] -// (5,1) = [{9=10}] -// (5,-1) = [{4=2},{5=15},{9=10}] -// (3,2) = [{9=10}] -// (3,-2) = [{0=17},{4=2},{5=15},{9=10}] -func MapRemoveByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeRemoveByKeyRelIndexRange, _MAP_MODIFY, binName, ctx, NewValue(key), index, returnType) -} - -// MapRemoveByKeyRelativeIndexRangeCountOp creates map remove by key relative to index range operation. -// Server removes map items nearest to key and greater by index with a count limit. -// Server returns removed data specified by returnType. -// -// Examples for map [{0=17},{4=2},{5=15},{9=10}]: -// -// (value,index,count) = [removed items] -// (5,0,1) = [{5=15}] -// (5,1,2) = [{9=10}] -// (5,-1,1) = [{4=2}] -// (3,2,1) = [{9=10}] -// (3,-2,2) = [{0=17}] -func MapRemoveByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeRemoveByKeyRelIndexRange, _MAP_MODIFY, binName, ctx, NewValue(key), index, count, returnType) -} - -// MapSizeOp creates map size operation. -// Server returns size of map. -func MapSizeOp(binName string, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValues0(cdtMapOpTypeSize, _MAP_READ, binName, ctx) -} - -// MapGetByKeyOp creates map get by key operation. -// Server selects map item identified by key and returns selected data specified by returnType. -func MapGetByKeyOp(binName string, key interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByKey, _MAP_READ, binName, ctx, key, returnType) -} - -// MapGetByKeyRangeOp creates map get by key range operation. -// Server selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). -// If keyBegin is nil, the range is less than keyEnd. -// If keyEnd is nil, the range is greater than equal to keyBegin. -// -// Server returns selected data specified by returnType. -func MapGetByKeyRangeOp(binName string, keyBegin interface{}, keyEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateRangeOperation(cdtMapOpTypeGetByKeyInterval, _MAP_READ, binName, ctx, keyBegin, keyEnd, returnType) -} - -// MapGetByKeyRelativeIndexRangeOp creates a map get by key relative to index range operation. -// Server selects map items nearest to key and greater by index. -// Server returns selected data specified by returnType. -// -// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: -// -// (value,index) = [selected items] -// (5,0) = [{5=15},{9=10}] -// (5,1) = [{9=10}] -// (5,-1) = [{4=2},{5=15},{9=10}] -// (3,2) = [{9=10}] -// (3,-2) = [{0=17},{4=2},{5=15},{9=10}] -func MapGetByKeyRelativeIndexRangeOp(binName string, key interface{}, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeGetByKeyRelIndexRange, _MAP_READ, binName, ctx, NewValue(key), index, returnType) -} - -// MapGetByKeyRelativeIndexRangeCountOp creates a map get by key relative to index range operation. -// Server selects map items nearest to key and greater by index with a count limit. -// Server returns selected data specified by returnType (See MapReturnType). -// -// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: -// -// (value,index,count) = [selected items] -// (5,0,1) = [{5=15}] -// (5,1,2) = [{9=10}] -// (5,-1,1) = [{4=2}] -// (3,2,1) = [{9=10}] -// (3,-2,2) = [{0=17}] -func MapGetByKeyRelativeIndexRangeCountOp(binName string, key interface{}, index, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeGetByKeyRelIndexRange, _MAP_READ, binName, ctx, NewValue(key), index, count, returnType) -} - -// MapGetByKeyListOp creates a map get by key list operation. -// Server selects map items identified by keys and returns selected data specified by returnType. -func MapGetByKeyListOp(binName string, keys []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByKeyList, _MAP_READ, binName, ctx, keys, returnType) -} - -// MapGetByValueOp creates map get by value operation. -// Server selects map items identified by value and returns selected data specified by returnType. -func MapGetByValueOp(binName string, value interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByValue, _MAP_READ, binName, ctx, value, returnType) -} - -// MapGetByValueRangeOp creates map get by value range operation. -// Server selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// -// Server returns selected data specified by returnType. -func MapGetByValueRangeOp(binName string, valueBegin interface{}, valueEnd interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateRangeOperation(cdtMapOpTypeGetByValueInterval, _MAP_READ, binName, ctx, valueBegin, valueEnd, returnType) -} - -// MapGetByValueRelativeRankRangeOp creates a map get by value relative to rank range operation. -// Server selects map items nearest to value and greater by relative rank. -// Server returns selected data specified by returnType. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// (value,rank) = [selected items] -// (11,1) = [{0=17}] -// (11,-1) = [{9=10},{5=15},{0=17}] -func MapGetByValueRelativeRankRangeOp(binName string, value interface{}, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndex(cdtMapOpTypeGetByValueRelRankRange, _MAP_READ, binName, ctx, NewValue(value), rank, returnType) -} - -// MapGetByValueRelativeRankRangeCountOp creates a map get by value relative to rank range operation. -// Server selects map items nearest to value and greater by relative rank with a count limit. -// Server returns selected data specified by returnType. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// (value,rank,count) = [selected items] -// (11,1,1) = [{0=17}] -// (11,-1,1) = [{9=10}] -func MapGetByValueRelativeRankRangeCountOp(binName string, value interface{}, rank, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTMapCreateOperationRelativeIndexCount(cdtMapOpTypeGetByValueRelRankRange, _MAP_READ, binName, ctx, NewValue(value), rank, count, returnType) -} - -// MapGetByValueListOp creates map get by value list operation. -// Server selects map items identified by values and returns selected data specified by returnType. -func MapGetByValueListOp(binName string, values []interface{}, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByValueList, _MAP_READ, binName, ctx, values, returnType) -} - -// MapGetByIndexOp creates map get by index operation. -// Server selects map item identified by index and returns selected data specified by returnType. -func MapGetByIndexOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByIndex, _MAP_READ, binName, ctx, index, returnType) -} - -// MapGetByIndexRangeOp creates map get by index range operation. -// Server selects map items starting at specified index to the end of map and returns selected -// data specified by returnType. -func MapGetByIndexRangeOp(binName string, index int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByIndexRange, _MAP_READ, binName, ctx, index, returnType) -} - -// MapGetByIndexRangeCountOp creates map get by index range operation. -// Server selects "count" map items starting at specified index and returns selected data specified by returnType. -func MapGetByIndexRangeCountOp(binName string, index int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationIndexCount(cdtMapOpTypeGetByIndexRange, _MAP_READ, binName, ctx, index, count, returnType) -} - -// MapGetByRankOp creates map get by rank operation. -// Server selects map item identified by rank and returns selected data specified by returnType. -func MapGetByRankOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByRank, _MAP_READ, binName, ctx, rank, returnType) -} - -// MapGetByRankRangeOp creates map get by rank range operation. -// Server selects map items starting at specified rank to the last ranked item and returns selected -// data specified by returnType. -func MapGetByRankRangeOp(binName string, rank int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationValue1(cdtMapOpTypeGetByRankRange, _MAP_READ, binName, ctx, rank, returnType) -} - -// MapGetByRankRangeCountOp creates map get by rank range operation. -// Server selects "count" map items starting at specified rank and returns selected data specified by returnType. -func MapGetByRankRangeCountOp(binName string, rank int, count int, returnType mapReturnType, ctx ...*CDTContext) *Operation { - return newCDTCreateOperationIndexCount(cdtMapOpTypeGetByRankRange, _MAP_READ, binName, ctx, rank, count, returnType) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go b/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go deleted file mode 100644 index 5dd76084..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cdt_map_test.go +++ /dev/null @@ -1,953 +0,0 @@ -//go:build !as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -const udfCDTTests = ` -function add(rec, bin, key, value) - if not aerospike:exists(rec) then - --create record - local m1 = map() - local m2 = map() - m2[value] = key - - m1[key] = m2 -- set map to map - rec[bin] = m1 -- set map to record - --create record - return aerospike:create(rec) - end - - --record existed, let's see if key exists - local m1 = rec[bin] --get map - local m2 = m1[key] --get second map - - --did list already exist? - if m2 == nil then - m2 = map() --map didn't exist yet, let's create it - end - local doesExist = m2[value] - if doesExist ~= nil then - return 0 --value already existed, no need to update record - end - - m2[value] = key - --done setting values, let's store information back to set - m1[key] = m2 --map back to map - rec[bin] = m1 --map back to record - - return aerospike:update(rec) --..and update aerospike :) -end - ---remove from map[]map[] -function remove(rec, bin, key, value) - if not aerospike:exists(rec) then - return 0 --record does not exist, cannot remove so no error - end - - local m1 = rec[bin] - local m2 = m1[key] - if m2 == nil then - return 0 --key does not exist, cannot remove - end - - --remove key from map - local doesExist = m2[value] - if doesExist == nil then - return 0 --value does not exist - end - - map.remove(m2, value) --remove value from map - --done, let's update record with modified maps - m1[key] = m2 --back to map - rec[bin] = m1 --back to record - - return aerospike:update(rec) --and update! -end -` - -var _ = gg.Describe("CDT Map Test", func() { - - // connection data - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var cdtBinName string - // var list []interface{} - - putMode := as.DefaultMapPolicy() - addMode := as.NewMapPolicy(as.MapOrder.UNORDERED, as.MapWriteMode.CREATE_ONLY) - - gg.BeforeEach(func() { - - if !featureEnabled("cdt-map") { - gg.Skip("CDT Map Tests will not run since feature is not supported by the server.") - return - } - - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtBinName = randString(10) - }) - - gg.Describe("Simple Usecases", func() { - - gg.It("should create a valid CDT Map using MapPutOp", func() { - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutOp(putMode, cdtBinName, 1, 1), - as.MapPutOp(putMode, cdtBinName, 2, 2), - as.MapPutOp(addMode, cdtBinName, 3, 3), - as.MapPutOp(addMode, cdtBinName, 4, 4), - as.MapPutOp(addMode, cdtBinName, 6, 6), - as.MapPutOp(addMode, cdtBinName, 7, 7), - as.MapPutOp(addMode, cdtBinName, 8, 8), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key, cdtBinName) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4, 6: 6, 7: 7, 8: 8})) - }) - - gg.It("should unpack an empty Non-Ordered CDT map correctly", func() { - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutOp(putMode, cdtBinName, 1, 1), - as.MapRemoveByKeyOp(cdtBinName, 1, as.MapReturnType.NONE), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key, cdtBinName) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{})) - }) - - gg.It("should unpack an empty Ordered CDT map correctly", func() { - _, err := client.Operate(wpolicy, key, - as.MapPutOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, 1, 1), - // MapRemoveByKeyOp(cdtBinName, 1, as.MapReturnType.NONE), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rs, err := client.ScanAll(nil, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for rs := range rs.Results() { - gm.Expect(rs.Err).ToNot(gm.HaveOccurred()) - - } - - }) - - gg.It("should return the content of an Ordered CDT map correctly", func() { - items := map[interface{}]interface{}{ - "mk1": []interface{}{"v1.0", "v1.1"}, - "mk2": []interface{}{"v2.0", "v2.1"}, - } - - rec, err := client.Operate(nil, key, - as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE), "bin", items), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Operate(nil, key, - as.MapGetByKeyOp("bin", "mk1", as.MapReturnType.VALUE), - as.MapGetByKeyOp("bin", "mk2", as.MapReturnType.VALUE), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": []interface{}{[]interface{}{"v1.0", "v1.1"}, []interface{}{"v2.0", "v2.1"}}})) - - rec, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"bin": []as.MapPair{{Key: "mk1", Value: []interface{}{"v1.0", "v1.1"}}, {Key: "mk2", Value: []interface{}{"v2.0", "v2.1"}}}})) - }) - - gg.It("should create a valid CDT Map using MapPutOp", func() { - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutOp(putMode, cdtBinName, 1, 1), - as.MapPutOp(putMode, cdtBinName, 2, 2), - as.MapPutOp(addMode, cdtBinName, 3, 3), - as.MapPutOp(addMode, cdtBinName, 4, 4), - - as.GetBinOp(cdtBinName), - ) - // gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap).NotTo(gm.Equal([]interface{}{1, 2, 3, 4, 4, 4, map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4}})) - - cdtMap, err = client.Get(nil, key, cdtBinName) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(map[interface{}]interface{}{1: 1, 2: 2, 3: 3, 4: 4})) - }) - - gg.It("should create a valid CDT Map using MapPutItemsOp", func() { - addMap := map[interface{}]interface{}{ - 12: "myValue", - -8734: "str2", - 1: "my default", - } - - putMap := map[interface{}]interface{}{ - 12: "myval12222", - 13: "str13", - } - - updateMap := map[interface{}]interface{}{ - 13: "myval2", - } - - replaceMap := map[interface{}]interface{}{ - 12: 23, - -8734: "changed", - } - - putMode := as.DefaultMapPolicy() - addMode := as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.CREATE_ONLY) - updateMode := as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE_ONLY) - - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(addMode, cdtBinName, addMap), - as.MapPutItemsOp(putMode, cdtBinName, putMap), - as.MapPutItemsOp(updateMode, cdtBinName, updateMap), - as.MapPutItemsOp(updateMode, cdtBinName, replaceMap), - as.MapGetByKeyOp(cdtBinName, 1, as.MapReturnType.VALUE), - as.MapGetByKeyOp(cdtBinName, -8734, as.MapReturnType.VALUE), - as.MapGetByKeyRangeOp(cdtBinName, 12, 15, as.MapReturnType.KEY_VALUE), - // as.GetBinOp(cdtBinName), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{3, 4, 4, 4, "my default", "changed", []as.MapPair{{Key: 12, Value: 23}, {Key: 13, Value: "myval2"}}})) - - cdtMap, err = client.Get(nil, key, cdtBinName) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]as.MapPair{{Key: -8734, Value: "changed"}, {Key: 1, Value: "my default"}, {Key: 12, Value: 23}, {Key: 13, Value: "myval2"}})) - }) - - gg.It("should create a valid CDT Map using mixed MapPutOp and MapPutItemsOp", func() { - - items := map[interface{}]interface{}{ - 12: "myval", - -8734: "str2", - 1: "my default", - 7: 1, - } - - otherBinName := "other_bin" - - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, items), - as.PutOp(as.NewBin(otherBinName, "head")), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(4)) - gm.Expect(cdtMap.Bins).To(gm.HaveKey(otherBinName)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapGetByKeyOp(cdtBinName, 12, as.MapReturnType.INDEX), - as.AppendOp(as.NewBin(otherBinName, "...tail")), - as.GetBinOp(otherBinName), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: 3, "other_bin": []interface{}{nil, "head...tail"}})) // there were two operations for bin `other_bin`, so the results come back in an array - - // Should set SendKey == true for a solely read operation without getting PARAMETER_ERROR from the server - wpolicy2 := *wpolicy - wpolicy2.SendKey = true - cdtMap, err = client.Operate(&wpolicy2, key, - as.MapGetByKeyOp(cdtBinName, 12, as.MapReturnType.VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: "myval"})) - }) - - gg.It("should create a valid CDT Map and then Switch Policy For Order", func() { - - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 4, 1), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 3, 2), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 2, 3), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 1, 4), - - as.MapGetByIndexOp(cdtBinName, 2, as.MapReturnType.KEY_VALUE), - as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapSetPolicyOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName), - - as.MapGetByKeyRangeOp(cdtBinName, 3, 5, as.MapReturnType.COUNT), - as.MapGetByKeyRangeOp(cdtBinName, -5, 2, as.MapReturnType.KEY_VALUE), - as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) - - }) - - gg.It("should create a valid CDT Map and then Switch Policy For Order with Persisted Index", func() { - - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 4, 1), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 3, 2), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 2, 3), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, 1, 4), - - as.MapGetByIndexOp(cdtBinName, 2, as.MapReturnType.KEY_VALUE), - as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(1)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.Equal(2)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(3)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.Equal(4)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]as.MapPair{{Key: 3, Value: 2}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[5]).To(gm.ConsistOf([]as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}})) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapSetPolicyOp(as.NewMapPolicyWithFlagsAndPersistedIndex(as.MapOrder.KEY_ORDERED, as.MapWriteFlagsDefault), cdtBinName), - - as.MapGetByKeyRangeOp(cdtBinName, 3, 5, as.MapReturnType.COUNT), - as.MapGetByKeyRangeOp(cdtBinName, -5, 2, as.MapReturnType.KEY_VALUE), - as.MapGetByIndexRangeCountOp(cdtBinName, 0, 10, as.MapReturnType.KEY_VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{interface{}(nil), 2, []as.MapPair{{Key: 1, Value: 4}}, []as.MapPair{{Key: 1, Value: 4}, {Key: 2, Value: 3}, {Key: 3, Value: 2}, {Key: 4, Value: 1}}}})) - - }) - - gg.It("should create a valid CDT Map and then apply Inc/Dec operations and Get Correct Values", func() { - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - } - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapIncrementOp(as.DefaultMapPolicy(), cdtBinName, "John", 5), - as.MapDecrementOp(as.DefaultMapPolicy(), cdtBinName, "Jim", 4), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(nil, key, - as.MapGetByRankRangeCountOp(cdtBinName, -2, 2, as.MapReturnType.KEY), - as.MapGetByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.KEY_VALUE), - as.MapGetByRankOp(cdtBinName, 0, as.MapReturnType.VALUE), - as.MapGetByRankOp(cdtBinName, 2, as.MapReturnType.KEY), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.RANK), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.COUNT), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.KEY_VALUE), - as.MapGetByValueRangeOp(cdtBinName, 81, 82, as.MapReturnType.KEY), - as.MapGetByValueOp(cdtBinName, 77, as.MapReturnType.KEY), - as.MapGetByValueOp(cdtBinName, 81, as.MapReturnType.RANK), - as.MapGetByKeyOp(cdtBinName, "Charlie", as.MapReturnType.RANK), - as.MapGetByKeyOp(cdtBinName, "Charlie", as.MapReturnType.REVERSE_RANK), - as.MapGetByKeyListOp(cdtBinName, []interface{}{"Charlie", "Jim"}, as.MapReturnType.KEY), - as.MapGetByValueListOp(cdtBinName, []interface{}{55, 94}, as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ - []interface{}{"Harry", "Jim"}, - []as.MapPair{{Key: "Charlie", Value: 55}, {Key: "John", Value: 81}}, - 55, - "Harry", - []interface{}{3}, 1, []as.MapPair{{Key: "Jim", Value: 94}}, - []interface{}{"John"}, - []interface{}{}, - []interface{}{1}, - 0, - 3, - []interface{}{"Charlie", "Jim"}, - []interface{}{"Charlie", "Jim"}, - }})) - }) - - gg.It("should create a valid CDT Map and then Get via MapReturnType.INVERTED", func() { - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - } - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(nil, key, - as.MapGetByRankRangeCountOp(cdtBinName, -2, 2, as.MapReturnType.KEY|as.MapReturnType.INVERTED), - as.MapGetByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.KEY_VALUE|as.MapReturnType.INVERTED), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.RANK|as.MapReturnType.INVERTED), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.COUNT|as.MapReturnType.INVERTED), - as.MapGetByValueRangeOp(cdtBinName, 90, 95, as.MapReturnType.KEY_VALUE|as.MapReturnType.INVERTED), - as.MapGetByValueRangeOp(cdtBinName, 81, 82, as.MapReturnType.KEY|as.MapReturnType.INVERTED), - as.MapGetByValueOp(cdtBinName, 77, as.MapReturnType.KEY|as.MapReturnType.INVERTED), - as.MapGetByValueOp(cdtBinName, 81, as.MapReturnType.RANK|as.MapReturnType.INVERTED), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{ - []interface{}{"Charlie", "John"}, - []as.MapPair{{Key: "Harry", Value: 82}, {Key: "Jim", Value: 98}}, - []interface{}{0, 1, 2, 3}, - 4, - []as.MapPair{{Key: "Charlie", Value: 55}, {Key: "Harry", Value: 82}, {Key: "Jim", Value: 98}, {Key: "John", Value: 76}}, - []interface{}{"Charlie", "Harry", "Jim", "John"}, - []interface{}{"Charlie", "Harry", "Jim", "John"}, - []interface{}{0, 1, 2, 3}, - }})) - }) - - gg.It("should create a valid CDT Map and then execute Remove operations", func() { - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - "Sally": 79, - "Lenny": 84, - "Abe": 88, - } - - itemsToRemove := []interface{}{ - "Sally", - "UNKNOWN", - "Lenny", - } - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), - as.MapRemoveByKeyOp(cdtBinName, "NOTFOUND", as.MapReturnType.VALUE), - as.MapRemoveByKeyOp(cdtBinName, "Jim", as.MapReturnType.VALUE), - as.MapRemoveByKeyListOp(cdtBinName, itemsToRemove, as.MapReturnType.VALUE), - as.MapRemoveByValueOp(cdtBinName, 55, as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, nil, 98, []interface{}{79, 84}, []interface{}{"Charlie"}}})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[0]).To(gm.Equal(7)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[1]).To(gm.BeNil()) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[2]).To(gm.Equal(98)) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[3]).To(gm.ConsistOf([]interface{}{79, 84})) - gm.Expect(cdtMap.Bins[cdtBinName].([]interface{})[4]).To(gm.Equal([]interface{}{"Charlie"})) - }) - - }) - - gg.It("should create a valid CDT Map and then execute RemoveRange operations", func() { - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - "Sally": 79, - "Lenny": 84, - "Abe": 88, - } - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), - as.MapRemoveByKeyRangeOp(cdtBinName, "J", "K", as.MapReturnType.COUNT), - as.MapRemoveByValueRangeOp(cdtBinName, 80, 85, as.MapReturnType.COUNT), - as.MapRemoveByIndexRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.COUNT), - as.MapRemoveByRankRangeCountOp(cdtBinName, 0, 2, as.MapReturnType.COUNT), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{7, 2, 2, 2, 1}})) - }) - - gg.It("should create a valid CDT Map and then execute Clear operations", func() { - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - "Sally": 79, - "Lenny": 84, - "Abe": 88, - } - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(as.DefaultMapPolicy(), cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapClearOp(cdtBinName), - as.MapSizeOp(cdtBinName), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{nil, 0}})) - }) - - gg.It("should create a valid CDT Map and then execute RANK operations", func() { - - items := map[interface{}]interface{}{ - "p1": 0, - "p2": 0, - "p3": 0, - "p4": 0, - } - - mapPolicy := as.NewMapPolicy(as.MapOrder.KEY_VALUE_ORDERED, as.MapWriteMode.UPDATE) - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - _, err = client.Operate(wpolicy, key, - as.MapIncrementOp(mapPolicy, cdtBinName, "p1", 10), - as.MapIncrementOp(mapPolicy, cdtBinName, "p2", 20), - as.MapIncrementOp(mapPolicy, cdtBinName, "p3", 1), - as.MapIncrementOp(mapPolicy, cdtBinName, "p4", 20), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapGetByRankRangeCountOp(cdtBinName, -3, 3, as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{"p1", "p2", "p4"}})) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapRemoveByValueOp(cdtBinName, 10, as.MapReturnType.KEY), - as.MapGetByRankRangeCountOp(cdtBinName, -3, 3, as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins).To(gm.Equal(as.BinMap{cdtBinName: []interface{}{[]interface{}{"p1"}, []interface{}{"p3", "p2", "p4"}}})) - }) - - gg.It("should support MapWriteFlagsPartial & MapWriteFlagsNoFail", func() { - client.Delete(nil, key) - - cdtBinName2 := cdtBinName + "2" - items := map[interface{}]interface{}{ - 0: 17, - 4: 2, - 5: 15, - 9: 10, - } - - mapPolicy := as.DefaultMapPolicy() - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - as.MapPutItemsOp(mapPolicy, cdtBinName2, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(2)) - - cdtMapPolicy1 := as.NewMapPolicyWithFlags(as.MapOrder.UNORDERED, as.MapWriteFlagsCreateOnly|as.MapWriteFlagsPartial|as.MapWriteFlagsNoFail) - cdtMapPolicy2 := as.NewMapPolicyWithFlags(as.MapOrder.UNORDERED, as.MapWriteFlagsCreateOnly|as.MapWriteFlagsNoFail) - - items = map[interface{}]interface{}{ - 3: 3, - 5: 15, - } - - cdtMap, err = client.Operate(wpolicy, key, - as.MapPutItemsOp(cdtMapPolicy1, cdtBinName, items), - as.MapPutItemsOp(cdtMapPolicy2, cdtBinName2, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal(5)) - gm.Expect(cdtMap.Bins[cdtBinName2]).To(gm.Equal(4)) - - }) - - gg.It("should support Map Infinity ops", func() { - client.Delete(nil, key) - - items := map[interface{}]interface{}{ - 0: 17, - 4: 2, - 5: 15, - 9: 10, - } - - mapPolicy := as.DefaultMapPolicy() - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapGetByKeyRangeOp(cdtBinName, 5, as.NewInfinityValue(), as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{5, 9})) - }) - - gg.It("should support Map WildCard ops", func() { - client.Delete(nil, key) - - items := map[interface{}]interface{}{ - 4: []interface{}{"John", 55}, - 5: []interface{}{"Jim", 95}, - 9: []interface{}{"Joe", 80}, - } - - mapPolicy := as.DefaultMapPolicy() - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapGetByValueOp(cdtBinName, []interface{}{"Joe", as.NewWildCardValue()}, as.MapReturnType.KEY), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{9})) - }) - - gg.It("should support Relative MapGet ops", func() { - client.Delete(nil, key) - - items := map[interface{}]interface{}{ - 0: 17, - 4: 2, - 5: 15, - 9: 10, - } - - mapPolicy := as.DefaultMapPolicy() - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, 0, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, 1, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 5, -1, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 3, 2, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeOp(cdtBinName, 3, -2, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, 0, 1, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, 1, 2, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 5, -1, 1, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 3, 2, 1, as.MapReturnType.KEY), - as.MapGetByKeyRelativeIndexRangeCountOp(cdtBinName, 3, -2, 2, as.MapReturnType.KEY), - as.MapGetByValueRelativeRankRangeOp(cdtBinName, 11, 1, as.MapReturnType.VALUE), - as.MapGetByValueRelativeRankRangeOp(cdtBinName, 11, -1, as.MapReturnType.VALUE), - as.MapGetByValueRelativeRankRangeCountOp(cdtBinName, 11, 1, 1, as.MapReturnType.VALUE), - as.MapGetByValueRelativeRankRangeCountOp(cdtBinName, 11, -1, 1, as.MapReturnType.VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{5, 9}, []interface{}{9}, []interface{}{4, 5, 9}, []interface{}{9}, []interface{}{0, 4, 5, 9}, []interface{}{5}, []interface{}{9}, []interface{}{4}, []interface{}{9}, []interface{}{0}, []interface{}{17}, []interface{}{10, 15, 17}, []interface{}{17}, []interface{}{10}})) - }) - - gg.It("should support Relative MapRemove ops", func() { - client.Delete(nil, key) - - items := map[interface{}]interface{}{ - 0: 17, - 4: 2, - 5: 15, - 9: 10, - } - - mapPolicy := as.DefaultMapPolicy() - - // Write values to empty map. - cdtMap, err := client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cdtMap, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapRemoveByKeyRelativeIndexRangeOp(cdtBinName, 5, 0, as.MapReturnType.VALUE), - as.MapRemoveByKeyRelativeIndexRangeOp(cdtBinName, 5, 1, as.MapReturnType.VALUE), - as.MapRemoveByKeyRelativeIndexRangeCountOp(cdtBinName, 5, -1, 1, as.MapReturnType.VALUE), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{15, 10}, []interface{}{}, []interface{}{2}})) - - client.Delete(nil, key) - cdtMap, err = client.Operate(wpolicy, key, - as.MapPutItemsOp(mapPolicy, cdtBinName, items), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(cdtMap.Bins)).To(gm.Equal(1)) - - cdtMap, err = client.Operate(wpolicy, key, - as.MapRemoveByValueRelativeRankRangeOp(cdtBinName, 11, 1, as.MapReturnType.VALUE), - as.MapRemoveByValueRelativeRankRangeCountOp(cdtBinName, 11, -1, 1, as.MapReturnType.VALUE), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtMap.Bins[cdtBinName]).To(gm.Equal([]interface{}{[]interface{}{17}, []interface{}{10}})) - }) - - gg.It("should support Nested Map ops", func() { - client.Delete(nil, key) - - m := map[interface{}]interface{}{ - "key1": map[interface{}]interface{}{ - "key11": 9, "key12": 4, - }, - "key2": map[interface{}]interface{}{ - "key21": 3, "key22": 5, - }, - } - - err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) - - record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key21"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key2"))), as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ - 2, - map[interface{}]interface{}{ - "key1": map[interface{}]interface{}{ - "key11": 9, "key12": 4, - }, - "key2": map[interface{}]interface{}{ - "key21": 11, "key22": 5, - }, - }, - })) - }) - - gg.It("should support Double Nested Map ops", func() { - client.Delete(nil, key) - - m := map[interface{}]interface{}{ - "key1": map[interface{}]interface{}{ - "key11": map[interface{}]interface{}{"key111": 1}, "key12": map[interface{}]interface{}{"key121": 5}, - }, - "key2": map[interface{}]interface{}{ - "key21": map[interface{}]interface{}{"key211": 7}, - }, - } - - err := client.Put(wpolicy, key, as.BinMap{cdtBinName: m}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - record, err := client.Operate(wpolicy, key, as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal(m)) - - record, err = client.Operate(wpolicy, key, as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, as.StringValue("key121"), as.IntegerValue(11), as.CtxMapKey(as.StringValue("key1")), as.CtxMapRank(-1)), as.GetBinOp(cdtBinName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(record.Bins[cdtBinName]).To(gm.Equal([]interface{}{ - 1, - map[interface{}]interface{}{ - "key1": map[interface{}]interface{}{ - "key11": map[interface{}]interface{}{"key111": 1}, "key12": map[interface{}]interface{}{"key121": 11}, - }, - "key2": map[interface{}]interface{}{ - "key21": map[interface{}]interface{}{"key211": 7}, - }, - }, - })) - }) - - gg.It("should handle CDTs in UDFs", func() { - - registerUDF(udfCDTTests, "cdt_tests.lua") - - _, err = client.Execute(nil, key, "cdt_tests", "add", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - sets, err := client.ScanAll(nil, ns, "skill") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"b": map[interface{}]interface{}{"k": map[interface{}]interface{}{1: "k"}}})) - - for res := range sets.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - _, err = client.Delete(nil, res.Record.Key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - _, err = client.Execute(nil, key, "cdt_tests", "add", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Execute(nil, key, "cdt_tests", "remove", as.NewValue("b"), as.NewValue("k"), as.NewValue(1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"b": map[interface{}]interface{}{"k": map[interface{}]interface{}{}}})) - - sets, err = client.ScanAll(nil, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for res := range sets.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - _, err = client.Delete(nil, res.Record.Key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - gg.It("should handle Map Create gg.Context", func() { - // Key key = new Key(args.namespace, args.set, "opmkey22"); - client.Delete(nil, key) - - m1 := map[string]int{"key11": 9, "key12": 4} - m2 := map[string]int{"key21": 3, "key22": 5} - inputMap := map[string]interface{}{"key1": m1, "key2": m2} - - // Create maps. - err := client.Put(nil, key, as.BinMap{cdtBinName: inputMap}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Set map value to 11 for map key "key21" inside of map key "key2" - // and retrieve all maps. - record, err := client.Operate(nil, key, - as.MapCreateOp(cdtBinName, as.MapOrder.KEY_ORDERED, []*as.CDTContext{as.CtxMapKey(as.StringValue("key3"))}), - as.MapPutOp(as.DefaultMapPolicy(), cdtBinName, "key31", 99, as.CtxMapKey(as.StringValue("key3"))), - as.GetBinOp(cdtBinName), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - results := record.Bins[cdtBinName].([]interface{}) - - count := results[1] - gm.Expect(count).To(gm.Equal(1)) - - m := results[2].(map[interface{}]interface{}) - gm.Expect(len(m)).To(gm.Equal(3)) - - mp := m["key3"].([]as.MapPair) - - gm.Expect(len(mp)).To(gm.Equal(1)) - gm.Expect(mp[0].Key).To(gm.Equal("key31")) - gm.Expect(mp[0].Value).To(gm.Equal(99)) - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/client.go b/aerospike-tls/vendor-aerospike-client-go/client.go deleted file mode 100644 index 60062cbb..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client.go +++ /dev/null @@ -1,1925 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "os" - "regexp" - "runtime" - "strconv" - "strings" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const unreachable = "UNREACHABLE" - -// Client encapsulates an Aerospike cluster. -// All database operations are available against this object. -type Client struct { - cluster *Cluster - - // DefaultPolicy is used for all read commands without a specific policy. - DefaultPolicy *BasePolicy - // DefaultBatchPolicy is the default parent policy used in batch read commands. Base policy fields - // include socketTimeout, totalTimeout, maxRetries, etc... - DefaultBatchPolicy *BatchPolicy - // DefaultBatchReadPolicy is the default read policy used in batch operate commands. - DefaultBatchReadPolicy *BatchReadPolicy - // DefaultBatchWritePolicy is the default write policy used in batch operate commands. - // Write policy fields include generation, expiration, durableDelete, etc... - DefaultBatchWritePolicy *BatchWritePolicy - // DefaultBatchDeletePolicy is the default delete policy used in batch delete commands. - DefaultBatchDeletePolicy *BatchDeletePolicy - // DefaultBatchUDFPolicy is the default user defined function policy used in batch UDF execute commands. - DefaultBatchUDFPolicy *BatchUDFPolicy - // DefaultWritePolicy is used for all write commands without a specific policy. - DefaultWritePolicy *WritePolicy - // DefaultScanPolicy is used for all scan commands without a specific policy. - DefaultScanPolicy *ScanPolicy - // DefaultQueryPolicy is used for all query commands without a specific policy. - DefaultQueryPolicy *QueryPolicy - // DefaultAdminPolicy is used for all security commands without a specific policy. - DefaultAdminPolicy *AdminPolicy - // DefaultInfoPolicy is used for all info commands without a specific policy. - DefaultInfoPolicy *InfoPolicy -} - -func clientFinalizer(f *Client) { - f.Close() -} - -//------------------------------------------------------- -// Constructors -//------------------------------------------------------- - -// NewClient generates a new Client instance. -// The connection pool after connecting to the database is initially empty, -// and connections are established on a per need basis, which can be slow and -// time out some initial commands. -// It is recommended to call the client.WarmUp() method right after connecting to the database -// to fill up the connection pool to the required service level. -func NewClient(hostname string, port int) (*Client, Error) { - return NewClientWithPolicyAndHost(NewClientPolicy(), NewHost(hostname, port)) -} - -// NewClientWithPolicy generates a new Client using the specified ClientPolicy. -// If the policy is nil, the default relevant policy will be used. -// The connection pool after connecting to the database is initially empty, -// and connections are established on a per need basis, which can be slow and -// time out some initial commands. -// It is recommended to call the client.WarmUp() method right after connecting to the database -// to fill up the connection pool to the required service level. -func NewClientWithPolicy(policy *ClientPolicy, hostname string, port int) (*Client, Error) { - return NewClientWithPolicyAndHost(policy, NewHost(hostname, port)) -} - -// NewClientWithPolicyAndHost generates a new Client with the specified ClientPolicy and -// sets up the cluster using the provided hosts. -// If the policy is nil, the default relevant policy will be used. -// The connection pool after connecting to the database is initially empty, -// and connections are established on a per need basis, which can be slow and -// time out some initial commands. -// It is recommended to call the client.WarmUp() method right after connecting to the database -// to fill up the connection pool to the required service level. -func NewClientWithPolicyAndHost(policy *ClientPolicy, hosts ...*Host) (*Client, Error) { - if policy == nil { - policy = NewClientPolicy() - } - - cluster, err := NewCluster(policy, hosts) - if err != nil && policy.FailIfNotConnected { - logger.Logger.Debug("Failed to connect to host(s): %v; error: %s", hosts, err) - return nil, err - } - - client := &Client{ - cluster: cluster, - DefaultPolicy: NewPolicy(), - DefaultBatchPolicy: NewBatchPolicy(), - DefaultBatchReadPolicy: NewBatchReadPolicy(), - DefaultBatchWritePolicy: NewBatchWritePolicy(), - DefaultBatchDeletePolicy: NewBatchDeletePolicy(), - DefaultBatchUDFPolicy: NewBatchUDFPolicy(), - DefaultWritePolicy: NewWritePolicy(0, 0), - DefaultScanPolicy: NewScanPolicy(), - DefaultQueryPolicy: NewQueryPolicy(), - DefaultAdminPolicy: NewAdminPolicy(), - DefaultInfoPolicy: NewInfoPolicy(), - } - - runtime.SetFinalizer(client, clientFinalizer) - return client, err -} - -//------------------------------------------------------- -// Policy methods -//------------------------------------------------------- - -// DefaultPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultPolicy() *BasePolicy { - return clnt.DefaultPolicy -} - -// DefaultBatchPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultBatchPolicy() *BatchPolicy { - return clnt.DefaultBatchPolicy -} - -// DefaultBatchWritePolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultBatchWritePolicy() *BatchWritePolicy { - return clnt.DefaultBatchWritePolicy -} - -// DefaultBatchReadPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultBatchReadPolicy() *BatchReadPolicy { - return clnt.DefaultBatchReadPolicy -} - -// DefaultBatchDeletePolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultBatchDeletePolicy() *BatchDeletePolicy { - return clnt.DefaultBatchDeletePolicy -} - -// DefaultBatchUDFPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultBatchUDFPolicy() *BatchUDFPolicy { - return clnt.DefaultBatchUDFPolicy -} - -// DefaultWritePolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultWritePolicy() *WritePolicy { - return clnt.DefaultWritePolicy -} - -// DefaultScanPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultScanPolicy() *ScanPolicy { - return clnt.DefaultScanPolicy -} - -// DefaultQueryPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultQueryPolicy() *QueryPolicy { - return clnt.DefaultQueryPolicy -} - -// DefaultAdminPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultAdminPolicy() *AdminPolicy { - return clnt.DefaultAdminPolicy -} - -// DefaultInfoPolicy returns corresponding default policy from the client -func (clnt *Client) GetDefaultInfoPolicy() *InfoPolicy { - return clnt.DefaultInfoPolicy -} - -// DefaultPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultPolicy(policy *BasePolicy) { - clnt.DefaultPolicy = policy -} - -// DefaultBatchPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultBatchPolicy(policy *BatchPolicy) { - clnt.DefaultBatchPolicy = policy -} - -// DefaultBatchWritePolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultBatchWritePolicy(policy *BatchWritePolicy) { - clnt.DefaultBatchWritePolicy = policy -} - -// DefaultBatchReadPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultBatchReadPolicy(policy *BatchReadPolicy) { - clnt.DefaultBatchReadPolicy = policy -} - -// DefaultBatchDeletePolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultBatchDeletePolicy(policy *BatchDeletePolicy) { - clnt.DefaultBatchDeletePolicy = policy -} - -// DefaultBatchUDFPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultBatchUDFPolicy(policy *BatchUDFPolicy) { - clnt.DefaultBatchUDFPolicy = policy -} - -// DefaultWritePolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultWritePolicy(policy *WritePolicy) { - clnt.DefaultWritePolicy = policy -} - -// DefaultScanPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultScanPolicy(policy *ScanPolicy) { - clnt.DefaultScanPolicy = policy -} - -// DefaultQueryPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultQueryPolicy(policy *QueryPolicy) { - clnt.DefaultQueryPolicy = policy -} - -// DefaultAdminPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultAdminPolicy(policy *AdminPolicy) { - clnt.DefaultAdminPolicy = policy -} - -// DefaultInfoPolicy returns corresponding default policy from the client -func (clnt *Client) SetDefaultInfoPolicy(policy *InfoPolicy) { - clnt.DefaultInfoPolicy = policy -} - -//------------------------------------------------------- -// Cluster Connection Management -//------------------------------------------------------- - -// Close closes all client connections to database server nodes. -func (clnt *Client) Close() { - clnt.cluster.Close() -} - -// IsConnected determines if the client is ready to talk to the database server cluster. -func (clnt *Client) IsConnected() bool { - return clnt.cluster.IsConnected() -} - -// GetNodes returns an array of active server nodes in the cluster. -func (clnt *Client) GetNodes() []*Node { - return clnt.cluster.GetNodes() -} - -// GetNodeNames returns a list of active server node names in the cluster. -func (clnt *Client) GetNodeNames() []string { - nodes := clnt.cluster.GetNodes() - names := make([]string, 0, len(nodes)) - - for _, node := range nodes { - names = append(names, node.GetName()) - } - return names -} - -//------------------------------------------------------- -// Write Record Operations -//------------------------------------------------------- - -// Put writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Put(policy *WritePolicy, key *Key, binMap BinMap) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _WRITE) - if err != nil { - return err - } - - return command.Execute() -} - -// PutBins writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This method avoids using the BinMap allocation and iteration and is lighter on GC. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _WRITE) - if err != nil { - return err - } - - return command.Execute() -} - -//------------------------------------------------------- -// Operations string -//------------------------------------------------------- - -// Append appends bin value's string to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call only works for string and []byte values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Append(policy *WritePolicy, key *Key, binMap BinMap) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _APPEND) - if err != nil { - return err - } - - return command.Execute() -} - -// AppendBins works the same as Append, but avoids BinMap allocation and iteration. -func (clnt *Client) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _APPEND) - if err != nil { - return err - } - - return command.Execute() -} - -// Prepend prepends bin value's string to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call works only for string and []byte values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _PREPEND) - if err != nil { - return err - } - - return command.Execute() -} - -// PrependBins works the same as Prepend, but avoids BinMap allocation and iteration. -func (clnt *Client) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _PREPEND) - if err != nil { - return err - } - - return command.Execute() -} - -//------------------------------------------------------- -// Arithmetic Operations -//------------------------------------------------------- - -// Add adds integer bin values to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call only works for integer values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Add(policy *WritePolicy, key *Key, binMap BinMap) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _ADD) - if err != nil { - return err - } - - return command.Execute() -} - -// AddBins works the same as Add, but avoids BinMap allocation and iteration. -func (clnt *Client) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(clnt.cluster, policy, key, bins, nil, _ADD) - if err != nil { - return err - } - - return command.Execute() -} - -//------------------------------------------------------- -// Delete Operations -//------------------------------------------------------- - -// Delete deletes a record for specified key. -// The policy specifies the transaction timeout. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Delete(policy *WritePolicy, key *Key) (bool, Error) { - policy = clnt.getUsableWritePolicy(policy) - command, err := newDeleteCommand(clnt.cluster, policy, key) - if err != nil { - return false, err - } - - err = command.Execute() - return command.Existed(), err -} - -//------------------------------------------------------- -// Touch Operations -//------------------------------------------------------- - -// Touch updates a record's metadata. -// If the record exists, the record's TTL will be reset to the -// policy's expiration. -// If the record doesn't exist, it will return an error. -func (clnt *Client) Touch(policy *WritePolicy, key *Key) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newTouchCommand(clnt.cluster, policy, key) - if err != nil { - return err - } - - return command.Execute() -} - -//------------------------------------------------------- -// Existence-Check Operations -//------------------------------------------------------- - -// Exists determine if a record key exists. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Exists(policy *BasePolicy, key *Key) (bool, Error) { - policy = clnt.getUsablePolicy(policy) - command, err := newExistsCommand(clnt.cluster, policy, key) - if err != nil { - return false, err - } - - err = command.Execute() - return command.Exists(), err -} - -// BatchExists determines if multiple record keys exist in one batch request. -// The returned boolean array is in positional order with the original key array order. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be marked true - existsArray := make([]bool, len(keys)) - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) - if err != nil { - return nil, err - } - - // pass nil to make sure it will be cloned and prepared - cmd := newBatchCommandExists(clnt, nil, policy, keys, existsArray) - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - if err != nil { - return nil, err - } - - return existsArray, err -} - -//------------------------------------------------------- -// Read Record Operations -//------------------------------------------------------- - -// Get reads a record header and bins for specified key. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) { - policy = clnt.getUsablePolicy(policy) - - command, err := newReadCommand(clnt.cluster, policy, key, binNames, nil) - if err != nil { - return nil, err - } - - if err := command.Execute(); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -// GetHeader reads a record generation and expiration only for specified key. -// Bins are not read. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) GetHeader(policy *BasePolicy, key *Key) (*Record, Error) { - policy = clnt.getUsablePolicy(policy) - - command, err := newReadHeaderCommand(clnt.cluster, policy, key) - if err != nil { - return nil, err - } - - if err := command.Execute(); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -//------------------------------------------------------- -// Batch Read Operations -//------------------------------------------------------- - -// BatchGet reads multiple record headers and bins for specified keys in one batch request. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be set to record - records := make([]*Record, len(keys)) - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) - if err != nil { - return nil, err - } - - cmd := newBatchCommandGet(clnt, nil, policy, keys, binNames, nil, records, _INFO1_READ, false) - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if err != nil && !policy.AllowPartialResults { - return nil, err - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return records, err -} - -// BatchGetOperate reads multiple records for specified keys using read operations in one batch call. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// -// If a batch request to a node fails, the entire batch is cancelled. -func (clnt *Client) BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be set to record - records := make([]*Record, len(keys)) - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) - if err != nil { - return nil, err - } - - cmd := newBatchCommandGet(clnt, nil, policy, keys, nil, ops, records, _INFO1_READ, true) - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if err != nil && !policy.AllowPartialResults { - return nil, err - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return records, err -} - -// BatchGetComplex reads multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins to be requested for each key in the batch. -// The returned records are located in the same list. -// If the BatchRead key field is not found, the corresponding record field will be nil. -// The policy can be used to specify timeouts and maximum concurrent goroutines. -// This method requires Aerospike Server version >= 3.6.0. -func (clnt *Client) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error { - policy = clnt.getUsableBatchPolicy(policy) - - cmd := newBatchIndexCommandGet(clnt, nil, policy, records, true) - - batchNodes, err := newBatchIndexNodeList(clnt.cluster, policy, records) - if err != nil { - return err - } - - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if err != nil && !policy.AllowPartialResults { - return err - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return err -} - -// BatchGetHeader reads multiple record header data for specified keys in one batch request. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be set to record - records := make([]*Record, len(keys)) - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) - if err != nil { - return nil, err - } - - cmd := newBatchCommandGet(clnt, nil, policy, keys, nil, nil, records, _INFO1_READ|_INFO1_NOBINDATA, false) - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if err != nil && !policy.AllowPartialResults { - return nil, err - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return records, err -} - -// BatchDelete deletes records for specified keys. If a key is not found, the corresponding result -// BatchRecord.ResultCode will be types.KEY_NOT_FOUND_ERROR. -// -// Requires server version 6.0+ -func (clnt *Client) BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) { - policy = clnt.getUsableBatchPolicy(policy) - deletePolicy = clnt.getUsableBatchDeletePolicy(deletePolicy) - - attr := &batchAttr{} - attr.setBatchDelete(deletePolicy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be set to record - records := make([]*BatchRecord, len(keys)) - for i := range records { - records[i] = newSimpleBatchRecord(keys[i], true) - } - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, records, true) - if err != nil { - return nil, err - } - - cmd := newBatchCommandDelete(clnt, nil, policy, deletePolicy, keys, records, attr) - _, err = clnt.batchExecute(policy, batchNodes, cmd) - return records, err -} - -// BatchOperate will read/write multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins for each key in the batch. -// The returned records are located in the same list. -// -// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. -// -// Requires server version 6.0+ -func (clnt *Client) BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error { - policy = clnt.getUsableBatchPolicy(policy) - - batchNodes, err := newBatchOperateNodeListIfc(clnt.cluster, policy, records) - if err != nil && policy.RespondAllKeys { - return err - } - - cmd := newBatchCommandOperate(clnt, nil, policy, records) - _, err = clnt.batchExecute(policy, batchNodes, cmd) - return err -} - -// BatchExecute will read/write multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins for each key in the batch. -// The returned records are located in the same list. -// -// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. -// -// Requires server version 6.0+ -func (clnt *Client) BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) { - policy = clnt.getUsableBatchPolicy(policy) - udfPolicy = clnt.getUsableBatchUDFPolicy(udfPolicy) - - attr := &batchAttr{} - attr.setBatchUDF(udfPolicy) - - // same array can be used without synchronization; - // when a key exists, the corresponding index will be set to record - records := make([]*BatchRecord, len(keys)) - for i := range records { - records[i] = newSimpleBatchRecord(keys[i], attr.hasWrite) - } - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, records, attr.hasWrite) - if err != nil { - return nil, err - } - - cmd := newBatchCommandUDF(clnt, nil, policy, udfPolicy, keys, packageName, functionName, args, records, attr) - _, err = clnt.batchExecute(policy, batchNodes, cmd) - return records, err -} - -//------------------------------------------------------- -// Generic Database Operations -//------------------------------------------------------- - -// Operate performs multiple read/write operations on a single key in one batch request. -// An example would be to add an integer value to an existing record and then -// read the result, all in one database call. -// -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) { - return clnt.operate(policy, key, false, operations...) -} - -// useOpResults is used in batch single nodes commands and should be true to return the right type for BatchOperate results -func (clnt *Client) operate(policy *WritePolicy, key *Key, useOpResults bool, operations ...*Operation) (*Record, Error) { - // TODO: Remove this method in the next major release. - policy = clnt.getUsableWritePolicy(policy) - args, err := newOperateArgs(clnt.cluster, policy, key, operations) - if err != nil { - return nil, err - } - command, err := newOperateCommand(clnt.cluster, policy, key, args, useOpResults) - if err != nil { - return nil, err - } - - if err := command.Execute(); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -//------------------------------------------------------- -// Scan Operations -//------------------------------------------------------- - -// ScanPartitions Read records in specified namespace, set and partition filter. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If partitionFilter is nil, all partitions will be scanned. -// If the policy is nil, the default relevant policy will be used. -// This method is only supported by Aerospike 4.9+ servers. -func (clnt *Client) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - var tracker *partitionTracker - if partitionFilter == nil { - tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) - } else { - tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) - } - - // result recordset - res := newRecordset(policy.RecordQueueSize, 1) - go clnt.scanPartitions(&policy, tracker, namespace, setName, res, binNames...) - - return res, nil -} - -// ScanAll reads all records in specified namespace and set from all nodes. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.ScanPartitions(apolicy, nil, namespace, setName, binNames...) -} - -// scanNodePartitions reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) scanNodePartitions(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) - - // result recordset - res := newRecordset(policy.RecordQueueSize, 1) - go clnt.scanPartitions(&policy, tracker, namespace, setName, res, binNames...) - - return res, nil -} - -// ScanNode reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.scanNodePartitions(apolicy, node, namespace, setName, binNames...) -} - -//--------------------------------------------------------------- -// User defined functions (Supported by Aerospike 3+ servers only) -//--------------------------------------------------------------- - -// RegisterUDFFromFile reads a file from file system and registers -// the containing a package user defined functions with the server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RegisterTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) { - policy = clnt.getUsableWritePolicy(policy) - udfBody, err := os.ReadFile(clientPath) - if err != nil { - return nil, newCommonError(err) - } - - return clnt.RegisterUDF(policy, udfBody, serverPath, language) -} - -// RegisterUDF registers a package containing user defined functions with server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RegisterTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) { - policy = clnt.getUsableWritePolicy(policy) - content := base64.StdEncoding.EncodeToString(udfBody) - - var strCmd bytes.Buffer - // errors are to remove errcheck warnings - // they will always be nil as stated in golang docs - strCmd.WriteString("udf-put:filename=") - strCmd.WriteString(serverPath) - strCmd.WriteString(";content=") - strCmd.WriteString(content) - strCmd.WriteString(";content-len=") - strCmd.WriteString(strconv.Itoa(len(content))) - strCmd.WriteString(";udf-type=") - strCmd.WriteString(string(language)) - strCmd.WriteString(";") - - // Send UDF to one node. That node will distribute the UDF to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) - if err != nil { - return nil, err - } - - response := responseMap[strCmd.String()] - if strings.EqualFold(response, "ok") { - return NewRegisterTask(clnt.cluster, serverPath), nil - } - - err = parseInfoErrorCode(response) - - res := make(map[string]string) - vals := strings.Split("error="+err.Error(), ";") - for _, pair := range vals { - t := strings.SplitN(pair, "=", 2) - if len(t) == 2 { - res[strings.ToLower(t[0])] = t[1] - } else if len(t) == 1 { - res[strings.ToLower(t[0])] = "" - } - } - - if _, exists := res["error"]; exists { - msg, _ := base64.StdEncoding.DecodeString(res["message"]) - return nil, newError(err.resultCode(), fmt.Sprintf("Registration failed: %s\nFile: %s\nLine: %s\nMessage: %s", - res["error"], res["file"], res["line"], msg)) - } - - // if message was not parsable - return nil, parseInfoErrorCode(response) -} - -// RemoveUDF removes a package containing user defined functions in the server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RemoveTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) { - policy = clnt.getUsableWritePolicy(policy) - var strCmd bytes.Buffer - // errors are to remove errcheck warnings - // they will always be nil as stated in golang docs - strCmd.WriteString("udf-remove:filename=") - strCmd.WriteString(udfName) - strCmd.WriteString(";") - - // Send command to one node. That node will distribute it to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) - if err != nil { - return nil, err - } - - response := responseMap[strCmd.String()] - if strings.EqualFold(response, "ok") { - return NewRemoveTask(clnt.cluster, udfName), nil - } - return nil, parseInfoErrorCode(response) -} - -// ListUDF lists all packages containing user defined functions in the server. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ListUDF(policy *BasePolicy) ([]*UDF, Error) { - policy = clnt.getUsablePolicy(policy) - - var strCmd bytes.Buffer - // errors are to remove errcheck warnings - // they will always be nil as stated in golang docs - strCmd.WriteString("udf-list") - - // Send command to one node. That node will distribute it to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) - if err != nil { - return nil, err - } - - response := responseMap[strCmd.String()] - vals := strings.Split(response, ";") - res := make([]*UDF, 0, len(vals)) - - for _, udfInfo := range vals { - if strings.Trim(udfInfo, " ") == "" { - continue - } - udfParts := strings.Split(udfInfo, ",") - - udf := &UDF{} - for _, values := range udfParts { - valueParts := strings.Split(values, "=") - if len(valueParts) == 2 { - switch valueParts[0] { - case "filename": - udf.Filename = valueParts[1] - case "hash": - udf.Hash = valueParts[1] - case "type": - udf.Language = Language(valueParts[1]) - } - } - } - res = append(res, udf) - } - - return res, nil -} - -// Execute executes a user defined function on server and return results. -// The function operates on a single record. -// The package name is used to locate the udf file location: -// -// udf file = /.lua -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) { - record, err := clnt.execute(policy, key, packageName, functionName, args...) - if err != nil { - return nil, err - } - - if record == nil || len(record.Bins) == 0 { - return nil, nil - } - - for k, v := range record.Bins { - if strings.Contains(k, "SUCCESS") { - return v, nil - } else if strings.Contains(k, "FAILURE") { - return nil, newError(ErrUDFBadResponse.ResultCode, fmt.Sprintf("%v", v)) - } - } - - return nil, ErrUDFBadResponse.err() -} - -func (clnt *Client) execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) { - policy = clnt.getUsableWritePolicy(policy) - command, err := newExecuteCommand(clnt.cluster, policy, key, packageName, functionName, NewValueArray(args)) - if err != nil { - return nil, err - } - - if err := command.Execute(); err != nil { - return nil, err - } - - return command.GetRecord(), nil -} - -//---------------------------------------------------------- -// Query/Execute (Supported by Aerospike 3+ servers only) -//---------------------------------------------------------- - -// QueryExecute applies operations on records that match the statement filter. -// Records are not returned to the client. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryExecute(policy *QueryPolicy, - writePolicy *WritePolicy, - statement *Statement, - ops ...*Operation, -) (*ExecuteTask, Error) { - - if len(statement.BinNames) > 0 { - return nil, ErrNoBinNamesAllowedInQueryExecute.err() - } - - policy = clnt.getUsableQueryPolicy(policy) - writePolicy = clnt.getUsableWritePolicy(writePolicy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - statement.prepare(false) - - var errs Error - for i := range nodes { - command := newServerCommand(nodes[i], policy, writePolicy, statement, statement.TaskId, ops) - if err := command.Execute(); err != nil { - errs = chainErrors(err, errs) - } - } - - return NewExecuteTask(clnt.cluster, statement), errs -} - -// ExecuteUDF applies user defined function on records that match the statement filter. -// Records are not returned to the client. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ExecuteUDF(policy *QueryPolicy, - statement *Statement, - packageName string, - functionName string, - functionArgs ...Value, -) (*ExecuteTask, Error) { - policy = clnt.getUsableQueryPolicy(policy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - statement.SetAggregateFunction(packageName, functionName, functionArgs, false) - - var errs Error - for i := range nodes { - command := newServerCommand(nodes[i], policy, nil, statement, statement.TaskId, nil) - if err := command.Execute(); err != nil { - errs = chainErrors(err, errs) - } - } - - return NewExecuteTask(clnt.cluster, statement), errs -} - -// ExecuteUDFNode applies user defined function on records that match the statement filter on the specified node. -// Records are not returned to the client. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ExecuteUDFNode(policy *QueryPolicy, - node *Node, - statement *Statement, - packageName string, - functionName string, - functionArgs ...Value, -) (*ExecuteTask, Error) { - policy = clnt.getUsableQueryPolicy(policy) - - if node == nil { - return nil, ErrClusterIsEmpty.err() - } - - statement.SetAggregateFunction(packageName, functionName, functionArgs, false) - - command := newServerCommand(node, policy, nil, statement, statement.TaskId, nil) - err := command.Execute() - - return NewExecuteTask(clnt.cluster, statement), err -} - -// SetXDRFilter sets XDR filter for given datacenter name and namespace. The expression filter indicates -// which records XDR should ship to the datacenter. -// Pass nil as filter to remove the current filter on the server. -func (clnt *Client) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error { - policy = clnt.getUsableInfoPolicy(policy) - - var strCmd string - if filter == nil { - strCmd = "xdr-set-filter:dc=" + datacenter + ";namespace=" + namespace + ";exp=null" - } else { - b64, err := filter.Base64() - if err != nil { - return newError(types.SERIALIZE_ERROR, "FilterExpression could not be serialized to Base64") - } - - strCmd = "xdr-set-filter:dc=" + datacenter + ";namespace=" + namespace + ";exp=" + b64 - } - - // Send command to one node. That node will distribute it to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.Timeout, strCmd) - if err != nil { - return err - } - - response := responseMap[strCmd] - if strings.EqualFold(response, "ok") { - return nil - } - - return parseInfoErrorCode(response) -} - -var infoErrRegexp = regexp.MustCompile(`(?i)(fail|error)((:|=)(?P[0-9]+))?((:|=)(?P.+))?`) - -func parseInfoErrorCode(response string) Error { - match := infoErrRegexp.FindStringSubmatch(response) - - var code = types.SERVER_ERROR - var message = response - - if len(match) > 0 { - for i, name := range infoErrRegexp.SubexpNames() { - if i != 0 && name != "" && len(match[i]) > 0 { - switch name { - case "code": - i, err := strconv.ParseInt(match[i], 10, 64) - if err == nil { - code = types.ResultCode(i) - message = types.ResultCodeToString(code) - } - case "msg": - message = match[i] - } - } - } - } - - return newError(code, message) -} - -//-------------------------------------------------------- -// Query functions (Supported by Aerospike 3+ servers only) -//-------------------------------------------------------- - -// QueryPartitions executes a query for specified partitions and returns a recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 4.9+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - var tracker *partitionTracker - if partitionFilter == nil { - tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) - } else { - tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) - } - - // result recordset - res := newRecordset(policy.RecordQueueSize, 1) - go clnt.queryPartitions(policy, tracker, statement, res) - - return res, nil -} - -// Query executes a query and returns a Recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) { - return clnt.QueryPartitions(policy, statement, nil) -} - -// QueryNode executes a query on a specific node and returns a recordset. -// The caller can concurrently pop records off the channel through the -// record channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { - return clnt.queryNodePartitions(policy, node, statement) -} - -func (clnt *Client) queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) - - // result recordset - res := newRecordset(policy.RecordQueueSize, 1) - go clnt.queryPartitions(policy, tracker, statement, res) - - return res, nil -} - -//-------------------------------------------------------- -// Index functions (Supported by Aerospike 3+ servers only) -//-------------------------------------------------------- - -// CreateIndex creates a secondary index. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// IndexTask instance. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) CreateIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType IndexType, -) (*IndexTask, Error) { - policy = clnt.getUsableWritePolicy(policy) - return clnt.CreateComplexIndex(policy, namespace, setName, indexName, binName, indexType, ICT_DEFAULT) -} - -// CreateComplexIndex creates a secondary index, with the ability to put indexes -// on bin containing complex data types, e.g: Maps and Lists. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// IndexTask instance. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) CreateComplexIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType IndexType, - indexCollectionType IndexCollectionType, - ctx ...*CDTContext, -) (*IndexTask, Error) { - policy = clnt.getUsableWritePolicy(policy) - - var strCmd bytes.Buffer - strCmd.WriteString("sindex-create:ns=") - strCmd.WriteString(namespace) - - if len(setName) > 0 { - strCmd.WriteString(";set=") - strCmd.WriteString(setName) - } - - strCmd.WriteString(";indexname=") - strCmd.WriteString(indexName) - - var bufEx *bufferEx - if len(ctx) > 0 { - sz, err := cdtContextList(ctx).packArray(nil) - if err != nil { - return nil, err - } - - bufEx = newBuffer(sz) - - _, err = cdtContextList(ctx).packArray(bufEx) - if err != nil { - return nil, err - } - - strCmd.WriteString(";context=") - s := base64.StdEncoding.EncodeToString(bufEx.Bytes()) - strCmd.WriteString(s) - } - - if indexCollectionType != ICT_DEFAULT { - strCmd.WriteString(";indextype=") - strCmd.WriteString(ictToString(indexCollectionType)) - } - - strCmd.WriteString(";indexdata=") - strCmd.WriteString(binName) - strCmd.WriteString(",") - strCmd.WriteString(string(indexType)) - - // Send index command to one node. That node will distribute the command to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) - if err != nil { - return nil, err - } - - response := responseMap[strCmd.String()] - if strings.EqualFold(response, "OK") { - // Return task that could optionally be polled for completion. - return NewIndexTask(clnt.cluster, namespace, indexName), nil - } - - return nil, parseInfoErrorCode(response) -} - -// DropIndex deletes a secondary index. It will block until index is dropped on all nodes. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) DropIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, -) Error { - policy = clnt.getUsableWritePolicy(policy) - var strCmd bytes.Buffer - strCmd.WriteString("sindex-delete:ns=") - strCmd.WriteString(namespace) - - if len(setName) > 0 { - strCmd.WriteString(";set=") - strCmd.WriteString(setName) - } - strCmd.WriteString(";indexname=") - strCmd.WriteString(indexName) - - // Send index command to one node. That node will distribute the command to other nodes. - responseMap, err := clnt.sendInfoCommand(policy.TotalTimeout, strCmd.String()) - if err != nil { - return err - } - - response := responseMap[strCmd.String()] - - if strings.EqualFold(response, "OK") { - // Return task that could optionally be polled for completion. - task := NewDropIndexTask(clnt.cluster, namespace, indexName) - return <-task.OnComplete() - } - - err = parseInfoErrorCode(response) - if err.Matches(types.INDEX_NOTFOUND) { - // Index did not previously exist. Return without error. - return nil - } - - return err -} - -// Truncate removes records in specified namespace/set efficiently. This method is many orders of magnitude -// faster than deleting records one at a time. Works with Aerospike Server versions >= 3.12. -// This asynchronous server call may return before the truncation is complete. The user can still -// write new records after the server call returns because new records will have last update times -// greater than the truncate cutoff (set at the time of truncate call). -// For more information, See https://www.aerospike.com/docs/reference/info#truncate -func (clnt *Client) Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error { - policy = clnt.getUsableInfoPolicy(policy) - - var strCmd bytes.Buffer - if len(set) > 0 { - strCmd.WriteString("truncate:namespace=") - strCmd.WriteString(namespace) - strCmd.WriteString(";set=") - strCmd.WriteString(set) - } else { - strCmd.WriteString("truncate-namespace:namespace=") - strCmd.WriteString(namespace) - } - if beforeLastUpdate != nil { - strCmd.WriteString(";lut=") - strCmd.WriteString(strconv.FormatInt(beforeLastUpdate.UnixNano(), 10)) - } - - responseMap, err := clnt.sendInfoCommand(policy.Timeout, strCmd.String()) - if err != nil { - return err - } - - response := responseMap[strCmd.String()] - if strings.EqualFold(response, "OK") { - return nil - } - - return parseInfoErrorCode(response) -} - -//------------------------------------------------------- -// User administration -//------------------------------------------------------- - -// CreateUser creates a new user with password and roles. Clear-text password will be hashed using bcrypt -// before sending to server. -func (clnt *Client) CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - hash, err := hashPassword(password) - if err != nil { - return err - } - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.createUser(conn, policy, user, hash, roles) - }) - - return err -} - -// DropUser removes a user from the cluster. -func (clnt *Client) DropUser(policy *AdminPolicy, user string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.dropUser(conn, policy, user) - }) - return err -} - -// ChangePassword changes a user's password. Clear-text password will be hashed using bcrypt before sending to server. -func (clnt *Client) ChangePassword(policy *AdminPolicy, user string, password string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - if clnt.cluster.user == "" { - return ErrInvalidUser.err() - } - - hash, err := hashPassword(password) - if err != nil { - return err - } - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - - if user == clnt.cluster.user { - // Change own password. - err = command.changePassword(conn, policy, user, clnt.cluster.Password(), hash) - } else { - // Change other user's password by user admin. - err = command.setPassword(conn, policy, user, hash) - } - }) - - if err == nil { - clnt.cluster.changePassword(user, password, hash) - } - - return err -} - -// GrantRoles adds roles to user's list of roles. -func (clnt *Client) GrantRoles(policy *AdminPolicy, user string, roles []string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.grantRoles(conn, policy, user, roles) - }) - return err -} - -// RevokeRoles removes roles from user's list of roles. -func (clnt *Client) RevokeRoles(policy *AdminPolicy, user string, roles []string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.revokeRoles(conn, policy, user, roles) - }) - - return err -} - -// QueryUser retrieves roles for a given user. -func (clnt *Client) QueryUser(policy *AdminPolicy, user string) (res *UserRoles, err Error) { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return nil, err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - res, err = command.QueryUser(conn, policy, user) - }) - return res, err -} - -// QueryUsers retrieves all users and their roles. -func (clnt *Client) QueryUsers(policy *AdminPolicy) (res []*UserRoles, err Error) { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return nil, err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - res, err = command.QueryUsers(conn, policy) - }) - return res, err -} - -// QueryRole retrieves privileges for a given role. -func (clnt *Client) QueryRole(policy *AdminPolicy, role string) (res *Role, err Error) { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return nil, err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - res, err = command.QueryRole(conn, policy, role) - }) - return res, err -} - -// QueryRoles retrieves all roles and their privileges. -func (clnt *Client) QueryRoles(policy *AdminPolicy) (res []*Role, err Error) { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return nil, err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - res, err = command.QueryRoles(conn, policy) - }) - return res, err -} - -// CreateRole creates a user-defined role. -// Quotas require server security configuration "enable-quotas" to be set to true. -// Pass 0 for quota values for no limit. -func (clnt *Client) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.createRole(conn, policy, roleName, privileges, whitelist, readQuota, writeQuota) - }) - return err -} - -// DropRole removes a user-defined role. -func (clnt *Client) DropRole(policy *AdminPolicy, roleName string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.dropRole(conn, policy, roleName) - }) - return err -} - -// GrantPrivileges grant privileges to a user-defined role. -func (clnt *Client) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.grantPrivileges(conn, policy, roleName, privileges) - }) - return err -} - -// RevokePrivileges revokes privileges from a user-defined role. -func (clnt *Client) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.revokePrivileges(conn, policy, roleName, privileges) - }) - return err -} - -// SetWhitelist sets IP address whitelist for a role. If whitelist is nil or empty, it removes existing whitelist from role. -func (clnt *Client) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.setWhitelist(conn, policy, roleName, whitelist) - }) - return err -} - -// SetQuotas sets maximum reads/writes per second limits for a role. If a quota is zero, the limit is removed. -// Quotas require server security configuration "enable-quotas" to be set to true. -// Pass 0 for quota values for no limit. -func (clnt *Client) SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { - policy = clnt.getUsableAdminPolicy(policy) - - // prepare the node.tendConn - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return err - } - - node.usingTendConn(policy.Timeout, func(conn *Connection) { - command := NewAdminCommand(nil) - err = command.setQuotas(conn, policy, roleName, readQuota, writeQuota) - }) - return err -} - -//------------------------------------------------------- -// Access Methods -//------------------------------------------------------- - -// Cluster exposes the cluster object to the user -func (clnt *Client) Cluster() *Cluster { - return clnt.cluster -} - -// String implements the Stringer interface for client -func (clnt *Client) String() string { - if clnt.cluster != nil { - return clnt.cluster.String() - } - return "" -} - -// MetricsEnabled returns true if metrics are enabled for the cluster. -func (clnt *Client) MetricsEnabled() bool { - return clnt.cluster.MetricsEnabled() -} - -// EnableMetrics enables the cluster transaction metrics gathering. -// If the parameters for the histogram in the policy are the different from the one already -// on the cluster, the metrics will be reset. -func (clnt *Client) EnableMetrics(policy *MetricsPolicy) { - clnt.cluster.EnableMetrics(policy) -} - -// DisableMetrics disables the cluster transaction metrics gathering. -func (clnt *Client) DisableMetrics() { - clnt.cluster.DisableMetrics() -} - -// Stats returns internal statistics regarding the inner state of the client and the cluster. -func (clnt *Client) Stats() (map[string]interface{}, Error) { - resStats := clnt.cluster.statsCopy() - - clusterStats := *newNodeStats(clnt.cluster.MetricsPolicy()) - for _, stats := range resStats { - clusterStats.aggregate(&stats) - } - - resStats["cluster-aggregated-stats"] = clusterStats - - b, err := json.Marshal(resStats) - if err != nil { - return nil, newCommonError(err) - } - - res := map[string]interface{}{} - err = json.Unmarshal(b, &res) - if err != nil { - return nil, newCommonError(err) - } - - res["open-connections"] = clusterStats.ConnectionsOpen.Get() - res["total-nodes"] = len(clnt.cluster.GetNodes()) - - aggstats := res["cluster-aggregated-stats"].(map[string]interface{}) - aggstats["exceeded-max-retries"] = clnt.cluster.maxRetriesExceededCount.Get() - aggstats["exceeded-total-timeout"] = clnt.cluster.totalTimeoutExceededCount.Get() - - return res, nil -} - -// WarmUp fills the connection pool with connections for all nodes. -// This is necessary on startup for high traffic programs. -// If the count is <= 0, the connection queue will be filled. -// If the count is more than the size of the pool, the pool will be filled. -// Note: One connection per node is reserved for tend operations and is not used for transactions. -func (clnt *Client) WarmUp(count int) (int, Error) { - return clnt.cluster.WarmUp(count) -} - -//------------------------------------------------------- -// Internal Methods -//------------------------------------------------------- - -func (clnt *Client) sendInfoCommand(timeout time.Duration, command string) (map[string]string, Error) { - node, err := clnt.cluster.GetRandomNode() - if err != nil { - return nil, err - } - - policy := InfoPolicy{Timeout: timeout} - return node.RequestInfo(&policy, command) -} - -//------------------------------------------------------- -// Policy Methods -//------------------------------------------------------- - -func (clnt *Client) getUsablePolicy(policy *BasePolicy) *BasePolicy { - if policy == nil { - if clnt.DefaultPolicy != nil { - return clnt.DefaultPolicy - } - return NewPolicy() - } - return policy -} - -func (clnt *Client) getUsableBatchPolicy(policy *BatchPolicy) *BatchPolicy { - if policy == nil { - if clnt.DefaultBatchPolicy != nil { - return clnt.DefaultBatchPolicy - } - return NewBatchPolicy() - } - return policy -} - -func (clnt *Client) getUsableBaseBatchWritePolicy(policy *BatchPolicy) *BatchPolicy { - if policy == nil { - if clnt.DefaultBatchPolicy != nil { - return clnt.DefaultBatchPolicy - } - return NewBatchPolicy() - } - return policy -} - -func (clnt *Client) getUsableBatchReadPolicy(policy *BatchReadPolicy) *BatchReadPolicy { - if policy == nil { - if clnt.DefaultBatchReadPolicy != nil { - return clnt.DefaultBatchReadPolicy - } - return NewBatchReadPolicy() - } - return policy -} - -func (clnt *Client) getUsableBatchWritePolicy(policy *BatchWritePolicy) *BatchWritePolicy { - if policy == nil { - if clnt.DefaultBatchWritePolicy != nil { - return clnt.DefaultBatchWritePolicy - } - return NewBatchWritePolicy() - } - return policy -} - -func (clnt *Client) getUsableBatchDeletePolicy(policy *BatchDeletePolicy) *BatchDeletePolicy { - if policy == nil { - if clnt.DefaultBatchDeletePolicy != nil { - return clnt.DefaultBatchDeletePolicy - } - return NewBatchDeletePolicy() - } - return policy -} - -func (clnt *Client) getUsableBatchUDFPolicy(policy *BatchUDFPolicy) *BatchUDFPolicy { - if policy == nil { - if clnt.DefaultBatchUDFPolicy != nil { - return clnt.DefaultBatchUDFPolicy - } - return NewBatchUDFPolicy() - } - return policy -} - -func (clnt *Client) getUsableWritePolicy(policy *WritePolicy) *WritePolicy { - if policy == nil { - if clnt.DefaultWritePolicy != nil { - return clnt.DefaultWritePolicy - } - return NewWritePolicy(0, 0) - } - return policy -} - -func (clnt *Client) getUsableScanPolicy(policy *ScanPolicy) *ScanPolicy { - if policy == nil { - if clnt.DefaultScanPolicy != nil { - return clnt.DefaultScanPolicy - } - return NewScanPolicy() - } - return policy -} - -func (clnt *Client) getUsableQueryPolicy(policy *QueryPolicy) *QueryPolicy { - if policy == nil { - if clnt.DefaultQueryPolicy != nil { - return clnt.DefaultQueryPolicy - } - return NewQueryPolicy() - } - return policy -} - -func (clnt *Client) getUsableAdminPolicy(policy *AdminPolicy) *AdminPolicy { - if policy == nil { - if clnt.DefaultAdminPolicy != nil { - return clnt.DefaultAdminPolicy - } - return NewAdminPolicy() - } - return policy -} - -func (clnt *Client) getUsableInfoPolicy(policy *InfoPolicy) *InfoPolicy { - if policy == nil { - if clnt.DefaultInfoPolicy != nil { - return clnt.DefaultInfoPolicy - } - return NewInfoPolicy() - } - return policy -} - -//------------------------------------------------------- -// Utility Functions -//------------------------------------------------------- diff --git a/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go b/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go deleted file mode 100644 index 180445cf..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_appengine_exclusions.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "sync" - - "golang.org/x/sync/semaphore" - - lualib "github.com/aerospike/aerospike-client-go/v7/internal/lua" - "github.com/aerospike/aerospike-client-go/v7/logger" - lua "github.com/yuin/gopher-lua" -) - -//-------------------------------------------------------- -// Query Aggregate functions (Supported by Aerospike 3+ servers only) -//-------------------------------------------------------- - -// SetLuaPath sets the Lua interpreter path to files -// This path is used to load UDFs for QueryAggregate command -func SetLuaPath(lpath string) { - lualib.SetPath(lpath) -} - -// QueryAggregate executes a Map/Reduce query and returns the results. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) { - statement.SetAggregateFunction(packageName, functionName, functionArgs, true) - - policy = clnt.getUsableQueryPolicy(policy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, ErrClusterIsEmpty.err() - } - - // results channel must be async for performance - recSet := newRecordset(policy.RecordQueueSize, len(nodes)) - - // get a lua instance - luaInstance := lualib.LuaPool.Get().(*lua.LState) - if luaInstance == nil { - return nil, ErrLuaPoolEmpty.err() - } - - // Input Channel - inputChan := make(chan interface{}, 4096) // 4096 = number of partitions - istream := lualib.NewStream(luaInstance, inputChan) - - // Output Channe; - outputChan := make(chan interface{}) - ostream := lualib.NewStream(luaInstance, outputChan) - - // results channel must be async for performance - var wg sync.WaitGroup - wg.Add(len(nodes)) - // results channel must be async for performance - maxConcurrentNodes := policy.MaxConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(nodes) - } - sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) - ctx := context.Background() - for _, node := range nodes { - // copy policies to avoid race conditions - newPolicy := *policy - command := newQueryAggregateCommand(node, &newPolicy, statement, recSet) - command.luaInstance = luaInstance - command.inputChan = inputChan - - if err := sem.Acquire(ctx, 1); err != nil { - logger.Logger.Error("Constraint Semaphore failed for QueryAggregate: %s", err.Error()) - } - go func() { - defer sem.Release(1) - defer wg.Done() - command.Execute() - }() - } - - go func() { - wg.Wait() - close(inputChan) - }() - - go func() { - // we cannot signal end and close the recordset - // while processing is still going on - // We will do it only here, after all processing is over - defer func() { - for i := 0; i < len(nodes); i++ { - recSet.signalEnd() - } - }() - - for val := range outputChan { - recSet.records <- &Result{Record: &Record{Bins: BinMap{"SUCCESS": val}}, Err: nil} - } - }() - - go func() { - defer close(outputChan) - defer luaInstance.Close() - - err := luaInstance.DoFile(lualib.Path() + packageName + ".lua") - if err != nil { - recSet.sendError(newCommonError(err)) - return - } - - fn := luaInstance.GetGlobal(functionName) - - luaArgs := []lua.LValue{fn, lualib.NewValue(luaInstance, 2), istream, ostream} - for _, a := range functionArgs { - luaArgs = append(luaArgs, lualib.NewValue(luaInstance, unwrapValue(a))) - } - - if err := luaInstance.CallByParam(lua.P{ - Fn: luaInstance.GetGlobal("apply_stream"), - NRet: 1, - Protect: true, - }, - luaArgs..., - ); err != nil { - recSet.sendError(newCommonError(err)) - return - } - - luaInstance.Get(-1) // returned value - luaInstance.Pop(1) // remove received value - }() - - return recSet, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder.go b/aerospike-tls/vendor-aerospike-client-go/client_builder.go deleted file mode 100644 index 6e34feb1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_builder.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// ClientType determines the type of client to build. -type ClientType int - -const ( - // CTNative means: Create a native client. - CTNative ClientType = iota - - // CTProxy means: Create a proxy client. - CTProxy -) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go b/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go deleted file mode 100644 index e3f54d14..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_builder_native.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build !as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -// CreateClientWithPolicyAndHost generates a new Client of the specified type -// with the specified ClientPolicy and sets up the cluster using the provided hosts. -// If the policy is nil, the default relevant policy will be used. -func CreateClientWithPolicyAndHost(typ ClientType, policy *ClientPolicy, hosts ...*Host) (ClientIfc, Error) { - if len(hosts) == 0 { - return nil, newError(types.SERVER_NOT_AVAILABLE, "No hosts were provided") - } - - switch typ { - case CTNative: - return NewClientWithPolicyAndHost(policy, hosts...) - case CTProxy: - return nil, newError(types.GRPC_ERROR, "Proxy client mode not enabled. Pass -tags as_proxy during build") - } - return nil, newError(types.SERVER_NOT_AVAILABLE, "Invalid client type") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go b/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go deleted file mode 100644 index de7f58bd..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_builder_proxy.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -// CreateClientWithPolicyAndHost generates a new Client of the specified type -// with the specified ClientPolicy and sets up the cluster using the provided hosts. -// If the policy is nil, the default relevant policy will be used. -func CreateClientWithPolicyAndHost(typ ClientType, policy *ClientPolicy, hosts ...*Host) (ClientIfc, Error) { - if len(hosts) == 0 { - return nil, newError(types.SERVER_NOT_AVAILABLE, "No hosts were provided") - } - - switch typ { - case CTNative: - return NewClientWithPolicyAndHost(policy, hosts...) - case CTProxy: - if len(hosts) > 1 { - return nil, newError(types.GRPC_ERROR, "Only one proxy host is acceptable") - } - return NewProxyClientWithPolicyAndHost(policy, hosts[0]) - } - return nil, newError(types.SERVER_NOT_AVAILABLE, "Invalid client type") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc.go deleted file mode 100644 index 7cfe2a1a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_ifc.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build !as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go deleted file mode 100644 index 310bb050..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build !as_performance && app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchReadPolicy() *BatchReadPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchReadPolicy(*BatchReadPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go deleted file mode 100644 index e2ccaa8c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_ifc_app_engine_perf.go +++ /dev/null @@ -1,139 +0,0 @@ -//go:build as_performance && app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - // QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go b/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go deleted file mode 100644 index 3e3376b6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_ifc_as_performance.go +++ /dev/null @@ -1,141 +0,0 @@ -//go:build as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// ClientIfc abstracts an Aerospike cluster. -type ClientIfc interface { - Add(policy *WritePolicy, key *Key, binMap BinMap) Error - AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Append(policy *WritePolicy, key *Key, binMap BinMap) Error - AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) - BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) - BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) - BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) - BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error - BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) - BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) - BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error - ChangePassword(policy *AdminPolicy, user string, password string) Error - Close() - Cluster() *Cluster - CreateComplexIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType, indexCollectionType IndexCollectionType, ctx ...*CDTContext) (*IndexTask, Error) - CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, Error) - CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error - CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error - Delete(policy *WritePolicy, key *Key) (bool, Error) - DropIndex(policy *WritePolicy, namespace string, setName string, indexName string) Error - DropRole(policy *AdminPolicy, roleName string) Error - DropUser(policy *AdminPolicy, user string) Error - Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) - ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - ExecuteUDFNode(policy *QueryPolicy, node *Node, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, Error) - Exists(policy *BasePolicy, key *Key) (bool, Error) - Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) - GetHeader(policy *BasePolicy, key *Key) (*Record, Error) - GetNodeNames() []string - GetNodes() []*Node - GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - GrantRoles(policy *AdminPolicy, user string, roles []string) Error - IsConnected() bool - ListUDF(policy *BasePolicy) ([]*UDF, Error) - Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) - Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error - PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Put(policy *WritePolicy, key *Key, binMap BinMap) Error - PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error - Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) - QueryExecute(policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, ops ...*Operation) (*ExecuteTask, Error) - QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) - QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) - QueryRole(policy *AdminPolicy, role string) (*Role, Error) - QueryRoles(policy *AdminPolicy) ([]*Role, Error) - QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) - QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) - RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) - RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) - RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) - RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error - RevokeRoles(policy *AdminPolicy, user string, roles []string) Error - ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) - ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error - SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error - SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error - Stats() (map[string]interface{}, Error) - String() string - Touch(policy *WritePolicy, key *Key) Error - Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error - WarmUp(count int) (int, Error) - - QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) - - // BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) - // GetObject(policy *BasePolicy, key *Key, obj interface{}) Error - // PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) - // QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) - // QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) - // ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) - // ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) - - // TODO: Synchronization here for the sake of dynamic config in the future - - getUsablePolicy(*BasePolicy) *BasePolicy - getUsableWritePolicy(*WritePolicy) *WritePolicy - getUsableScanPolicy(*ScanPolicy) *ScanPolicy - getUsableQueryPolicy(*QueryPolicy) *QueryPolicy - getUsableAdminPolicy(*AdminPolicy) *AdminPolicy - getUsableInfoPolicy(*InfoPolicy) *InfoPolicy - - getUsableBatchPolicy(*BatchPolicy) *BatchPolicy - getUsableBatchReadPolicy(*BatchReadPolicy) *BatchReadPolicy - getUsableBatchWritePolicy(*BatchWritePolicy) *BatchWritePolicy - getUsableBatchDeletePolicy(*BatchDeletePolicy) *BatchDeletePolicy - getUsableBatchUDFPolicy(*BatchUDFPolicy) *BatchUDFPolicy - - GetDefaultPolicy() *BasePolicy - GetDefaultBatchPolicy() *BatchPolicy - GetDefaultBatchReadPolicy() *BatchReadPolicy - GetDefaultBatchWritePolicy() *BatchWritePolicy - GetDefaultBatchDeletePolicy() *BatchDeletePolicy - GetDefaultBatchUDFPolicy() *BatchUDFPolicy - GetDefaultWritePolicy() *WritePolicy - GetDefaultScanPolicy() *ScanPolicy - GetDefaultQueryPolicy() *QueryPolicy - GetDefaultAdminPolicy() *AdminPolicy - GetDefaultInfoPolicy() *InfoPolicy - - SetDefaultPolicy(*BasePolicy) - SetDefaultBatchPolicy(*BatchPolicy) - SetDefaultBatchReadPolicy(*BatchReadPolicy) - SetDefaultBatchWritePolicy(*BatchWritePolicy) - SetDefaultBatchDeletePolicy(*BatchDeletePolicy) - SetDefaultBatchUDFPolicy(*BatchUDFPolicy) - SetDefaultWritePolicy(*WritePolicy) - SetDefaultScanPolicy(*ScanPolicy) - SetDefaultQueryPolicy(*QueryPolicy) - SetDefaultAdminPolicy(*AdminPolicy) - SetDefaultInfoPolicy(*InfoPolicy) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_object_test.go b/aerospike-tls/vendor-aerospike-client-go/client_object_test.go deleted file mode 100644 index 3e71cef0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_object_test.go +++ /dev/null @@ -1,1436 +0,0 @@ -//go:build !as_performance && !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "strconv" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - var nsup int - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - for _, useBoolType := range []bool{false, true} { - - gg.BeforeEach(func() { - as.UseNativeBoolTypeInReflection = useBoolType - }) - - gg.Describe("Data operations on objects", func() { - // connection data - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - - gg.BeforeEach(func() { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - type SomeBool bool - type SomeByte byte - type SomeInt int - type SomeUint uint - type SomeInt8 int8 - type SomeUint8 uint8 - type SomeInt16 int16 - type SomeUint16 uint16 - type SomeInt32 int32 - type SomeUint32 uint32 - type SomeInt64 int64 - type SomeUint64 uint64 - type SomeFloat32 float32 - type SomeFloat64 float64 - type SomeString string - - type SomeStruct struct { - A int - Self *SomeStruct - } - - type testObject struct { - TTL uint32 `asm:"ttl"` - Gen uint32 `asm:"gen"` - - Nil interface{} - NilP *int - - Bool bool - BoolP *bool - - Byte byte - ByteP *byte - - Int int - Intp *int - - Int8 int8 - Int8P *int8 - UInt8 uint8 - UInt8P *uint8 - - Int16 int16 - Int16P *int16 - UInt16 uint16 - UInt16P *uint16 - - Int32 int32 - Int32P *int32 - UInt32 uint32 - UInt32P *uint32 - - Int64 int64 - Int64P *int64 - UInt64 uint64 - UInt64P *uint64 - - F32 float32 - F32P *float32 - - F64 float64 - F64P *float64 - - String string - StringP *string - - Interface interface{} - // InterfaceP interface{} - InterfacePP *interface{} - - ByteArray []byte - ArrByteArray [][]byte - Array [3]interface{} - SliceString []string - SliceFloat64 []float64 - SliceInt []interface{} - Slice []interface{} - ArrayOfMaps [1]map[int]string - SliceOfMaps []map[int]string - ArrayOfSlices [1][]interface{} - SliceOfSlices [][]interface{} - ArrayOfArrays [1][1]interface{} - SliceOfArrays [][1]interface{} - - ArrayOfStructs [1]SomeStruct - SliceOfStructs []SomeStruct - - Map map[interface{}]interface{} - MapOfMaps map[string]map[int64]byte - MapOfSlices map[string][]byte - MapOfArrays map[string][3]byte - MapOfStructs map[string]SomeStruct - MapOfPStructs map[string]*SomeStruct - - CustomBool SomeBool - CustomBoolP *SomeBool - CustomByte SomeByte - CustomByteP *SomeByte - CustomInt SomeInt - CustomIntP *SomeInt - CustomUint SomeUint - CustomUintP *SomeUint - CustomInt8 SomeInt8 - CustomInt8P *SomeInt8 - CustomUint8 SomeUint8 - CustomUint8P *SomeUint8 - CustomInt16 SomeInt16 - CustomInt16P *SomeInt16 - CustomUint16 SomeUint16 - CustomUint16P *SomeUint16 - CustomInt32 SomeInt32 - CustomInt32P *SomeInt32 - CustomUint32 SomeUint32 - CustomUint32P *SomeUint32 - CustomInt64 SomeInt64 - CustomInt64P *SomeInt64 - CustomUint64 SomeUint64 - CustomUint64P *SomeUint64 - - CustomFloat32 SomeFloat32 - CustomFloat32P *SomeFloat32 - CustomFloat64 SomeFloat64 - CustomFloat64P *SomeFloat64 - - CustomString SomeString - CustomStringP *SomeString - - NestedObj SomeStruct - NestedObjP *testObject - EmpNestedObjP *testObject - - // Important: Used in ODMs - NestedObjSlice []SomeStruct - EmpNstdObjSlic []SomeStruct - NstdObjPSlice []*testObject - EmpNstdObjPSlc []*testObject - - // std lib type - Tm time.Time - TmP *time.Time - - Anonym struct { - SomeStruct - } - - AnonymP *struct { - SomeStruct - } - } - - type testObjectTagged struct { - TTL uint32 `asm:"ttl"` - Gen uint32 `asm:"gen"` - - Nil interface{} `as:"nil"` - NilP *int `as:"nilp"` - - Bool bool `as:"bool"` - BoolP *bool `as:"boolp"` - - Byte byte `as:"byte"` - ByteP *byte `as:"bytep"` - - Int int `as:"int"` - Intp *int `as:"intp"` - - Int8 int8 `as:"int8"` - Int8P *int8 `as:"int8p"` - UInt8 uint8 `as:"uint8"` - UInt8P *uint8 `as:"uint8p"` - - Int16 int16 `as:"int16"` - Int16P *int16 `as:"int16p"` - UInt16 uint16 `as:"uint16"` - UInt16P *uint16 `as:"uint16p"` - - Int32 int32 `as:"int32"` - Int32P *int32 `as:"int32p"` - UInt32 uint32 `as:"uint32"` - UInt32P *uint32 `as:"uint32p"` - - Int64 int64 `as:"int64"` - Int64P *int64 `as:"int64p"` - UInt64 uint64 `as:"uint64"` - UInt64P *uint64 `as:"uint64p"` - - F32 float32 `as:"f32"` - F32P *float32 `as:"f32p"` - - F64 float64 `as:"f64"` - F64P *float64 `as:"f64p"` - - String string `as:"string"` - StringP *string `as:"stringp"` - - Interface interface{} `as:"interface"` - // InterfaceP interface{} `as:"// interface"` - InterfacePP *interface{} `as:"interfacepp"` - - ByteArray []byte `as:"bytearray"` - ArrByteArray [][]byte `as:"arrbytearray"` - Array [3]interface{} `as:"array"` - SliceString []string `as:"slicestring"` - SliceFloat64 []float64 `as:"slicefloat64"` - SliceInt []interface{} `as:"sliceint"` - Slice []interface{} `as:"slice"` - - ArrayOfMaps [1]map[int]string `as:"arrayOfMaps"` - SliceOfMaps []map[int]string `as:"sliceOfMaps"` - ArrayOfSlices [1][]interface{} `as:"arrayOfSlices"` - SliceOfSlices [][]interface{} `as:"sliceOfSlices"` - ArrayOfArrays [1][1]interface{} `as:"arrayOfArrays"` - SliceOfArrays [][1]interface{} `as:"sliceOfArrays"` - ArrayOfStructs [1]SomeStruct `as:"ArrayOfStructs"` - SliceOfStructs []SomeStruct `as:"SliceOfStructs"` - - Map map[interface{}]interface{} `as:"map"` - MapOfMaps map[string]map[int64]byte `as:"mapOfMaps"` - MapOfSlices map[string][]byte `as:"mapOfSlices"` - MapOfArrays map[string][3]byte `as:"MapOfArrays"` - MapOfStructs map[string]SomeStruct `as:"mapOfStructs"` - MapOfPStructs map[string]*SomeStruct `as:"mapOfPStructs"` - - CustomBool SomeBool `as:"custombool"` - CustomBoolP *SomeBool `as:"customboolp"` - CustomByte SomeByte `as:"custombyte"` - CustomByteP *SomeByte `as:"custombytep"` - CustomInt SomeInt `as:"customint"` - CustomIntP *SomeInt `as:"customintp"` - CustomUint SomeUint `as:"customuint"` - CustomUintP *SomeUint `as:"customuintp"` - CustomInt8 SomeInt8 `as:"customint8"` - CustomInt8P *SomeInt8 `as:"customint8p"` - CustomUint8 SomeUint8 `as:"customuint8"` - CustomUint8P *SomeUint8 `as:"customuint8p"` - CustomInt16 SomeInt16 `as:"customint16"` - CustomInt16P *SomeInt16 `as:"customint16p"` - CustomUint16 SomeUint16 `as:"customuint16"` - CustomUint16P *SomeUint16 `as:"customuint16p"` - CustomInt32 SomeInt32 `as:"customint32"` - CustomInt32P *SomeInt32 `as:"customint32p"` - CustomUint32 SomeUint32 `as:"customuint32"` - CustomUint32P *SomeUint32 `as:"customuint32p"` - CustomInt64 SomeInt64 `as:"customint64"` - CustomInt64P *SomeInt64 `as:"customint64p"` - CustomUint64 SomeUint64 `as:"customuint64"` - CustomUint64P *SomeUint64 `as:"customuint64p"` - - CustomFloat32 SomeFloat32 `as:"customfloat32"` - CustomFloat32P *SomeFloat32 `as:"customfloat32p"` - CustomFloat64 SomeFloat64 `as:"customfloat64"` - CustomFloat64P *SomeFloat64 `as:"customfloat64p"` - - CustomString SomeString `as:"customstring"` - CustomStringP *SomeString `as:"customstringp"` - - NestedObj SomeStruct `as:"nestedobj"` - NestedObjP *testObject `as:"nestedobjp"` - EmpNestedObjP *testObject `as:"empnestedobj"` - - // Important: Used in ODMs `as:"// important"` - NestedObjSlice []SomeStruct `as:"nestedobjslice"` - EmpNstdObjSlic []SomeStruct `as:"empnstdobj"` - NstdObjPSlice []*testObject `as:"nstdobjpslice"` - EmpNstdObjPSlc []*testObject `as:"empnstdobjp"` - - // std lib type `as:"// std lib"` - Tm time.Time `as:"tm time."` - TmP *time.Time `as:"tmp"` - - Anonym struct { - SomeStruct - } `as:"anonym"` - - AnonymP *struct { - SomeStruct - } `as:"anonymp"` - } - - makeTestObject := func() *testObject { - bl := true - b := byte(0) - ip := 11 - p8 := int8(4) - up8 := uint8(6) - p16 := int16(8) - up16 := uint16(10) - p32 := int32(12) - up32 := uint32(14) - p64 := int64(16) - up64 := uint64(math.MaxUint64) - f32p := float32(math.MaxFloat32) - f64p := math.MaxFloat64 - str := "pointer to a string" - iface := interface{}("a string") - - ctbl := SomeBool(true) - ctb := SomeByte(100) - cti := SomeInt(math.MinInt64) - ctui := SomeUint(math.MaxInt64) - cti8 := SomeInt8(103) - ctui8 := SomeUint8(math.MaxUint8) - cti16 := SomeInt16(math.MinInt16) - ctui16 := SomeUint16(math.MaxUint16) - cti32 := SomeInt32(math.MinInt32) - ctui32 := SomeUint32(math.MaxUint32) - cti64 := SomeInt64(math.MinInt64) - ctui64 := SomeUint64(math.MaxUint64) - cf32 := SomeFloat32(math.SmallestNonzeroFloat32) - cf64 := SomeFloat64(math.SmallestNonzeroFloat64) - ctstr := SomeString("Some string") - - now := time.Now().Round(time.Nanosecond) - - return &testObject{ - Bool: true, - BoolP: &bl, - - Nil: nil, - NilP: nil, - - Byte: byte(0), - ByteP: &b, - - Int: 1, - Intp: &ip, - - Int8: 3, - Int8P: &p8, - UInt8: 5, - UInt8P: &up8, - - Int16: 7, - Int16P: &p16, - UInt16: 9, - UInt16P: &up16, - - Int32: 11, - Int32P: &p32, - UInt32: 13, - UInt32P: &up32, - - Int64: math.MaxInt64, - Int64P: &p64, - UInt64: math.MaxUint64, - UInt64P: &up64, - - F32: 1.87132794, - F32P: &f32p, - F64: 59285092891.502818573, - F64P: &f64p, - - String: "string", - StringP: &str, - - Interface: iface, - // InterfaceP: ifaceP, // NOTICE: NOT SUPPORTED - InterfacePP: &iface, - - ByteArray: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, - ArrByteArray: [][]byte{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, - Array: [3]interface{}{1, "string", nil}, - SliceString: []string{"string1", "string2", "string3"}, - SliceFloat64: []float64{1.1, 2.2, 3.3, 4.4}, - SliceInt: []interface{}{1, 2, 3}, - Slice: []interface{}{1, "string", []byte{1, 11, 111}, nil, true}, - ArrayOfMaps: [1]map[int]string{{1: "str"}}, - SliceOfMaps: []map[int]string{{1: "str"}}, - ArrayOfSlices: [1][]interface{}{{1, 2, 3}}, - SliceOfSlices: [][]interface{}{{1, 2, 3}, {4, 5, 6}}, - ArrayOfArrays: [1][1]interface{}{{1}}, - SliceOfArrays: [][1]interface{}{{1}, {2}, {3}}, - ArrayOfStructs: [1]SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, - SliceOfStructs: []SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, - - Map: map[interface{}]interface{}{1: "string", "string": nil /*nil: map[interface{}]interface{}{"1": ip}, true: false*/}, - MapOfMaps: map[string]map[int64]byte{"1": {1: 1, 2: 2}}, - MapOfSlices: map[string][]byte{"1": {1, 2}, "2": {3, 4}}, - MapOfArrays: map[string][3]byte{"1": {1, 2, 3}, "2": {3, 4, 5}}, - MapOfStructs: map[string]SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, - MapOfPStructs: map[string]*SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, - - CustomBool: true, - CustomBoolP: &ctbl, - CustomByte: 100, - CustomByteP: &ctb, - CustomInt: 100, - CustomIntP: &cti, - CustomUint: 100, - CustomUintP: &ctui, - CustomInt8: 100, - CustomInt8P: &cti8, - CustomUint8: 100, - CustomUint8P: &ctui8, - CustomInt16: 100, - CustomInt16P: &cti16, - CustomUint16: 100, - CustomUint16P: &ctui16, - CustomInt32: 100, - CustomInt32P: &cti32, - CustomUint32: 100, - CustomUint32P: &ctui32, - CustomInt64: 100, - CustomInt64P: &cti64, - CustomUint64: 100, - CustomUint64P: &ctui64, - - CustomFloat32: cf32, - CustomFloat32P: &cf32, - CustomFloat64: cf64, - CustomFloat64P: &cf64, - - CustomString: ctstr, - CustomStringP: &ctstr, - - NestedObj: SomeStruct{A: 1, Self: &SomeStruct{A: 999}}, - NestedObjP: &testObject{Int: 1, Intp: &ip, Tm: now}, - - NestedObjSlice: []SomeStruct{{A: 1, Self: &SomeStruct{A: 999}}, {A: 2, Self: &SomeStruct{A: 998}}}, - NstdObjPSlice: []*testObject{{Int: 1, Intp: &ip, Tm: now}, {Int: 2, Intp: &ip, Tm: now}}, - - Tm: now, - TmP: &now, - - Anonym: struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}, - AnonymP: &(struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}), - } - } - - makeTestObjectTagged := func() *testObjectTagged { - bl := true - b := byte(0) - ip := 11 - p8 := int8(4) - up8 := uint8(6) - p16 := int16(8) - up16 := uint16(10) - p32 := int32(12) - up32 := uint32(14) - p64 := int64(16) - up64 := uint64(math.MaxUint64) - f32p := float32(math.MaxFloat32) - f64p := math.MaxFloat64 - str := "pointer to a string" - iface := interface{}("a string") - - ctbl := SomeBool(true) - ctb := SomeByte(100) - cti := SomeInt(math.MinInt64) - ctui := SomeUint(math.MaxInt64) - cti8 := SomeInt8(103) - ctui8 := SomeUint8(math.MaxUint8) - cti16 := SomeInt16(math.MinInt16) - ctui16 := SomeUint16(math.MaxUint16) - cti32 := SomeInt32(math.MinInt32) - ctui32 := SomeUint32(math.MaxUint32) - cti64 := SomeInt64(math.MinInt64) - ctui64 := SomeUint64(math.MaxUint64) - cf32 := SomeFloat32(math.SmallestNonzeroFloat32) - cf64 := SomeFloat64(math.SmallestNonzeroFloat64) - ctstr := SomeString("Some string") - - now := time.Now().Round(time.Nanosecond) - - return &testObjectTagged{ - Bool: true, - BoolP: &bl, - - Nil: nil, - NilP: nil, - - Byte: byte(0), - ByteP: &b, - - Int: 1, - Intp: &ip, - - Int8: 3, - Int8P: &p8, - UInt8: 5, - UInt8P: &up8, - - Int16: 7, - Int16P: &p16, - UInt16: 9, - UInt16P: &up16, - - Int32: 11, - Int32P: &p32, - UInt32: 13, - UInt32P: &up32, - - Int64: math.MaxInt64, - Int64P: &p64, - UInt64: math.MaxUint64, - UInt64P: &up64, - - F32: 1.87132794, - F32P: &f32p, - F64: 59285092891.502818573, - F64P: &f64p, - - String: "string", - StringP: &str, - - Interface: iface, - // InterfaceP: ifaceP, // NOTICE: NOT SUPPORTED - InterfacePP: &iface, - - ByteArray: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9}, - ArrByteArray: [][]byte{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, - Array: [3]interface{}{1, "string", nil}, - SliceString: []string{"string1", "string2", "string3"}, - SliceFloat64: []float64{1.1, 2.2, 3.3, 4.4}, - SliceInt: []interface{}{1, 2, 3}, - Slice: []interface{}{1, "string", []byte{1, 11, 111}, nil, true}, - ArrayOfMaps: [1]map[int]string{{1: "str"}}, - SliceOfMaps: []map[int]string{{1: "str"}}, - ArrayOfSlices: [1][]interface{}{{1, 2, 3}}, - SliceOfSlices: [][]interface{}{{1, 2, 3}, {4, 5, 6}}, - ArrayOfArrays: [1][1]interface{}{{1}}, - SliceOfArrays: [][1]interface{}{{1}, {2}, {3}}, - ArrayOfStructs: [1]SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, - SliceOfStructs: []SomeStruct{{A: 1, Self: &SomeStruct{A: 1}}}, - - Map: map[interface{}]interface{}{1: "string", "string": nil /*nil: map[interface{}]interface{}{"1": ip}, true: false*/}, - MapOfMaps: map[string]map[int64]byte{"1": {1: 1, 2: 2}}, - MapOfSlices: map[string][]byte{"1": {1, 2}, "2": {3, 4}}, - MapOfArrays: map[string][3]byte{"1": {1, 2, 3}, "2": {3, 4, 5}}, - MapOfStructs: map[string]SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, - MapOfPStructs: map[string]*SomeStruct{"1": {A: 10, Self: &SomeStruct{A: 10}}}, - - CustomBool: true, - CustomBoolP: &ctbl, - CustomByte: 100, - CustomByteP: &ctb, - CustomInt: 100, - CustomIntP: &cti, - CustomUint: 100, - CustomUintP: &ctui, - CustomInt8: 100, - CustomInt8P: &cti8, - CustomUint8: 100, - CustomUint8P: &ctui8, - CustomInt16: 100, - CustomInt16P: &cti16, - CustomUint16: 100, - CustomUint16P: &ctui16, - CustomInt32: 100, - CustomInt32P: &cti32, - CustomUint32: 100, - CustomUint32P: &ctui32, - CustomInt64: 100, - CustomInt64P: &cti64, - CustomUint64: 100, - CustomUint64P: &ctui64, - - CustomFloat32: cf32, - CustomFloat32P: &cf32, - CustomFloat64: cf64, - CustomFloat64P: &cf64, - - CustomString: ctstr, - CustomStringP: &ctstr, - - NestedObj: SomeStruct{A: 1, Self: &SomeStruct{A: 999}}, - NestedObjP: &testObject{Int: 1, Intp: &ip, Tm: now}, - - NestedObjSlice: []SomeStruct{{A: 1, Self: &SomeStruct{A: 999}}, {A: 2, Self: &SomeStruct{A: 998}}}, - NstdObjPSlice: []*testObject{{Int: 1, Intp: &ip, Tm: now}, {Int: 2, Intp: &ip, Tm: now}}, - - Tm: now, - TmP: &now, - - Anonym: struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}, - AnonymP: &(struct{ SomeStruct }{SomeStruct{A: 1, Self: &SomeStruct{A: 999}}}), - } - } - - gg.Context("PutObject operations", func() { - - gg.It("must respect `UseNativeBoolTypeInReflection` option", func() { - type T struct { - T, F bool - } - - t := &T{ - T: true, - F: false, - } - - // Use native bools - as.UseNativeBoolTypeInReflection = true - key, _ := as.NewKey(ns, set, randString(50)) - err = client.PutObject(nil, key, t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"T": t.T, "F": t.F})) - - // Use integers - as.UseNativeBoolTypeInReflection = false - key, _ = as.NewKey(ns, set, randString(50)) - err = client.PutObject(nil, key, t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"T": 1, "F": 0})) - }) - - gg.It("must respect `,omitempty` option", func() { - type Inner struct { - V1 int `as:" v1,ommitempty "` - V2 string `as:" v2,ommitempty "` - } - - type T struct { - Name string `as:" name "` - Description string `as:" desc ,omitempty"` - Age int `as:" ,omitempty"` - - InnerVal Inner `as:"inner,omitempty"` - } - - t := &T{ - Name: "Ada Lovelace", - Description: "Was doing it before it was cool", - Age: 31, - } - - key, _ := as.NewKey(ns, set, randString(50)) - err = client.PutObject(nil, key, t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"name": t.Name, "desc": t.Description, "Age": 31, "inner": map[interface{}]interface{}{"v1": 0, "v2": ""}})) - - key, _ = as.NewKey(ns, set, randString(50)) - - t = &T{ - Name: "", - Description: "", - Age: 0, - } - - err = client.PutObject(nil, key, t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"name": t.Name, "inner": map[interface{}]interface{}{"v1": 0, "v2": ""}})) - }) - - gg.It("must save an object with the most complex structure possible and retrieve it via BatchGetObject", func() { - - testObj := makeTestObject() - err := client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - resObj := &testObject{} - err = client.GetObject(nil, key, resObj) - - // set the Gen and TTL - testObj.TTL = resObj.TTL - testObj.Gen = resObj.Gen - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(resObj).To(gm.Equal(testObj)) - gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) - - // should not panic if read back to an object with none of the bins - T := struct { - NonExisting int `as:"nonexisting"` - }{-1} - err = client.GetObject(nil, key, &T) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(T.NonExisting).To(gm.Equal(-1)) - - // get the same object via BatchGetObject - resObj = &testObject{} - found, err := client.BatchGetObjects(nil, []*as.Key{key}, []interface{}{resObj}) - gm.Expect(len(found)).To(gm.Equal(1)) - gm.Expect(found[0]).To(gm.BeTrue()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // set the Gen and TTL - testObj.TTL = resObj.TTL - testObj.Gen = resObj.Gen - - gm.Expect(resObj).To(gm.Equal(testObj)) - gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) - }) - - gg.It("must save a tagged object with the most complex structure possible", func() { - - testObj := makeTestObjectTagged() - err := client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - resObj := &testObjectTagged{} - err = client.GetObject(nil, key, resObj) - - // set the Gen and TTL - testObj.TTL = resObj.TTL - testObj.Gen = resObj.Gen - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(resObj).To(gm.Equal(testObj)) - gm.Expect(resObj.AnonymP).NotTo(gm.BeNil()) - }) - - gg.It("must save an object and read it back respecting the tags", func() { - - type InnerStruct struct { - Strings []string `as:"b"` - PersistNot int `as:"-"` - PersistAsInner1 int `as:"inner1"` - } - - type TaggedStruct struct { - Strings []string `as:"b"` - DontPersist int `as:"-"` - PersistAsFld1 int `as:"fld1"` - Bytes []byte `as:"fldbytes"` - - IStruct InnerStruct `as:"istruct"` - } - - testObj := TaggedStruct{Strings: []string{"a", "b", "c"}, DontPersist: 1, PersistAsFld1: 2, Bytes: []byte{1, 2, 3, 4}, IStruct: InnerStruct{Strings: []string{"d", "e", "f", "g"}, PersistNot: 10, PersistAsInner1: 11}} - err := client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - resObj := &TaggedStruct{} - err = client.GetObject(nil, key, resObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(resObj.DontPersist).To(gm.Equal(0)) - gm.Expect(resObj.PersistAsFld1).To(gm.Equal(2)) - gm.Expect(resObj.IStruct.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.IStruct.PersistAsInner1).To(gm.Equal(11)) - - // get the bins and check for bin names - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins).To(gm.Equal( - as.BinMap{ - "b": []interface{}{"a", "b", "c"}, - "fld1": 2, - "fldbytes": []byte{1, 2, 3, 4}, - "istruct": map[interface{}]interface{}{ - "b": []interface{}{"d", "e", "f", "g"}, - "inner1": 11, - }, - })) - - gm.Expect(len(rec.Bins)).To(gm.Equal(4)) - gm.Expect(rec.Bins["DontPersist"]).To(gm.BeNil()) - gm.Expect(rec.Bins["fld1"]).To(gm.Equal(2)) - innerStruct := rec.Bins["istruct"].(map[interface{}]interface{}) - gm.Expect(len(innerStruct)).To(gm.Equal(2)) - gm.Expect(innerStruct["PersistNot"]).To(gm.BeNil()) - gm.Expect(innerStruct["inner1"]).To(gm.Equal(11)) - - }) - - gg.It("must save an object *pointer* and read it back respecting the tags", func() { - - type InnerStruct struct { - PersistNot int `as:"-"` - PersistAsInner1 int `as:"inner1"` - } - - type TaggedStruct struct { - DontPersist int `as:"-"` - PersistAsFld1 int `as:"fld1"` - - IStruct *InnerStruct - } - - testObj := &TaggedStruct{DontPersist: 1, PersistAsFld1: 2, IStruct: &InnerStruct{PersistNot: 10, PersistAsInner1: 11}} - err := client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - resObj := &TaggedStruct{IStruct: &InnerStruct{}} - err = client.GetObject(nil, key, resObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(resObj.DontPersist).To(gm.Equal(0)) - gm.Expect(resObj.PersistAsFld1).To(gm.Equal(2)) - gm.Expect(resObj.IStruct.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.IStruct.PersistAsInner1).To(gm.Equal(11)) - - // get the bins and check for bin names - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(len(rec.Bins)).To(gm.Equal(2)) - gm.Expect(rec.Bins["DontPersist"]).To(gm.BeNil()) - gm.Expect(rec.Bins["fld1"]).To(gm.Equal(2)) - innerStruct := rec.Bins["IStruct"].(map[interface{}]interface{}) - gm.Expect(len(innerStruct)).To(gm.Equal(1)) - gm.Expect(innerStruct["PersistNot"]).To(gm.BeNil()) - gm.Expect(innerStruct["inner1"]).To(gm.Equal(11)) - - }) - - gg.It("must put and get pre-assigned lists and maps", func() { - - type MyObject struct { - List []string - Map map[int]string - } - - var t, o1, o2 MyObject - o1.List = nil // the default is nil anyways - o1.Map = nil // the default is nil anyways - - o2.List = []string{"Should be overwritten"} - o2.Map = map[int]string{666: "Nope"} - - t = MyObject{ - List: []string{"Apple", "Orange"}, - Map: map[int]string{1: "Apple", 2: "Orange"}, - } - - err := client.PutObject(nil, key, &t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{ - "Map": map[interface{}]interface{}{1: "Apple", 2: "Orange"}, - "List": []interface{}{"Apple", "Orange"}, - })) - - err = client.GetObject(nil, key, &o1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.GetObject(nil, key, &o2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(o1).To(gm.Equal(o2)) - gm.Expect(t).To(gm.Equal(o1)) - gm.Expect(t).To(gm.Equal(o2)) - }) - - }) // PutObject context - - gg.Context("Metadata operations", func() { - - gg.It("must save an object and read its metadata back", func() { - - type objMeta struct { - TTL1, TTL2 uint32 `asm:"ttl"` - GEN1, GEN2 uint32 `asm:"gen"` - Val int `as:"val"` - } - - testObj := objMeta{Val: 1} - err := client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"val": 1})) - - resObj := &objMeta{} - err = client.GetObject(nil, key, resObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(resObj.TTL1).NotTo(gm.Equal(uint32(0))) - gm.Expect(resObj.TTL1).To(gm.Equal(resObj.TTL2)) - - gm.Expect(resObj.GEN1).To(gm.Equal(uint32(1))) - gm.Expect(resObj.GEN2).To(gm.Equal(uint32(1))) - - // put it again to check the generation - err = client.PutObject(nil, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.GetObject(nil, key, resObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(resObj.TTL1).NotTo(gm.Equal(uint32(0))) - gm.Expect(resObj.TTL1).To(gm.Equal(resObj.TTL2)) - - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - defaultTTL, nerr := strconv.Atoi(nsInfo(ns, "default-ttl")) - gm.Expect(nerr).ToNot(gm.HaveOccurred()) - - switch defaultTTL { - case 0: - gm.Expect(resObj.TTL1).To(gm.Equal(uint32(math.MaxUint32))) - default: - gm.Expect(resObj.TTL1).To(gm.Equal(uint32(defaultTTL))) - } - - gm.Expect(resObj.GEN1).To(gm.Equal(uint32(2))) - gm.Expect(resObj.GEN2).To(gm.Equal(uint32(2))) - }) - - }) // PutObject context - - gg.Context("BatchGetObjects operations", func() { - - var keys []*as.Key - var resObjects []interface{} - var objects []*testObjectTagged - - gg.BeforeEach(func() { - set = randString(50) - - keys = nil - resObjects = nil - objects = nil - - nsup = nsupPeriod(ns) - - var wpolicy *as.WritePolicy - if nsup > 0 { - wpolicy = as.NewWritePolicy(0, 500) - } else { - wpolicy = as.NewWritePolicy(0, 0) - } - - for i := 0; i < 100; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - keys = append(keys, key) - resObjects = append(resObjects, new(testObjectTagged)) - - // only put odd objects in the db - if i%2 == 0 { - objects = append(objects, new(testObjectTagged)) - continue - } - - testObj := makeTestObjectTagged() - objects = append(objects, testObj) - err := client.PutObject(wpolicy, key, testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - }) - - gg.It("must return error on invalid input", func() { - _, err := client.BatchGetObjects(nil, nil, resObjects) - gm.Expect(err).To(gm.HaveOccurred()) - - _, err = client.BatchGetObjects(nil, nil, nil) - gm.Expect(err).To(gm.HaveOccurred()) - - _, err = client.BatchGetObjects(nil, []*as.Key{}, []interface{}{}) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - gg.It("should create a valid Sorted CDT Map and then Get Correct Values back in both map and []MapPair fields", func() { - - cdtBinName := "orderedMap" - - items := map[interface{}]interface{}{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - } - - // Write values to empty map. - _, err := client.Operate(nil, key, - as.MapPutItemsOp(as.NewMapPolicy(as.MapOrder.KEY_ORDERED, as.MapWriteMode.UPDATE), cdtBinName, items), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - - type testObjectTagged struct { - TTL uint32 `asm:"ttl"` - Gen uint32 `asm:"gen"` - - M map[string]int `as:"orderedMap"` - } - - instance := testObjectTagged{} - err = client.GetObject(nil, key, &instance) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(instance.M).To(gm.Equal(map[string]int{ - "Charlie": 55, - "Jim": 98, - "John": 76, - "Harry": 82, - })) - - type testObjectTaggedSorted struct { - TTL uint32 `asm:"ttl"` - Gen uint32 `asm:"gen"` - - M []as.MapPair `as:"orderedMap"` - } - - instanceSorted := testObjectTaggedSorted{} - err = client.GetObject(nil, key, &instanceSorted) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(instanceSorted.M).To(gm.Equal([]as.MapPair{ - {"Charlie", 55}, - {"Harry", 82}, - {"Jim", 98}, - {"John", 76}, - })) - }) - - gg.It("must get all objects with the most complex structure possible", func() { - found, err := client.BatchGetObjects(nil, keys, resObjects) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for i := range resObjects { - if i%2 == 0 { - gm.Expect(found[i]).To(gm.BeFalse()) - resObj := resObjects[i].(*testObjectTagged) - gm.Expect(*resObj).To(gm.BeZero()) - } else { - gm.Expect(found[i]).To(gm.BeTrue()) - resObj := resObjects[i].(*testObjectTagged) - - if nsup > 0 { - gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) - } - gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) - - objects[i].TTL = resObj.TTL - objects[i].Gen = resObj.Gen - - gm.Expect(resObj).To(gm.Equal(objects[i])) - } - } - }) - - }) // ScanObjects context - - gg.Context("UDF Objects operations", func() { - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - gg.It("must store and get values of types which implement Value interface using udf", func() { - udfFunc := `function setValue(rec, val) - rec['value'] = val - aerospike:update(rec) - - return rec - end` - - registerUDF(udfFunc, "test_set.lua") - - var ( - bytes = []byte("bytes") - str = "string" - i = 10 - f = 3.14 - valArray = []as.Value{as.NewValue(i), as.NewValue(str)} - list = []interface{}{i, str} - m = map[interface{}]interface{}{"int": i, "string": str} - json = map[string]interface{}{"int": i, "string": str} - ) - - cases := []struct { - in as.Value - out interface{} - }{ - {in: as.NewNullValue(), out: nil}, - {in: as.NewInfinityValue(), out: nil}, - {in: as.NewWildCardValue(), out: nil}, - {in: as.NewBytesValue(bytes), out: bytes}, - {in: as.NewStringValue(str), out: str}, - {in: as.NewIntegerValue(i), out: i}, - {in: as.NewFloatValue(f), out: f}, - {in: as.NewValueArray(valArray), out: list}, - {in: as.NewListValue(list), out: list}, - {in: as.NewMapValue(m), out: m}, - {in: as.NewJsonValue(json), out: m}, - } - - for i, data := range cases { - err = client.PutBins(nil, key, as.NewBin("test", i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Execute(nil, key, "test_set", "setValue", data.in) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(nil, key, "value") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - if data.out == nil { - gm.Expect(rec.Bins["value"]).To(gm.BeNil()) - } else { - gm.Expect(rec.Bins["value"]).To(gm.Equal(data.out)) - } - - } - }) // #272 issue - - gg.It("must serialize values to the lua function and deserialize into object, even if it is int", func() { - - type Test struct { - Test float64 `as:"test"` - TestLua float64 `as:"testLua"` - } - - udfFunc := `function addValue(rec, val) - local ret = map() - if not aerospike:exists(rec) then - ret['status'] = false - ret['result'] = 'Record does not exist' - else - rec['testLua'] = (rec['testLua'] or 0.0) + val - aerospike:update(rec) - ret['status'] = true - end - return ret - end` - - registerUDF(udfFunc, "test.lua") - - adOp := as.AddOp(as.NewBin("test", float64(1))) - testLua := float64(0) - for i := 1; i <= 100; i++ { - _, err := client.Operate(nil, key, adOp) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - testLua += float64(i) * float64(0.1) - _, err = client.Execute(nil, key, "test", "addValue", as.NewValue(float64(i)*float64(0.1))) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - t := &Test{} - err = client.GetObject(nil, key, t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(t.Test).To(gm.Equal(float64(i))) - gm.Expect(t.TestLua).To(gm.BeNumerically("~", testLua)) - } - - }) // it - }) - - var scanPolicy = as.NewScanPolicy() - var queryPolicy = as.NewQueryPolicy() - - gg.Context("ScanObjects operations", func() { - type InnerStruct struct { - PersistNot int `as:"-"` - PersistAsInner1 int `as:"inner1"` - Gen uint32 `asm:"gen"` - TTL uint32 `asm:"ttl"` - } - - gg.BeforeEach(func() { - set = randString(50) - - nsup = nsupPeriod(ns) - - var wp *as.WritePolicy - if nsup > 0 { - wp = as.NewWritePolicy(0, 500) - } else { - wp = as.NewWritePolicy(0, 0) - - } - for i := 1; i < 100; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - testObj := InnerStruct{PersistAsInner1: i} - err := client.PutObject(wp, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - }) - - gg.It("must scan all objects with the most complex structure possible", func() { - - testObj := &InnerStruct{} - - retChan := make(chan *InnerStruct, 10) - - rs, err := client.ScanAllObjects(scanPolicy, retChan, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for resObj := range retChan { - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">", 0)) - gm.Expect(resObj.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) - if nsup > 0 { - gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) - } - - testObj.PersistAsInner1 = resObj.PersistAsInner1 - testObj.Gen = resObj.Gen - testObj.TTL = resObj.TTL - gm.Expect(resObj).To(gm.Equal(testObj)) - cnt++ - } - - for e := range rs.Errors() { - gm.Expect(e).ToNot(gm.HaveOccurred()) - } - - gm.Expect(cnt).To(gm.Equal(99)) - }) - - }) // ScanObjects context - - gg.Context("QueryObjects operations", func() { - - type InnerStruct struct { - PersistNot int `as:"-"` - PersistAsInner1 int `as:"inner1"` - Gen uint32 `asm:"gen"` - TTL uint32 `asm:"ttl"` - } - - gg.BeforeEach(func() { - set = randString(50) - - nsup = nsupPeriod(ns) - - var wp *as.WritePolicy - if nsup > 0 { - wp = as.NewWritePolicy(5, 500) - } else { - wp = as.NewWritePolicy(5, 0) - } - for i := 1; i < 100; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - testObj := InnerStruct{PersistAsInner1: i} - err := client.PutObject(wp, key, &testObj) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - }) - - gg.It("must scan all objects with the most complex structure possible", func() { - - testObj := &InnerStruct{} - - retChan := make(chan *InnerStruct, 10) - stmt := as.NewStatement(ns, set) - - rs, err := client.QueryObjects(queryPolicy, stmt, retChan) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for resObj := range retChan { - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">", 0)) - gm.Expect(resObj.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) - if nsup > 0 { - gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) - } - - testObj.PersistAsInner1 = resObj.PersistAsInner1 - testObj.Gen = resObj.Gen - testObj.TTL = resObj.TTL - gm.Expect(resObj).To(gm.Equal(testObj)) - cnt++ - } - - for e := range rs.Errors() { - gm.Expect(e).ToNot(gm.HaveOccurred()) - } - - gm.Expect(cnt).To(gm.Equal(99)) - }) - - gg.It("must query only relevant objects with the most complex structure possible", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - // first create an index - createIndex(nil, ns, set, set+"inner1", "inner1", as.NUMERIC) - defer dropIndex(nil, ns, set, set+"inner1") - - testObj := &InnerStruct{} - - retChan := make(chan *InnerStruct, 10) - stmt := as.NewStatement(ns, set) - stmt.SetFilter(as.NewRangeFilter("inner1", 21, 70)) - - rs, err := client.QueryObjects(queryPolicy, stmt, retChan) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for resObj := range retChan { - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">=", 21)) - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically("<=", 70)) - gm.Expect(resObj.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) - if nsup > 0 { - gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) - } - - testObj.PersistAsInner1 = resObj.PersistAsInner1 - testObj.Gen = resObj.Gen - testObj.TTL = resObj.TTL - gm.Expect(resObj).To(gm.Equal(testObj)) - cnt++ - } - - for e := range rs.Errors() { - gm.Expect(e).ToNot(gm.HaveOccurred()) - } - - gm.Expect(cnt).To(gm.Equal(50)) - }) - - gg.It("must query only relevant objects, and close and return", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - // first create an index - createIndex(nil, ns, set, set+"inner1", "inner1", as.NUMERIC) - defer dropIndex(nil, ns, set, set+"inner1") - - testObj := &InnerStruct{} - - retChan := make(chan *InnerStruct, 1) - stmt := as.NewStatement(ns, set) - stmt.SetFilter(as.NewRangeFilter("inner1", 21, 70)) - - qpolicy := as.NewQueryPolicy() - qpolicy.RecordQueueSize = 1 - - rs, err := client.QueryObjects(queryPolicy, stmt, retChan) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for resObj := range retChan { - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically(">=", 21)) - gm.Expect(resObj.PersistAsInner1).To(gm.BeNumerically("<=", 70)) - gm.Expect(resObj.PersistNot).To(gm.Equal(0)) - gm.Expect(resObj.Gen).To(gm.BeNumerically(">", 0)) - if nsup > 0 { - gm.Expect(resObj.TTL).To(gm.BeNumerically("<=", 500)) - } - - testObj.PersistAsInner1 = resObj.PersistAsInner1 - testObj.Gen = resObj.Gen - testObj.TTL = resObj.TTL - gm.Expect(resObj).To(gm.Equal(testObj)) - cnt++ - - if cnt >= 10 { - rs.Close() - gm.Eventually(rs.Errors()).Should(gm.BeClosed()) - } - } - - for e := range rs.Errors() { - gm.Expect(e).ToNot(gm.HaveOccurred()) - } - - gm.Expect(cnt).To(gm.BeNumerically("<=", 11)) - }) - - }) // QueryObject context - }) - } // for useBoolType -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_policy.go b/aerospike-tls/vendor-aerospike-client-go/client_policy.go deleted file mode 100644 index df3b55b0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_policy.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "crypto/tls" - "time" -) - -// ClientPolicy encapsulates parameters for client policy command. -type ClientPolicy struct { - // AuthMode specifies authentication mode used when user/password is defined. It is set to AuthModeInternal by default. - AuthMode AuthMode - - // User authentication to cluster. Leave empty for clusters running without restricted access. - User string - - // Password authentication to cluster. The password will be stored by the client and sent to server - // in hashed format. Leave empty for clusters running without restricted access. - Password string - - // ClusterName sets the expected cluster ID. If not nil, server nodes must return this cluster ID in order to - // join the client's view of the cluster. Should only be set when connecting to servers that - // support the "cluster-name" info command. (v3.10+) - ClusterName string //="" - - // Initial host connection timeout duration. The timeout when opening a connection - // to the server host for the first time. - Timeout time.Duration //= 30 seconds - - // Connection idle timeout. Every time a connection is used, its idle - // deadline will be extended by this duration. When this deadline is reached, - // the connection will be closed and discarded from the connection pool. - // The value is limited to 24 hours (86400s). - // - // It's important to set this value to a few seconds less than the server's proto-fd-idle-ms - // (default 60000 milliseconds or 1 minute), so the client does not attempt to use a socket - // that has already been reaped by the server. - // - // Connection pools are now implemented by a LIFO stack. Connections at the tail of the - // stack will always be the least used. These connections are checked for IdleTimeout - // on every tend (usually 1 second). - // - // Default: 0 seconds - IdleTimeout time.Duration //= 0 seconds - - // LoginTimeout specifies the timeout for login operation for external authentication such as LDAP. - LoginTimeout time.Duration //= 10 seconds - - // ConnectionQueueCache specifies the size of the Connection Queue cache PER NODE. - // Note: One connection per node is reserved for tend operations and is not used for transactions. - ConnectionQueueSize int //= 100 - - // MinConnectionsPerNode specifies the minimum number of synchronous connections allowed per server node. - // Preallocate min connections on client node creation. - // The client will periodically allocate new connections if count falls below min connections. - // - // Server proto-fd-idle-ms may also need to be increased substantially if min connections are defined. - // The proto-fd-idle-ms default directs the server to close connections that are idle for 60 seconds - // which can defeat the purpose of keeping connections in reserve for a future burst of activity. - // - // If server proto-fd-idle-ms is changed, client ClientPolicy.IdleTimeout should also be - // changed to be a few seconds less than proto-fd-idle-ms. - // - // Default: 0 - MinConnectionsPerNode int - - // MaxErrorRate defines the maximum number of errors allowed per node per ErrorRateWindow before - // the circuit-breaker algorithm returns MAX_ERROR_RATE on database commands to that node. - // If MaxErrorRate is zero, there is no error limit and - // the exception will never be thrown. - // - // The counted error types are any error that causes the connection to close (socket errors - // and client timeouts) and types.ResultCode.DEVICE_OVERLOAD. - // - // Default: 100 - MaxErrorRate int - - // ErrorRateWindow defined the number of cluster tend iterations that defines the window for MaxErrorRate. - // One tend iteration is defined as TendInterval plus the time to tend all nodes. - // At the end of the window, the error count is reset to zero and backoff state is removed - // on all nodes. - // - // Default: 1 - ErrorRateWindow int //= 1 - - // If set to true, will not create a new connection - // to the node if there are already `ConnectionQueueSize` active connections. - // Note: One connection per node is reserved for tend operations and is not used for transactions. - LimitConnectionsToQueueSize bool //= true - - // Number of connections allowed to established at the same time. - // This value does not limit the number of connections. It just - // puts a threshold on the number of parallel opening connections. - // By default, there are no limits. - OpeningConnectionThreshold int // 0 - - // Throw exception if host connection fails during addHost(). - FailIfNotConnected bool //= true - - // TendInterval determines interval for checking for cluster state changes. - // Minimum possible interval is 10 Milliseconds. - TendInterval time.Duration //= 1 second - - // A IP translation table is used in cases where different clients - // use different server IP addresses. This may be necessary when - // using clients from both inside and outside a local area - // network. Default is no translation. - // The key is the IP address returned from friend info requests to other servers. - // The value is the real IP address used to connect to the server. - IpMap map[string]string - - // UseServicesAlternate determines if the client should use "services-alternate" instead of "services" - // in info request during cluster tending. - //"services-alternate" returns server configured external IP addresses that client - // uses to talk to nodes. "services-alternate" can be used in place of providing a client "ipMap". - // This feature is recommended instead of using the client-side IpMap above. - // - // "services-alternate" is available with Aerospike Server versions >= 3.7.1. - UseServicesAlternate bool // false - - // RackAware directs the client to update rack information on intervals. - // When this feature is enabled, the client will prefer to use nodes which reside - // on the same rack as the client for read transactions. The application should also set the RackId, and - // use the ReplicaPolicy.PREFER_RACK for reads. - // This feature is in particular useful if the cluster is in the cloud and the cloud provider - // is charging for network bandwidth out of the zone. Keep in mind that the node on the same rack - // may not be the Master, and as such the data may be stale. This setting is particularly usable - // for clusters that are read heavy. - RackAware bool // false - - // RackIds defines the list of acceptable racks in order of preference. Nodes in RackIds[0] are chosen first. - // If a node is not found in rackIds[0], then nodes in rackIds[1] are searched, and so on. - // If rackIds is set, ClientPolicy.RackId is ignored. - // - // ClientPolicy.RackAware, ReplicaPolicy.PREFER_RACK and server rack - // configuration must also be set to enable this functionality. - RackIds []int // nil - - // TlsConfig specifies TLS secure connection policy for TLS enabled servers. - // For better performance, we suggest preferring the server-side ciphers by - // setting PreferServerCipherSuites = true. - TlsConfig *tls.Config //= nil - - // IgnoreOtherSubnetAliases helps to ignore aliases that are outside main subnet - IgnoreOtherSubnetAliases bool //= false - - // SeedOnlyCluster enforces the client to use only the seed addresses. - // Peers nodes for the cluster are not discovered and seed nodes are - // retained despite connection failures. - SeedOnlyCluster bool // = false -} - -// NewClientPolicy generates a new ClientPolicy with default values. -func NewClientPolicy() *ClientPolicy { - return &ClientPolicy{ - AuthMode: AuthModeInternal, - Timeout: 30 * time.Second, - IdleTimeout: 0 * time.Second, - LoginTimeout: 10 * time.Second, - ConnectionQueueSize: 100, - OpeningConnectionThreshold: 0, - FailIfNotConnected: true, - TendInterval: time.Second, - LimitConnectionsToQueueSize: true, - IgnoreOtherSubnetAliases: false, - MaxErrorRate: 100, - ErrorRateWindow: 1, - SeedOnlyCluster: false, - } -} - -// RequiresAuthentication returns true if a User or Password is set for ClientPolicy. -func (cp *ClientPolicy) RequiresAuthentication() bool { - return (cp.User != "") || (cp.Password != "") || (cp.AuthMode == AuthModePKI) -} - -func (cp *ClientPolicy) servicesString() string { - if cp.UseServicesAlternate { - return "services-alternate" - } - return "services" -} - -func (cp *ClientPolicy) serviceString() string { - // PATCH (e2e-tls-run): always request the clear-text service info - // command. Upstream Aerospike is CE; service-tls-std is EE-only - // and returns "ERROR:25:enterprise only", which breaks node - // validation. TLS is still used on the wire (stunnel terminates - // in front of CE); only the info command name is overridden. - if cp.UseServicesAlternate { - return "service-clear-alt" - } - return "service-clear-std" -} - -func (cp *ClientPolicy) peersString() string { - // PATCH (e2e-tls-run): same reason — CE doesn't answer - // peers-tls-std. Ask peers-clear-std even on a TLS connection. - if cp.UseServicesAlternate { - return "peers-clear-alt" - } - return "peers-clear-std" -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_reflect.go b/aerospike-tls/vendor-aerospike-client-go/client_reflect.go deleted file mode 100644 index 995d27c3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_reflect.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// PutObject writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// If the policy is nil, the default relevant policy will be used. -// A struct can be tagged to influence the way the object is put in the database: -// -// type Person struct { -// TTL uint32 `asm:"ttl"` -// RecGen uint32 `asm:"gen"` -// Name string `as:"name"` -// Address string `as:"desc,omitempty"` -// Age uint8 `as:",omitempty"` -// Password string `as:"-"` -// } -// -// Tag `as:` denotes Aerospike fields. The first value will be the alias for the field. -// `,omitempty` (without any spaces between the comma and the word) will act like the -// json package, and will not send the value of the field to the database if the value is zero value. -// Tag `asm:` denotes Aerospike Meta fields, and includes ttl and generation values. -// If a tag is marked with `-`, it will not be sent to the database at all. -// Note: Tag `as` can be replaced with any other user-defined tag via the function `SetAerospikeTag`. -func (clnt *Client) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) { - policy = clnt.getUsableWritePolicy(policy) - - binMap := marshal(obj) - command, err := newWriteCommand(clnt.cluster, policy, key, nil, binMap, _WRITE) - if err != nil { - return err - } - - res := command.Execute() - return res -} - -// GetObject reads a record for specified key and puts the result into the provided object. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) GetObject(policy *BasePolicy, key *Key, obj interface{}) Error { - policy = clnt.getUsablePolicy(policy) - - rval := reflect.ValueOf(obj) - binNames := objectMappings.getFields(rval.Type()) - - partition, err := PartitionForRead(clnt.cluster, policy, key) - if err != nil { - return err - } - - command, err := newReadCommand(clnt.cluster, policy, key, binNames, partition) - if err != nil { - return err - } - - command.object = &rval - return command.Execute() -} - -// getObjectDirect reads a record for specified key and puts the result into the provided object. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) getObjectDirect(policy *BasePolicy, key *Key, rval *reflect.Value) Error { - policy = clnt.getUsablePolicy(policy) - - binNames := objectMappings.getFields(rval.Type()) - command, err := newReadCommand(clnt.cluster, policy, key, binNames, nil) - if err != nil { - return err - } - - command.object = rval - return command.Execute() -} - -// BatchGetObjects reads multiple record headers and bins for specified keys in one batch request. -// The returned objects are in positional order with the original key array order. -// If a key is not found, the positional object will not change, and the positional found boolean will be false. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // check the size of key and objects - if len(keys) != len(objects) { - return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: number of keys and objects do not match") - } - - if len(keys) == 0 { - return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: keys are empty") - } - - binSet := map[string]struct{}{} - objectsVal := make([]*reflect.Value, len(objects)) - for i := range objects { - rval := reflect.ValueOf(objects[i]) - objectsVal[i] = &rval - for _, bn := range objectMappings.getFields(rval.Type()) { - binSet[bn] = struct{}{} - } - } - binNames := make([]string, 0, len(binSet)) - for binName := range binSet { - binNames = append(binNames, binName) - } - - objectsFound := make([]bool, len(keys)) - cmd := newBatchCommandGet(clnt, nil, policy, keys, binNames, nil, nil, _INFO1_READ, false) - cmd.objects = objectsVal - cmd.objectsFound = objectsFound - - batchNodes, err := newBatchNodeList(clnt.cluster, policy, keys, nil, false) - if err != nil { - return nil, err - } - - filteredOut, err := clnt.batchExecute(policy, batchNodes, cmd) - if err != nil { - return nil, err - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return objectsFound, err -} - -// ScanPartitionObjects Reads records in specified namespace, set and partition filter. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If partitionFilter is nil, all partitions will be scanned. -// If the policy is nil, the default relevant policy will be used. -// This method is only supported by Aerospike 4.9+ servers. -func (clnt *Client) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, newError(types.SERVER_NOT_AVAILABLE, "Scan failed because cluster is empty.") - } - - var tracker *partitionTracker - if partitionFilter == nil { - tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) - } else { - tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) - } - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - go clnt.scanPartitionObjects(&policy, tracker, namespace, setName, res, binNames...) - - return res, nil -} - -// ScanAllObjects reads all records in specified namespace and set from all nodes. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.ScanPartitionObjects(apolicy, objChan, nil, namespace, setName, binNames...) -} - -// scanNodePartitions reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) scanNodePartitionsObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - - tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - go clnt.scanPartitionObjects(&policy, tracker, namespace, setName, res, binNames...) - - return res, nil -} - -// ScanNodeObjects reads all records in specified namespace and set for one node only, -// and marshalls the results into the objects of the provided channel in Recordset. -// If the policy is nil, the default relevant policy will be used. -// The resulting records will be marshalled into the objChan. -// objChan will be closed after all the records are read. -func (clnt *Client) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.scanNodePartitionsObjects(apolicy, node, objChan, namespace, setName, binNames...) -} - -// QueryPartitionObjects executes a query for specified partitions and returns a recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 4.9+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - - nodes := clnt.cluster.GetNodes() - if len(nodes) == 0 { - return nil, newError(types.SERVER_NOT_AVAILABLE, "Query failed because cluster is empty.") - } - - var tracker *partitionTracker - - if partitionFilter == nil { - tracker = newPartitionTrackerForNodes(&policy.MultiPolicy, nodes) - } else { - tracker = newPartitionTracker(&policy.MultiPolicy, partitionFilter, nodes) - } - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - go clnt.queryPartitionObjects(policy, tracker, statement, res) - - return res, nil -} - -// QueryObjects executes a query on all nodes in the cluster and marshals the records into the given channel. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop objects. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) { - return clnt.QueryPartitionObjects(policy, statement, objChan, nil) -} - -func (clnt *Client) queryNodePartitionsObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - - tracker := newPartitionTrackerForNode(&policy.MultiPolicy, node) - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - go clnt.queryPartitionObjects(policy, tracker, statement, res) - - return res, nil -} - -// QueryNodeObjects executes a query on a specific node and marshals the records into the given channel. -// The caller can concurrently pop records off the channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { - return clnt.queryNodePartitionsObjects(policy, node, statement, objChan) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go deleted file mode 100644 index 6fac8087..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_reflect_test.go +++ /dev/null @@ -1,280 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "errors" - "math" - "strings" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - - gg.Describe("Data operations on complex types with reflection", func() { - // connection data - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var rpolicy = as.NewPolicy() - var rec *as.Record - - if *useReplicas { - rpolicy.ReplicaPolicy = as.MASTER_PROLES - } - - gg.BeforeEach(func() { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.Context("Put operations", func() { - - gg.Context("Bins with complex types", func() { - - gg.Context("Bins with LIST type", func() { - - gg.It("must return error for Get for a nonexisting key", func() { - rec, err = client.Get(rpolicy, key) - gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) - }) - - gg.It("must save a key with Array Types", func() { - bin1 := as.NewBin("Aerospike1", []int8{math.MinInt8, 0, 1, 2, 3, math.MaxInt8}) - bin2 := as.NewBin("Aerospike2", []int16{math.MinInt16, 0, 1, 2, 3, math.MaxInt16}) - bin3 := as.NewBin("Aerospike3", []int32{math.MinInt32, 0, 1, 2, 3, math.MaxInt32}) - bin4 := as.NewBin("Aerospike4", []int64{math.MinInt64, 0, 1, 2, 3, math.MaxInt64}) - bin5 := as.NewBin("Aerospike5", []uint8{0, 1, 2, 3, math.MaxUint8}) - bin6 := as.NewBin("Aerospike6", []uint16{0, 1, 2, 3, math.MaxUint16}) - bin7 := as.NewBin("Aerospike7", []uint32{0, 1, 2, 3, math.MaxUint32}) - bin8 := as.NewBin("Aerospike8", []string{"", "\n", "string"}) - bin9 := as.NewBin("Aerospike9", []interface{}{"", 1, nil, true, false, uint64(math.MaxUint64), math.MaxFloat32, math.MaxFloat64, as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), [3]int{1, 2, 3}}) - - // complex type, consisting different arrays - bin10 := as.NewBin("Aerospike10", []interface{}{ - nil, - bin1.Value.GetObject(), - bin2.Value.GetObject(), - bin3.Value.GetObject(), - bin4.Value.GetObject(), - bin5.Value.GetObject(), - bin6.Value.GetObject(), - bin7.Value.GetObject(), - bin8.Value.GetObject(), - bin9.Value.GetObject(), - map[interface{}]interface{}{ - 1: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}: []interface{}{"string", 12, nil}, - // [3]int{0, 1, 2}: []interface{}{"string", 12, nil}, - // [3]string{"0", "1", "2"}: []interface{}{"string", 12, nil}, - 15: nil, - int8(math.MaxInt8): int8(math.MaxInt8), - int64(math.MinInt64): int64(math.MinInt64), - int64(math.MaxInt64): int64(math.MaxInt64), - // uint64(math.MaxUint64): uint64(math.MaxUint64), - // float32(-math.MaxFloat32): float32(-math.MaxFloat32), - // float64(-math.MaxFloat64): float64(-math.MaxFloat64), - // float32(math.MaxFloat32): float32(math.MaxFloat32), - // float64(math.MaxFloat64): float64(math.MaxFloat64), - "true": true, - "false": false, - "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array - // nil: []int{18, 41}, // array to complex map - "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test - }, - }) - - err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7, bin8, bin9, bin10) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - arraysEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) - arraysEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) - arraysEqual(rec.Bins[bin3.Name], bin3.Value.GetObject()) - arraysEqual(rec.Bins[bin4.Name], bin4.Value.GetObject()) - arraysEqual(rec.Bins[bin5.Name], bin5.Value.GetObject()) - arraysEqual(rec.Bins[bin6.Name], bin6.Value.GetObject()) - arraysEqual(rec.Bins[bin7.Name], bin7.Value.GetObject()) - arraysEqual(rec.Bins[bin8.Name], bin8.Value.GetObject()) - arraysEqual(rec.Bins[bin9.Name], bin9.Value.GetObject()) - arraysEqual(rec.Bins[bin10.Name], bin10.Value.GetObject()) - }) - - }) // context list - - gg.Context("Bins with MAP type", func() { - - gg.It("must save a key with Array Types", func() { - // complex type, consisting different maps - bin1 := as.NewBin("Aerospike1", map[int32]string{ - 0: "", - int32(math.MaxInt32): randString(100), - int32(math.MinInt32): randString(100), - }) - - bin2 := as.NewBin("Aerospike2", map[interface{}]interface{}{ - 15: nil, - "true": true, - "false": false, - int8(math.MaxInt8): int8(math.MaxInt8), - int64(math.MinInt64): int64(math.MinInt64), - int64(math.MaxInt64): int64(math.MaxInt64), - // uint64(math.MaxUint64): uint64(math.MaxUint64), - // float32(-math.MaxFloat32): float32(-math.MaxFloat32), - // float64(-math.MaxFloat64): float64(-math.MaxFloat64), - // float32(math.MaxFloat32): float32(math.MaxFloat32), - // float64(math.MaxFloat64): float64(math.MaxFloat64), - "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array - // nil: []int{18, 41}, // array to complex map - // "longString": strings.Repeat("s", 32911), // bit-sign test - "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test - }) - - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - mapsEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) - mapsEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) - }) - - }) // context map - - gg.Context("Bins with LIST type", func() { - - gg.It("must save a key with Array Types", func() { - bin1 := as.NewBin("Aerospike1", []interface{}{math.MinInt8, 0, 1, 2, 3, math.MaxInt8}) - bin2 := as.NewBin("Aerospike2", []interface{}{math.MinInt16, 0, 1, 2, 3, math.MaxInt16}) - bin3 := as.NewBin("Aerospike3", []interface{}{math.MinInt32, 0, 1, 2, 3, math.MaxInt32}) - bin4 := as.NewBin("Aerospike4", []interface{}{math.MinInt64, 0, 1, 2, 3, math.MaxInt64}) - bin5 := as.NewBin("Aerospike5", []interface{}{0, 1, 2, 3, math.MaxUint8}) - bin6 := as.NewBin("Aerospike6", []interface{}{0, 1, 2, 3, math.MaxUint16}) - bin7 := as.NewBin("Aerospike7", []interface{}{0, 1, 2, 3, math.MaxUint32}) - bin8 := as.NewBin("Aerospike8", []interface{}{"", "\n", "string"}) - bin9 := as.NewBin("Aerospike9", []interface{}{"", 1, nil, true, false, uint64(math.MaxUint64), math.MaxFloat32, math.MaxFloat64, as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), [3]int{1, 2, 3}}) - - // complex type, consisting different arrays - bin10 := as.NewBin("Aerospike10", []interface{}{ - nil, - bin1.Value.GetObject(), - bin2.Value.GetObject(), - bin3.Value.GetObject(), - bin4.Value.GetObject(), - bin5.Value.GetObject(), - bin6.Value.GetObject(), - bin7.Value.GetObject(), - bin8.Value.GetObject(), - bin9.Value.GetObject(), - map[interface{}]interface{}{ - 1: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}: []interface{}{"string", 12, nil}, - // [3]int{0, 1, 2}: []interface{}{"string", 12, nil}, - // [3]string{"0", "1", "2"}: []interface{}{"string", 12, nil}, - 15: nil, - int8(math.MaxInt8): int8(math.MaxInt8), - int64(math.MinInt64): int64(math.MinInt64), - int64(math.MaxInt64): int64(math.MaxInt64), - // uint64(math.MaxUint64): uint64(math.MaxUint64), - // float32(-math.MaxFloat32): float32(-math.MaxFloat32), - // float64(-math.MaxFloat64): float64(-math.MaxFloat64), - // float32(math.MaxFloat32): float32(math.MaxFloat32), - // float64(math.MaxFloat64): float64(math.MaxFloat64), - "true": true, - "false": false, - "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array - // nil: []interface{}{18, 41}, // array to complex map - "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test - }, - }) - - err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7, bin8, bin9, bin10) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - arraysEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) - arraysEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) - arraysEqual(rec.Bins[bin3.Name], bin3.Value.GetObject()) - arraysEqual(rec.Bins[bin4.Name], bin4.Value.GetObject()) - arraysEqual(rec.Bins[bin5.Name], bin5.Value.GetObject()) - arraysEqual(rec.Bins[bin6.Name], bin6.Value.GetObject()) - arraysEqual(rec.Bins[bin7.Name], bin7.Value.GetObject()) - arraysEqual(rec.Bins[bin8.Name], bin8.Value.GetObject()) - arraysEqual(rec.Bins[bin9.Name], bin9.Value.GetObject()) - arraysEqual(rec.Bins[bin10.Name], bin10.Value.GetObject()) - }) - - }) // context list - - gg.Context("Bins with MAP type", func() { - - gg.It("must save a key with Array Types", func() { - // complex type, consisting different maps - bin1 := as.NewBin("Aerospike1", map[int32]string{ - 0: "", - int32(math.MaxInt32): randString(100), - int32(math.MinInt32): randString(100), - }) - - bin2 := as.NewBin("Aerospike2", map[interface{}]interface{}{ - 15: nil, - "true": true, - "false": false, - int8(math.MaxInt8): int8(math.MaxInt8), - int64(math.MinInt64): int64(math.MinInt64), - int64(math.MaxInt64): int64(math.MaxInt64), - // uint64(math.MaxUint64): uint64(math.MaxUint64), - // float32(-math.MaxFloat32): float32(-math.MaxFloat32), - // float64(-math.MaxFloat64): float64(-math.MaxFloat64), - // float32(math.MaxFloat32): float32(math.MaxFloat32), - // float64(math.MaxFloat64): float64(math.MaxFloat64), - "string": map[interface{}]interface{}{ /*nil: "string",*/ "string": 19}, // map to complex array - // nil: []int{18, 41}, // array to complex map - "longString": strings.Repeat("s", 32911), // bit-sign test - "GeoJSON": as.NewGeoJSONValue(`{ "type": "Point", "coordinates": [0.00, 0.00] }"`), // bit-sign test - }) - - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - mapsEqual(rec.Bins[bin1.Name], bin1.Value.GetObject()) - mapsEqual(rec.Bins[bin2.Name], bin2.Value.GetObject()) - }) - - }) // context map - - }) // context complex types - - }) // put context - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/client_test.go b/aerospike-tls/vendor-aerospike-client-go/client_test.go deleted file mode 100644 index 3b04ba79..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/client_test.go +++ /dev/null @@ -1,1768 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "bytes" - "errors" - "fmt" - "math" - "math/rand" - "strconv" - "strings" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/types" - ast "github.com/aerospike/aerospike-client-go/v7/types" - asub "github.com/aerospike/aerospike-client-go/v7/utils/buffer" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func isJsonObject(ifc interface{}) bool { - switch ifc := ifc.(type) { - case float64, float32, int, int64, uint64: - return true - case []interface{}: - for _, v := range ifc { - switch v.(type) { - case float64, float32, int, int64, uint64: - default: - return false - } - } - return true - case map[string]interface{}: - for _, v := range ifc { - if !isJsonObject(v) { - return false - } - } - return true - default: - return false - } -} - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - - var actualClusterName string - - gg.Describe("Client InfoErrorParser", func() { - - gg.It("must parse InfoError response strings", func() { - type t struct { - r string - code types.ResultCode - err string - } - - responses := []t{ - {"invalid", types.SERVER_ERROR, "invalid"}, - {"FAIL", types.SERVER_ERROR, "FAIL"}, - {"FAiL", types.SERVER_ERROR, "FAiL"}, - {"Error", types.SERVER_ERROR, "Error"}, - {"ERROR", types.SERVER_ERROR, "ERROR"}, - {"ERROR:200", types.INDEX_FOUND, "Index already exists"}, - {"FAIL:201", types.INDEX_NOTFOUND, "Index not found"}, - {"ERROR:200", types.INDEX_FOUND, "Index already exists"}, - {"FAIL:201", types.INDEX_NOTFOUND, "Index not found"}, - {"FAIL:201:some message from the server", types.INDEX_NOTFOUND, "some message from the server"}, - {"FAIL:some message from the server", types.SERVER_ERROR, "some message from the server"}, - {"error:some message from the server", types.SERVER_ERROR, "some message from the server"}, - } - - for _, r := range responses { - err := as.ParseInfoErrorCode(r.r) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.(*as.AerospikeError).Msg()).To(gm.Equal(r.err)) - gm.Expect(err.Matches(r.code)).To(gm.BeTrue()) - } - - }) - - }) - - gg.Describe("Client Management", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - }) - - dbHost := as.NewHost(*host, *port) - dbHost.TLSName = *nodeTLSName - - gg.It("must open and close the client without a problem", func() { - client, err := as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(client.IsConnected()).To(gm.BeTrue()) - - time.Sleep(5 * time.Second) - - // set actual cluster name - node, err := client.Cluster().GetRandomNode() - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(node).NotTo(gm.BeNil()) - res, err := node.RequestInfo(as.NewInfoPolicy(), "cluster-name") - gm.Expect(err).ToNot(gm.HaveOccurred()) - actualClusterName = res["cluster-name"] - - stats, err := client.Stats() - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(stats)).To(gm.BeNumerically(">", 0)) - for _, nodeStatsIfc := range stats { - // make sure it's a strict map of string => float64 | string => float64 - gm.Expect(isJsonObject(nodeStatsIfc)).To(gm.BeTrue()) - - if nodeStats, ok := nodeStatsIfc.(map[string]interface{}); ok { - gm.Expect(nodeStats["connections-attempts"].(float64)).To(gm.BeNumerically(">=", 1)) - gm.Expect(nodeStats["node-added-count"].(float64)).To(gm.BeNumerically(">=", 1)) - gm.Expect(nodeStats["partition-map-updates"].(float64)).To(gm.BeNumerically(">=", 1)) - gm.Expect(nodeStats["tends-successful"].(float64)).To(gm.BeNumerically(">", 1)) - gm.Expect(nodeStats["tends-total"].(float64)).To(gm.BeNumerically(">", 1)) - } - } - - client.Close() - gm.Expect(client.IsConnected()).To(gm.BeFalse()) - }) - - gg.It("must return an error if supplied cluster-name is wrong", func() { - cpolicy := *clientPolicy - cpolicy.ClusterName = "haha" - cpolicy.Timeout = 10 * time.Second - nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.CLUSTER_NAME_MISMATCH_ERROR)).To(gm.BeTrue()) - gm.Expect(nclient).To(gm.BeNil()) - }) - - gg.It("must return a client even if cluster-name is wrong, but failIfConnected is false", func() { - cpolicy := *clientPolicy - cpolicy.ClusterName = "haha" - cpolicy.Timeout = 10 * time.Second - cpolicy.FailIfNotConnected = false - nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.CLUSTER_NAME_MISMATCH_ERROR)).To(gm.BeTrue()) - gm.Expect(nclient).NotTo(gm.BeNil()) - gm.Expect(nclient.IsConnected()).To(gm.BeFalse()) - }) - - gg.It("must connect to the cluster when cluster-name is correct", func() { - nodeCount := len(client.GetNodes()) - - cpolicy := *clientPolicy - cpolicy.ClusterName = actualClusterName - cpolicy.Timeout = 10 * time.Second - nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(len(nclient.GetNodes())).To(gm.Equal(nodeCount)) - }) - - gg.It("must connect to the cluster using external authentication protocol", func() { - if *authMode != "external" { - gg.Skip("Skipping External Authentication connection...") - } - - nodeCount := len(client.GetNodes()) - - cpolicy := *clientPolicy - cpolicy.Timeout = 10 * time.Second - cpolicy.AuthMode = as.AuthModeExternal - cpolicy.User = "badwan" - cpolicy.Password = "blastoff" - nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(len(nclient.GetNodes())).To(gm.Equal(nodeCount)) - }) - - gg.Context("Rackaware", func() { - - gg.It("must connect to the cluster in rackaware mode, and set the RackId = 0, and still get master node for all keys", func() { - cpolicy := *clientPolicy - cpolicy.User = *user - cpolicy.Password = *password - c, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - info := info(c, "racks:") - if strings.HasPrefix(strings.ToUpper(info), "ERROR") { - gg.Skip("Skipping RackAware test since it is not supported on this cluster...") - } - - cpolicy = *clientPolicy - cpolicy.Timeout = 10 * time.Second - cpolicy.RackAware = true - - for rid := 1; rid <= 20; rid++ { - nclient, err := as.NewClientWithPolicyAndHost(&cpolicy, dbHost) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - wpolicy := as.NewWritePolicy(0, 0) - wpolicy.ReplicaPolicy = as.PREFER_RACK - for i := 0; i < 12; i++ { - key, _ := as.NewKey(*namespace, "test", 1) - partition, err := as.PartitionForWrite(nclient.Cluster(), wpolicy.GetBasePolicy(), key) - gm.Expect(err).NotTo(gm.HaveOccurred()) - masterNode, err := partition.GetMasterNode(nclient.Cluster()) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - // node, err := nclient.Cluster().GetReadNode(partition, replicaPolicy, &seq) - node, err := partition.GetNodeRead(nclient.Cluster()) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(node).NotTo(gm.BeNil()) - gm.Expect(node).To(gm.Equal(masterNode)) - } - nclient.Close() - } - }) - - // gg.It("must connect to the cluster in rackaware mode", func() { - // cpolicy := *clientPolicy - // cpolicy.Timeout = 10 * time.Second - // cpolicy.RackAware = true - - // rpolicy := as.NewPolicy() - // rpolicy.ReplicaPolicy = as.PREFER_RACK - - // for rid := 1; rid <= 20; rid++ { - // cpolicy.RackId = (rid % 2) + 1 - - // nclient, err := as.NewClientWithPolicyAndHostNewClientWithPolicy(&cpolicy, dbHost) - // gm.Expect(err).NotTo(gm.HaveOccurred()) - - // for i := 0; i < 12; i++ { - // println(i) - // key, _ := as.NewKey(*namespace, "test", 1) - // partition, err := as.PartitionForRead(nclient.Cluster(), rpolicy.GetBasePolicy(), key) - // gm.Expect(err).NotTo(gm.HaveOccurred()) - - // node, err := partition.GetNodeRead(nclient.Cluster()) - // gm.Expect(err).NotTo(gm.HaveOccurred()) - // gm.Expect(node.Rack("test")).To(gm.Equal(cpolicy.RackId)) - // } - // nclient.Close() - // } - // }) - }) - }) - - gg.Describe("Data operations on native types", func() { - // connection data - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var rpolicy = as.NewPolicy() - var bpolicy = as.NewBatchPolicy() - var rec *as.Record - - if *useReplicas { - rpolicy.ReplicaPolicy = as.MASTER_PROLES - } - - gg.BeforeEach(func() { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.Context("Put operations", func() { - - gg.Context("Expiration values", func() { - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - gg.It("must return 30d if set to TTLServerDefault", func() { - wpolicy := as.NewWritePolicy(0, as.TTLServerDefault) - bin := as.NewBin("Aerospike", "value") - rec, err = client.Operate(wpolicy, key, as.PutOp(bin), as.GetOp()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - defaultTTL, err := strconv.Atoi(nsInfo(ns, "default-ttl")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - switch defaultTTL { - case 0: - gm.Expect(rec.Expiration).To(gm.Equal(uint32(math.MaxUint32))) - default: - gm.Expect(rec.Expiration).To(gm.Equal(uint32(defaultTTL))) - } - - }) - - gg.It("must return TTLDontExpire if set to TTLDontExpire", func() { - wpolicy := as.NewWritePolicy(0, as.TTLDontExpire) - bin := as.NewBin("Aerospike", "value") - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Expiration).To(gm.Equal(uint32(as.TTLDontExpire))) - }) - - gg.It("must not change the TTL if set to TTLDontUpdate", func() { - wpolicy := as.NewWritePolicy(0, as.TTLServerDefault) - bin := as.NewBin("Aerospike", "value") - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(3 * time.Second) - - wpolicy = as.NewWritePolicy(0, as.TTLDontUpdate) - bin = as.NewBin("Aerospike", "value") - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - defaultTTL, err := strconv.Atoi(nsInfo(ns, "default-ttl")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - switch defaultTTL { - case 0: - gm.Expect(rec.Expiration).To(gm.Equal(uint32(math.MaxUint32))) - default: - gm.Expect(rec.Expiration).To(gm.BeNumerically("<=", uint32(defaultTTL-3))) // default expiration on server is set to 30d - } - }) - }) - - gg.Context("Bins with `nil` values should be deleted", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", "value") - bin1 := as.NewBin("Aerospike1", "value2") // to avoid deletion of key - err = client.PutBins(wpolicy, key, bin, bin1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - - bin2 := as.NewBin("Aerospike", nil) - err = client.PutBins(wpolicy, key, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Key should not exist - _, exists := rec.Bins[bin.Name] - gm.Expect(exists).To(gm.Equal(false)) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", "nil") - bin2 := as.NewBin("Aerospike2", "value") - bin3 := as.NewBin("Aerospike3", "value") - err = client.PutBins(wpolicy, key, bin1, bin2, bin3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin2nil := as.NewBin("Aerospike2", nil) - bin3nil := as.NewBin("Aerospike3", nil) - err = client.PutBins(wpolicy, key, bin2nil, bin3nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Key should not exist - _, exists := rec.Bins[bin2.Name] - gm.Expect(exists).To(gm.Equal(false)) - _, exists = rec.Bins[bin3.Name] - gm.Expect(exists).To(gm.Equal(false)) - }) - - gg.It("must save a key with MULTIPLE bins using a BinMap", func() { - bin1 := as.NewBin("Aerospike1", "nil") - bin2 := as.NewBin("Aerospike2", "value") - bin3 := as.NewBin("Aerospike3", "value") - err = client.Put(wpolicy, key, as.BinMap{bin1.Name: bin1.Value, bin2.Name: bin2.Value, bin3.Name: bin3.Value}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin2nil := as.NewBin("Aerospike2", nil) - bin3nil := as.NewBin("Aerospike3", nil) - err = client.Put(wpolicy, key, as.BinMap{bin2nil.Name: bin2nil.Value, bin3nil.Name: bin3nil.Value}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Key should not exist - _, exists := rec.Bins[bin2.Name] - gm.Expect(exists).To(gm.Equal(false)) - _, exists = rec.Bins[bin3.Name] - gm.Expect(exists).To(gm.Equal(false)) - }) - }) - - gg.Context("Bins with `string` values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", "Awesome") - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", "Awesome1") - bin2 := as.NewBin("Aerospike2", "") - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - }) - }) - - gg.Context("Bins with `int8` and `uint8` values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", int8(rand.Intn(math.MaxInt8))) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", int8(math.MaxInt8)) - bin2 := as.NewBin("Aerospike2", int8(math.MinInt8)) - bin3 := as.NewBin("Aerospike3", uint8(math.MaxUint8)) - err = client.PutBins(wpolicy, key, bin1, bin2, bin3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) - }) - }) - - gg.Context("Bins with `int16` and `uint16` values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", int16(rand.Intn(math.MaxInt16))) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", int16(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", int16(math.MinInt16)) - bin3 := as.NewBin("Aerospike3", uint16(math.MaxUint16)) - err = client.PutBins(wpolicy, key, bin1, bin2, bin3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) - }) - }) - - gg.Context("Bins with `int` and `uint` values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", rand.Int()) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins; uint of > MaxInt32 will always result in LongValue", func() { - bin1 := as.NewBin("Aerospike1", math.MaxInt32) - bin2, bin3 := func() (*as.Bin, *as.Bin) { - if asub.Arch32Bits { - return as.NewBin("Aerospike2", int(math.MinInt32)), - as.NewBin("Aerospike3", uint(math.MaxInt32)) - } - return as.NewBin("Aerospike2", int(math.MinInt64)), - as.NewBin("Aerospike3", uint(math.MaxInt64)) - - }() - - err = client.PutBins(wpolicy, key, bin1, bin2, bin3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - if asub.Arch64Bits { - gm.Expect(rec.Bins[bin2.Name].(int)).To(gm.Equal(bin2.Value.GetObject())) - gm.Expect(int64(rec.Bins[bin3.Name].(int))).To(gm.Equal(bin3.Value.GetObject())) - } else { - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - gm.Expect(rec.Bins[bin3.Name]).To(gm.Equal(bin3.Value.GetObject())) - } - }) - }) - - gg.Context("Bins with `int64` only values (uint64 is supported via type cast to int64) ", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", rand.Int63()) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - if asub.Arch64Bits { - gm.Expect(int64(rec.Bins[bin.Name].(int))).To(gm.Equal(bin.Value.GetObject())) - } else { - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - } - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", math.MaxInt64) - bin2 := as.NewBin("Aerospike2", math.MinInt64) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - }) - }) - - gg.Context("Bins with `float32` only values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", rand.Float32()) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(float64(rec.Bins[bin.Name].(float64))).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", math.MaxFloat32) - bin2 := as.NewBin("Aerospike2", -math.MaxFloat32) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - }) - }) - - gg.Context("Bins with `float64` only values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", rand.Float64()) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(float64(rec.Bins[bin.Name].(float64))).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", math.MaxFloat64) - bin2 := as.NewBin("Aerospike2", -math.MaxFloat64) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - }) - }) - - gg.Context("Bins with `bool` only values", func() { - gg.It("must save a key with SINGLE bin", func() { - bin := as.NewBin("Aerospike", as.BoolValue(true)) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(bool(rec.Bins[bin.Name].(bool))).To(gm.Equal(bin.Value.GetObject())) - }) - - gg.It("must save a key with MULTIPLE bins", func() { - bin1 := as.NewBin("Aerospike1", as.BoolValue(true)) - bin2 := as.NewBin("Aerospike2", as.BoolValue(false)) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - }) - }) - - gg.Context("Bins with complex types", func() { - - gg.Context("Bins with BLOB type", func() { - gg.It("must save and retrieve Bins with AerospikeBlobs type", func() { - person := &testBLOB{name: "SomeDude"} - bin := as.NewBin("Aerospike1", person) - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - }) - - gg.Context("Bins with LIST type", func() { - - gg.It("must save a key with Array Types", func() { - // All int types and sizes should be encoded into an int64, - // unless if they are of type uint64, which always encodes to uint64 - // regardless of the values inside - intList := []interface{}{math.MinInt64, math.MinInt64 + 1} - for i := uint(0); i < 64; i++ { - intList = append(intList, -(1 << i)) - intList = append(intList, -(1<", generation)) - - recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure the - for r := range recordset.Results() { - gm.Expect(r.Err).ToNot(gm.HaveOccurred()) - if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { - gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) - gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) - } - } - }) - - }) // Touch context - - gg.Context("Exists operations", func() { - bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) - - gg.BeforeEach(func() { - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("must check Existence of a non-existing key", func() { - var nxkey *as.Key - nxkey, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - var exists bool - exists, err = client.Exists(rpolicy, nxkey) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(false)) - }) - - gg.It("must checks Existence of an existing key", func() { - var exists bool - exists, err = client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - }) - - }) // Exists context - - gg.Context("Batch Exists operations", func() { - bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) - var keyCount = []int{1, 2048} - - gg.BeforeEach(func() { - }) - - for _, keyCount := range keyCount { - for _, useInline := range []bool{true, false} { - gg.It(fmt.Sprintf("must return the result with same ordering. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { - var exists []bool - keys := []*as.Key{} - - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - keys = append(keys, key) - - // if key shouldExist == true, put it in the DB - if i%2 == 0 { - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - } - } - - bpolicy.AllowInline = useInline - exists, err = client.BatchExists(bpolicy, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(exists)).To(gm.Equal(len(keys))) - for idx, keyExists := range exists { - gm.Expect(keyExists).To(gm.Equal(idx%2 == 0)) - } - }) - } - } - - }) // Batch Exists context - - gg.Context("Batch Get operations", func() { - bin := as.NewBin("Aerospike", rand.Int()) - var keyCount = []int{1, 2048} - - gg.BeforeEach(func() { - }) - - for _, keyCount := range keyCount { - for _, useInline := range []bool{true, false} { - gg.It(fmt.Sprintf("must return the records with same ordering as keys. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { - binRedundant := as.NewBin("Redundant", "Redundant") - - var records []*as.Record - type existence struct { - key *as.Key - shouldExist bool // set randomly and checked against later - } - - exList := make([]existence, 0, keyCount) - keys := make([]*as.Key, 0, keyCount) - - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - e := existence{key: key, shouldExist: rand.Intn(100) > 50} - exList = append(exList, e) - keys = append(keys, key) - - // if key shouldExist == true, put it in the DB - if e.shouldExist { - err = client.PutBins(wpolicy, key, bin, binRedundant) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - rec, err := client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Bins[binRedundant.Name]).To(gm.Equal(binRedundant.Value.GetObject())) - } else { - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(false)) - } - } - - brecords := make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: true, - } - } - bpolicy.AllowInline = useInline - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for idx, rec := range brecords { - if exList[idx].shouldExist { - gm.Expect(len(rec.Record.Bins)).To(gm.Equal(2)) - gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec.Record).To(gm.BeNil()) - } - } - - brecords = make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: false, - BinNames: []string{bin.Name}, - } - } - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for idx, rec := range brecords { - if exList[idx].shouldExist { - gm.Expect(len(rec.Record.Bins)).To(gm.Equal(1)) - gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec.Record).To(gm.BeNil()) - } - } - - records, err = client.BatchGet(bpolicy, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(records)).To(gm.Equal(len(keys))) - for idx, rec := range records { - if exList[idx].shouldExist { - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec).To(gm.BeNil()) - } - } - - records, err = client.BatchGet(bpolicy, keys, bin.Name) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(records)).To(gm.Equal(len(keys))) - for idx, rec := range records { - if exList[idx].shouldExist { - // only bin1 has been requested - gm.Expect(rec.Bins[binRedundant.Name]).To(gm.BeNil()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec).To(gm.BeNil()) - } - } - }) - - gg.It(fmt.Sprintf("must return the records with same ordering as keys via Batch Complex Protocol. keyCount: %d, AllowInline: %v", keyCount, useInline), func() { - binRedundant := as.NewBin("Redundant", "Redundant") - - type existence struct { - key *as.Key - shouldExist bool // set randomly and checked against later - } - - exList := make([]existence, 0, keyCount) - keys := make([]*as.Key, 0, keyCount) - - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - e := existence{key: key, shouldExist: rand.Intn(100) > 50} - exList = append(exList, e) - keys = append(keys, key) - - // if key shouldExist == true, put it in the DB - if e.shouldExist { - err = client.PutBins(wpolicy, key, bin, binRedundant) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - rec, err := client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Bins[binRedundant.Name]).To(gm.Equal(binRedundant.Value.GetObject())) - } else { - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(false)) - } - } - - brecords := make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: true, - } - } - bpolicy.AllowInline = useInline - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for idx, rec := range brecords { - if exList[idx].shouldExist { - gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec.Record).To(gm.BeNil()) - } - } - - brecords = make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: false, - BinNames: []string{"Aerospike", "Redundant"}, - } - } - bpolicy.AllowInline = useInline - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for idx, rec := range brecords { - if exList[idx].shouldExist { - gm.Expect(rec.Record.Bins[bin.Name]).To(gm.Equal(bin.Value.GetObject())) - gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec.Record).To(gm.BeNil()) - } - } - - brecords = make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: false, - BinNames: nil, - } - } - bpolicy.AllowInline = useInline - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for idx, rec := range brecords { - if exList[idx].shouldExist { - gm.Expect(len(rec.Record.Bins)).To(gm.Equal(0)) - gm.Expect(rec.Record.Key).To(gm.Equal(keys[idx])) - } else { - gm.Expect(rec.Record).To(gm.BeNil()) - } - } - - }) - } - } - }) // Batch Get context - - gg.Context("GetHeader operations", func() { - bin := as.NewBin("Aerospike", rand.Intn(math.MaxInt16)) - - gg.BeforeEach(func() { - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("must Get the Header of an existing key after touch", func() { - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - generation := rec.Generation - - err = client.Touch(wpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err = client.GetHeader(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Generation).To(gm.BeNumerically(">", generation)) - gm.Expect(rec.Bins[bin.Name]).To(gm.BeNil()) - }) - - }) // GetHeader context - - gg.Context("BatchOperate", func() { - - gg.It("must execute BatchGetOperate with Operations", func() { - const listSize = 10 - const cdtBinName = "cdtBin" - - for keyCount := 1; keyCount < 10; keyCount++ { - keys := make([]*as.Key, keyCount) - for i := 0; i < keyCount; i++ { - keys[i], err = as.NewKey(ns, set, randString(10)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - // First Part: For CDTs - list := []interface{}{} - for j, key := range keys { - for i := 1; i <= listSize; i++ { - list = append(list, i*100) - - sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, j+i*100)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - } - } - - records, err := client.BatchGetOperate(bpolicy, keys, - as.ListSizeOp(cdtBinName), - as.ListGetByIndexOp(cdtBinName, -1, as.ListReturnTypeValue), - as.ListGetByIndexOp(cdtBinName, 0, as.ListReturnTypeValue), - as.ListGetByIndexOp(cdtBinName, 2, as.ListReturnTypeValue), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for i, key := range keys { - rec := records[i] - gm.Expect(rec.Key.Digest()).To(gm.Equal(key.Digest())) - gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(as.OpResults{listSize, i + listSize*100, i + 100, i + 300})) - } - } - }) - - gg.It("must execute BatchGetComplex with Operations", func() { - const listSize = 10 - const cdtBinName = "cdtBin" - - for keyCount := 1; keyCount < 10; keyCount++ { - keys := make([]*as.Key, keyCount) - for i := 0; i < keyCount; i++ { - keys[i], err = as.NewKey(ns, set, randString(10)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - brecords := make([]*as.BatchRead, len(keys)) - for i := range keys { - brecords[i] = &as.BatchRead{ - BatchRecord: as.BatchRecord{ - Key: keys[i], - }, - ReadAllBins: false, // just to check if the internal flags are set correctly regardless - Ops: []*as.Operation{ - as.ListSizeOp(cdtBinName), - as.ListGetByIndexOp(cdtBinName, -1, as.ListReturnTypeValue), - as.ListGetByIndexOp(cdtBinName, 0, as.ListReturnTypeValue), - as.ListGetByIndexOp(cdtBinName, 2, as.ListReturnTypeValue), - }, - } - } - - // First Part: For CDTs - list := []interface{}{} - for j, key := range keys { - for i := 1; i <= listSize; i++ { - list = append(list, i*100) - - sz, err := client.Operate(wpolicy, key, as.ListAppendOp(cdtBinName, j+i*100)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - } - } - - err = client.BatchGetComplex(bpolicy, brecords) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for i, key := range keys { - rec := brecords[i].Record - gm.Expect(rec.Key.Digest()).To(gm.Equal(key.Digest())) - gm.Expect(rec.Bins[cdtBinName]).To(gm.Equal(as.OpResults{listSize, i + listSize*100, i + 100, i + 300})) - } - } - }) - }) - - gg.Context("Batch Get Header operations", func() { - bin := as.NewBin("Aerospike", rand.Int()) - var keyCount = []int{1, 1024} - - gg.BeforeEach(func() { - }) - - for _, keyCount := range keyCount { - for _, useInline := range []bool{true, false} { - gg.It(fmt.Sprintf("must return the record headers with same ordering as keys. KeyCount: %d, AllowInline: %v", keyCount, useInline), func() { - var records []*as.Record - type existence struct { - key *as.Key - shouldExist bool // set randomly and checked against later - } - - exList := []existence{} - keys := []*as.Key{} - - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - e := existence{key: key, shouldExist: rand.Intn(100) > 50} - exList = append(exList, e) - keys = append(keys, key) - - // if key shouldExist == true, put it in the DB - if e.shouldExist { - err = client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // update generation - err = client.Touch(wpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure they exists in the DB - exists, err := client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.Equal(true)) - } - } - - bpolicy.AllowInline = useInline - records, err = client.BatchGetHeader(bpolicy, keys) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(records)).To(gm.Equal(len(keys))) - for idx, rec := range records { - if exList[idx].shouldExist { - gm.Expect(rec.Bins[bin.Name]).To(gm.BeNil()) - gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) - } else { - gm.Expect(rec).To(gm.BeNil()) - } - } - }) - } - } - }) // Batch Get Header context - - gg.Context("Operate operations", func() { - bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", randString(100)) - - gg.BeforeEach(func() { - // err = client.PutBins(wpolicy, key, bin) - // gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("must return proper error on write operations, but not reads", func() { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - wpolicy := as.NewWritePolicy(0, 0) - rec, err = client.Operate(wpolicy, key, as.GetOp()) - gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) - - rec, err = client.Operate(wpolicy, key, as.TouchOp()) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - gg.It("must work correctly when no BinOps are passed as argument", func() { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - ops1 := []*as.Operation{} - - wpolicy := as.NewWritePolicy(0, 0) - rec, err = client.Operate(wpolicy, key, ops1...) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Error()).To(gm.ContainSubstring("No operations were passed.")) - }) - - gg.It("must send key on Put operations", func() { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - ops1 := []*as.Operation{ - as.PutOp(bin1), - as.PutOp(bin2), - as.GetOp(), - } - - wpolicy := as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - rec, err = client.Operate(wpolicy, key, ops1...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure the result is what we put in - for r := range recordset.Results() { - gm.Expect(r.Err).ToNot(gm.HaveOccurred()) - if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { - gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) - gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) - } - } - }) - - gg.It("must send key on Touch operations", func() { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - ops1 := []*as.Operation{ - as.GetOp(), - as.PutOp(bin2), - } - - wpolicy := as.NewWritePolicy(0, 0) - wpolicy.SendKey = false - rec, err = client.Operate(wpolicy, key, ops1...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recordset, err := client.ScanAll(nil, key.Namespace(), key.SetName()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure the key is not saved - for r := range recordset.Results() { - gm.Expect(r.Err).ToNot(gm.HaveOccurred()) - if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { - gm.Expect(r.Record.Key.Value()).To(gm.BeNil()) - } - } - - ops2 := []*as.Operation{ - as.GetOp(), - as.TouchOp(), - } - wpolicy.SendKey = true - rec, err = client.Operate(wpolicy, key, ops2...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recordset, err = client.ScanAll(nil, key.Namespace(), key.SetName()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure the - for r := range recordset.Results() { - gm.Expect(r.Err).ToNot(gm.HaveOccurred()) - if bytes.Equal(key.Digest(), r.Record.Key.Digest()) { - gm.Expect(r.Record.Key.Value()).To(gm.Equal(key.Value())) - gm.Expect(r.Record.Bins).To(gm.Equal(rec.Bins)) - } - } - }) - - gg.It("must apply all operations, and result should match expectation", func() { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - ops1 := []*as.Operation{ - as.PutOp(bin1), - as.PutOp(bin2), - as.GetOp(), - } - - rec, err = client.Operate(nil, key, ops1...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int))) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string))) - gm.Expect(rec.Generation).To(gm.Equal(uint32(1))) - - ops2 := []*as.Operation{ - as.AddOp(bin1), // double the value of the bin - as.AppendOp(bin2), // with itself - as.GetOp(), - } - - rec, err = client.Operate(nil, key, ops2...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) * 2)) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat(bin2.Value.GetObject().(string), 2))) - gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) - - ops3 := []*as.Operation{ - as.AddOp(bin1), - as.PrependOp(bin2), - as.TouchOp(), - as.GetOp(), - } - - rec, err = client.Operate(nil, key, ops3...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) * 3)) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat(bin2.Value.GetObject().(string), 3))) - gm.Expect(rec.Generation).To(gm.Equal(uint32(3))) - - ops4 := []*as.Operation{ - as.TouchOp(), - as.GetHeaderOp(), - } - - rec, err = client.Operate(nil, key, ops4...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Generation).To(gm.Equal(uint32(4))) - gm.Expect(len(rec.Bins)).To(gm.Equal(0)) - - // GetOp should override GetHEaderOp - ops5 := []*as.Operation{ - as.GetOp(), - as.GetHeaderOp(), - } - - rec, err = client.Operate(nil, key, ops5...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Generation).To(gm.Equal(uint32(4))) - gm.Expect(len(rec.Bins)).To(gm.Equal(2)) - - // GetOp should override GetHeaderOp - ops6 := []*as.Operation{ - as.GetHeaderOp(), - as.DeleteOp(), - as.PutOp(bin1), - } - - rec, err = client.Operate(nil, key, ops6...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Generation).To(gm.Equal(uint32(5))) - gm.Expect(len(rec.Bins)).To(gm.Equal(0)) - - // GetOp should override GetHeaderOp - ops7 := []*as.Operation{ - as.GetOp(), - as.TouchOp(), - } - - rec, err = client.Operate(nil, key, ops7...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Generation).To(gm.Equal(uint32(6))) - gm.Expect(len(rec.Bins)).To(gm.Equal(1)) - }) - - gg.It("must re-apply the same operations, and result should match expectation", func() { - const listSize = 10 - const cdtBinName = "cdtBin" - - // First Part: For CDTs - list := []interface{}{} - opAppend := as.ListAppendOp(cdtBinName, 1) - for i := 1; i <= listSize; i++ { - list = append(list, i) - - sz, err := client.Operate(wpolicy, key, opAppend) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(sz.Bins[cdtBinName]).To(gm.Equal(i)) - } - - op := as.ListGetOp(cdtBinName, -1) - cdtListRes, err := client.Operate(wpolicy, key, op) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - cdtListRes, err = client.Operate(wpolicy, key, op) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(cdtListRes.Bins[cdtBinName]).To(gm.Equal(1)) - - // Second Part: For other normal Ops - bin1 := as.NewBin("Aerospike1", 1) - bin2 := as.NewBin("Aerospike2", "a") - - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - ops1 := []*as.Operation{ - as.PutOp(bin1), - as.PutOp(bin2), - as.GetOp(), - } - - rec, err = client.Operate(nil, key, ops1...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int))) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string))) - gm.Expect(rec.Generation).To(gm.Equal(uint32(1))) - - ops2 := []*as.Operation{ - as.AddOp(bin1), - as.AppendOp(bin2), - as.GetOp(), - } - - rec, err = client.Operate(nil, key, ops2...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) + 1)) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string) + "a")) - gm.Expect(rec.Generation).To(gm.Equal(uint32(2))) - - rec, err = client.Operate(nil, key, ops2...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject().(int) + 2)) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject().(string) + "aa")) - gm.Expect(rec.Generation).To(gm.Equal(uint32(3))) - - }) - - }) // GetHeader context - - }) - - gg.Describe("Commands Test", func() { - - gg.Context("XDR Filter", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - - if !xdrEnabled() { - gg.Skip("XDR Filter Tests are not supported in the Community Edition, or when the server is not configured for XDR") - return - } - }) - - gg.It("must successfully send SetXDRFilter command", func() { - xp := as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(85), - ) - - err := client.SetXDRFilter(nil, "test", "test", xp) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("must reject invalid Expression for SetXDRFilter command", func() { - xp := as.ExpEq( - as.ExpIntBin("bin"), - as.ExpStringVal("some string"), - ) - - err := client.SetXDRFilter(nil, "test", "test", xp) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - gg.It("must remove the server XDR filter using SetXDRFilter command", func() { - err := client.SetXDRFilter(nil, "test", "test", nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - }) // gg.Context - - }) // Describe - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/cluster.go b/aerospike-tls/vendor-aerospike-client-go/cluster.go deleted file mode 100644 index c98b8a98..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/cluster.go +++ /dev/null @@ -1,1010 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "net" - "runtime/debug" - "sync" - "sync/atomic" - "time" - - "golang.org/x/sync/errgroup" - - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - sm "github.com/aerospike/aerospike-client-go/v7/internal/atomic/map" - "github.com/aerospike/aerospike-client-go/v7/internal/seq" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Cluster encapsulates the aerospike cluster nodes and manages -// them. -type Cluster struct { - // Initial host nodes specified by user. - seeds iatomic.SyncVal[[]*Host] - - // All aliases for all nodes in cluster. - // Only accessed within cluster tend goroutine. - aliases sm.Map[Host, *Node] - - // Map of active nodes in cluster. - // Only accessed within cluster tend goroutine. - nodesMap sm.Map[string, *Node] - - // Active nodes in cluster. - nodes iatomic.SyncVal[[]*Node] - stats map[string]*nodeStats //host => stats - statsLock sync.Mutex - - // enable performance metrics - metricsEnabled atomic.Bool // bool - metricsPolicy iatomic.TypedVal[*MetricsPolicy] - - // Hints for best node for a partition - partitionWriteMap iatomic.TypedVal[partitionMap] //partitionMap - - clientPolicy ClientPolicy - infoPolicy InfoPolicy - connectionThreshold iatomic.Int // number of parallel opening connections - - maxRetriesExceededCount iatomic.Int // number of times the commands on this cluster were exceeded the specifiedmax retries - totalTimeoutExceededCount iatomic.Int // number of times the commands on this cluster were exceeded the specified total timeout - - nodeIndex iatomic.Int // only used via atomic operations - replicaIndex iatomic.Int // only used via atomic operations - - wgTend sync.WaitGroup - tendChannel chan struct{} - closed iatomic.Bool - tendCount int - - supportsPartitionQuery iatomic.Bool // whether all nodes in the cluster support query by partition. - - // User name in UTF-8 encoded bytes. - user string - - // Password in hashed format in bytes. - password iatomic.SyncVal[[]byte] -} - -// NewCluster generates a Cluster instance. -func NewCluster(policy *ClientPolicy, hosts []*Host) (*Cluster, Error) { - // Validate the policy params - if policy.MinConnectionsPerNode > policy.ConnectionQueueSize { - panic("minimum number of connections specified in the ClientPolicy is bigger than total connection pool size") - } - - // Default TLS names when TLS enabled. - newHosts := make([]*Host, 0, len(hosts)) - if policy.TlsConfig != nil && !policy.TlsConfig.InsecureSkipVerify { - useClusterName := len(policy.ClusterName) > 0 - - for _, host := range hosts { - nh := *host - if nh.TLSName == "" { - if useClusterName { - nh.TLSName = policy.ClusterName - } else { - nh.TLSName = host.Name - } - } - newHosts = append(newHosts, &nh) - } - hosts = newHosts - } - - clientPolicy := *policy - - // Set a default Idle Timeout for the connection - if clientPolicy.IdleTimeout <= 0 { - clientPolicy.IdleTimeout = 55 * time.Second - } - - newCluster := &Cluster{ - clientPolicy: clientPolicy, - infoPolicy: InfoPolicy{Timeout: policy.Timeout}, - tendChannel: make(chan struct{}), - - seeds: *iatomic.NewSyncVal(hosts), - aliases: *sm.New[Host, *Node](16), - nodesMap: *sm.New[string, *Node](16), - nodes: *iatomic.NewSyncVal([]*Node{}), - stats: map[string]*nodeStats{}, - - password: *iatomic.NewSyncVal[[]byte](nil), - - supportsPartitionQuery: *iatomic.NewBool(false), - } - - newCluster.partitionWriteMap.Set(make(partitionMap)) - - // setup auth info for cluster - if policy.RequiresAuthentication() { - if policy.AuthMode == AuthModeExternal && policy.TlsConfig == nil { - return nil, newError(types.PARAMETER_ERROR, "External Authentication requires TLS configuration to be set, because it sends clear password on the wire.") - } - - newCluster.user = policy.User - hashedPass, err := hashPassword(policy.Password) - if err != nil { - return nil, err - } - newCluster.password = *iatomic.NewSyncVal(hashedPass) - } - - // try to seed connections for first use - err := newCluster.waitTillStabilized() - - // apply policy rules - if policy.FailIfNotConnected && !newCluster.IsConnected() { - if err != nil { - return nil, err - } - return nil, newError(types.PARAMETER_ERROR, fmt.Sprintf("Failed to connect to host(s): %v. The network connection(s) to cluster nodes may have timed out, or the cluster may be in a state of flux.", hosts)) - } - - // start up cluster maintenance go routine - newCluster.wgTend.Add(1) - go newCluster.clusterBoss(&newCluster.clientPolicy) - - if err == nil { - logger.Logger.Debug("New cluster initialized and ready to be used...") - } else { - logger.Logger.Error("New cluster was not initialized successfully, but the client will keep trying to connect to the database. Error: %s", err.Error()) - } - - return newCluster, err -} - -// String implements the stringer interface -func (clstr *Cluster) String() string { - return fmt.Sprintf("%v", clstr.GetNodes()) -} - -// Maintains the cluster on intervals. -// All clean up code for cluster is here as well. -func (clstr *Cluster) clusterBoss(policy *ClientPolicy) { - logger.Logger.Info("Starting the cluster tend goroutine...") - - defer func() { - if r := recover(); r != nil { - logger.Logger.Error("Cluster tend goroutine crashed: %s", debug.Stack()) - go clstr.clusterBoss(&clstr.clientPolicy) - } - }() - - defer clstr.wgTend.Done() - - tendInterval := policy.TendInterval - if tendInterval <= 10*time.Millisecond { - tendInterval = 10 * time.Millisecond - } - -Loop: - for { - select { - case <-clstr.tendChannel: - // tend channel closed - logger.Logger.Debug("Tend channel closed. Shutting down the cluster...") - break Loop - case <-time.After(tendInterval): - tm := time.Now() - if err := clstr.tend(); err != nil { - logger.Logger.Warn(err.Error()) - } - - // Tending took longer than requested tend interval. - // Tending is too slow for the cluster, and may be falling behind schedule. - if tendDuration := time.Since(tm); tendDuration > clstr.clientPolicy.TendInterval { - logger.Logger.Warn("Tending took %s, while your requested ClientPolicy.TendInterval is %s. Tends are slower than the interval, and may be falling behind the changes in the cluster.", tendDuration, clstr.clientPolicy.TendInterval) - } - } - } - - // cleanup code goes here - // close the nodes - nodeArray := clstr.GetNodes() - for _, node := range nodeArray { - node.Close() - } -} - -// AddSeeds adds new hosts to the cluster. -// They will be added to the cluster on next tend call. -func (clstr *Cluster) AddSeeds(hosts []*Host) { - clstr.seeds.Update(func(seeds []*Host) ([]*Host, error) { - seeds = append(seeds, hosts...) - return seeds, nil - }) -} - -// Healthy returns an error if the cluster is not healthy. -func (clstr *Cluster) Healthy() Error { - p := clstr.getPartitions() - if p == nil { - return ErrInvalidPartitionMap.err() - } - return p.validate() -} - -// Updates cluster state -func (clstr *Cluster) tend() Error { - - nodes := clstr.GetNodes() - nodeCountBeforeTend := len(nodes) - - // All node additions/deletions are performed in tend goroutine. - // If active nodes don't exist, seed cluster. - if len(nodes) == 0 || (clstr.clientPolicy.SeedOnlyCluster && len(nodes) < clstr.GetSeedCount()) { - logger.Logger.Info("No nodes available; seeding...") - if newNodesFound, err := clstr.seedNodes(); !newNodesFound { - return err - } - - // refresh nodes list after seeding - nodes = clstr.GetNodes() - } - - peers := newPeers(len(nodes)+16, 16) - - seq.ParDo(nodes, func(node *Node) { - if err := node.Refresh(peers); err != nil { - logger.Logger.Debug("Error occurred while refreshing node: %s", node.String()) - } - }) - - // Refresh peers when necessary. - if peers.genChanged.Get() || len(peers.peers()) != nodeCountBeforeTend { - // Refresh peers for all nodes that responded the first time even if only one node's peers changed. - peers.refreshCount.Set(0) - - seq.ParDo(nodes, func(node *Node) { - node.refreshPeers(peers) - }) - } - - var partMap iatomic.Guard[partitionMap] - - // find the first host that connects - seq.ParDo(peers.peers(), func(_peer *peer) { - if clstr.peerExists(peers, _peer.nodeName) { - // Node already exists. Do not even try to connect to hosts. - return - } - - seq.Do(_peer.hosts, func(host *Host) error { - // attempt connection to the host - nv := nodeValidator{seedOnlyCluster: clstr.clientPolicy.SeedOnlyCluster} - if err := nv.validateNode(clstr, host); err != nil { - logger.Logger.Warn("Add node `%s` failed: `%s`", host, err) - return nil - } - - // Must look for new node name in the unlikely event that node names do not agree. - if _peer.nodeName != nv.name { - logger.Logger.Warn("Peer node `%s` is different than actual node `%s` for host `%s`", _peer.nodeName, nv.name, host) - } - - if clstr.peerExists(peers, nv.name) { - // Node already exists. Do not even try to connect to hosts. - return seq.Break - } - - // Create new node. - node := clstr.createNode(&nv) - peers.addNode(nv.name, node) - partMap.InitDoVal(clstr.getPartitions().clone, func(partMap partitionMap) { - node.refreshPartitions(peers, partMap, true) - }) - return seq.Break - }) - }) - - // Refresh partition map when necessary. - seq.ParDo(nodes, func(node *Node) { - if node.partitionChanged.Get() { - partMap.InitDoVal(clstr.getPartitions().clone, func(partMap partitionMap) { - node.refreshPartitions(peers, partMap, false) - }) - } - }) - - if peers.genChanged.Get() { - // Handle nodes changes determined from refreshes. - removeList := clstr.findNodesToRemove(peers.refreshCount.Get()) - - // Remove nodes in a batch. - for i := range removeList { - logger.Logger.Debug("The following nodes will be removed: %s", removeList[i]) - } - clstr.removeNodes(removeList) - clstr.aggregateNodeStats(removeList) - } - - // Add nodes in a batch. - clstr.addNodes(peers.nodes()) - - // add to the number of successful tends - clstr.tendCount++ - - // update all partitions in one go - updatePartitionMap := seq.Any(clstr.GetNodes(), func(node *Node) bool { - return node.partitionChanged.Get() - }) - - if updatePartitionMap { - clstr.setPartitions(*partMap.Release()) - } - - if err := clstr.getPartitions().validate(); err != nil { - logger.Logger.Error("Error validating the cluster partition map after tend: %s", err.Error()) - } - - // only log if node count is changed - if nodeCountBeforeTend != len(clstr.GetNodes()) { - logger.Logger.Info("Tend finished. Live node count changes from %d to %d", nodeCountBeforeTend, len(clstr.GetNodes())) - } - - clstr.aggregateNodeStats(clstr.GetNodes()) - - // Reset connection error window for all nodes every connErrorWindow tend iterations. - if clstr.clientPolicy.MaxErrorRate > 0 && clstr.tendCount%clstr.clientPolicy.ErrorRateWindow == 0 { - for _, node := range clstr.GetNodes() { - node.resetErrorCount() - } - } - - return nil -} - -func (clstr *Cluster) aggregateNodeStats(nodeList []*Node) { - // update stats - clstr.statsLock.Lock() - defer clstr.statsLock.Unlock() - - for _, node := range nodeList { - h := node.host.String() - if stats, exists := clstr.stats[h]; exists { - stats.aggregate(node.stats.getAndReset()) - } else { - clstr.stats[h] = node.stats.getAndReset() - } - } -} - -func (clstr *Cluster) statsCopy() map[string]nodeStats { - // update the stats on the cluster object - clstr.aggregateNodeStats(clstr.GetNodes()) - - clstr.statsLock.Lock() - defer clstr.statsLock.Unlock() - - res := make(map[string]nodeStats, len(clstr.stats)) - for _, node := range clstr.GetNodes() { - h := node.host.String() - if stats, exists := clstr.stats[h]; exists { - statsCopy := stats.clone() - statsCopy.ConnectionsOpen.Set(node.connectionCount.Get()) - res[h] = statsCopy - } - } - - // stats for nodes which do not exist anymore - for h, stats := range clstr.stats { - if _, exists := res[h]; !exists { - stats.ConnectionsOpen.Set(0) - res[h] = stats.clone() - } - } - - return res -} - -func (clstr *Cluster) peerExists(peers *peers, nodeName string) bool { - node := clstr.findNodeByName(nodeName) - if node != nil { - node.referenceCount.IncrementAndGet() - return true - } - - node = peers.nodeByName(nodeName) - if node != nil { - node.referenceCount.IncrementAndGet() - return true - } - - return false -} - -// Tend the cluster until it has stabilized and return control. -// This helps avoid initial database request timeout issues when -// a large number of goroutines are initiated at client startup. -// -// If the cluster has not stabilized by the timeout, return -// control as well. Do not return an error since future -// database requests may still succeed. -func (clstr *Cluster) waitTillStabilized() Error { - count := -1 - - doneCh := make(chan Error, 10) - - // will run until the cluster is stabilized - go func() { - var err Error - for { - if err = clstr.tend(); err != nil { - if err.Matches(types.NOT_AUTHENTICATED, types.CLUSTER_NAME_MISMATCH_ERROR) { - select { - case doneCh <- err: - default: - } - } - logger.Logger.Warn(err.Error()) - } - - // Check to see if cluster has changed since the last Tend(). - // If not, assume cluster has stabilized and return. - if count == len(clstr.GetNodes()) { - break - } - - time.Sleep(time.Millisecond) - - count = len(clstr.GetNodes()) - } - doneCh <- err - }() - - select { - case <-time.After(clstr.clientPolicy.Timeout): - if clstr.clientPolicy.FailIfNotConnected { - clstr.Close() - } - return ErrTimeout.err() - case err := <-doneCh: - if err != nil && clstr.clientPolicy.FailIfNotConnected { - clstr.Close() - } - return err - } -} - -func (clstr *Cluster) findAlias(alias *Host) *Node { - return clstr.aliases.Get(*alias) -} - -func (clstr *Cluster) setPartitions(partMap partitionMap) { - if err := partMap.validate(); err != nil { - logger.Logger.Error("Partition map error: %s.", err.Error()) - } - - clstr.partitionWriteMap.Set(partMap) -} - -func (clstr *Cluster) getPartitions() partitionMap { - return clstr.partitionWriteMap.Get() -} - -// discoverSeeds will lookup the seed hosts and convert seed hosts -// to IP addresses. -func discoverSeedIPs(seeds []*Host) (res []*Host) { - for _, seed := range seeds { - addresses, err := net.LookupHost(seed.Name) - if err != nil { - continue - } - - for i := range addresses { - h := *seed - h.Name = addresses[i] - res = append(res, &h) - } - } - - return res -} - -// Adds seeds to the cluster -func (clstr *Cluster) seedNodes() (newSeedsFound bool, errChain Error) { - // Must copy array reference for copy on write semantics to work. - seedArrayCopy, _ := clstr.seeds.GetSyncedVia(func(seeds []*Host) ([]*Host, error) { - seedsCopy := make([]*Host, len(seeds)) - copy(seedsCopy, seeds) - - return seedsCopy, nil - }) - - // discover seed IPs from DNS or Load Balancers - seedArray := discoverSeedIPs(seedArrayCopy) - - successChan := make(chan struct{}, len(seedArray)) - errChan := make(chan Error, len(seedArray)) - - logger.Logger.Info("Seeding the cluster. Seeds count: %d", len(seedArray)) - - // Add all nodes at once to avoid copying entire array multiple times. - for i, seed := range seedArray { - go func(index int, seed *Host) { - nodesToAdd := make(nodesToAddT, 128) - nv := nodeValidator{seedOnlyCluster: clstr.clientPolicy.SeedOnlyCluster} - err := nv.seedNodes(clstr, seed, nodesToAdd) - if err != nil { - logger.Logger.Warn("Seed %s failed: %s", seed.String(), err.Error()) - errChan <- err - return - } - clstr.addNodes(nodesToAdd) - successChan <- struct{}{} - }(i, seed) - } - - seedCount := len(seedArray) -L: - for { - select { - case err := <-errChan: - errChain = chainErrors(err, errChain) - seedCount-- - if seedCount <= 0 { - break L - } - case <-successChan: - seedCount-- - newSeedsFound = true - if seedCount <= 0 { - break L - } - case <-time.After(clstr.clientPolicy.Timeout): - // time is up, no seeds found - break L - } - } - - if errChain != nil { - errChain = chainErrors(newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Failed to connect to hosts: %v", seedArray)), errChain) - } - - return newSeedsFound, errChain -} - -func (clstr *Cluster) createNode(nv *nodeValidator) *Node { - return newNode(clstr, nv) -} - -// Finds a node by name in a list of nodes -func (clstr *Cluster) findNodeName(list []*Node, name string) bool { - for _, node := range list { - if node.GetName() == name { - return true - } - } - return false -} - -func (clstr *Cluster) addAlias(host *Host, node *Node) { - if host != nil && node != nil { - clstr.aliases.Set(*host, node) - } -} - -func (clstr *Cluster) findNodesToRemove(refreshCount int) []*Node { - removeList := []*Node{} - - if clstr.clientPolicy.SeedOnlyCluster { - // Don't remove any node even if its bad or inactive. - return removeList - } - - nodes := clstr.GetNodes() - - for _, node := range nodes { - if !node.IsActive() { - // Inactive nodes must be removed. - removeList = append(removeList, node) - continue - } - - // Single node clusters rely on whether it responded to info requests. - if refreshCount == 0 && node.failures.Get() >= 5 { - // All node info requests failed and this node had 5 consecutive failures. - // Remove node. If no nodes are left, seeds will be tried in next cluster - // tend iteration. - removeList = append(removeList, node) - continue - } - - // Two node clusters require at least one successful refresh before removing. - if len(nodes) > 1 && refreshCount >= 1 && node.referenceCount.Get() == 0 { - // Node is not referenced by other nodes. - // Check if node responded to info request. - if node.failures.Get() == 0 { - // Node is alive, but not referenced by other nodes. Check if mapped. - if !clstr.findNodeInPartitionMap(node) { - // Node doesn't have any partitions mapped to it. - // There is no point in keeping it in the cluster. - removeList = append(removeList, node) - } - } else { - // Node not responding. Remove it. - removeList = append(removeList, node) - } - } - } - - return removeList -} - -func (clstr *Cluster) findNodeInPartitionMap(filter *Node) bool { - partMap := clstr.getPartitions() - - for _, partitions := range partMap { - for _, nodeArray := range partitions.Replicas { - for _, node := range nodeArray { - // Use reference equality for performance. - if node == filter { - return true - } - } - } - } - return false -} - -func (clstr *Cluster) updateClusterFeatures() { - pQuery := true - for _, n := range clstr.GetNodes() { - if !n.SupportsPartitionQuery() { - pQuery = false - break - } - } - clstr.supportsPartitionQuery.Set(pQuery) -} - -func (clstr *Cluster) addNodes(nodesToAdd map[string]*Node) { - if len(nodesToAdd) == 0 { - return - } - - // update features for all nodes - defer clstr.updateClusterFeatures() - - clstr.nodes.Update(func(nodes []*Node) ([]*Node, error) { - if clstr.clientPolicy.SeedOnlyCluster && clstr.GetSeedCount() == len(nodes) { - // Don't add new nodes. - return nodes, nil - } - - for _, node := range nodesToAdd { - if node != nil && !clstr.findNodeName(nodes, node.name) { - logger.Logger.Debug("Adding node %s (%s) to the cluster.", node.name, node.host.String()) - nodes = append(nodes, node) - } - } - - nodesMap := make(map[string]*Node, len(nodes)) - nodesAliases := make(map[Host]*Node, len(nodes)) - for i := range nodes { - nodesMap[nodes[i].name] = nodes[i] - - for _, alias := range nodes[i].GetAliases() { - nodesAliases[*alias] = nodes[i] - } - } - - clstr.nodesMap.Replace(nodesMap) - clstr.aliases.Replace(nodesAliases) - - return nodes, nil - }) -} - -func (clstr *Cluster) removeNodes(nodesToRemove []*Node) { - if len(nodesToRemove) == 0 { - return - } - - // update features for all nodes - defer clstr.updateClusterFeatures() - - // There is no need to delete nodes from partitionWriteMap because the nodes - // have already been set to inactive. - - // Cleanup node resources. - for _, node := range nodesToRemove { - // Remove node's aliases from cluster alias set. - // Aliases are only used in tend goroutine, so synchronization is not necessary. - clstr.aliases.DeleteAllDeref(node.GetAliases()...) - clstr.nodesMap.Delete(node.name) - node.Close() - } - - // Remove all nodes at once to avoid copying entire array multiple times. - clstr.nodes.Update(func(nodes []*Node) ([]*Node, error) { - nlist := make([]*Node, 0, len(nodes)) - nlist = append(nlist, nodes...) - for i, n := range nlist { - for _, ntr := range nodesToRemove { - if ntr.Equals(n) { - nlist[i] = nil - } - } - } - - newNodes := make([]*Node, 0, len(nlist)) - for i := range nlist { - if nlist[i] != nil { - newNodes = append(newNodes, nlist[i]) - } - } - - return newNodes, nil - }) - -} - -// IsConnected returns true if cluster has nodes and is not already closed. -func (clstr *Cluster) IsConnected() bool { - // Must copy array reference for copy on write semantics to work. - nodeArray := clstr.GetNodes() - return (len(nodeArray) > 0) && !clstr.closed.Get() -} - -// GetRandomNode returns a random node on the cluster -func (clstr *Cluster) GetRandomNode() (*Node, Error) { - // Must copy array reference for copy on write semantics to work. - nodeArray := clstr.GetNodes() - length := len(nodeArray) - - // prevent division by zero - if length > 0 { - for i := 0; i < length; i++ { - // Must handle concurrency with other non-tending goroutines, so nodeIndex is consistent. - index := clstr.nodeIndex.IncrementAndGet() % length - node := nodeArray[index] - - if node != nil && node.IsActive() { - //logger.Logger.Debug("Node `%s` is active. index=%d", node, index) - return node, nil - } - } - } - - return nil, ErrClusterIsEmpty.err() -} - -// GetNodes returns a list of all nodes in the cluster -func (clstr *Cluster) GetNodes() []*Node { - // Must copy array reference for copy on write semantics to work. - return clstr.nodes.Get() -} - -// GetSeedCount is the count of seed nodes -func (clstr *Cluster) GetSeedCount() int { - res, _ := iatomic.MapSyncValue(&clstr.seeds, func(seeds []*Host) (int, error) { - return len(seeds), nil - }) - - return res -} - -// GetSeeds returns a list of all seed nodes in the cluster -func (clstr *Cluster) GetSeeds() []Host { - res, _ := iatomic.MapSyncValue(&clstr.seeds, func(seeds []*Host) ([]Host, error) { - res := make([]Host, 0, len(seeds)) - for _, seed := range seeds { - res = append(res, *seed) - } - - return res, nil - }) - - return res -} - -// GetAliases returns a list of all node aliases in the cluster -func (clstr *Cluster) GetAliases() map[Host]*Node { - return clstr.aliases.Clone() -} - -// GetNodeByName finds a node by name and returns an -// error if the node is not found. -func (clstr *Cluster) GetNodeByName(nodeName string) (*Node, Error) { - node := clstr.findNodeByName(nodeName) - - if node == nil { - return nil, newError(types.INVALID_NODE_ERROR, "Invalid node name"+nodeName) - } - return node, nil -} - -func (clstr *Cluster) findNodeByName(nodeName string) *Node { - // Must copy array reference for copy on write semantics to work. - for _, node := range clstr.GetNodes() { - if node.GetName() == nodeName { - return node - } - } - return nil -} - -// Close closes all cached connections to the cluster nodes -// and stops the tend goroutine. -func (clstr *Cluster) Close() { - if clstr.closed.CompareAndToggle(false) { - // send close signal to maintenance channel - close(clstr.tendChannel) - - // wait until tend is over - clstr.wgTend.Wait() - - // remove node references from the partition table - // to allow GC to work its magic. Leaks otherwise. - clstr.getPartitions().cleanup() - } -} - -// MigrationInProgress determines if any node in the cluster -// is participating in a data migration -func (clstr *Cluster) MigrationInProgress(timeout time.Duration) (res bool, err Error) { - if timeout <= 0 { - timeout = _DEFAULT_TIMEOUT - } - - done := make(chan bool, 1) - - go func() { - // this function is guaranteed to return after _DEFAULT_TIMEOUT - nodes := clstr.GetNodes() - for _, node := range nodes { - if node.IsActive() { - if res, err = node.MigrationInProgress(); res || err != nil { - done <- true - return - } - } - } - - res, err = false, nil - done <- false - }() - - dealine := time.After(timeout) - for { - select { - case <-dealine: - return false, ErrTimeout.err() - case <-done: - return res, err - } - } -} - -// WaitUntillMigrationIsFinished will block until all -// migration operations in the cluster all finished. -func (clstr *Cluster) WaitUntillMigrationIsFinished(timeout time.Duration) Error { - if timeout <= 0 { - timeout = _NO_TIMEOUT - } - done := make(chan Error, 1) - - go func() { - // this function is guaranteed to return after timeout - // no go routines will be leaked - for { - if res, err := clstr.MigrationInProgress(timeout); err != nil || !res { - done <- err - return - } - } - }() - - dealine := time.After(timeout) - select { - case <-dealine: - return ErrTimeout.err() - case err := <-done: - return err - } -} - -// Password returns the password that is currently used with the cluster. -func (clstr *Cluster) Password() (res []byte) { - pass := clstr.password.Get() - if pass != nil { - return pass - } - return nil -} - -func (clstr *Cluster) changePassword(user string, password string, hash []byte) { - // change password ONLY if the user is the same - if clstr.user == user { - clstr.clientPolicy.Password = password - clstr.password.Set(hash) - } -} - -// ClientPolicy returns the client policy that is currently used with the cluster. -func (clstr *Cluster) ClientPolicy() (res ClientPolicy) { - return clstr.clientPolicy -} - -// WarmUp fills the connection pool with connections for all nodes. -// This is necessary on startup for high traffic programs. -// If the count is <= 0, the connection queue will be filled. -// If the count is more than the size of the pool, the pool will be filled. -// Note: One connection per node is reserved for tend operations and is not used for transactions. -func (clstr *Cluster) WarmUp(count int) (int, Error) { - var g errgroup.Group - cnt := iatomic.NewInt(0) - nodes := clstr.GetNodes() - for i := range nodes { - node := nodes[i] - g.Go(func() error { - n, err := node.WarmUp(count) - cnt.AddAndGet(n) - - return err - }) - } - - err := g.Wait() - if err != nil { - return cnt.Get(), err.(Error) - } - return cnt.Get(), nil -} - -// MetricsEnabled returns true if metrics are enabled for the cluster. -func (clstr *Cluster) MetricsPolicy() *MetricsPolicy { - return clstr.metricsPolicy.Get() -} - -// MetricsEnabled returns true if metrics are enabled for the cluster. -func (clstr *Cluster) MetricsEnabled() bool { - return clstr.metricsEnabled.Load() -} - -// EnableMetrics enables the cluster transaction metrics gathering. -// If the parameters for the histogram in the policy are the different from the one already -// on the cluster, the metrics will be reset. -func (clstr *Cluster) EnableMetrics(policy *MetricsPolicy) { - if policy == nil { - policy = DefaultMetricsPolicy() - } - - clstr.metricsPolicy.Set(policy) - clstr.metricsEnabled.Store(true) - - clstr.statsLock.Lock() - defer clstr.statsLock.Unlock() - - // reshape the histogram in case it has changed - for _, stat := range clstr.stats { - stat.reshape(policy) - } - - for _, node := range clstr.GetNodes() { - node.stats.reshape(policy) - } -} - -// DisableMetrics disables the cluster transaction metrics gathering. -func (clstr *Cluster) DisableMetrics() { - clstr.metricsEnabled.Store(false) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/command.go b/aerospike-tls/vendor-aerospike-client-go/command.go deleted file mode 100644 index 3fa0e7c8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/command.go +++ /dev/null @@ -1,2907 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "compress/zlib" - "encoding/binary" - "errors" - "fmt" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - "github.com/aerospike/aerospike-client-go/v7/types/pool" - - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -const ( - // Flags commented out are not supported by cmd client. - // Contains a read operation. - _INFO1_READ int = (1 << 0) - // Get all bins. - _INFO1_GET_ALL int = (1 << 1) - // Short query - _INFO1_SHORT_QUERY int = (1 << 2) - // Batch read or exists. - _INFO1_BATCH int = (1 << 3) - - // Do not read the bins - _INFO1_NOBINDATA int = (1 << 5) - - // Involve all replicas in read operation. - _INFO1_READ_MODE_AP_ALL = (1 << 6) - - // Tell server to compress its response. - _INFO1_COMPRESS_RESPONSE = (1 << 7) - - // Create or update record - _INFO2_WRITE int = (1 << 0) - // Fling a record into the belly of Moloch. - _INFO2_DELETE int = (1 << 1) - // Update if expected generation == old. - _INFO2_GENERATION int = (1 << 2) - // Update if new generation >= old, good for restore. - _INFO2_GENERATION_GT int = (1 << 3) - // Transaction resulting in record deletion leaves tombstone (Enterprise only). - _INFO2_DURABLE_DELETE int = (1 << 4) - // Create only. Fail if record already exists. - _INFO2_CREATE_ONLY int = (1 << 5) - // Treat as long query, but relax read consistency. - _INFO2_RELAX_AP_LONG_QUERY = (1 << 6) - // Return a result for every operation. - _INFO2_RESPOND_ALL_OPS int = (1 << 7) - - // This is the last of a multi-part message. - _INFO3_LAST int = (1 << 0) - // Commit to master only before declaring success. - _INFO3_COMMIT_MASTER int = (1 << 1) - // On send: Do not return partition done in scan/query. - // On receive: Specified partition is done in scan/query. - _INFO3_PARTITION_DONE int = (1 << 2) - // Update only. Merge bins. - _INFO3_UPDATE_ONLY int = (1 << 3) - - // Create or completely replace record. - _INFO3_CREATE_OR_REPLACE int = (1 << 4) - // Completely replace existing record only. - _INFO3_REPLACE_ONLY int = (1 << 5) - // See Below - _INFO3_SC_READ_TYPE int = (1 << 6) - // See Below - _INFO3_SC_READ_RELAX int = (1 << 7) - - // Interpret SC_READ bits in info3. - // - // RELAX TYPE - // strict - // ------ - // 0 0 sequential (default) - // 0 1 linearize - // - // relaxed - // ------- - // 1 0 allow replica - // 1 1 allow unavailable - - _STATE_READ_AUTH_HEADER uint8 = 1 - _STATE_READ_HEADER uint8 = 2 - _STATE_READ_DETAIL uint8 = 3 - _STATE_COMPLETE uint8 = 4 - - _BATCH_MSG_READ uint8 = 0x0 - _BATCH_MSG_REPEAT uint8 = 0x1 - _BATCH_MSG_INFO uint8 = 0x2 - _BATCH_MSG_GEN uint8 = 0x4 - _BATCH_MSG_TTL uint8 = 0x8 - - _MSG_TOTAL_HEADER_SIZE uint8 = 30 - _FIELD_HEADER_SIZE uint8 = 5 - _OPERATION_HEADER_SIZE uint8 = 8 - _MSG_REMAINING_HEADER_SIZE uint8 = 22 - _DIGEST_SIZE uint8 = 20 - _COMPRESS_THRESHOLD int = 128 - _CL_MSG_VERSION int64 = 2 - _AS_MSG_TYPE int64 = 3 - _AS_MSG_TYPE_COMPRESSED int64 = 4 -) - -type transactionType int - -const ( - ttNone transactionType = iota - ttGet - ttGetHeader - ttExists - ttPut - ttDelete - ttOperate - ttQuery - ttScan - ttUDF - ttBatchRead - ttBatchWrite -) - -var ( - buffPool = pool.NewTieredBufferPool(MinBufferSize, PoolCutOffBufferSize) -) - -// command interface describes all commands available -type command interface { - getPolicy(ifc command) Policy - - writeBuffer(ifc command) Error - getNode(ifc command) (*Node, Error) - getConnection(policy Policy) (*Connection, Error) - putConnection(conn *Connection) - parseResult(ifc command, conn *Connection) Error - parseRecordResults(ifc command, receiveSize int) (bool, Error) - prepareRetry(ifc command, isTimeout bool) bool - - transactionType() transactionType - - isRead() bool - - execute(ifc command) Error - executeAt(ifc command, policy *BasePolicy, deadline time.Time, iterations int) Error - - canPutConnBack() bool - - // Executes the command - Execute() Error -} - -// Holds data buffer for the command -type baseCommand struct { - bufferEx - - node *Node - conn *Connection - - // dataBufferCompress is not a second buffer; it is just a pointer to - // the beginning of the dataBuffer. - // To avoid allocating multiple buffers before compression, the dataBuffer - // will be referencing to a padded buffer. After the command is written to - // the buffer, this padding will be used to compress the command in-place, - // and then the compressed proto header will be written. - dataBufferCompress []byte - // oneShot determines if streaming commands like query, scan or queryAggregate - // are not retried if they error out mid-parsing - oneShot bool - - // will determine if the buffer will be compressed - // before being sent to the server - compressed bool - - commandSentCounter int - commandWasSent bool -} - -// Writes the command for write operations -func (cmd *baseCommand) setWrite(policy *WritePolicy, operation OperationType, key *Key, bins []*Bin, binMap BinMap) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if binMap == nil { - for i := range bins { - if err := cmd.estimateOperationSizeForBin(bins[i]); err != nil { - return err - } - } - } else { - for name, value := range binMap { - if err := cmd.estimateOperationSizeForBinNameAndValue(name, value); err != nil { - return err - } - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - if binMap == nil { - cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, len(bins)) - } else { - cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, len(binMap)) - } - - if err := cmd.writeKey(key, policy.SendKey); err != nil { - return err - } - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - if binMap == nil { - for i := range bins { - if err := cmd.writeOperationForBin(bins[i], operation); err != nil { - return err - } - } - } else { - for name, value := range binMap { - if err := cmd.writeOperationForBinNameAndValue(name, value, operation); err != nil { - return err - } - } - } - - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -// Writes the command for delete operations -func (cmd *baseCommand) setDelete(policy *WritePolicy, key *Key) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, false) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - cmd.writeHeaderWrite(policy, _INFO2_WRITE|_INFO2_DELETE, fieldCount, 0) - if err := cmd.writeKey(key, false); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.end() - cmd.markCompressed(policy) - - return nil - -} - -// Writes the command for touch operations -func (cmd *baseCommand) setTouch(policy *WritePolicy, key *Key) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - cmd.estimateOperationSize() - if err := cmd.sizeBuffer(false); err != nil { - return err - } - cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, 1) - if err := cmd.writeKey(key, policy.SendKey); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.writeOperationForOperationType(_TOUCH) - cmd.end() - return nil - -} - -// Writes the command for exist operations -func (cmd *baseCommand) setExists(policy *BasePolicy, key *Key) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, false) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if err := cmd.sizeBuffer(false); err != nil { - return err - } - cmd.writeHeaderReadHeader(policy, _INFO1_READ|_INFO1_NOBINDATA, fieldCount, 0) - if err := cmd.writeKey(key, false); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.end() - return nil - -} - -// Writes the command for get operations (all bins) -func (cmd *baseCommand) setReadForKeyOnly(policy *BasePolicy, key *Key) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, false) - if err != nil { - return err - } - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeHeaderRead(policy, _INFO1_READ|_INFO1_GET_ALL, 0, 0, fieldCount, 0) - if err := cmd.writeKey(key, false); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.end() - cmd.markCompressed(policy) - - return nil - -} - -// Writes the command for get operations (specified bins) -func (cmd *baseCommand) setRead(policy *BasePolicy, key *Key, binNames []string) Error { - if len(binNames) > 0 { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, false) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - for i := range binNames { - cmd.estimateOperationSizeForBinName(binNames[i]) - } - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - attr := _INFO1_READ - if len(binNames) == 0 { - attr |= _INFO1_GET_ALL - } - cmd.writeHeaderRead(policy, attr, 0, 0, fieldCount, len(binNames)) - - if err := cmd.writeKey(key, false); err != nil { - return err - } - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - for i := range binNames { - cmd.writeOperationForBinName(binNames[i], _READ) - } - cmd.end() - cmd.markCompressed(policy) - return nil - } - return cmd.setReadForKeyOnly(policy, key) -} - -// Writes the command for getting metadata operations -func (cmd *baseCommand) setReadHeader(policy *BasePolicy, key *Key) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, false) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeHeaderReadHeader(policy, _INFO1_READ|_INFO1_NOBINDATA, fieldCount, 0) - if err := cmd.writeKey(key, false); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.end() - cmd.markCompressed(policy) - - return nil - -} - -// Implements different command operations -func (cmd *baseCommand) setOperate(policy *WritePolicy, key *Key, args *operateArgs) Error { - if len(args.operations) == 0 { - return newError(types.PARAMETER_ERROR, "No operations were passed.") - } - - cmd.begin() - fieldCount := 0 - - for i := range args.operations { - if err := cmd.estimateOperationSizeForOperation(args.operations[i], false); err != nil { - return err - } - } - - ksz, err := cmd.estimateKeySize(key, policy.SendKey && args.hasWrite) - if err != nil { - return err - } - fieldCount += ksz - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeHeaderReadWrite(policy, args, fieldCount) - - if err := cmd.writeKey(key, policy.SendKey && args.hasWrite); err != nil { - return err - } - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - for _, operation := range args.operations { - if err := cmd.writeOperationForOperation(operation); err != nil { - return err - } - } - - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -func (cmd *baseCommand) setUdf(policy *WritePolicy, key *Key, packageName string, functionName string, args *ValueArray) Error { - cmd.begin() - fieldCount, err := cmd.estimateKeySize(key, policy.SendKey) - if err != nil { - return err - } - - predSize := 0 - if policy.FilterExpression != nil { - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - fc, err := cmd.estimateUdfSize(packageName, functionName, args) - if err != nil { - return err - } - fieldCount += fc - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeHeaderWrite(policy, _INFO2_WRITE, fieldCount, 0) - if err := cmd.writeKey(key, policy.SendKey); err != nil { - return err - } - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - cmd.writeFieldString(packageName, UDF_PACKAGE_NAME) - cmd.writeFieldString(functionName, UDF_FUNCTION) - if err := cmd.writeUdfArgs(args); err != nil { - return err - } - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -func (cmd *baseCommand) setBatchOperateIfc(client ClientIfc, policy *BatchPolicy, records []BatchRecordIfc, batch *batchNode) (*batchAttr, Error) { - offsets := batch.offsets - max := len(batch.offsets) - - // Estimate buffer size - cmd.begin() - fieldCount := 1 - predSize := 0 - if policy.FilterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return nil, err - } - if predSize > 0 { - fieldCount++ - } - } - cmd.dataOffset += predSize - - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 - - var prev BatchRecordIfc - for i := 0; i < max; i++ { - record := records[offsets[i]] - key := record.key() - cmd.dataOffset += len(key.digest) + 4 - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !policy.SendKey && prev != nil && prev.key().namespace == key.namespace && (prev.key().setName == key.setName) && record.equals(prev) { - // Can set repeat previous namespace/bin names to save space. - cmd.dataOffset++ - } else { - // Must write full header and namespace/set/bin names. - cmd.dataOffset += 12 // header(4) + ttl(4) + fielCount(2) + opCount(2) = 12 - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - - if sz, err := record.size(&policy.BasePolicy); err != nil { - return nil, err - } else { - cmd.dataOffset += sz - } - - prev = record - } - - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return nil, err - } - - cmd.writeBatchHeader(policy, fieldCount) - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return nil, err - } - } - - // Write real field size. - fieldSizeOffset := cmd.dataOffset - cmd.writeFieldHeader(0, BATCH_INDEX) - - cmd.WriteUint32(uint32(max)) - - cmd.WriteByte(cmd.getBatchFlags(policy)) - - attr := &batchAttr{} - prev = nil - for i := 0; i < max; i++ { - index := offsets[i] - cmd.WriteUint32(uint32(index)) - - record := records[index] - key := record.key() - if _, err := cmd.Write(key.digest[:]); err != nil { - return nil, newCommonError(err) - } - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !policy.SendKey && prev != nil && prev.key().namespace == key.namespace && prev.key().setName == key.setName && record.equals(prev) { - // Can set repeat previous namespace/bin names to save space. - cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat - } else { - // Write full message. - switch record.getType() { - case _BRT_BATCH_READ: - br := record.(*BatchRead) - - attr.setBatchRead(client.getUsableBatchReadPolicy(br.Policy)) - if len(br.BinNames) > 0 { - cmd.writeBatchBinNames(key, br.BinNames, attr, attr.filterExp) - } else if br.Ops != nil { - attr.adjustRead(br.Ops) - cmd.writeBatchOperations(key, br.Ops, attr, attr.filterExp) - } else { - attr.adjustReadForAllBins(br.ReadAllBins) - cmd.writeBatchRead(key, attr, attr.filterExp, 0) - } - - case _BRT_BATCH_WRITE: - bw := record.(*BatchWrite) - - attr.setBatchWrite(client.getUsableBatchWritePolicy(bw.Policy)) - attr.adjustWrite(bw.Ops) - cmd.writeBatchOperations(key, bw.Ops, attr, attr.filterExp) - - case _BRT_BATCH_UDF: - bu := record.(*BatchUDF) - - attr.setBatchUDF(client.getUsableBatchUDFPolicy(bu.Policy)) - cmd.writeBatchWrite(key, attr, attr.filterExp, 3, 0) - cmd.writeFieldString(bu.PackageName, UDF_PACKAGE_NAME) - cmd.writeFieldString(bu.FunctionName, UDF_FUNCTION) - cmd.writeFieldBytes(bu.argBytes, UDF_ARGLIST) - - case _BRT_BATCH_DELETE: - bd := record.(*BatchDelete) - - attr.setBatchDelete(client.getUsableBatchDeletePolicy(bd.Policy)) - cmd.writeBatchWrite(key, attr, attr.filterExp, 0, 0) - } - prev = record - } - } - - cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) - cmd.end() - cmd.markCompressed(policy) - - return attr, nil - -} - -func (cmd *baseCommand) setBatchOperate(policy *BatchPolicy, keys []*Key, batch *batchNode, binNames []string, ops []*Operation, attr *batchAttr) Error { - offsets := batch.offsets - max := len(batch.offsets) - // Estimate buffer size - cmd.begin() - fieldCount := 1 - predSize := 0 - - exp := policy.FilterExpression - if attr.filterExp != nil { - exp = attr.filterExp - } - - if exp != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(exp) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - cmd.dataOffset += predSize - - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 - - var prev *Key - for i := 0; i < max; i++ { - key := keys[offsets[i]] - cmd.dataOffset += len(key.digest) + 4 - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !attr.sendKey && prev != nil && prev.namespace == key.namespace && (prev.setName == key.setName) { - // Can set repeat previous namespace/bin names to save space. - cmd.dataOffset++ - } else { - // Must write full header and namespace/set/bin names. - cmd.dataOffset += 12 // header(4) + ttl(4) + fielCount(2) + opCount(2) = 12 - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - - if attr.sendKey { - if sz, err := key.userKey.EstimateSize(); err != nil { - return err - } else { - cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 - } - } - - if len(binNames) > 0 { - for _, binName := range binNames { - cmd.estimateOperationSizeForBinName(binName) - } - } else if len(ops) > 0 { - for _, op := range ops { - if op.opType.isWrite { - if !attr.hasWrite { - return newError(types.PARAMETER_ERROR, "batch operation is write but isWrite flag not set in attrs") - } - cmd.dataOffset += 2 // Extra write specific fields. - } - - if err := cmd.estimateOperationSizeForOperation(op, true); err != nil { - return err - } - } - } else if (attr.writeAttr & _INFO2_DELETE) != 0 { - cmd.dataOffset += 2 // Extra write specific fields. - } - - prev = key - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeBatchHeader(policy, fieldCount) - - if exp != nil { - if err := cmd.writeFilterExpression(exp, predSize); err != nil { - return err - } - } - - // Write real field size. - fieldSizeOffset := cmd.dataOffset - cmd.writeFieldHeader(0, BATCH_INDEX) - - cmd.WriteUint32(uint32(max)) - - cmd.WriteByte(cmd.getBatchFlags(policy)) - - prev = nil - for i := 0; i < max; i++ { - index := offsets[i] - cmd.WriteUint32(uint32(index)) - - key := keys[index] - if _, err := cmd.Write(key.digest[:]); err != nil { - return newCommonError(err) - } - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !attr.sendKey && prev != nil && prev.namespace == key.namespace && prev.setName == key.setName { - // Can set repeat previous namespace/bin names to save space. - cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat - } else { - // Write full header, namespace and bin names. - if len(binNames) > 0 { - cmd.writeBatchBinNames(key, binNames, attr, nil) - } else if len(ops) > 0 { - cmd.writeBatchOperations(key, ops, attr, nil) - } else if (attr.writeAttr & _INFO2_DELETE) != 0 { - cmd.writeBatchWrite(key, attr, nil, 0, 0) - } else { - cmd.writeBatchRead(key, attr, nil, 0) - } - - prev = key - } - } - - cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -func (cmd *baseCommand) setBatchUDF(policy *BatchPolicy, keys []*Key, batch *batchNode, packageName, functionName string, args ValueArray, attr *batchAttr) Error { - offsets := batch.offsets - max := len(batch.offsets) - - // Estimate buffer size - cmd.begin() - fieldCount := 1 - predSize := 0 - if policy.FilterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - cmd.dataOffset += predSize - - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 - - var prev *Key - for i := 0; i < max; i++ { - key := keys[offsets[i]] - cmd.dataOffset += len(key.digest) + 4 - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !attr.sendKey && prev != nil && prev.namespace == key.namespace && (prev.setName == key.setName) { - // Can set repeat previous namespace/bin names to save space. - cmd.dataOffset++ - } else { - // Must write full header and namespace/set/bin names. - cmd.dataOffset += 12 // header(4) + ttl(4) + fieldCount(2) + opCount(2) = 12 - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - - if attr.sendKey { - if sz, err := key.userKey.EstimateSize(); err != nil { - return err - } else { - cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 - } - } - - cmd.dataOffset += 2 // gen(2) = 2 - if sz, err := cmd.estimateUdfSize(packageName, functionName, &args); err != nil { - return err - } else { - cmd.dataOffset += sz - } - - prev = key - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - cmd.writeBatchHeader(policy, fieldCount) - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - // Write real field size. - fieldSizeOffset := cmd.dataOffset - cmd.writeFieldHeader(0, BATCH_INDEX) - - cmd.WriteUint32(uint32(max)) - - cmd.WriteByte(cmd.getBatchFlags(policy)) - - prev = nil - for i := 0; i < max; i++ { - index := offsets[i] - cmd.WriteUint32(uint32(index)) - - key := keys[index] - if _, err := cmd.Write(key.digest[:]); err != nil { - return newCommonError(err) - } - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if !attr.sendKey && prev != nil && prev.namespace == key.namespace && prev.setName == key.setName { - // Can set repeat previous namespace/bin names to save space. - cmd.WriteByte(_BATCH_MSG_REPEAT) // repeat - } else { - cmd.writeBatchWrite(key, attr, nil, 3, 0) - cmd.writeFieldString(packageName, UDF_PACKAGE_NAME) - cmd.writeFieldString(functionName, UDF_FUNCTION) - if err := cmd.writeUdfArgs(&args); err != nil { - return err - } - prev = key - } - } - - cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) - cmd.end() - cmd.markCompressed(policy) - - // fmt.Printf("len: %d\n", len(cmd.dataBuffer[:cmd.dataOffset])) - // fmt.Printf("%s\n", hex.Dump(cmd.dataBuffer[:cmd.dataOffset])) - - return nil -} - -func (cmd *baseCommand) writeBatchHeader(policy *BatchPolicy, fieldCount int) { - readAttr := _INFO1_BATCH - - if policy.UseCompression { - readAttr |= _INFO1_COMPRESS_RESPONSE - } - - cmd.dataOffset = 8 - - // Write all header data except total size which must be written last. - cmd.WriteByte(_MSG_REMAINING_HEADER_SIZE) // Message header length. - cmd.WriteByte(byte(readAttr)) - cmd.WriteByte(0) - cmd.WriteByte(0) - for i := 12; i < 22; i++ { - cmd.WriteByte(0) - } - cmd.WriteUint32(0) // timeout will be rewritten later - cmd.WriteUint16(uint16(fieldCount)) - cmd.WriteUint16(0) - // cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -func (cmd *baseCommand) writeBatchBinNames(key *Key, binNames []string, attr *batchAttr, filter *Expression) { - cmd.writeBatchRead(key, attr, filter, len(binNames)) - - for i := range binNames { - cmd.writeOperationForBinName(binNames[i], _READ) - } -} - -func (cmd *baseCommand) writeBatchOperations(key *Key, ops []*Operation, attr *batchAttr, filter *Expression) { - if attr.hasWrite { - cmd.writeBatchWrite(key, attr, filter, 0, len(ops)) - } else { - cmd.writeBatchRead(key, attr, filter, len(ops)) - } - - for i := range ops { - cmd.writeOperationForOperation(ops[i]) - } -} - -func (cmd *baseCommand) writeBatchRead(key *Key, attr *batchAttr, filter *Expression, opCount int) { - cmd.WriteByte(_BATCH_MSG_INFO | _BATCH_MSG_TTL) - cmd.WriteByte(byte(attr.readAttr)) - cmd.WriteByte(byte(attr.writeAttr)) - cmd.WriteByte(byte(attr.infoAttr)) - cmd.WriteUint32(attr.expiration) - cmd.writeBatchFieldsWithFilter(key, filter, 0, opCount) -} - -func (cmd *baseCommand) writeBatchWrite(key *Key, attr *batchAttr, filter *Expression, fieldCount, opCount int) { - cmd.WriteByte(_BATCH_MSG_INFO | _BATCH_MSG_GEN | _BATCH_MSG_TTL) - cmd.WriteByte(byte(attr.readAttr)) - cmd.WriteByte(byte(attr.writeAttr)) - cmd.WriteByte(byte(attr.infoAttr)) - cmd.WriteUint16(uint16(attr.generation)) - cmd.WriteUint32(attr.expiration) - - if attr.sendKey { - fieldCount++ - cmd.writeBatchFieldsWithFilter(key, filter, fieldCount, opCount) - cmd.writeFieldValue(key.userKey, KEY) - } else { - cmd.writeBatchFieldsWithFilter(key, filter, fieldCount, opCount) - } -} - -func (cmd *baseCommand) getBatchFlags(policy *BatchPolicy) byte { - flags := byte(0) - if policy.AllowInline { - flags = 1 - } - - if policy.AllowInlineSSD { - flags |= 0x2 - } - - if policy.RespondAllKeys { - flags |= 0x4 - } - return flags -} - -func (cmd *baseCommand) setBatchRead(policy *BatchPolicy, keys []*Key, batch *batchNode, binNames []string, ops []*Operation, readAttr int) Error { - offsets := batch.offsets - max := len(batch.offsets) - - // Estimate buffer size - cmd.begin() - fieldCount := 1 - predSize := 0 - if policy.FilterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - cmd.dataOffset += predSize - - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 - - var prev *Key - for i := 0; i < max; i++ { - key := keys[offsets[i]] - cmd.dataOffset += len(key.digest) + 4 - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if prev != nil && prev.namespace == key.namespace && - (prev.setName == key.setName) { - // Can set repeat previous namespace/bin names to save space. - cmd.dataOffset++ - } else { - // Must write full header and namespace/set/bin names. - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + 6 - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - - if len(binNames) > 0 { - for _, binName := range binNames { - cmd.estimateOperationSizeForBinName(binName) - } - } else if len(ops) > 0 { - for _, op := range ops { - if err := cmd.estimateOperationSizeForOperation(op, true); err != nil { - return err - } - } - } - - prev = key - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - if policy.ReadModeAP == ReadModeAPAll { - readAttr |= _INFO1_READ_MODE_AP_ALL - } - - cmd.writeHeaderRead(&policy.BasePolicy, readAttr|_INFO1_BATCH, 0, 0, fieldCount, 0) - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - // Write real field size. - fieldSizeOffset := cmd.dataOffset - cmd.writeFieldHeader(0, BATCH_INDEX_WITH_SET) - - cmd.WriteUint32(uint32(max)) - - if policy.AllowInline { - cmd.WriteByte(1) - } else { - cmd.WriteByte(0) - } - - prev = nil - for i := 0; i < max; i++ { - index := offsets[i] - cmd.WriteUint32(uint32(index)) - - key := keys[index] - if _, err := cmd.Write(key.digest[:]); err != nil { - return newCommonError(err) - } - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if prev != nil && prev.namespace == key.namespace && - (prev.setName == key.setName) { - // Can set repeat previous namespace/bin names to save space. - cmd.WriteByte(1) // repeat - } else { - // Write full header, namespace and bin names. - cmd.WriteByte(0) // do not repeat - if len(binNames) > 0 { - cmd.WriteByte(byte(readAttr)) - cmd.writeBatchFields(key, 0, len(binNames)) - for _, binName := range binNames { - cmd.writeOperationForBinName(binName, _READ) - } - } else if len(ops) > 0 { - offset := cmd.dataOffset - cmd.dataOffset++ - cmd.writeBatchFields(key, 0, len(ops)) - cmd.dataBuffer[offset], _ = cmd.writeBatchReadOperations(ops, readAttr) - } else { - attr := byte(readAttr) - if len(binNames) == 0 { - attr |= byte(_INFO1_GET_ALL) - } else { - attr |= byte(_INFO1_NOBINDATA) - } - cmd.WriteByte(attr) - cmd.writeBatchFields(key, 0, 0) - } - - prev = key - } - } - - cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -func (cmd *baseCommand) setBatchIndexRead(policy *BatchPolicy, records []*BatchRead, batch *batchNode) Error { - offsets := batch.offsets - max := len(batch.offsets) - - // Estimate buffer size - cmd.begin() - fieldCount := 1 - predSize := 0 - if policy.FilterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 5 - - var prev *BatchRead - for i := 0; i < max; i++ { - record := records[offsets[i]] - key := record.Key - binNames := record.BinNames - ops := record.Ops - - cmd.dataOffset += len(key.digest) + 4 - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if prev != nil && prev.Key.namespace == key.namespace && - (prev.Key.setName == key.setName) && - &prev.BinNames == &binNames && prev.ReadAllBins == record.ReadAllBins && - &prev.Ops == &ops { - // Can set repeat previous namespace/bin names to save space. - cmd.dataOffset++ - } else { - // Must write full header and namespace/set/bin names. - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) + 6 - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - - if len(binNames) != 0 { - for _, binName := range binNames { - cmd.estimateOperationSizeForBinName(binName) - } - } else if len(ops) != 0 { - for _, op := range ops { - cmd.estimateOperationSizeForOperation(op, true) - } - } - - prev = record - } - } - - if err := cmd.sizeBuffer(policy.compress()); err != nil { - return err - } - - readAttr := _INFO1_READ - if policy.ReadModeAP == ReadModeAPAll { - readAttr |= _INFO1_READ_MODE_AP_ALL - } - - cmd.writeHeaderRead(&policy.BasePolicy, readAttr|_INFO1_BATCH, 0, 0, fieldCount, 0) - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - // Write real field size. - fieldSizeOffset := cmd.dataOffset - cmd.writeFieldHeader(0, BATCH_INDEX_WITH_SET) - - cmd.WriteUint32(uint32(max)) - - if policy.AllowInline { - cmd.WriteByte(1) - } else { - cmd.WriteByte(0) - } - - prev = nil - for i := 0; i < max; i++ { - index := offsets[i] - cmd.WriteUint32(uint32(index)) - - record := records[index] - key := record.Key - binNames := record.BinNames - ops := record.Ops - if _, err := cmd.Write(key.digest[:]); err != nil { - return newCommonError(err) - } - - // Try reference equality in hope that namespace/set for all keys is set from fixed variables. - if prev != nil && prev.Key.namespace == key.namespace && - (prev.Key.setName == key.setName) && - &prev.BinNames == &binNames && prev.ReadAllBins == record.ReadAllBins && - &prev.Ops == &ops { - // Can set repeat previous namespace/bin names to save space. - cmd.WriteByte(1) // repeat - } else { - // Write full header, namespace and bin names. - cmd.WriteByte(0) // do not repeat - if len(binNames) > 0 { - cmd.WriteByte(byte(readAttr)) - cmd.writeBatchFields(key, 0, len(binNames)) - for _, binName := range binNames { - cmd.writeOperationForBinName(binName, _READ) - } - } else if len(ops) > 0 { - offset := cmd.dataOffset - cmd.dataOffset++ - cmd.writeBatchFields(key, 0, len(ops)) - cmd.dataBuffer[offset], _ = cmd.writeBatchReadOperations(ops, readAttr) - } else { - attr := byte(readAttr) - if record.ReadAllBins { - attr |= byte(_INFO1_GET_ALL) - } else { - attr |= byte(_INFO1_NOBINDATA) - } - cmd.WriteByte(attr) - cmd.writeBatchFields(key, 0, 0) - } - - prev = record - } - } - - cmd.WriteUint32At(uint32(cmd.dataOffset)-uint32(_MSG_TOTAL_HEADER_SIZE)-4, fieldSizeOffset) - cmd.end() - cmd.markCompressed(policy) - - return nil -} - -func (cmd *baseCommand) writeBatchFieldsWithFilter(key *Key, filter *Expression, fieldCount, opCount int) Error { - if filter != nil { - fieldCount++ - cmd.writeBatchFields(key, fieldCount, opCount) - expSize, err := filter.size() - if err != nil { - return err - } - if err := cmd.writeFilterExpression(filter, expSize); err != nil { - return err - } - } else { - cmd.writeBatchFields(key, fieldCount, opCount) - } - return nil -} - -func (cmd *baseCommand) writeBatchFields(key *Key, fieldCount, opCount int) Error { - fieldCount += 2 - cmd.WriteUint16(uint16(fieldCount)) - cmd.WriteUint16(uint16(opCount)) - cmd.writeFieldString(key.namespace, NAMESPACE) - cmd.writeFieldString(key.setName, TABLE) - - return nil -} - -func (cmd *baseCommand) setScan(policy *ScanPolicy, namespace *string, setName *string, binNames []string, taskID uint64, nodePartitions *nodePartitions) Error { - cmd.begin() - fieldCount := 0 - - // for grpc - partsFullSize := 0 - partsPartialSize := 0 - maxRecords := int64(0) - if nodePartitions != nil { - partsFullSize = len(nodePartitions.partsFull) * 2 - partsPartialSize = len(nodePartitions.partsPartial) * 20 - maxRecords = int64(nodePartitions.recordMax) - } - - predSize := 0 - if policy.FilterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(policy.FilterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - if namespace != nil { - cmd.dataOffset += len(*namespace) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if setName != nil { - cmd.dataOffset += len(*setName) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if partsFullSize > 0 { - cmd.dataOffset += partsFullSize + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if partsPartialSize > 0 { - cmd.dataOffset += partsPartialSize + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if maxRecords > 0 { - cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if policy.RecordsPerSecond > 0 { - cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - // Estimate scan timeout size. - cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) - fieldCount++ - - // Allocate space for TaskId field. - cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) - fieldCount++ - - for i := range binNames { - cmd.estimateOperationSizeForBinName(binNames[i]) - } - - if err := cmd.sizeBuffer(false); err != nil { - return err - } - readAttr := _INFO1_READ - - if !policy.IncludeBinData { - readAttr |= _INFO1_NOBINDATA - } - - operationCount := 0 - if len(binNames) > 0 { - operationCount = len(binNames) - } - cmd.writeHeaderRead(&policy.BasePolicy, readAttr, 0, _INFO3_PARTITION_DONE, fieldCount, operationCount) - - if namespace != nil { - cmd.writeFieldString(*namespace, NAMESPACE) - } - - if setName != nil { - cmd.writeFieldString(*setName, TABLE) - } - - if partsFullSize > 0 { - cmd.writeFieldHeader(partsFullSize, PID_ARRAY) - - for _, part := range nodePartitions.partsFull { - cmd.WriteInt16LittleEndian(uint16(part.Id)) - } - } - - if partsPartialSize > 0 { - cmd.writeFieldHeader(partsPartialSize, DIGEST_ARRAY) - - for _, part := range nodePartitions.partsPartial { - if _, err := cmd.Write(part.Digest[:]); err != nil { - return newCommonError(err) - } - } - } - - if policy.FilterExpression != nil { - if err := cmd.writeFilterExpression(policy.FilterExpression, predSize); err != nil { - return err - } - } - - if maxRecords > 0 { - cmd.writeFieldInt64(maxRecords, MAX_RECORDS) - } - - if policy.RecordsPerSecond > 0 { - cmd.writeFieldInt32(int32(policy.RecordsPerSecond), RECORDS_PER_SECOND) - } - - // Write scan timeout - cmd.writeFieldHeader(4, SOCKET_TIMEOUT) - cmd.WriteInt32(int32(policy.SocketTimeout / time.Millisecond)) // in milliseconds - - cmd.writeFieldHeader(8, TRAN_ID) - cmd.WriteUint64(taskID) - - for i := range binNames { - cmd.writeOperationForBinName(binNames[i], _READ) - } - - cmd.end() - - return nil -} - -func (cmd *baseCommand) setQuery(policy *QueryPolicy, wpolicy *WritePolicy, statement *Statement, taskID uint64, operations []*Operation, background bool, nodePartitions *nodePartitions) Error { - fieldCount := 0 - filterSize := 0 - binNameSize := 0 - predSize := 0 - var ctxSize int - - filterExpression := policy.FilterExpression - if filterExpression == nil && wpolicy != nil { - filterExpression = wpolicy.FilterExpression - } - - isNew := false - if cmd.node != nil { - isNew = cmd.node.cluster.supportsPartitionQuery.Get() - } - - cmd.begin() - - if statement.Namespace != "" { - cmd.dataOffset += len(statement.Namespace) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - // if statement.IndexName != "" { - // cmd.dataOffset += len(statement.IndexName) + int(_FIELD_HEADER_SIZE) - // fieldCount++ - // } - - if statement.SetName != "" { - cmd.dataOffset += len(statement.SetName) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - // Estimate recordsPerSecond field size. This field is used in new servers and not used - // (but harmless to add) in old servers. - if policy.RecordsPerSecond > 0 { - cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - // Estimate socket timeout field size. This field is used in new servers and not used - // (but harmless to add) in old servers. - cmd.dataOffset += 4 + int(_FIELD_HEADER_SIZE) - fieldCount++ - - // Allocate space for TaskId field. - cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) - fieldCount++ - - if statement.Filter != nil { - idxType := statement.Filter.IndexCollectionType() - - // Estimate INDEX_TYPE field. - if idxType != ICT_DEFAULT { - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 1 - fieldCount++ - } - - // Estimate INDEX_RANGE field. - cmd.dataOffset += int(_FIELD_HEADER_SIZE) - filterSize++ // num filters - - sz, err := statement.Filter.EstimateSize() - if err != nil { - return err - } - filterSize += sz - - cmd.dataOffset += filterSize - fieldCount++ - - // Query bin names are specified as a field (Scan bin names are specified later as operations) - // in old servers. Estimate size for selected bin names. - if !isNew { - if len(statement.BinNames) > 0 { - cmd.dataOffset += int(_FIELD_HEADER_SIZE) - binNameSize++ // num bin names - - for _, binName := range statement.BinNames { - binNameSize += len(binName) + 1 - } - cmd.dataOffset += binNameSize - fieldCount++ - } - } - - if statement.Filter.ctx != nil { - ctxSize, err = statement.Filter.estimatePackedCtxSize() - if err != nil { - return newCommonError(err) - } - if ctxSize > 0 { - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + ctxSize - fieldCount++ - } - } - } - - partsFullSize := 0 - partsPartialSize := 0 - maxRecords := int64(0) - partsPartialBValSize := 0 - - // Calling query with no filters is more efficiently handled by a primary index scan. - // Estimate scan options size. - if nodePartitions != nil { - partsFullSize = len(nodePartitions.partsFull) * 2 - partsPartialSize = len(nodePartitions.partsPartial) * 20 - if statement.Filter != nil { - partsPartialBValSize = len(nodePartitions.partsPartial) * 8 - } - maxRecords = nodePartitions.recordMax - } - - if partsFullSize > 0 { - cmd.dataOffset += partsFullSize + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if partsPartialSize > 0 { - cmd.dataOffset += partsPartialSize + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if partsPartialBValSize > 0 { - cmd.dataOffset += partsPartialBValSize + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - // Estimate max records size; - if maxRecords > 0 { - cmd.dataOffset += 8 + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if filterExpression != nil { - var err Error - predSize, err = cmd.estimateExpressionSize(filterExpression) - if err != nil { - return err - } - if predSize > 0 { - fieldCount++ - } - } - - var functionArgs *ValueArray - if statement.functionName != "" { - cmd.dataOffset += int(_FIELD_HEADER_SIZE) + 1 // udf type - cmd.dataOffset += len(statement.packageName) + int(_FIELD_HEADER_SIZE) - cmd.dataOffset += len(statement.functionName) + int(_FIELD_HEADER_SIZE) - - // function args - cmd.dataOffset += int(_FIELD_HEADER_SIZE) - if len(statement.functionArgs) > 0 { - functionArgs = NewValueArray(statement.functionArgs) - fasz, err := functionArgs.EstimateSize() - if err != nil { - return err - } - - cmd.dataOffset += fasz - } - - fieldCount += 4 - } - - operationCount := 0 - - // Operations (used in query execute) and bin names (used in scan/query) are mutually exclusive. - if len(operations) > 0 { - if !background { - return newError(types.PARAMETER_ERROR, "Operations not allowed in foreground query") - } - - for _, op := range operations { - if !op.opType.isWrite { - return newError(types.PARAMETER_ERROR, "Read operations not allowed in background query") - } - if err := cmd.estimateOperationSizeForOperation(op, false); err != nil { - return err - } - } - operationCount = len(operations) - } else if len(statement.BinNames) > 0 && (isNew || statement.Filter == nil) { - for _, binName := range statement.BinNames { - cmd.estimateOperationSizeForBinName(binName) - } - operationCount = len(statement.BinNames) - } - - ////////////////////////////////////////////////////////////////////////// - - if err := cmd.sizeBuffer(false); err != nil { - return err - } - - if background { - cmd.writeHeaderWrite(wpolicy, _INFO2_WRITE, fieldCount, operationCount) - } else { - readAttr := _INFO1_READ | _INFO1_NOBINDATA - writeAttr := 0 - - if policy.IncludeBinData { - readAttr = _INFO1_READ - } - if policy.ShortQuery || policy.ExpectedDuration == SHORT { - readAttr |= _INFO1_SHORT_QUERY - } else if policy.ExpectedDuration == LONG_RELAX_AP { - writeAttr |= _INFO2_RELAX_AP_LONG_QUERY - } - infoAttr := 0 - if isNew || statement.Filter == nil { - infoAttr = _INFO3_PARTITION_DONE - } - cmd.writeHeaderRead(&policy.BasePolicy, readAttr, writeAttr, infoAttr, fieldCount, operationCount) - } - - if statement.Namespace != "" { - cmd.writeFieldString(statement.Namespace, NAMESPACE) - } - - if statement.IndexName != "" { - cmd.writeFieldString(statement.IndexName, INDEX_NAME) - } - - if statement.SetName != "" { - cmd.writeFieldString(statement.SetName, TABLE) - } - - cmd.writeFieldHeader(8, TRAN_ID) - cmd.WriteUint64(taskID) - - if statement.Filter != nil { - idxType := statement.Filter.IndexCollectionType() - - if idxType != ICT_DEFAULT { - cmd.writeFieldHeader(1, INDEX_TYPE) - cmd.WriteByte(byte(idxType)) - } - - cmd.writeFieldHeader(filterSize, INDEX_RANGE) - cmd.WriteByte(byte(1)) // number of filters - - _, err := statement.Filter.write(cmd) - if err != nil { - return err - } - - if !isNew { - // Query bin names are specified as a field (Scan bin names are specified later as operations) - // in old servers. - if len(statement.BinNames) > 0 { - cmd.writeFieldHeader(binNameSize, QUERY_BINLIST) - cmd.WriteByte(byte(len(statement.BinNames))) - - for _, binName := range statement.BinNames { - len := copy(cmd.dataBuffer[cmd.dataOffset+1:], binName) - cmd.dataBuffer[cmd.dataOffset] = byte(len) - cmd.dataOffset += len + 1 - } - } - } - - if ctxSize > 0 { - cmd.writeFieldHeader(ctxSize, INDEX_CONTEXT) - if _, err = statement.Filter.packCtx(cmd); err != nil { - return newCommonError(err) - } - } - } - - // Calling query with no filters is more efficiently handled by a primary index scan. - if partsFullSize > 0 { - cmd.writeFieldHeader(partsFullSize, PID_ARRAY) - - for _, part := range nodePartitions.partsFull { - cmd.WriteInt16LittleEndian(uint16(part.Id)) - } - } - - if partsPartialSize > 0 { - cmd.writeFieldHeader(partsPartialSize, DIGEST_ARRAY) - - for _, part := range nodePartitions.partsPartial { - if _, err := cmd.Write(part.Digest[:]); err != nil { - return newCommonError(err) - } - } - } - - if partsPartialBValSize > 0 { - cmd.writeFieldHeader(partsPartialBValSize, BVAL_ARRAY) - - for _, part := range nodePartitions.partsPartial { - cmd.WriteInt64LittleEndian(uint64(part.BVal)) - } - } - - if maxRecords > 0 { - cmd.writeFieldInt64(maxRecords, MAX_RECORDS) - } - - // Write scan timeout - cmd.writeFieldHeader(4, SOCKET_TIMEOUT) - cmd.WriteInt32(int32(policy.SocketTimeout / time.Millisecond)) // in milliseconds - - // Write records per second. - if policy.RecordsPerSecond > 0 { - cmd.writeFieldInt32(int32(policy.RecordsPerSecond), RECORDS_PER_SECOND) - } - - if filterExpression != nil { - if err := cmd.writeFilterExpression(filterExpression, predSize); err != nil { - return err - } - } - - if statement.functionName != "" { - cmd.writeFieldHeader(1, UDF_OP) - if statement.ReturnData { - cmd.dataBuffer[cmd.dataOffset] = byte(1) - } else { - cmd.dataBuffer[cmd.dataOffset] = byte(2) - } - cmd.dataOffset++ - - cmd.writeFieldString(statement.packageName, UDF_PACKAGE_NAME) - cmd.writeFieldString(statement.functionName, UDF_FUNCTION) - if err := cmd.writeUdfArgs(functionArgs); err != nil { - return err - } - } - - if len(operations) > 0 { - for _, op := range operations { - if err := cmd.writeOperationForOperation(op); err != nil { - return err - } - } - } else if len(statement.BinNames) > 0 && (isNew || statement.Filter == nil) { - // scan binNames come last - for _, binName := range statement.BinNames { - cmd.writeOperationForBinName(binName, _READ) - } - } - - cmd.end() - - return nil -} - -func (cmd *baseCommand) estimateKeySize(key *Key, sendKey bool) (int, Error) { - fieldCount := 0 - - if key.namespace != "" { - cmd.dataOffset += len(key.namespace) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - if key.setName != "" { - cmd.dataOffset += len(key.setName) + int(_FIELD_HEADER_SIZE) - fieldCount++ - } - - cmd.dataOffset += int(_DIGEST_SIZE + _FIELD_HEADER_SIZE) - fieldCount++ - - if sendKey { - // field header size + key size - sz, err := key.userKey.EstimateSize() - if err != nil { - return sz, err - } - cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) + 1 - fieldCount++ - } - - return fieldCount, nil -} - -func (cmd *baseCommand) estimateUdfSize(packageName string, functionName string, args *ValueArray) (int, Error) { - cmd.dataOffset += len(packageName) + int(_FIELD_HEADER_SIZE) - cmd.dataOffset += len(functionName) + int(_FIELD_HEADER_SIZE) - - sz, err := args.EstimateSize() - if err != nil { - return 0, err - } - - // fmt.Println(args, sz) - - cmd.dataOffset += sz + int(_FIELD_HEADER_SIZE) - return 3, nil -} - -func (cmd *baseCommand) estimateOperationSizeForBin(bin *Bin) Error { - cmd.dataOffset += len(bin.Name) + int(_OPERATION_HEADER_SIZE) - sz, err := bin.Value.EstimateSize() - if err != nil { - return err - } - cmd.dataOffset += sz - return nil -} - -func (cmd *baseCommand) estimateOperationSizeForBinNameAndValue(name string, value interface{}) Error { - cmd.dataOffset += len(name) + int(_OPERATION_HEADER_SIZE) - sz, err := NewValue(value).EstimateSize() - if err != nil { - return err - } - cmd.dataOffset += sz - return nil -} - -func (cmd *baseCommand) estimateOperationSizeForOperation(operation *Operation, isBatch bool) Error { - if isBatch && operation.opType.isWrite { - return newError(types.PARAMETER_ERROR, "Write operations not allowed in batch read") - } - - size, err := operation.size() - if err != nil { - return err - } - - cmd.dataOffset += size - return nil -} - -func (cmd *baseCommand) estimateOperationSizeForBinName(binName string) { - cmd.dataOffset += len(binName) + int(_OPERATION_HEADER_SIZE) -} - -func (cmd *baseCommand) estimateOperationSize() { - cmd.dataOffset += int(_OPERATION_HEADER_SIZE) -} - -func (cmd *baseCommand) estimateExpressionSize(exp *Expression) (int, Error) { - size, err := exp.size() - if err != nil { - return size, err - } - - cmd.dataOffset += size + int(_FIELD_HEADER_SIZE) - return size, nil -} - -// Header write for write commands. -func (cmd *baseCommand) writeHeaderWrite(policy *WritePolicy, writeAttr, fieldCount, operationCount int) { - // Set flags. - generation := uint32(0) - readAttr := 0 - infoAttr := 0 - - switch policy.RecordExistsAction { - case UPDATE: - case UPDATE_ONLY: - infoAttr |= _INFO3_UPDATE_ONLY - case REPLACE: - infoAttr |= _INFO3_CREATE_OR_REPLACE - case REPLACE_ONLY: - infoAttr |= _INFO3_REPLACE_ONLY - case CREATE_ONLY: - writeAttr |= _INFO2_CREATE_ONLY - } - - switch policy.GenerationPolicy { - case NONE: - case EXPECT_GEN_EQUAL: - generation = policy.Generation - writeAttr |= _INFO2_GENERATION - case EXPECT_GEN_GT: - generation = policy.Generation - writeAttr |= _INFO2_GENERATION_GT - } - - if policy.CommitLevel == COMMIT_MASTER { - infoAttr |= _INFO3_COMMIT_MASTER - } - - if policy.DurableDelete { - writeAttr |= _INFO2_DURABLE_DELETE - } - - // if (policy.Xdr) { - // readAttr |= _INFO1_XDR; - // } - - // Write all header data except total size which must be written last. - cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. - cmd.dataBuffer[9] = byte(readAttr) - cmd.dataBuffer[10] = byte(writeAttr) - cmd.dataBuffer[11] = byte(infoAttr) - cmd.dataBuffer[12] = 0 // unused - cmd.dataBuffer[13] = 0 // clear the result code - cmd.dataOffset = 14 - cmd.WriteUint32(generation) - cmd.WriteUint32(policy.Expiration) - cmd.WriteInt32(0) // TODO: server timeout - cmd.WriteInt16(int16(fieldCount)) - cmd.WriteInt16(int16(operationCount)) - cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -// Header write for operate command. -func (cmd *baseCommand) writeHeaderReadWrite(policy *WritePolicy, args *operateArgs, fieldCount int) { - // Set flags. - generation := uint32(0) - ttl := int64(policy.ReadTouchTTLPercent) - if args.hasWrite { - ttl = int64(policy.Expiration) - } - readAttr := args.readAttr - writeAttr := args.writeAttr - infoAttr := 0 - operationCount := len(args.operations) - - switch policy.RecordExistsAction { - case UPDATE: - case UPDATE_ONLY: - infoAttr |= _INFO3_UPDATE_ONLY - case REPLACE: - infoAttr |= _INFO3_CREATE_OR_REPLACE - case REPLACE_ONLY: - infoAttr |= _INFO3_REPLACE_ONLY - case CREATE_ONLY: - writeAttr |= _INFO2_CREATE_ONLY - } - - switch policy.GenerationPolicy { - case NONE: - case EXPECT_GEN_EQUAL: - generation = policy.Generation - writeAttr |= _INFO2_GENERATION - case EXPECT_GEN_GT: - generation = policy.Generation - writeAttr |= _INFO2_GENERATION_GT - } - - if policy.CommitLevel == COMMIT_MASTER { - infoAttr |= _INFO3_COMMIT_MASTER - } - - if policy.DurableDelete { - writeAttr |= _INFO2_DURABLE_DELETE - } - - // if (policy.xdr) { - // readAttr |= _INFO1_XDR; - // } - - switch policy.ReadModeSC { - case ReadModeSCSession: - case ReadModeSCLinearize: - infoAttr |= _INFO3_SC_READ_TYPE - case ReadModeSCAllowReplica: - infoAttr |= _INFO3_SC_READ_RELAX - case ReadModeSCAllowUnavailable: - infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX - } - - if policy.ReadModeAP == ReadModeAPAll { - readAttr |= _INFO1_READ_MODE_AP_ALL - } - - if policy.UseCompression { - readAttr |= _INFO1_COMPRESS_RESPONSE - } - - // Write all header data except total size which must be written last. - cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. - cmd.dataBuffer[9] = byte(readAttr) - cmd.dataBuffer[10] = byte(writeAttr) - cmd.dataBuffer[11] = byte(infoAttr) - cmd.dataBuffer[12] = 0 // unused - cmd.dataBuffer[13] = 0 // clear the result code - cmd.dataOffset = 14 - cmd.WriteUint32(generation) - cmd.WriteInt32(int32(ttl)) - cmd.WriteInt32(0) // timeout - cmd.WriteInt16(int16(fieldCount)) - cmd.WriteInt16(int16(operationCount)) - cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -// Header write for read commands. -func (cmd *baseCommand) writeHeaderRead(policy *BasePolicy, readAttr, writeAttr, infoAttr, fieldCount, operationCount int) { - switch policy.ReadModeSC { - case ReadModeSCSession: - case ReadModeSCLinearize: - infoAttr |= _INFO3_SC_READ_TYPE - case ReadModeSCAllowReplica: - infoAttr |= _INFO3_SC_READ_RELAX - case ReadModeSCAllowUnavailable: - infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX - } - - if policy.ReadModeAP == ReadModeAPAll { - readAttr |= _INFO1_READ_MODE_AP_ALL - } - - if policy.UseCompression { - readAttr |= _INFO1_COMPRESS_RESPONSE - } - - // Write all header data except total size which must be written last. - cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. - cmd.dataBuffer[9] = byte(readAttr) - cmd.dataBuffer[10] = byte(writeAttr) - cmd.dataBuffer[11] = byte(infoAttr) - - for i := 12; i < 18; i++ { - cmd.dataBuffer[i] = 0 - } - cmd.dataOffset = 18 - cmd.WriteInt32(policy.ReadTouchTTLPercent) - cmd.WriteInt32(0) // timeout - cmd.WriteInt16(int16(fieldCount)) - cmd.WriteInt16(int16(operationCount)) - cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -// Header write for read header commands. -func (cmd *baseCommand) writeHeaderReadHeader(policy *BasePolicy, readAttr, fieldCount, operationCount int) { - infoAttr := 0 - - switch policy.ReadModeSC { - case ReadModeSCSession: - case ReadModeSCLinearize: - infoAttr |= _INFO3_SC_READ_TYPE - case ReadModeSCAllowReplica: - infoAttr |= _INFO3_SC_READ_RELAX - case ReadModeSCAllowUnavailable: - infoAttr |= _INFO3_SC_READ_TYPE | _INFO3_SC_READ_RELAX - } - - if policy.ReadModeAP == ReadModeAPAll { - readAttr |= _INFO1_READ_MODE_AP_ALL - } - - // Write all header data except total size which must be written last. - cmd.dataBuffer[8] = _MSG_REMAINING_HEADER_SIZE // Message header length. - cmd.dataBuffer[9] = byte(readAttr) - cmd.dataBuffer[10] = byte(0) - cmd.dataBuffer[11] = byte(infoAttr) - - for i := 12; i < 18; i++ { - cmd.dataBuffer[i] = 0 - } - - cmd.dataOffset = 18 - cmd.WriteInt32(policy.ReadTouchTTLPercent) - // cmd.WriteInt32(serverTimeout) // TODO: handle argument - cmd.WriteInt32(0) - cmd.WriteInt16(int16(fieldCount)) - cmd.WriteInt16(int16(operationCount)) - cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -func (cmd *baseCommand) writeKey(key *Key, sendKey bool) Error { - // Write key into buffer. - if key.namespace != "" { - cmd.writeFieldString(key.namespace, NAMESPACE) - } - - if key.setName != "" { - cmd.writeFieldString(key.setName, TABLE) - } - - cmd.writeFieldBytes(key.digest[:], DIGEST_RIPE) - - if sendKey { - if err := cmd.writeFieldValue(key.userKey, KEY); err != nil { - return err - } - } - - return nil -} - -func (cmd *baseCommand) writeOperationForBin(bin *Bin, operation OperationType) Error { - nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], bin.Name) - - valueLength, err := bin.Value.EstimateSize() - if err != nil { - return err - } - - cmd.WriteInt32(int32(nameLength + valueLength + 4)) - cmd.WriteByte((operation.op)) - cmd.WriteByte((byte(bin.Value.GetType()))) - cmd.WriteByte((byte(0))) - cmd.WriteByte((byte(nameLength))) - cmd.dataOffset += nameLength - _, err = bin.Value.write(cmd) - return err -} - -func (cmd *baseCommand) writeOperationForBinNameAndValue(name string, val interface{}, operation OperationType) Error { - nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], name) - - v := NewValue(val) - - valueLength, err := v.EstimateSize() - if err != nil { - return err - } - - cmd.WriteInt32(int32(nameLength + valueLength + 4)) - cmd.WriteByte((operation.op)) - cmd.WriteByte((byte(v.GetType()))) - cmd.WriteByte((byte(0))) - cmd.WriteByte((byte(nameLength))) - cmd.dataOffset += nameLength - _, err = v.write(cmd) - return err -} - -func (cmd *baseCommand) writeBatchReadOperations(ops []*Operation, readAttr int) (byte, Error) { - for _, op := range ops { - switch op.opType { - case _READ_HEADER: - readAttr |= _INFO1_NOBINDATA - case _READ: - // Read all bins if no bin is specified. - if len(op.binName) == 0 { - readAttr |= _INFO1_GET_ALL - } - default: - } - if err := cmd.writeOperationForOperation(op); err != nil { - return byte(readAttr), err - } - } - - return byte(readAttr), nil -} - -func (cmd *baseCommand) writeOperationForOperation(operation *Operation) Error { - nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], operation.binName) - - if operation.encoder == nil { - valueLength, err := operation.binValue.EstimateSize() - if err != nil { - return err - } - - cmd.WriteInt32(int32(nameLength + valueLength + 4)) - cmd.WriteByte((operation.opType.op)) - cmd.WriteByte((byte(operation.binValue.GetType()))) - cmd.WriteByte((byte(0))) - cmd.WriteByte((byte(nameLength))) - cmd.dataOffset += nameLength - _, err = operation.binValue.write(cmd) - return err - } - - valueLength, err := operation.encoder(operation, nil) - if err != nil { - return err - } - - cmd.WriteInt32(int32(nameLength + valueLength + 4)) - cmd.WriteByte((operation.opType.op)) - cmd.WriteByte((byte(ParticleType.BLOB))) - cmd.WriteByte((byte(0))) - cmd.WriteByte((byte(nameLength))) - cmd.dataOffset += nameLength - _, err = operation.encoder(operation, cmd) - return err -} - -func (cmd *baseCommand) writeOperationForBinName(name string, operation OperationType) { - nameLength := copy(cmd.dataBuffer[(cmd.dataOffset+int(_OPERATION_HEADER_SIZE)):], name) - cmd.WriteInt32(int32(nameLength + 4)) - cmd.WriteByte((operation.op)) - cmd.WriteByte(byte(0)) - cmd.WriteByte(byte(0)) - cmd.WriteByte(byte(nameLength)) - cmd.dataOffset += nameLength -} - -func (cmd *baseCommand) writeOperationForOperationType(operation OperationType) { - cmd.WriteInt32(int32(4)) - cmd.WriteByte(operation.op) - cmd.WriteByte(0) - cmd.WriteByte(0) - cmd.WriteByte(0) -} - -func (cmd *baseCommand) writeFilterExpression(exp *Expression, expSize int) Error { - cmd.writeFieldHeader(expSize, FILTER_EXP) - if _, err := exp.pack(cmd); err != nil { - return err - } - return nil -} - -func (cmd *baseCommand) writeFieldValue(value Value, ftype FieldType) Error { - vlen, err := value.EstimateSize() - if err != nil { - return err - } - cmd.writeFieldHeader(vlen+1, ftype) - cmd.WriteByte(byte(value.GetType())) - - _, err = value.write(cmd) - return err -} - -func (cmd *baseCommand) writeUdfArgs(value *ValueArray) Error { - if value != nil { - vlen, err := value.EstimateSize() - if err != nil { - return err - } - cmd.writeFieldHeader(vlen, UDF_ARGLIST) - _, err = value.pack(cmd) - return err - } - - cmd.writeFieldHeader(0, UDF_ARGLIST) - return nil -} - -func (cmd *baseCommand) writeFieldInt32(val int32, ftype FieldType) { - cmd.writeFieldHeader(4, ftype) - cmd.WriteInt32(val) -} - -func (cmd *baseCommand) writeFieldInt64(val int64, ftype FieldType) { - cmd.writeFieldHeader(8, ftype) - cmd.WriteInt64(val) -} - -func (cmd *baseCommand) writeFieldString(str string, ftype FieldType) { - flen := copy(cmd.dataBuffer[(cmd.dataOffset+int(_FIELD_HEADER_SIZE)):], str) - cmd.writeFieldHeader(flen, ftype) - cmd.dataOffset += flen -} - -func (cmd *baseCommand) writeFieldBytes(bytes []byte, ftype FieldType) { - copy(cmd.dataBuffer[cmd.dataOffset+int(_FIELD_HEADER_SIZE):], bytes) - - cmd.writeFieldHeader(len(bytes), ftype) - cmd.dataOffset += len(bytes) -} - -func (cmd *baseCommand) writeFieldHeader(size int, ftype FieldType) { - cmd.WriteInt32(int32(size + 1)) - cmd.WriteByte((byte(ftype))) -} - -func (cmd *baseCommand) begin() { - cmd.dataOffset = int(_MSG_TOTAL_HEADER_SIZE) -} - -func (cmd *baseCommand) sizeBuffer(compress bool) Error { - return cmd.sizeBufferSz(cmd.dataOffset, compress) -} - -func (cmd *baseCommand) validateHeader(header int64) Error { - msgVersion := (uint64(header) & 0xFF00000000000000) >> 56 - if msgVersion != 2 { - return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected version to be 2, but got %v", msgVersion)) - } - - msgType := (uint64(header) & 0x00FF000000000000) >> 49 - if !(msgType == 1 || msgType == 3 || msgType == 4) { - return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected type to be 1, 3 or 4, but got %v", msgType)) - } - - msgSize := header & 0x0000FFFFFFFFFFFF - if msgSize > int64(MaxBufferSize) { - return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid Message Header: Expected size to be under 10MiB, but got %v", msgSize)) - } - - return nil -} - -const ( - msgHeaderPad = 16 - zlibHeaderPad = 2 -) - -func (cmd *baseCommand) sizeBufferSz(size int, willCompress bool) Error { - - if willCompress { - // adds zlib and proto pads to the size of the buffer - size += msgHeaderPad + zlibHeaderPad - } - - // Corrupted data streams can result in a huge length. - // Do a sanity check here. - if size > MaxBufferSize || size < 0 { - return newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Invalid size for buffer: %d", size)) - } - - if cmd.conn != nil && cmd.conn.buffHist != nil { - cmd.conn.buffHist.Add(uint64(size)) - } - - if size <= len(cmd.dataBuffer) { - // don't touch the buffer - // this is a noop, here to silence the linters - cmd.dataBuffer = cmd.dataBuffer - } else if size <= cap(cmd.dataBuffer) { - cmd.dataBuffer = cmd.dataBuffer[:size] - } else { - // not enough space - cmd.dataBuffer = buffPool.Get(size) - } - - // The trick here to keep a ref to the buffer, and set the buffer itself - // to a padded version of the original: - // | Proto Header | Original Compressed Size | compressed message | - // | 8 Bytes | 8 Bytes | | - if willCompress { - cmd.dataBufferCompress = cmd.dataBuffer - cmd.dataBuffer = cmd.dataBufferCompress[msgHeaderPad+zlibHeaderPad:] - } - - return nil -} - -func (cmd *baseCommand) end() { - var proto = int64(cmd.dataOffset-8) | (_CL_MSG_VERSION << 56) | (_AS_MSG_TYPE << 48) - binary.BigEndian.PutUint64(cmd.dataBuffer[0:], uint64(proto)) -} - -func (cmd *baseCommand) markCompressed(policy Policy) { - cmd.compressed = policy.compress() -} - -func (cmd *baseCommand) compress() Error { - if cmd.compressed && cmd.dataOffset > _COMPRESS_THRESHOLD { - b := bytes.NewBuffer(cmd.dataBufferCompress[msgHeaderPad:]) - b.Reset() - w := zlib.NewWriter(b) - - // There seems to be a bug either in Go's zlib or in zlibc - // which messes up a single write block of bigger than 64KB to - // the deflater. - // Things work in multiple writes of 64KB though, so this is - // how we're going to do it. - i := 0 - const step = 64 * 1024 - for i+step < cmd.dataOffset { - n, err := w.Write(cmd.dataBuffer[i : i+step]) - i += n - if err != nil { - return newErrorAndWrap(err, types.SERIALIZE_ERROR) - } - } - - if i < cmd.dataOffset { - if _, err := w.Write(cmd.dataBuffer[i:cmd.dataOffset]); err != nil { - return newErrorAndWrap(err, types.SERIALIZE_ERROR) - } - } - - // flush - if err := w.Close(); err != nil { - return newErrorAndWrap(err, types.SERIALIZE_ERROR) - } - - compressedSz := b.Len() - - // check if compression ended up inflating the data. - // If so, the internal buffer has grown and reallocated, try to reuse it. - // If not possible to reuse it, reallocate a buffer. - if compressedSz+msgHeaderPad > len(cmd.dataBufferCompress) { - // compression added to the size of the message - buf := buffPool.Get(compressedSz + msgHeaderPad) - if n := copy(buf[msgHeaderPad:], b.Bytes()); n < compressedSz { - return newError(types.SERIALIZE_ERROR) - } - cmd.dataBufferCompress = buf - } - - // Use compressed buffer if compression completed within original buffer size. - var proto = int64(compressedSz+8) | (_CL_MSG_VERSION << 56) | (_AS_MSG_TYPE_COMPRESSED << 48) - binary.BigEndian.PutUint64(cmd.dataBufferCompress[0:], uint64(proto)) - binary.BigEndian.PutUint64(cmd.dataBufferCompress[8:], uint64(cmd.dataOffset)) - - cmd.dataBuffer = cmd.dataBufferCompress - cmd.dataOffset = compressedSz + msgHeaderPad - cmd.dataBufferCompress = nil - } - - return nil -} - -// isCompressed returns the length of the compressed buffer. -// If the buffer is not compressed, the result will be -1 -func (cmd *baseCommand) compressedSize() int { - proto := Buffer.BytesToInt64(cmd.dataBuffer, 0) - size := proto & 0xFFFFFFFFFFFF - - msgType := (proto >> 48) & 0xff - - if msgType != _AS_MSG_TYPE_COMPRESSED { - return -1 - } - - return int(size) -} - -func (cmd *baseCommand) batchInDoubt(isWrite bool, commandSentCounter int) bool { - return isWrite && commandSentCounter > 1 -} - -func (cmd *baseCommand) isRead() bool { - return true -} - -// grpcPutBufferBack puts the assigned buffer back in the pool. -// This function should only be called from grpc commands. -func (cmd *baseCommand) grpcPutBufferBack() { - // put the data buffer back in the pool in case it gets used again - buffPool.Put(cmd.dataBuffer) - cmd.dataBuffer = nil -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Execute -// -/////////////////////////////////////////////////////////////////////////////// - -func (cmd *baseCommand) execute(ifc command) Error { - policy := ifc.getPolicy(ifc).GetBasePolicy() - deadline := policy.deadline() - - return cmd.executeAt(ifc, policy, deadline, -1) -} - -func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, deadline time.Time, iterations int) (errChain Error) { - // for exponential backoff - interval := policy.SleepBetweenRetries - - transStart := time.Now() - - notFirstIteration := false - isClientTimeout := false - loopCount := 0 - - var err Error - - // Execute command until successful, timed out or maximum iterations have been reached. - for { - cmd.commandSentCounter++ - loopCount++ - - // too many retries - if (policy.MaxRetries <= 0 && cmd.commandSentCounter > 1) || (policy.MaxRetries > 0 && cmd.commandSentCounter > policy.MaxRetries) { - if cmd.node != nil && cmd.node.cluster != nil { - cmd.node.cluster.maxRetriesExceededCount.GetAndIncrement() - } - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - return chainErrors(ErrMaxRetriesExceeded.err(), errChain).iter(cmd.commandSentCounter).setInDoubt(ifc.isRead(), cmd.commandSentCounter).setNode(cmd.node) - } - - // Sleep before trying again, after the first iteration - if policy.SleepBetweenRetries > 0 && notFirstIteration { - // Do not sleep if you know you'll wake up after the deadline - if policy.TotalTimeout > 0 && time.Now().Add(interval).After(deadline) { - break - } - - time.Sleep(interval) - if policy.SleepMultiplier > 1 { - interval = time.Duration(float64(interval) * policy.SleepMultiplier) - } - } - - if notFirstIteration { - applyTransactionRetryMetrics(cmd.node) - - if !ifc.prepareRetry(ifc, isClientTimeout || (err != nil && err.Matches(types.SERVER_NOT_AVAILABLE))) { - if bc, ok := ifc.(batcher); ok { - // Batch may be retried in separate commands. - alreadyRetried, err := bc.retryBatch(bc, cmd.node.cluster, deadline, cmd.commandSentCounter) - if alreadyRetried { - // Batch was retried in separate subcommands. Complete this command. - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - if err != nil { - return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - } - return nil - } - - // chain the errors and retry - if err != nil { - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - continue - } - } - } - } - - // NOTE: This is important to be after the prepareRetry block above - isClientTimeout = false - - notFirstIteration = true - - // check for command timeout - if policy.TotalTimeout > 0 && time.Now().After(deadline) { - break - } - - // set command node, so when you return a record it has the node - cmd.node, err = ifc.getNode(ifc) - if cmd.node == nil || !cmd.node.IsActive() || err != nil { - isClientTimeout = false - - // chain the errors - if err != nil { - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - } - - // Node is currently inactive. Retry. - continue - } - - // check if node has encountered too many errors - if err = cmd.node.validateErrorCount(); err != nil { - isClientTimeout = false - - applyTransactionErrorMetrics(cmd.node) - - // chain the errors - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - - // Max error rate achieved, try again per policy - continue - } - - cmd.conn, err = ifc.getConnection(policy) - if err != nil { - isClientTimeout = false - - // chain the errors - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - - applyTransactionErrorMetrics(cmd.node) - - // exit immediately if connection pool is exhausted and the corresponding policy option is set - if policy.ExitFastOnExhaustedConnectionPool && errors.Is(err, ErrConnectionPoolExhausted) { - break - } - - if errors.Is(err, ErrConnectionPoolEmpty) || errors.Is(err, ErrConnectionPoolExhausted) { - if errors.Is(err, ErrConnectionPoolExhausted) || (errors.Is(err, ErrConnectionPoolEmpty) && loopCount == 1) { - isClientTimeout = true - } - // if the connection pool is empty, we still haven't tried - // the transaction to increase the iteration count. - cmd.commandSentCounter-- - } - logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) - continue - } - - // Assign the connection buffer to the command buffer - cmd.dataBuffer = cmd.conn.dataBuffer - - // Set command buffer. - err = ifc.writeBuffer(ifc) - if err != nil { - applyTransactionErrorMetrics(cmd.node) - - // chain the errors - err = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - - // All runtime exceptions are considered fatal. Do not retry. - // Close socket to flush out possible garbage. Do not put back in pool. - cmd.conn.Close() - cmd.conn = nil - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - return err - } - - // Reset timeout in send buffer (destined for server) and socket. - binary.BigEndian.PutUint32(cmd.dataBuffer[22:], 0) - if !deadline.IsZero() { - serverTimeout := time.Until(deadline) - if serverTimeout < time.Millisecond { - serverTimeout = time.Millisecond - } - binary.BigEndian.PutUint32(cmd.dataBuffer[22:], uint32(serverTimeout/time.Millisecond)) - } - - // now that the deadline has been set in the buffer, compress the contents - if err = cmd.compress(); err != nil { - applyTransactionErrorMetrics(cmd.node) - return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - } - - // now that the deadline has been set in the buffer, compress the contents - if err = cmd.prepareBuffer(ifc, deadline); err != nil { - applyTransactionErrorMetrics(cmd.node) - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node) - } - - // Send command. - cmd.commandWasSent = true - _, err = cmd.conn.Write(cmd.dataBuffer[:cmd.dataOffset]) - if err != nil { - applyTransactionErrorMetrics(cmd.node) - - // chain the errors - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - - isClientTimeout = false - if deviceOverloadError(err) { - cmd.node.incrErrorCount() - } - - // IO errors are considered temporary anomalies. Retry. - // Close socket to flush out possible garbage. Do not put back in pool. - cmd.conn.Close() - cmd.conn = nil - - logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) - continue - } - - // Parse results. - err = ifc.parseResult(ifc, cmd.conn) - if err != nil { - applyTransactionErrorMetrics(cmd.node) - - // chain the errors - errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - - if networkError(err) { - isTimeout := errors.Is(err, ErrTimeout) - isClientTimeout = isTimeout - if !isTimeout { - if deviceOverloadError(err) { - cmd.node.incrErrorCount() - } - } - - // IO errors are considered temporary anomalies. Retry. - // Close socket to flush out possible garbage. Do not put back in pool. - cmd.conn.Close() - - logger.Logger.Debug("Node " + cmd.node.String() + ": " + err.Error()) - - // retry only for non-streaming commands - if !cmd.oneShot { - cmd.conn = nil - continue - } - } - - // close the connection - // cancelling/closing the batch/multi commands will return an error, which will - // close the connection to throw away its data and signal the server about the - // situation. We will not put back the connection in the buffer. - if ifc.canPutConnBack() && cmd.conn.IsConnected() && KeepConnection(err) { - // Put connection back in pool. - cmd.node.PutConnection(cmd.conn) - } else { - cmd.conn.Close() - cmd.conn = nil - } - - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - return errChain.setInDoubt(ifc.isRead(), cmd.commandSentCounter) - } - - applyTransactionMetrics(cmd.node, ifc.transactionType(), transStart) - - // in case it has grown and re-allocated, it means - // it was borrowed from the pool, sp put it back. - if &cmd.dataBufferCompress != &cmd.conn.origDataBuffer { - buffPool.Put(cmd.dataBufferCompress) - } else if &cmd.dataBuffer != &cmd.conn.origDataBuffer { - buffPool.Put(cmd.dataBuffer) - } - - cmd.dataBuffer = nil - cmd.dataBufferCompress = nil - cmd.conn.dataBuffer = cmd.conn.origDataBuffer - - // Put connection back in pool. - ifc.putConnection(cmd.conn) - - // command has completed successfully. Exit method. - return nil - - } - - // execution timeout - if cmd.node != nil && cmd.node.cluster != nil { - cmd.node.cluster.totalTimeoutExceededCount.GetAndIncrement() - } - errChain = chainErrors(ErrTimeout.err(), errChain).iter(cmd.commandSentCounter).setNode(cmd.node).setInDoubt(ifc.isRead(), cmd.commandSentCounter) - return errChain -} - -func (cmd *baseCommand) prepareBuffer(ifc command, deadline time.Time) Error { - // Set command buffer. - if err := ifc.writeBuffer(ifc); err != nil { - return err - } - - // Reset timeout in send buffer (destined for server) and socket. - binary.BigEndian.PutUint32(cmd.dataBuffer[22:], 0) - if !deadline.IsZero() { - serverTimeout := time.Until(deadline) - if serverTimeout < time.Millisecond { - serverTimeout = time.Millisecond - } - binary.BigEndian.PutUint32(cmd.dataBuffer[22:], uint32(serverTimeout/time.Millisecond)) - } - - // now that the deadline has been set in the buffer, compress the contents - return cmd.compress() -} - -func (cmd *baseCommand) canPutConnBack() bool { - return true -} - -func (cmd *baseCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - panic("Abstract method. Should not end up here") -} - -func networkError(err Error) bool { - return err.Matches(types.NETWORK_ERROR, types.TIMEOUT) -} - -func deviceOverloadError(err Error) bool { - return err.Matches(types.DEVICE_OVERLOAD) -} - -func applyTransactionMetrics(node *Node, tt transactionType, tb time.Time) { - if node != nil && node.cluster.MetricsEnabled() { - applyMetrics(tt, &node.stats, tb) - } -} - -func applyTransactionErrorMetrics(node *Node) { - if node != nil { - node.stats.TransactionErrorCount.GetAndIncrement() - } -} - -func applyTransactionRetryMetrics(node *Node) { - if node != nil { - node.stats.TransactionRetryCount.GetAndIncrement() - } -} - -func applyMetrics(tt transactionType, metrics *nodeStats, s time.Time) { - d := uint64(time.Since(s).Microseconds()) - switch tt { - case ttGet: - metrics.GetMetrics.Add(d) - case ttGetHeader: - metrics.GetHeaderMetrics.Add(d) - case ttExists: - metrics.ExistsMetrics.Add(d) - case ttPut: - metrics.PutMetrics.Add(d) - case ttDelete: - metrics.DeleteMetrics.Add(d) - case ttOperate: - metrics.OperateMetrics.Add(d) - case ttQuery: - metrics.QueryMetrics.Add(d) - case ttScan: - metrics.ScanMetrics.Add(d) - case ttUDF: - metrics.UDFMetrics.Add(d) - case ttBatchRead: - metrics.BatchReadMetrics.Add(d) - case ttBatchWrite: - metrics.BatchWriteMetrics.Add(d) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/commit_policy.go b/aerospike-tls/vendor-aerospike-client-go/commit_policy.go deleted file mode 100644 index cf34300a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/commit_policy.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -// CommitLevel indicates the desired consistency guarantee when committing a transaction on the server. -type CommitLevel int - -const ( - // COMMIT_ALL indicates the server should wait until successfully committing master and all replicas. - COMMIT_ALL CommitLevel = iota - - // COMMIT_MASTER indicates the server should wait until successfully committing master only. - COMMIT_MASTER -) diff --git a/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go b/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go deleted file mode 100644 index 144b59b0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/complex_index_test.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Complex Index operations test", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - }) - - gg.Describe("Complex Index Creation", func() { - // connection data - var err error - var ns = *namespace - var set = randString(40) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - - const keyCount = 1000 - - valueList := []interface{}{1, 2, 3, "a", "ab", "abc"} - valueMap := map[interface{}]interface{}{"a": "b", 0: 1, 1: "a", "b": 2} - - bin1 := as.NewBin("Aerospike1", valueList) - bin2 := as.NewBin("Aerospike2", valueMap) - - gg.BeforeEach(func() { - for i := 0; i < keyCount; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - gg.Context("Create non-existing complex index", func() { - - gg.It("must create a complex Index for Lists", func() { - idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING, as.ICT_LIST) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.DropIndex(wpolicy, ns, set, set+bin1.Name) - - // wait until index is created - <-idxTask.OnComplete() - - // no duplicate index is allowed - _, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - gg.It("must create a complex Index for Map Keys", func() { - idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin2.Name+"keys", bin2.Name, as.STRING, as.ICT_MAPKEYS) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.DropIndex(wpolicy, ns, set, set+bin2.Name+"keys") - - // wait until index is created - <-idxTask.OnComplete() - - // no duplicate index is allowed - _, err = client.CreateIndex(wpolicy, ns, set, set+bin2.Name+"keys", bin1.Name, as.STRING) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - gg.It("must create a complex Index for Map Values", func() { - idxTask, err := client.CreateComplexIndex(wpolicy, ns, set, set+bin2.Name+"values", bin2.Name, as.STRING, as.ICT_MAPVALUES) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.DropIndex(wpolicy, ns, set, set+bin2.Name+"values") - - // wait until index is created - <-idxTask.OnComplete() - - // no duplicate index is allowed - _, err = client.CreateIndex(wpolicy, ns, set, set+bin2.Name+"values", bin1.Name, as.STRING) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - }) - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go b/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go deleted file mode 100644 index 2adff807..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/complex_query_test.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Query operations on complex types", gg.Ordered, func() { - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - const keyCount = 1000 - - valueList := []interface{}{1, 2, 3, "a", "ab", "abc", []byte{1}, []byte{2, 3}, []byte{1, 3, 5}} - valueMap := map[interface{}]interface{}{"a": "b", 0: 1, 1: "a", "b": 2, 6: []byte{1, 2, 3}} - - bin1 := as.NewBin("List", valueList) - bin2 := as.NewBin("Map", valueMap) - var keys map[string]*as.Key - - gg.BeforeAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - keys = make(map[string]*as.Key, keyCount) - set = randString(50) - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - keys[string(key.Digest())] = key - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin1.Name+"N", bin1.Name, as.NUMERIC, as.ICT_LIST) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"N"+"keys", bin2.Name, as.NUMERIC, as.ICT_MAPKEYS) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"N"+"values", bin2.Name, as.NUMERIC, as.ICT_MAPVALUES) - - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin1.Name+"S", bin1.Name, as.STRING, as.ICT_LIST) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"S"+"keys", bin2.Name, as.STRING, as.ICT_MAPKEYS) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"S"+"values", bin2.Name, as.STRING, as.ICT_MAPVALUES) - - if serverIsNewerThan("7") { - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin1.Name+"B", bin1.Name, as.BLOB, as.ICT_LIST) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"B"+"keys", bin2.Name, as.BLOB, as.ICT_MAPKEYS) - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin2.Name+"B"+"values", bin2.Name, as.BLOB, as.ICT_MAPVALUES) - } - }) - - gg.AfterAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - dropIndex(nil, ns, set, set+bin1.Name+"N") - dropIndex(nil, ns, set, set+bin2.Name+"N"+"keys") - dropIndex(nil, ns, set, set+bin2.Name+"N"+"values") - - dropIndex(nil, ns, set, set+bin1.Name+"S") - dropIndex(nil, ns, set, set+bin2.Name+"S"+"keys") - dropIndex(nil, ns, set, set+bin2.Name+"S"+"values") - - if serverIsNewerThan("7") { - dropIndex(nil, ns, set, set+bin1.Name+"B") - dropIndex(nil, ns, set, set+bin2.Name+"B"+"keys") - dropIndex(nil, ns, set, set+bin2.Name+"B"+"values") - } - }) - - var queryPolicy = as.NewQueryPolicy() - - gg.It("must Query a specific element in list and get only relevant records back", func() { - if serverIsOlderThan("7") { - gg.Skip("Not supported on the servers prior to v7") - return - } - - // Only supported by server v7+ - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{1, "a", []byte{1, 3, 5}} { - stm.SetFilter(as.NewContainsFilter(bin1.Name, as.ICT_LIST, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - cnt++ - _, exists := keys[string(rec.Key.Digest())] - gm.Expect(exists).To(gm.Equal(true)) - } - - gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) - } - }) - - gg.It("must Query a specific non-existig element in list and get no records back", func() { - if serverIsOlderThan("7") { - gg.Skip("Not supported on the servers prior to v7") - return - } - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{-1, "aaaa", []byte{0, 1, 255}} { - stm.SetFilter(as.NewContainsFilter(bin1.Name, as.ICT_LIST, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 0)) - } - }) - - gg.It("must Query a key in map and get only relevant records back", func() { - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{1, "a"} { - stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPKEYS, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - cnt++ - _, exists := keys[string(rec.Key.Digest())] - gm.Expect(exists).To(gm.Equal(true)) - } - - gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) - } - }) - - gg.It("must Query a specific non-existig key in map and get no records back", func() { - if serverIsOlderThan("7") { - gg.Skip("Not supported on the servers prior to v7") - return - } - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{-1, "aaaa", []byte{255, 245, 5}} { - stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPKEYS, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 0)) - } - }) - - gg.It("must Query a value in map and get only relevant records back", func() { - if serverIsOlderThan("7") { - gg.Skip("Not supported on the servers prior to v7") - return - } - - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{1, "a", []byte{1, 2, 3}} { - stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPVALUES, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - cnt++ - _, exists := keys[string(rec.Key.Digest())] - gm.Expect(exists).To(gm.Equal(true)) - } - - gm.Expect(cnt).To(gm.BeNumerically("==", keyCount)) - } - }) - - gg.It("must Query a specific non-existig value in map and get no records back", func() { - if serverIsOlderThan("7") { - gg.Skip("Not supported on the servers prior to v7") - return - } - - stm := as.NewStatement(ns, set) - for _, v := range []interface{}{-1, "aaaa", []byte{255, 255, 5}} { - stm.SetFilter(as.NewContainsFilter(bin2.Name, as.ICT_MAPVALUES, v)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 0)) - } - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/connection.go b/aerospike-tls/vendor-aerospike-client-go/connection.go deleted file mode 100644 index 3b977a1d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/connection.go +++ /dev/null @@ -1,596 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "compress/zlib" - "crypto/tls" - "io" - "net" - "runtime" - "strconv" - "sync" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - "github.com/aerospike/aerospike-client-go/v7/types/histogram" -) - -const _BUFF_ADJUST_INTERVAL = 5 * time.Second - -var ( - // DefaultBufferSize specifies the initial size of the connection buffer when it is created. - // If not big enough (as big as the average record), it will be reallocated to size again - // which will be more expensive. - DefaultBufferSize = 64 * 1024 // 64 KiB - - // MaxBufferSize protects against allocating massive memory blocks - // for buffers. Tweak this number if you are returning a lot of - // large records in your requests. - MaxBufferSize = 1024 * 1024 * 120 // 120 MiB - - // PoolCutOffBufferSize specifies the largest buffer size that will be pooled. Anything larger will be - // allocated per request and thrown away afterwards to avoid allocating very big buffers. - PoolCutOffBufferSize = 1024 * 1024 // 1MiB - - // MinBufferSize specifies the smallest buffer size that would be allocated for connections. Smaller buffer - // requests will allocate at least this amount of memory. This protects against allocating too many small - // buffers that would require reallocation and putting pressure on the GC. - MinBufferSize = 8 * 1024 // 16 KiB -) - -// Connection represents a connection with a timeout. -// Connections maintain a buffer to minimize requesting buffers from the pool. -// If a returned record requires a bigger buffer, the connection will borrow a larger -// buffer from the pool and temporarily use it, returning it after the request. -// A histogram keeps track of the sizes of buffers used for the connection, and the median -// value is used to resize the connection buffer on intervals to optimize memory usage and -// minimize GC pressure. -type Connection struct { - node *Node - - // timeouts - socketTimeout time.Duration - deadline time.Time - - // duration after which connection is considered idle - idleTimeout time.Duration - idleDeadline time.Time - - // connection object - conn net.Conn - - // histogram to adjust the buff size to optimal value over time - buffHist *histogram.Log2 - bufferAdjustDeadline time.Time - - // to avoid having a buffer pool and contention - dataBuffer []byte - - // This is a reference to the original data buffer. - // After a big buffer is used temporarily, we will use - // this field to reset the dataBuffer field to the original - // smaller buffer. - origDataBuffer []byte - - compressed bool - inflater io.ReadCloser - // inflater may consume more bytes than required. - // LimitReader is used to avoid that problem. - limitReader *io.LimitedReader - - closer sync.Once - - grpcConn bool - grpcReadCallback func() ([]byte, Error) - grpcReader io.ReadWriter -} - -// makes sure that the connection is closed eventually, even if it is not consumed -func connectionFinalizer(c *Connection) { - c.Close() -} - -// errToAerospikeErr will convert golang's net and io errors into *AerospikeError -// If the errors is nil, nil be returned. If conn is not nil, its node value -// will be set for the error. -func errToAerospikeErr(conn *Connection, err error) (aerr Error) { - if err == nil { - return nil - } - - if terr, ok := err.(net.Error); ok { - if terr.Timeout() { - if conn != nil && conn.node != nil { - conn.node.stats.ConnectionsTimeoutErrors.IncrementAndGet() - } - aerr = newErrorAndWrap(err, types.TIMEOUT) - } else { - aerr = newErrorAndWrap(err, types.NETWORK_ERROR) - } - } else { - aerr = newErrorAndWrap(err, types.NETWORK_ERROR) - } - - // set node if exists - if conn != nil { - aerr.setNode(conn.node) - } - - return aerr -} - -// newGrpcFakeConnection creates a connection that fakes a real connection for when grpc connections are required. -// These connections only support reading to allow parsing of the returned payload. -func newGrpcFakeConnection(payload []byte, callback func() ([]byte, Error)) *Connection { - buf := bytes.NewBuffer(payload) - return &Connection{ - grpcConn: true, - grpcReader: buf, - grpcReadCallback: callback, - limitReader: &io.LimitedReader{R: buf, N: 0}, - } -} - -// newConnection creates a connection on the network and returns the pointer -// A minimum timeout of 2 seconds will always be applied. -// If the connection is not established in the specified timeout, -// an error will be returned -func newConnection(address string, timeout time.Duration) (*Connection, Error) { - newConn := &Connection{dataBuffer: buffPool.Get(DefaultBufferSize)} - newConn.buffHist = histogram.NewLog2(32) - newConn.bufferAdjustDeadline = time.Now().Add(_BUFF_ADJUST_INTERVAL) - newConn.origDataBuffer = newConn.dataBuffer - - runtime.SetFinalizer(newConn, connectionFinalizer) - - // don't wait indefinitely - if timeout == 0 { - timeout = 5 * time.Second - } - - conn, err := net.DialTimeout("tcp", address, timeout) - if err != nil { - logger.Logger.Debug("Connection to address `%s` failed to establish with error: %s", address, err.Error()) - return nil, errToAerospikeErr(nil, err) - } - newConn.conn = conn - newConn.limitReader = &io.LimitedReader{R: conn, N: 0} - - // set timeout at the last possible moment - if err := newConn.SetTimeout(time.Now().Add(timeout), timeout); err != nil { - newConn.Close() - return nil, err - } - - return newConn, nil -} - -// NewConnection creates a TLS connection on the network and returns the pointer. -// A minimum timeout of 2 seconds will always be applied. -// If the connection is not established in the specified timeout, -// an error will be returned -func NewConnection(policy *ClientPolicy, host *Host) (*Connection, Error) { - address := net.JoinHostPort(host.Name, strconv.Itoa(host.Port)) - conn, err := newConnection(address, policy.Timeout) - if err != nil { - return nil, err - } - - if policy.TlsConfig == nil { - return conn, nil - } - - // Use version dependent clone function to clone the config - tlsConfig := policy.TlsConfig.Clone() - tlsConfig.ServerName = host.TLSName - - sconn := tls.Client(conn.conn, tlsConfig) - if err := sconn.Handshake(); err != nil { - nerr := newWrapNetworkError(err) - if cerr := sconn.Close(); cerr != nil { - logger.Logger.Debug("Closing connection after handshake error failed: %s", cerr.Error()) - nerr = chainErrors(newWrapNetworkError(cerr), nerr) - } - return nil, nerr - } - - if host.TLSName != "" && !tlsConfig.InsecureSkipVerify { - if err := sconn.VerifyHostname(host.TLSName); err != nil { - nerr := newWrapNetworkError(err) - if cerr := sconn.Close(); cerr != nil { - logger.Logger.Debug("Closing connection after VerifyHostName error failed: %s", cerr.Error()) - nerr = chainErrors(newWrapNetworkError(cerr), nerr) - } - logger.Logger.Error("Connection to address `%s` failed to establish with error: %s", address, err.Error()) - return nil, nerr - } - } - - conn.conn = sconn - return conn, nil -} - -// Write writes the slice to the connection buffer. -func (ctn *Connection) Write(buf []byte) (total int, aerr Error) { - var err error - - // make sure all bytes are written - // Don't worry about the loop, timeout has been set elsewhere - if err = ctn.updateDeadline(); err == nil { - if total, err = ctn.conn.Write(buf); err == nil { - return total, nil - } - - // If all bytes are written, ignore any potential error - // The error will bubble up on the next network io if it matters. - if total == len(buf) { - return total, nil - } - } - - aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) - - if ctn.node != nil { - ctn.node.incrErrorCount() - ctn.node.stats.ConnectionsFailed.IncrementAndGet() - } - - // the line should happen before .Close() - ctn.Close() - - return total, aerr -} - -// Read reads from connection buffer to the provided slice. -func (ctn *Connection) Read(buf []byte, length int) (total int, aerr Error) { - if ctn.grpcConn { - // grpc fake conn - return ctn.grpcRead(buf, length) - } - - var err error - - // if all bytes are not read, retry until successful - // Don't worry about the loop; we've already set the timeout elsewhere - for total < length { - var r int - if err = ctn.updateDeadline(); err != nil { - break - } - - if !ctn.compressed { - r, err = ctn.conn.Read(buf[total:length]) - } else { - r, err = ctn.inflater.Read(buf[total:length]) - if err == io.EOF && total+r == length { - ctn.compressed = false - err = ctn.inflater.Close() - } - } - total += r - if err != nil { - break - } - } - - if total == length { - // If all required bytes are read, ignore any potential error. - // The error will bubble up on the next network io if it matters. - return total, nil - } - - aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) - - if ctn.node != nil { - ctn.node.incrErrorCount() - ctn.node.stats.ConnectionsFailed.IncrementAndGet() - } - - // the line should happen before .Close() - ctn.Close() - - return total, aerr -} - -// Reads the grpc payload -func (ctn *Connection) grpcReadNext() (aerr Error) { - // if there is no payload set, ask for the next chunk - if ctn.grpcReadCallback != nil { - grpcPayload, err := ctn.grpcReadCallback() - if err != nil { - return err - } - - if _, err := ctn.grpcReader.Write(grpcPayload); err != nil { - errToAerospikeErr(ctn, io.EOF) - } - - if ctn.compressed { - ctn.limitReader.R = ctn.grpcReader - } - - return nil - } - return errToAerospikeErr(ctn, io.EOF) -} - -// Reads the grpc payload -func (ctn *Connection) grpcRead(buf []byte, length int) (total int, aerr Error) { - var err error - - // if all bytes are not read, retry until successful - // Don't worry about the loop; we've already set the timeout elsewhere - for total < length { - var r int - if !ctn.compressed { - r, err = ctn.grpcReader.Read(buf[total:length]) - } else { - r, err = ctn.inflater.Read(buf[total:length]) - if err == io.EOF && total+r == length { - ctn.compressed = false - err = ctn.inflater.Close() - } - } - total += r - if err != nil { - if err == io.EOF { - if err := ctn.grpcReadNext(); err != nil { - return total, err - } - continue - } - break - } - } - - if total == length { - // If all required bytes are read, ignore any potential error. - // The error will bubble up on the next network io if it matters. - return total, nil - } - - aerr = chainErrors(errToAerospikeErr(ctn, err), aerr) - - return total, aerr -} - -// IsConnected returns true if the connection is not closed yet. -func (ctn *Connection) IsConnected() bool { - return ctn.conn != nil -} - -// updateDeadline sets connection timeout for both read and write operations. -// this function is called before each read and write operation. If deadline has passed, -// the function will return a TIMEOUT error. -func (ctn *Connection) updateDeadline() Error { - now := time.Now() - var socketDeadline time.Time - if ctn.deadline.IsZero() { - if ctn.socketTimeout > 0 { - socketDeadline = now.Add(ctn.socketTimeout) - } - } else { - if now.After(ctn.deadline) { - return newError(types.TIMEOUT) - } - if ctn.socketTimeout == 0 { - socketDeadline = ctn.deadline - } else { - tDeadline := now.Add(ctn.socketTimeout) - if tDeadline.After(ctn.deadline) { - socketDeadline = ctn.deadline - } else { - socketDeadline = tDeadline - } - } - - // floor to a millisecond to avoid too short timeouts - if socketDeadline.Sub(now) < time.Millisecond { - socketDeadline = now.Add(time.Millisecond) - } - } - - if err := ctn.conn.SetDeadline(socketDeadline); err != nil { - if ctn.node != nil { - ctn.node.stats.ConnectionsFailed.IncrementAndGet() - } - return errToAerospikeErr(ctn, err) - } - - return nil -} - -// SetTimeout sets connection timeout for both read and write operations. -func (ctn *Connection) SetTimeout(deadline time.Time, socketTimeout time.Duration) Error { - ctn.deadline = deadline - ctn.socketTimeout = socketTimeout - - return nil -} - -// Close closes the connection -func (ctn *Connection) Close() { - ctn.closer.Do(func() { - if ctn != nil && ctn.conn != nil { - // deregister - if ctn.node != nil { - ctn.node.connectionCount.DecrementAndGet() - ctn.node.stats.ConnectionsClosed.IncrementAndGet() - } - - if err := ctn.conn.Close(); err != nil { - logger.Logger.Warn(err.Error()) - } - ctn.conn = nil - - // put the data buffer back in the pool in case it gets used again - buffPool.Put(ctn.dataBuffer) - - ctn.dataBuffer = nil - ctn.origDataBuffer = nil - ctn.node = nil - } - }) -} - -// Login will send authentication information to the server. -func (ctn *Connection) login(policy *ClientPolicy, hashedPassword []byte, sessionInfo *sessionInfo) Error { - // need to authenticate - if policy.RequiresAuthentication() { - var err Error - command := newLoginCommand(ctn.dataBuffer) - - if !sessionInfo.isValid() { - err = command.login(policy, ctn, hashedPassword) - } else { - err = command.authenticateViaToken(policy, ctn, sessionInfo.token) - if err != nil && err.Matches(types.INVALID_CREDENTIAL, types.EXPIRED_SESSION) { - // invalidate the token - if ctn.node != nil { - ctn.node.resetSessionInfo() - } - - // retry via user/pass - if hashedPassword != nil { - command = newLoginCommand(ctn.dataBuffer) - err = command.login(policy, ctn, hashedPassword) - } - } - } - - if err != nil { - if ctn.node != nil { - ctn.node.stats.ConnectionsFailed.IncrementAndGet() - } - // Socket not authenticated. Do not put back into pool. - ctn.Close() - return err - } - - si := command.sessionInfo() - if ctn.node != nil && si.isValid() { - ctn.node.sessionInfo.Set(si) - } - } - - return nil -} - -// Login will send authentication information to the server. -// This function is provided for using the connection in conjunction with external libraries. -// The password will be hashed every time, which is a slow operation. -func (ctn *Connection) Login(policy *ClientPolicy) Error { - if !policy.RequiresAuthentication() { - return nil - } - - hashedPassword, err := hashPassword(policy.Password) - if err != nil { - return err - } - - return ctn.login(policy, hashedPassword, nil) -} - -// RequestInfo gets info values by name from the specified connection. -// Timeout should already be set on the connection. -func (ctn *Connection) RequestInfo(names ...string) (map[string]string, Error) { - info, err := newInfo(ctn, names...) - if err != nil { - return nil, err - } - - return info.parseMultiResponse() -} - -// setIdleTimeout sets the idle timeout for the connection. -func (ctn *Connection) setIdleTimeout(timeout time.Duration) { - ctn.idleTimeout = timeout -} - -// isIdle returns true if the connection has reached the idle deadline. -func (ctn *Connection) isIdle() bool { - return ctn.idleTimeout > 0 && time.Now().After(ctn.idleDeadline) -} - -func selectWithinRange[T int | uint | int64 | uint64](min, val, max T) T { - if val < min { - return min - } else if val > max { - return max - } - return val -} - -// refresh extends the idle deadline of the connection. -func (ctn *Connection) refresh() { - now := time.Now() - ctn.idleDeadline = now.Add(ctn.idleTimeout) - if ctn.inflater != nil { - ctn.inflater.Close() - } - ctn.compressed = false - ctn.inflater = nil - ctn.dataBuffer = ctn.origDataBuffer - - // adjust buffer size - if now.After(ctn.bufferAdjustDeadline) { - ctn.bufferAdjustDeadline = now.Add(_BUFF_ADJUST_INTERVAL) - newBuffSize := selectWithinRange(MinBufferSize, int(ctn.buffHist.Median()), PoolCutOffBufferSize) - ctn.buffHist.Reset() - // Do not go lower than 1K and larger than max allowed buffer size - if newBuffSize != len(ctn.dataBuffer) { - ctn.origDataBuffer = nil - // put the current buffer back in the pool - buffPool.Put(ctn.dataBuffer) - - // Get a new one from the pool - ctn.dataBuffer = buffPool.Get(int(newBuffSize)) - ctn.origDataBuffer = ctn.dataBuffer - } - } -} - -// initInflater sets up the zlib inflater to read compressed data from the connection -func (ctn *Connection) initInflater(enabled bool, length int) Error { - ctn.compressed = enabled - ctn.inflater = nil - if ctn.compressed { - ctn.limitReader.N = int64(length) - r, err := zlib.NewReader(ctn.limitReader) - if err != nil { - return newCommonError(err) - } - ctn.inflater = r - } - return nil -} - -// KeepConnection decides if a connection should be kept -// based on the error type. -func KeepConnection(err Error) bool { - // Do not keep connection on client errors. - if err.resultCode() < 0 { - return false - } - - return !err.Matches(types.QUERY_TERMINATED, - types.SCAN_ABORT, - types.QUERY_ABORTED, - types.TIMEOUT) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/connection_heap.go b/aerospike-tls/vendor-aerospike-client-go/connection_heap.go deleted file mode 100644 index cc6cb102..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/connection_heap.go +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "runtime" - "sync" -) - -// singleConnectionHeap is a non-blocking LIFO heap. -// If the heap is empty, nil is returned. -// if the heap is full, offer will return false -type singleConnectionHeap struct { - head, tail uint32 - data []*Connection - size uint32 - full bool - mutex sync.Mutex -} - -// newSingleConnectionHeap creates a new heap with initial size. -func newSingleConnectionHeap(size int) *singleConnectionHeap { - if size <= 0 { - panic("Heap size cannot be less than 1") - } - - return &singleConnectionHeap{ - full: false, - data: make([]*Connection, uint32(size)), - size: uint32(size), - } -} - -func (h *singleConnectionHeap) cleanup() { - h.mutex.Lock() - defer h.mutex.Unlock() - - for i := range h.data { - if h.data[i] != nil { - h.data[i].Close() - } - - h.data[i] = nil - } - - // make sure offer and poll both fail - h.data = nil - h.full = true - h.head = 0 - h.tail = 0 -} - -// Offer adds an item to the heap unless the heap is full. -// In case the heap is full, the item will not be added to the heap -// and false will be returned -func (h *singleConnectionHeap) Offer(conn *Connection) bool { - h.mutex.Lock() - - // make sure heap is not full or cleaned up - if h.full || len(h.data) == 0 { - h.mutex.Unlock() - return false - } - - h.head = (h.head + 1) % h.size - h.full = (h.head == h.tail) - h.data[h.head] = conn - h.mutex.Unlock() - return true -} - -// Poll removes and returns an item from the heap. -// If the heap is empty, nil will be returned. -func (h *singleConnectionHeap) Poll() (res *Connection) { - h.mutex.Lock() - - // the heap has been cleaned up - if len(h.data) == 0 { - h.mutex.Unlock() - return nil - } - - // if heap is not empty - if (h.tail != h.head) || h.full { - res = h.data[h.head] - h.data[h.head] = nil - - h.full = false - if h.head == 0 { - h.head = h.size - 1 - } else { - h.head-- - } - } - - h.mutex.Unlock() - return res -} - -// DropIdleTail closes idle connection in tail. -// It will return true if tail connection was idle and dropped -func (h *singleConnectionHeap) DropIdleTail() bool { - h.mutex.Lock() - defer h.mutex.Unlock() - - // the heap has been cleaned up - if h.data == nil { - return false - } - - // if heap is not empty - if h.full || (h.tail != h.head) { - conn := h.data[(h.tail+1)%h.size] - - if conn.IsConnected() && !conn.isIdle() { - return false - } - - h.tail = (h.tail + 1) % h.size - h.data[h.tail] = nil - h.full = false - if conn.node != nil { - conn.node.stats.ConnectionsIdleDropped.IncrementAndGet() - } - conn.Close() - - return true - } - - return false -} - -// Len returns the number of connections in the heap -func (h *singleConnectionHeap) Len() int { - cnt := 0 - h.mutex.Lock() - - if !h.full { - if h.head >= h.tail { - cnt = int(h.head) - int(h.tail) - } else { - cnt = int(h.size) - (int(h.tail) - int(h.head)) - } - } else { - cnt = int(h.size) - } - h.mutex.Unlock() - return cnt -} - -// connectionHeap is a non-blocking FIFO heap. -// If the heap is empty, nil is returned. -// if the heap is full, offer will return false -type connectionHeap struct { - maxSize int - minSize int - heaps []singleConnectionHeap -} - -// Close cleans up all the data and removes all the references from -// active objects to ensure GC cleans up everything. -func (h *connectionHeap) cleanup() { - for i := range h.heaps { - h.heaps[i].cleanup() - } -} - -func newConnectionHeap(minSize, maxSize int) *connectionHeap { - if minSize > maxSize { - panic("minSize is bigger than maxSize for connection heap") - } - - heapCount := runtime.NumCPU() - if heapCount > maxSize { - heapCount = maxSize - } - - // will be >= 1 - perHeapSize := maxSize / heapCount - - heaps := make([]singleConnectionHeap, heapCount) - for i := range heaps { - heaps[i] = *newSingleConnectionHeap(perHeapSize) - } - - // add a heap for the remainder - remainder := maxSize - heapCount*perHeapSize - if remainder > 0 { - heaps = append(heaps, *newSingleConnectionHeap(remainder)) - } - - return &connectionHeap{ - maxSize: maxSize, - minSize: minSize, - heaps: heaps, - } -} - -// Offer adds an item to the heap unless the heap is full. -// In case the heap is full, the item will not be added to the heap -// and false will be returned -func (h *connectionHeap) Offer(conn *Connection, hint byte) bool { - idx := int(hint) % len(h.heaps) - end := idx + len(h.heaps) - for i := idx; i < end; i++ { - if h.heaps[i%len(h.heaps)].Offer(conn) { - // success - return true - } - } - return false -} - -// Poll removes and returns an item from the heap. -// If the heap is empty, nil will be returned. -func (h *connectionHeap) Poll(hint byte) (res *Connection) { - idx := int(hint) - - end := idx + len(h.heaps) - for i := idx; i < end; i++ { - if conn := h.heaps[i%len(h.heaps)].Poll(); conn != nil { - return conn - } - } - return nil -} - -// DropIdle closes all idle connections. -// It will only drop connections if there are -// at least ClientPolicy.MinConnectionPerNode available -func (h *connectionHeap) DropIdle() { - // decide how many conns are allowed to drop - // in minSize is 0, up to all connection can - // be closed if idle - excessCount := h.LenAll() - h.minSize - if excessCount <= 0 { - return - } - - for i := 0; i < len(h.heaps); i++ { - for h.heaps[i].DropIdleTail() { - excessCount-- - if excessCount == 0 { - return - } - } - } -} - -// Cap returns the total capacity of the connectionHeap -func (h *connectionHeap) Cap() int { - return h.maxSize -} - -// Len returns the number of connections in a specific sub-heap. -func (h *connectionHeap) Len(hint byte) (cnt int) { - return h.heaps[hint].Len() -} - -// LenAll returns the number of connections in all sub-heaps. -func (h *connectionHeap) LenAll() int { - cnt := 0 - for i := range h.heaps { - cnt += h.heaps[i].Len() - } - - return cnt -} diff --git a/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go b/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go deleted file mode 100644 index 8986d981..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/connection_heap_test.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Connection Heap tests", func() { - - conn := new(Connection) - - gg.Context("singleConnectionHeap", func() { - - gg.It("Must add until full", func() { - h := newSingleConnectionHeap(10) - for i := 0; i < 10; i++ { - gm.Expect(h.Len()).To(gm.Equal(i)) - gm.Expect(h.head).To(gm.Equal(uint32(i))) - gm.Expect(h.tail).To(gm.Equal(uint32(0))) - gm.Expect(h.Offer(conn)).To(gm.BeTrue()) - gm.Expect(h.Len()).To(gm.Equal(i + 1)) - gm.Expect(h.head).To(gm.Equal(uint32(i+1) % 10)) - gm.Expect(h.tail).To(gm.Equal(uint32(0))) - } - - gm.Expect(h.Offer(conn)).To(gm.BeFalse()) - gm.Expect(h.Offer(conn)).To(gm.BeFalse()) - gm.Expect(h.Len()).To(gm.Equal(10)) - gm.Expect(h.full).To(gm.BeTrue()) - gm.Expect(h.head).To(gm.Equal(h.tail)) - }) - - gg.It("Must add until full, then Poll successfully", func() { - h := newSingleConnectionHeap(10) - for i := 0; i < 10; i++ { - gm.Expect(h.Offer(conn)).To(gm.BeTrue()) - } - - for i := 0; i < 10; i++ { - gm.Expect(h.Len()).To(gm.Equal(10 - i)) - gm.Expect(h.head).To(gm.Equal(uint32(10-i) % 10)) - gm.Expect(h.tail).To(gm.Equal(uint32(0))) - gm.Expect(h.Poll()).NotTo(gm.BeNil()) - gm.Expect(h.full).To(gm.BeFalse()) - gm.Expect(h.Len()).To(gm.Equal(10 - i - 1)) - gm.Expect(h.head).To(gm.Equal(uint32(10 - i - 1))) - gm.Expect(h.tail).To(gm.Equal(uint32(0))) - } - - gm.Expect(h.Poll()).To(gm.BeNil()) - gm.Expect(h.Poll()).To(gm.BeNil()) - gm.Expect(h.Len()).To(gm.Equal(0)) - gm.Expect(h.full).To(gm.BeFalse()) - gm.Expect(h.head).To(gm.Equal(h.tail)) - }) - - gg.It("Must add then Poll successfully", func() { - h := newSingleConnectionHeap(10) - gm.Expect(h.Offer(conn)).To(gm.BeTrue()) - gm.Expect(h.Len()).To(gm.Equal(1)) - gm.Expect(h.head).To(gm.Equal(uint32(1))) - gm.Expect(h.full).To(gm.BeFalse()) - - gm.Expect(h.Poll()).NotTo(gm.BeNil()) - gm.Expect(h.Poll()).To(gm.BeNil()) - gm.Expect(h.Len()).To(gm.Equal(0)) - gm.Expect(h.full).To(gm.BeFalse()) - gm.Expect(h.head).To(gm.Equal(uint32(0))) - gm.Expect(h.head).To(gm.Equal(h.tail)) - - }) - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/delete_command.go b/aerospike-tls/vendor-aerospike-client-go/delete_command.go deleted file mode 100644 index 4f059d7c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/delete_command.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// guarantee deleteCommand implements command interface -var _ command = &deleteCommand{} - -type deleteCommand struct { - singleCommand - - policy *WritePolicy - existed bool -} - -func newDeleteCommand(cluster *Cluster, policy *WritePolicy, key *Key) (*deleteCommand, Error) { - var err Error - var partition *Partition - if cluster != nil { - partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) - if err != nil { - return nil, err - } - } - - newDeleteCmd := &deleteCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - policy: policy, - } - - return newDeleteCmd, nil -} - -func (cmd *deleteCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *deleteCommand) writeBuffer(ifc command) Error { - return cmd.setDelete(cmd.policy, cmd.key) -} - -func (cmd *deleteCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeWrite(cmd.cluster) -} - -func (cmd *deleteCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryWrite(isTimeout) - return true -} - -func (cmd *deleteCommand) parseResult(ifc command, conn *Connection) Error { - // Read header. - if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { - return err - } - - header := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(header); err != nil { - return err - } - - resultCode := cmd.dataBuffer[13] & 0xFF - - switch types.ResultCode(resultCode) { - case 0: - cmd.existed = true - case types.KEY_NOT_FOUND_ERROR: - cmd.existed = false - case types.FILTERED_OUT: - if err := cmd.emptySocket(conn); err != nil { - return err - } - cmd.existed = true - return ErrFilteredOut.err() - default: - return newError(types.ResultCode(resultCode)) - } - - return cmd.emptySocket(conn) -} - -func (cmd *deleteCommand) Existed() bool { - return cmd.existed -} - -func (cmd *deleteCommand) isRead() bool { - return false -} - -func (cmd *deleteCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *deleteCommand) transactionType() transactionType { - return ttDelete -} diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/README.md b/aerospike-tls/vendor-aerospike-client-go/docs/README.md deleted file mode 100644 index 10a5f950..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Introduction - -This package describes the Aerospike Go Client API in detail. - - -## Usage - -The aerospike Go client package is the main entry point to the client API. - -```go - import as "github.com/aerospike/aerospike-client-go/v7" -``` - -Before connecting to a cluster, you must import the package. - -You can then generate a client object for connecting to and operating against as cluster. - -```go - client, err := as.NewClient("127.0.0.1", 3000) -``` - -The application will use the client object to connect to a cluster, then perform operations such as writing and reading records. -Client object is goroutine frinedly, so you can use it in goroutines without synchronization. -It caches its connections and internal state automatically for optimal performance. These settings can also be changed. - -For more details on client operations, see [Client Class](client.md). - -## API Reference - -- [Aerospike Go Client Library Overview](aerospike.md) -- [Client Class](client.md) -- [Object Model](datamodel.md) -- [Policy Objects](policies.md) -- [Logger Object](log.md) diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md b/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md deleted file mode 100644 index 00448d7a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/aerospike.md +++ /dev/null @@ -1,103 +0,0 @@ -# Aerospike Package - -- [Usage](#usage) -- [Structs](#structs) - - [policies](#Policies) - - [logger](#logger) -- [Functions](#functions) - - [NewClient()](#client) - - [NewKey()](#key) - - - -## Usage - -The aerospike package can be imported into your project via: - -```go - import as "github.com/aerospike/aerospike-client-go/v7" -``` - - -## Structs - - - - -### Policies - -Policies contain the allowed values for operation conditions for each of the [client](client.md) operations. - -For details, see [Policies Object](policies.md) - - - - - -### Log - -Log is a collection of the various logging levels available in Aerospike. This logging levels can be used to modify the granularity of logging from the API. -Default level is LOG_ERR. - -```go - as.Logger.SetLevel(as.INFO) -``` - -For details, see [Logger Object](log.md) - - - -### client(host string, port int): *Client - -Creates a new [client](client.md) with the provided configuration. - -Parameters: - -- `name` – Host name or IP to connect to. -- `port` – Host port. - -Returns a new client object. - -Example: - -```go - client, err := as.NewClient("127.0.0.1", 3000) -``` - -For detals, see [Client Class](client.md). - - - - -### NewKey(ns, set string, key interface{}): * - -Creates a new [key object](datamodel.md#key) with the provided arguments. - -Parameters: - -- `ns` – The namespace for the key. -- `set` – The set for the key. -- `key` – The value for the key. - -Returns a new key. - -Example: - -```go - key := as.Key("test", "demo", 123) -``` - -For details, see [Key Object](datamodel.md#key). - diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/client.md b/aerospike-tls/vendor-aerospike-client-go/docs/client.md deleted file mode 100644 index de9a17fa..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/client.md +++ /dev/null @@ -1,745 +0,0 @@ -# Client Class - -The `Client` class provides operations which can be performed on an Aerospike -database cluster. In order to get an instance of the Client class, you need -to call `NewClient()`: - -```go - client, err := as.NewClient("127.0.0.1", 3000) -``` - -To customize a Client with a ClientPolicy: - -```go - clientPolicy := as.NewClientPolicy() - clientPolicy.ConnectionQueueSize = 64 - clientPolicy.LimitConnectionsToQueueSize = true - clientPolicy.Timeout = 50 * time.Millisecond - - client, err := as.NewClientWithPolicy(clientPolicy, "127.0.0.1", 3000) -``` - -*Notice*: Examples in the section are only intended to illuminate simple use cases without too much distraction. Always follow good coding practices in production. Always check for errors. - -With a new client, you can use any of the methods specified below. You need only *ONE* client object. This object is goroutine-friendly, and pools its resources internally. - -- [Methods](#methods) - - [Add()](#add) - - [Append()](#append) - - [Close()](#close) - - [Delete()](#delete) - - [Exists()](#exists) - - [BatchExists()](#batchexists) - - [Get()](#get) - - [GetHeader()](#getheader) - - [BatchGet()](#batchget) - - [BatchGetHeader()](#batchgetheader) - - [IsConnected()](#isConnected) - - [Operate()](#operate) - - [Prepend()](#prepend) - - [Put()](#put) - - [PutBins()](#putbins) - - [Touch()](#touch) - - [ScanAll()](#scanall) - - [ScanNode()](#scannode) - - [CreateIndex()](#createindex) - - [DropIndex()](#dropindex) - - [RegisterUDF()](#registerudf) - - [RegisterUDFFromFile()](#registerudffromfile) - - [Execute()](#execute) - - [ExecuteUDF()](#executeudf) - - [Query()](#query) - - - -## Methods - - - - -### Add(policy *WritePolicy, key *Key, bins BinMap) error - -Using the provided key, adds values to the mentioned bins. -Bin value types should be of type `integer` for the command to have any effect. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. - -Example: -```go - key := NewKey("test", "demo", 123) - - bins = BinMap { - "e": 2, - "pi": 3, - } - - err := client.Add(nil, key, bins) -``` - - - - -### Append(policy *WritePolicy, key *Key, bins BinMap) error - -Using the provided key, appends provided values to the mentioned bins. -Bin value types should be of type `string` or `[]byte` for the command to have any effect. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. - -Example: -```go - key := NewKey("test", "demo", 123) - - bins = BinMap { - "story": ", and lived happily ever after...", - } - - err := client.Append(nil, key, bins) -``` - - - - -### Close() - -Closes the client connection to the cluster. - -Example: -```go - client.Close() -``` - - - - -### Delete(policy *WritePoicy, key *Key) (existed bool, err error) - -Removes a record with the specified key from the database cluster. - -Parameters: - -- `policy` – (optional) The [delete Policy object](policies.md#RemovePolicy) to use for this operation. -- `key` – A [Key object](datamodel.md#key) used for locating the record to be removed. - -returned values: - -- `existed` – Boolean value that indicates if the Key existed. - -Example: -```go - key := NewKey("test", "demo", 123) - - if existed, err := client.Delete(nil, key); existed { - // do something - } -``` - - - - -### Exists(policy *BasePolicy, key *Key) (bool, error) - -Using the key provided, checks for the existence of a record in the database cluster . - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. - -Example: - -```go - key := NewKey("test", "demo", 123) - - if exists, err := client.Exists(nil, key) { - // do something - } -``` - - - - -### BatchExists(policy *BasePolicy, keys []*Key) ([]bool, error) - -Using the keys provided, checks for the existence of records in the database cluster in one request. - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `keys` – A [Key array](datamodel.md#key), used to locate the records in the cluster. - -Example: - -```go - key1 := NewKey("test", "demo", 123) - key2 := NewKey("test", "demo", 42) - - existanceArray, err := client.Exists(nil, []*Key{key1, key2}) { - // do something - } -``` - - - - -### Get(policy *BasePolicy, key *Key, bins ...string) (*Record, error) - -Using the key provided, reads a record from the database cluster . - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – (optional) Bins to retrieve. Will retrieve all bins if not provided. - -Example: - -```go - key := NewKey("test", "demo", 123) - - rec, err := client.Get(nil, key) // reads all the bins -``` - - - - -### GetHeader(policy *BasePolicy, key *Key) (*Record, error) - -Using the key provided, reads *ONLY* record metadata from the database cluster. Record metadata includes record generation and Expiration (TTL from the moment of retrieval, in seconds) - -```record.Bins``` will always be empty in resulting ```record```. - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. - -Example: - -```go - key := NewKey("test", "demo", 123) - - rec, err := client.GetHeader(nil, key) // No bins will be retrieved -``` - - - - -### BatchGet(policy *BasePolicy, keys *[]Key, bins ...string) ([]*Record, error) - -Using the keys provided, reads all relevant records from the database cluster in a single request. - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `keys` – A [Key array](datamodel.md#key), used to locate the record in the cluster. -- `bins` – (optional) Bins to retrieve. Will retrieve all bins if not provided. - -Example: - -```go - key1 := NewKey("test", "demo", 123) - key2 := NewKey("test", "demo", 42) - - recs, err := client.BatchGet(nil, []*Key{key1, key2}) // reads all the bins -``` - - - - -### BatchGetHeader(policy *BasePolicy, keys *[]Key) ([]*Record, error) - -Using the keys provided, reads all relevant record metadata from the database cluster in a single request. - -```record.Bins``` will always be empty in resulting ```record```. - -Parameters: - -- `policy` – (optional) The [BasePolicy object](policies.md#BasePolicy) to use for this operation. - Pass `nil` for default values. -- `keys` – A [Key array](datamodel.md#key), used to locate the record in the cluster. - -Example: - -```go - key1 := NewKey("test", "demo", 123) - key2 := NewKey("test", "demo", 42) - - recs, err := client.BatchGetHeader(nil, []*Key{key1, key2}) // reads all the bins -``` - - - -### IsConnected() bool - -Checks if the client is connected to the cluster. - - - - -### Prepend(policy *WritePolicy, key *Key, bins BinMap) error - -Using the provided key, prepends provided values to the mentioned bins. -Bin value types should be of type `string` or `[]byte` for the command to have any effect. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – A [BinMap](datamodel.md#binmap) used for specifying the fields and value. - -Example: -```go - key := NewKey("test", "demo", 123) - - bins = BinMap { - "story": "Long ago, in a galaxy far far away, ", - } - - err := client.Prepend(nil, key, bins) -``` - - - - -### Put(policy *WritePolicy, key *Key, bins BinMap) error - -Writes a record to the database cluster. If the record exists, it modifies the record with bins provided. -To remove a bin, set its value to `nil`. - -#### Node: Under the hood, Put converts BinMap to []Bins and uses ```PutBins```. Use PutBins to avoid unnecessary memory allocation and iteration. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – A [BinMap map](datamodel.md#binmap) used for specifying the fields to store. - -Example: -```go - key := NewKey("test", "demo", 123) - - bins := BinMap { - "a": "Lack of skill dictates economy of style.", - "b": 123, - "c": []int{1, 2, 3}, - "d": map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}, - } - - err := client.Put(nil, key, bins) -``` - - - - -### PutBins(policy *WritePolicy, key *Key, bins ...*Bin) error - -Writes a record to the database cluster. If the record exists, it modifies the record with bins provided. -To remove a bin, set its value to `nil`. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. -- `bins` – A [Bin array](datamodel.md#bin) used for specifying the fields to store. - -Example: -```go - key := NewKey("test", "demo", 123) - - bin1 := NewBin("a", "Lack of skill dictates economy of style.") - bin2 := NewBin("b", 123) - bin3 := NewBin("c", []int{1, 2, 3}) - bin4 := NewBin("d", map[string]interface{}{"a": 42, "b": "An elephant is mouse with an operating system."}) - - err := client.PutBins(nil, key, bin1, bin2, bin3, bin4) -``` - - - - -### Touch(policy *WritePolicy, key *Key) error - -Create record if it does not already exist. -If the record exists, the record's time to expiration will be reset to the policy's expiration. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `key` – A [Key object](datamodel.md#key), used to locate the record in the cluster. - -Example: -```go - key := NewKey("test", "demo", 123) - - err := client.Touch(NewWritePolicy(0, 5), key) -``` - - - - -### ScanAll(policy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, error) - -Performs a full Scan on all nodes in the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) - - -Parameters: - -- `policy` – (optional) A [Scan Policy object](policies.md#ScanPolicy) to use for this operation. - Pass `nil` for default values. -- `namespace` – Namespace to perform the scan on. -- `setName` – Name of the Set to perform the scan on. -- `binNames` – Name of bins to retrieve. If not passed, all bins will be retrieved. - -Refer to [Recordset object](datamodel.md#recordset) documentation for details on how to retrieve the data. - -Example: -```go - // scan the whole cluster - recordset, err := client.ScanAll(nil, "test", "demo") - - for res := range recordset.Results() { - if res.Err != nil { - // handle error; or close the recordset and break - } - - // process record - fmt.Println(res.Record) - } -``` - - - - -### ScanNode(policy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, error) - -Performs a full Scan *on a specific node* in the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) - -It works the same as ScanAll() method. - - - - -### CreateIndex(policy *WritePolicy, namespace string, setName string, indexName string, binName string, indexType IndexType) (*IndexTask, error) - -Creates a secondary index. IndexTask will return a IndexTask object which can be used to determine if the operation is completed. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `namespace` – Namespace -- `setName` – Name of the Set -- `indexName` – Name of index -- `binName` – Bin name to create the index on -- `indexType` – STRING or NUMERIC - -Example: - -```go - idxTask, err := client.CreateIndex(nil, "test", "demo", "indexName", "binName", NUMERIC) - panicOnErr(err) - - // wait until index is created. - // OnComplete() channel will return nil on success and an error on errors - err = <- idxTask.OnComplete() - if err != nil { - panic(err) - } -``` - - - -### DropIndex( policy *WritePolicy, namespace string, setName string, indexName string) error - -Drops an index. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `namespace` – Namespace -- `setName` – Name of the Set. -- `indexName` – Name of index - -```go - err := client.DropIndex(nil, "test", "demo", "indexName") -``` - - - - -### RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, error) - -Registers the given UDF on the server. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `udfBody` – UDF source code -- `serverPath` – Path on which the UDF should be put on the server-side -- `language` – Only 'LUA' is currently supported - - -Example: - -```go - const udfBody = `function testFunc1(rec) - local ret = map() -- Initialize the return value (a map) - - local x = rec['bin1'] -- Get the value from record bin named "bin1" - - rec['bin2'] = (x / 2) -- Set the value in record bin named "bin2" - - aerospike:update(rec) -- Update the main record - - ret['status'] = 'OK' -- Populate the return status - return ret -- Return the Return value and/or status - end` - - regTask, err := client.RegisterUDF(nil, []byte(udfBody), "udf1.lua", LUA) - panicOnErr(err) - - // wait until UDF is created - err = <-regTask.OnComplete() - if err != nil { - panic(err) - } -``` - - - - -### RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, error) - -Read the UDF source code from a file and registers it on the server. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `clientPath` – full file path for UDF source code -- `serverPath` – Path on which the UDF should be put on the server-side -- `language` – Only 'LUA' is currently supported - - -Example: - -```go - regTask, err := client.RegisterUDFFromFile(nil, "/path/udf.lua", "udf1.lua", LUA) - panicOnErr(err) - - // wait until UDF is created - err = <- regTask.OnComplete() - if err != nil { - panic(err) - } -``` - - - - -### Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, error) - -Executes a UDF on a record with the given key, and returns the results. - -Parameters: - -- `policy` – (optional) A [Write Policy object](policies.md#WritePolicy) to use for this operation. - Pass `nil` for default values. -- `packageName` – server path to the UDF -- `functionName` – UDF name -- `args` – (optional) UDF arguments - -Example: - -Considering the UDF registered in RegisterUDF example above: - -```go - res, err := client.Execute(nil, key, "udf1", "testFunc1") - - // res will be a: map[interface{}]interface{}{"status": "OK"} -``` - - - -### ExecuteUDF(policy *QueryPolicy, statement *Statement, packageName string, functionName string, functionArgs ...Value) (*ExecuteTask, error) - -Executes a UDF on all records which satisfy filters set in the statement. If there are filters, it will run on all records in the database. - -Parameters: - -- `policy` – (optional) A [Query Policy object](policies.md#QueryPolicy) to use for this operation. - Pass `nil` for default values. -- `statement` – [Statement object](datamodel.md#statement) to narrow down records. -- `packageName` – server path to the UDF -- `functionName` – UDF name -- `functionArgs` – (optional) UDF arguments - -Example: - -Considering the UDF registered in RegisterUDF example above: - -```go - statement := NewStatement("namespace", "set") - exTask, err := client.ExecuteUDF(nil, statement, "udf1", "testFunc1") - panicOnErr(err) - - // wait until UDF is run on all records - err = <- exTask.OnComplete() - if err != nil { - panic(err) - } -``` - - - - -### Query(policy *QueryPolicy, statement *Statement) (*Recordset, error) - -Performs a query on the cluster, and returns the results in a [Recordset object](datamodel.md#recordset) - - -Parameters: - -- `policy` – (optional) A [Query Policy object](policies.md#QueryPolicy) to use for this operation. - Pass `nil` for default values. -- `statement` – [Statement object](datamodel.md#statement) to narrow down records. - -Refer to [Recordset object](datamodel.md#recordset) documentation for details on how to retrieve the data. - - -Example: - -```go - stm := NewStatement("namespace", "set") - stm.Addfilter(NewRangeFilter("binName", value1, value2)) - - recordset, err := client.Query(nil, stm) - - // consume recordset and check errors - for res := recordset.Results() { - if res.Err != nil { - // handle error, or close the recordset and break - } - - // process record - fmt.Println(res.Record) - } -``` diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md b/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md deleted file mode 100644 index 993e6af5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/datamodel.md +++ /dev/null @@ -1,237 +0,0 @@ -# Data Model - - - - -## BinMap - -BinMap is a type defined as map[string]interface{} to facilitate declaring bin data. - -```go - bins := BinMap{ - "name" : "Abu Rayhan Biruni", - "contribution" : "accurately calculated the radius of earth in 11th century", - "citation" : "https://en.wikipedia.org/wiki/History_of_geodesy#Biruni", - } -``` - - - - -## Record - -A record is how the data is represented and stored in the database. A record is represented as a `struct`. - -Fields are: -- `Bins` — Bins and their values are represented as a BinMap (map[string]interface{}) -- `Key` — Associated Key pointer -- `Node` — Database node from which the record was retrieved from. -- `Expiration` — TimeToLive of the record in seconds. Shows in how many seconds the data will be erased if not updated. -- `Generation` — Record generation (number of times the record has been updated). - -The keys of the Bins are the names of the fields (bins) of a record. The values for each field can either be u/int/8,16,32,64, string, Array or Map. - -Note: Arrays and Maps can contain an array or a map as a value in them. In other words, nesting of complex values is allowed. - -Records are returned as a result of `Get` operations. To write back their values, one needs to pass their Bins field to the `Put` method. - -Simple example of a Read, Change, Update operation: - -```go - // define a client to connect to - client, err := NewClient("127.0.0.1", 3000) - panicOnError(err) - - key, err := NewKey("test", "demo", "key") // key can be of any supported type - panicOnError(err) - - // define some bins - bins := BinMap{ - "bin1": 42, // you can pass any supported type as bin value - "bin2": "An elephant is a mouse with an operating system", - "bin3": []interface{}{"Go", 2009}, - } - - // write the bins - writePolicy := NewWritePolicy(0, 0) - err = client.Put(writePolicy, key, bins) - panicOnError(err) - - // read it back! - readPolicy := NewPolicy() - rec, err := client.Get(readPolicy, key) - panicOnError(err) - - // change data - v := rec.Bins["bin1"].(int) - v += 1 - rec.Bins["bin1"] = v - - // update - err = client.Put(nil, key, rec.Bins) -``` - - - - -## Recordset - -A recordset is the result of a scan or query operation against the database. Records are retrieved one by one from the database, and delivered to the user via `Records` channel. -To prevent too much memory use, the operation will block if the Records channel is full. -Errors are returned on `Errors` channel. If an error is of type NodeError, it will contain the Node, ResultCode and Error message of the error. - -Recordsets can be closed at any time to cancel the operation. - -- `Records` — The resulting records channel. -- `Errors` – The error channel. - -```go - // scan the whole cluster - recordset, err := client.ScanAll(nil, "test", "demo") - - for res := range recordset.Results() { - if res.Err != nil { - // you may be able to find out on which node the error occurred - if ne, ok := err.(NodeError); ok { - node := ne.Node - // do something - } - } - - // process record - fmt.Println(res.Record) - } -``` - - - - -## NewKey(ns, set string, key interface{}) - -A record is addressable via its key. A key is a struct containing: - -- `ns` — The namespace of the key. Must be a String. -- `set` – The set of the key. Must be a String. -- `key` – The value of the key. Can be of any supported types. - -Example: - -```go - key, err := NewKey("test", "demo", "key") // key can be of any supported type - panicOnError(err) -``` - - - - -## NewBin(name string, value interface{}) Value - -Bins are analogous to fields in relational databases. - -- `name` — Bin name. Must be a String. -- `value` – The value of the key. Can be of any supported type. - -Example: - -```go - bin1 := NewBin("name", "Aerospike") // string value - bin2 := NewBin("maxTPS", 1000000) // number value - bin3 := NewBin("notes", - map[interface{}]interface{}{ - "age": 5, - 666: "not allowed in", - "clients": []string{"go", "c", "java", "python", "node", "erlang"}, - }) // go wild! -``` - - - - -## NewStatement(ns string, set string, binNames ...string) *Statement - -A statement indicates which records should be affected by the query. Limits are set by Filter objects. If no filters are set, the query will be a ScanAll. - -- `ns` — The namespace. Must be a String. -- `set` – Set name. Must be a String. -- `binNames` – (optional) name of bins which will be affected. - -The following optional attributes can also be changed in the statement struct: - -- `IndexName` — Query index name. If not set, the server will determine the index from the filter's bin name. -- `Filters` — Optional query filters. Currently, only one filter is allowed by the server on a secondary index lookup. - -```go - stm := NewStatement("namespace", "set", "binName") - - // Use one of the following - - // SQL Eq: select binName from ns.set where binName == 42 - stm.Addfilter(NewEqualFilter("binName", 42)) - - // OR - - // SQL Eq: select binName from ns.set where binName between 0 and 100 - stm.Addfilter(NewRangeFilter("binName", 0, 100)) - - // send the query with default policy - recordset, err := client.Query(nil, stm) - - // consume recordset and check errors - for res := recordset.Results() { - if res.Err != nil { - // handle error - panic(res.Err) - } - - // process record - fmt.Println(res.Record) - } -``` - - - - -## NewEqualFilter(binName string, value interface{}) *Filter - -Create equality filter for query. - -- `binName` — Name of bin which is being targeted. Must be a String. -- `value` – Value which needs to be matched. should be either integer or string - -## NewRangeFilter(binName string, begin int64, end int64) *Filter - -Create range filter for query. String ranges are not supported. - -- `binName` — Name of bin which is being targeted. Must be a String. -- `begin` – Lower bound of the range. It is included in the range. -- `end` – Upper bound of the range. It is included in the range. - -Refer to statement for examples. diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/log.md b/aerospike-tls/vendor-aerospike-client-go/docs/log.md deleted file mode 100644 index 2830a31f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/log.md +++ /dev/null @@ -1,24 +0,0 @@ -#log - -Various log levels available to log from the Aerospike API. -Default is set to OFF. - -```go - import asl "github.com/aerospike/aerospike-client-go/v7/logger" - - asl.Logger.SetLevel(asl.OFF) -``` - -You can set the Logger to any object that supports log.Logger interface. - -## Log levels: - -##### ERROR - -##### WARN - -##### INFO - -##### DEBUG - -##### OFF diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/performance.md b/aerospike-tls/vendor-aerospike-client-go/docs/performance.md deleted file mode 100644 index c1a93c56..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/performance.md +++ /dev/null @@ -1,41 +0,0 @@ -# Tweaking Performance - -This document details available mechanisms to optimize client performance characteristics, and tries to suggest good practices in using the client in a cluster of computers. - -There are different options in the library to tweak performance for different workloads. It is important to keep in mind that you should benchmark and profile your application under reasonably production-like workloads to gain best possible performance. - -This is a living document and we will keep it updated to help you make the best of our server and client solutions. - -## Client Design Goals - -We have tweaked and profiled the client library under various workloads to achieve the following goals: - - - **Minimal Memory Allocation**: We are conscious of this and have tried to remove as many allocations as possible. We are pooling buffers and hash objects whenever possible to achieve this goal. - - - **Customization Friendly**: We have added parameters to allow you to customize some variables when those variables could influence performance under different workloads. - - - **Determinism**: We have tried to keep the client inner workings deterministic. We have tried to stay away from data structures, or algorithms which are not deterministic. All pool and queue implementations in the client are bound in maximum memory size and perform in predetermined number of cycles. There are no heuristic algorithms in the client. - -Please let us know if you can suggest an improvement anywhere in the library. - -## Tweaking Performance / Best Practices - -1. **Server Connection Limit**: Each server node has a limited number of file descriptors on the operating system for connections. No matter how big, this resource is still limited and can get exhausted by too many connections. Clients pool their connections to database nodes for optimal performance. If node connections are exhausted by existing clients, new clients won't be able to connect to the database. (e.g. When you start up a new application in the cluster) - - To guard against this, you should observe the following in your application design: - - 1.1. **Use only one `Client` object in your application**: `Client` objects pool connections inside and synchronize their inner functionality. They are goroutine friendly. Use only one `Client` object in your application and pass it around. - - 1.2. **Limit `Client` connection pool**: The default number of maximum connection pool size in a client object is 256. Even under extreme load in fast metal, clients rarely use more than even a quarter of this many connection. When there's no available connections in the pool, new connection to server will be made. If the pool is full, connections will be closed after their use to guard against too many connections. - - If this pool is too small, the client will waste time in connecting to the server for each new request; If too big, it will waste server connections. - - At its maximum number of 256 for each client, and `proto-fd-max` set to 10000 in your server node configuration, you can safely have around 50 clients **per server node**. In practice, this will approach 150 high performing clients. You can change this pool size in `ClientPolicy`, and then initialize your `Client` object using `NewClientWithPolicy(policy **ClientPolicy, hostname string, port int)` initializer. - - You can also guard against the number of new connections to each node using `ClientPolicy.LimitConnectionsToQueueSize = true`, so that if a connection is not available in the pool, the client will wait or timeout instead of creating a new client. - -2. **Initial Connection Buffer Size**: Client library retains its buffers to reduce memory allocation. The memory buffers are grown automatically, but the initial size can be set to avoid reallocations in case the initial size is always too small. If you ever determine that the initial pool size is sub-optimal for you application, you can set the size by `DefaultBufferSize`. - -3. **Using `Bin` objects in `Put` operations instead of BinMaps**: `Put` method requires you to pass a map for bin values. While convenient, it will allocate an array of bins on each call, iterate on the map, and make `Bin` objects to use. - - If performance is absolutely important, use `PutBins` method and pass bins yourself. diff --git a/aerospike-tls/vendor-aerospike-client-go/docs/policies.md b/aerospike-tls/vendor-aerospike-client-go/docs/policies.md deleted file mode 100644 index d215ddf2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/docs/policies.md +++ /dev/null @@ -1,254 +0,0 @@ -# Policies - -Policies provide the ability to modify the behavior of operations. - -This document provides information on the structure of policy objects for specific -operations and the allowed values for some of the policies. - -- [`Policy Objects`](#Objects) -- [`Policy Values`](#Values) - - - -## Objects - -Policy objects are structs which define the behavior of associated operations. - -When invoking an operation, you can choose: -- pass `nil` as policy. A relevant Policy with default values will be generated automatically. -- Use a generator to make the policy; e.g. `NewWritePolicy(gen, ttl)` -- Generate a policy object directly; e.g. -```go - Policy{ - Priority: Priority.DEFAULT, - Timeout: 0 * time.Millisecond, // no timeout - MaxRetries: 2, - SleepBetweenRetries: 500 * time.Millisecond, - SleepMultiplier: 1.5 - } -``` - -Usage Example: - -```go - client.Get(nil, key); - client.Get(NewPolicy(), key); -``` - - - - -### Base Policy Object - -A policy effecting the behaviour of read operations. - -Attributes: - -- `Priority` – Specifies the behavior for the key. - For values, see [Priority Values](policies.md#priority). - * Default: `Priority.DEFAULT` -- `Timeout` – time.Duration datatype. Maximum time to wait for - the operation to complete. If 0 (zero), then the value - means there will be no timeout enforced. - * Default: `0 * time.Milliseconds` (no timeout) -- `MaxRetries` – Number of times to try on connection errors. - * Default: `2` -- `SleepBetweenRetries` – Duration of waiting between retries. - * Default: `500 * time.Milliseconds` -- `SleepMultiplier` - The multiplying factor to be used for exponential - backoff during retries. - * Default: `1.0` - -- `SendKey` – Qualify whether to send user defined key in addition to hash digest on both reads and writes. - If the key is sent on a write, the key will be stored with the record on server - * Default: `false` - - - - -### WritePolicy Object - -A policy effecting the behaviour of write operations. - -Includes All Base Policy attributes, plus: - -- `RecordExistsAction` – Qualify how to handle writes where the record already exists. - For values, see [RecordExistsAction Values](policies.md#exists). - * Default: `RecordExistsAction.UPDATE` -- `GenerationPolicy` – Qualify how to handle record writes based on record generation. - For values, see [GenerationPolicy Values](policies.md#gen). - * Default: `GenerationPolicy.NONE` (generation is not used to restrict writes) -- `Generation` – Expected generation. Generation is the number of times a record has been modified - (including creation) on the server. If a write operation is creating a record, - the expected generation would be 0 - * Default: `0` -- `Expiration` – Record expiration. Also known as ttl (time to live). Seconds record will live before being removed by the server. - For values, see [Expiration Values](policies.md#expiration). - * Default: `Expiration.TTLServerDefault` - - - - - -### QueryPolicy Object - -A policy effecting the behaviour of query operations. - -Includes All Base Policy attributes, plus: - -- `MaxConcurrentNodes` – Maximum number of concurrent requests to server nodes at any point in time. If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries will be made to 8 nodes in parallel. When a query completes, a new query will be issued until all 16 nodes have been queried. - * Default: `0` All nodes. -- `RecordQueueSize` – Number of records to place in queue before blocking. - Records received from multiple server nodes will be placed in a queue. A separate goroutine consumes these records in parallel. If the queue is full, the producer goroutines will block until records are consumed. - * Default: `50` - - - - -### ScanPolicy Object - -A policy effecting the behaviour of scan operations. - -Includes All Base Policy attributes, plus: - -- `ScanPercent` – ScanPercent determines percent of data to scan. Valid integer range is 1 to 100. - * Default: `100` All records. -- `MaxConcurrentNodes` – Maximum number of concurrent requests to server nodes at any point in time. If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then scans will be made to 8 nodes in parallel. When a scan completes, a new scan will be issued until all 16 nodes have been queried. - * Default: `0` All nodes together. -- `ConcurrentNodes` – Issue scan requests in parallel or serially. - * Default: `true` Concurrently. -- `IncludeBinData` – Indicates if bin data is retrieved. If false, only record metadata are retrieved. - * Default: `true` -- `FailOnClusterChange` – Terminate scan if cluster in fluctuating state. - * Default: `true` -- `RecordQueueSize` – Number of records to place in queue before blocking. Records received from multiple server nodes will be placed in a queue. A separate goroutine consumes these records in parallel. If the queue is full, the producer goroutines will block until records are consumed. - * Default: `5000` - - -## Values - -The following are values allowed for various policies. - - - - -### GenerationPolicy Values - -#### NONE - -Writes a record, regardless of generation. - -#### EXPECT_GEN_EQUAL - -Writes a record, ONLY if generations are equal. - -#### EXPECT_GEN_GT - -Writes a record, ONLY if local generation is greater-than remote generation. - - - - -### RecordExistsAction Values - -#### UPDATE - Create or update record. - - Merge write command bins with existing bins. - -#### UPDATE_ONLY - Update record only. Fail if record does not exist. - - Merge write command bins with existing bins. - -#### REPLACE - Create or replace record. - - Delete existing bins not referenced by write command bins. - - Supported by Aerospike 2 server versions >= 2.7.5 and - - Aerospike 3 server versions >= 3.1.6. - -#### REPLACE_ONLY - Replace record only. Fail if record does not exist. - - Delete existing bins not referenced by write command bins. - - Supported by Aerospike 2 server versions >= 2.7.5 and - - Aerospike 3 server versions >= 3.1.6. - -#### CREATE_ONLY - Create only. Fail if record exists. - - - - - -### Priority Values - -#### DEFAULT - The server defines the priority. - -#### LOW - Run the database operation in a background thread. - -#### MEDIUM - Run the database operation at medium priority. - -#### HIGH - Run the database operation at the highest priority. - - - - -### Expiration Values - -#### TTLServerDefault - Default to namespace configuration variable "default-ttl" on the server. - -#### TTLDontExpire - Never expire. - - Supported by Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server. - -#### TTLDontUpdate - Do not change ttl when record is written. - - Supported by Aerospike server versions >= 3.10.1. - -#### > 0 - Actual expiration in seconds. diff --git a/aerospike-tls/vendor-aerospike-client-go/error.go b/aerospike-tls/vendor-aerospike-client-go/error.go deleted file mode 100644 index c1722a2f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/error.go +++ /dev/null @@ -1,528 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "errors" - "fmt" - "runtime" - "strconv" - "strings" - - "github.com/aerospike/aerospike-client-go/v7/types" - grpc "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// Error is the internal error interface for the Aerospike client's errors. -// All the public API return this error type. This interface is compatible -// with error interface, including errors.Is and errors.As. -type Error interface { - error - - // Matches will return true is the ResultCode of the error or - // any of the errors wrapped down the chain has any of the - // provided codes. - Matches(rcs ...types.ResultCode) bool - - // IsInDoubt signifies that the write operation may have gone through on the server - // but the client is not able to confirm that due an error. - IsInDoubt() bool - - // resultCode returns the error result code. - resultCode() types.ResultCode - - // Unwrap returns the error inside - Unwrap() error - - // Trace returns a stack trace of where the error originates from - Trace() string - - iter(int) Error - setInDoubt(bool, int) Error - setNode(*Node) Error - markInDoubt(bool) Error - markInDoubtIf(bool) Error - wrap(error) Error -} - -// AerospikeError implements Error interface for aerospike specific errors. -// All errors returning from the library are of this type. -// Errors resulting from Go's stdlib are not translated to this type, unless -// they are a net.Timeout error. Refer to errors_test.go for examples. -// To be able to check for error type, you could use the idiomatic -// errors.Is and errors.As patterns: -// -// if errors.Is(err, as.ErrTimeout) { -// ... -// } -// -// or -// -// if errors.Is(err, &as.AerospikeError{ResultCode: ast.PARAMETER_ERROR}) { -// ... -// } -// -// or -// -// if err.Matches(ast.TIMEOUT, ast.NETWORK_ERROR, ast.PARAMETER_ERROR) { -// ... -// } -// -// or -// -// ae := &as.AerospikeError{} -// if errors.As(err, &ae) { -// println(ae.ResultCode) -// } -type AerospikeError struct { - wrapped error - - // error message - msg string - - // Node where the error occurred - Node *Node - - // ResultCode determines the type of error - ResultCode types.ResultCode - - // InDoubt determines if the command was sent to the server, but - // there is doubt if the server received and executed the command - // and changed the data. Only applies to commands that change data - InDoubt bool - - // Iteration determies on which retry the error occurred - Iteration int - - // Includes stack frames for the error - stackFrames []stackFrame -} - -var _ error = &AerospikeError{} -var _ Error = &AerospikeError{} - -// newError generates a new AerospikeError instance. -// If no message is provided, the result code will be translated into the default -// error message automatically. -func newError(code types.ResultCode, messages ...string) Error { - if len(messages) == 0 { - messages = []string{types.ResultCodeToString(code)} - } - - return &AerospikeError{msg: strings.Join(messages, " "), ResultCode: code, stackFrames: stackTrace(nil)} -} - -func newErrorAndWrap(e error, code types.ResultCode, messages ...string) Error { - ne := newError(code, messages...) - ne.wrap(e) - return ne -} - -func newTimeoutError(e error, messages ...string) Error { - ne := newError(types.TIMEOUT, messages...) - ne.wrap(e) - return ne -} - -func newCommonError(e error, messages ...string) Error { - ne := newError(types.COMMON_ERROR, messages...) - ne.wrap(e) - return ne -} - -func newGrpcError(isWrite bool, e error, messages ...string) Error { - if ae, ok := e.(Error); ok && ae.resultCode() == types.GRPC_ERROR { - return ae - } - - // convert error to Aerospike errors - if e == context.DeadlineExceeded { - return ErrNetTimeout.err().markInDoubt(isWrite) - } else if e == grpc.ErrClientConnTimeout { - return ErrNetTimeout.err().markInDoubt(isWrite) - } else if e == grpc.ErrServerStopped { - return ErrServerNotAvailable.err().markInDoubt(isWrite) - } - - // try to convert the error - code := status.Code(e) - if code == codes.Unknown { - if s := status.Convert(e); s != nil { - code = s.Code() - } - } - - switch code { - case codes.OK: - return nil - case codes.Canceled: - return ErrNetTimeout.err().markInDoubt(isWrite) - case codes.InvalidArgument: - return newError(types.PARAMETER_ERROR, messages...) - case codes.DeadlineExceeded: - return ErrNetTimeout.err().markInDoubt(isWrite) - case codes.NotFound: - return newError(types.SERVER_NOT_AVAILABLE, messages...).markInDoubt(isWrite) - case codes.PermissionDenied: - return newError(types.FAIL_FORBIDDEN, messages...) - case codes.ResourceExhausted: - return newError(types.QUOTA_EXCEEDED, messages...) - case codes.FailedPrecondition: - return newError(types.PARAMETER_ERROR, messages...) - case codes.Aborted: - return newError(types.SERVER_ERROR).markInDoubt(isWrite) - case codes.OutOfRange: - return newError(types.PARAMETER_ERROR, messages...) - case codes.Unimplemented: - return newError(types.SERVER_NOT_AVAILABLE, messages...) - case codes.Internal: - return newError(types.SERVER_ERROR, messages...).markInDoubt(isWrite) - case codes.Unavailable: - return newError(types.SERVER_NOT_AVAILABLE, messages...).markInDoubt(isWrite) - case codes.DataLoss: - return ErrNetwork.err().markInDoubt(isWrite) - case codes.Unauthenticated: - return newError(types.NOT_AUTHENTICATED, messages...) - - case codes.AlreadyExists: - case codes.Unknown: - } - - ne := newError(types.GRPC_ERROR, messages...).markInDoubt(isWrite) - ne.wrap(e) - return ne -} - -// SetInDoubt sets whether it is possible that the write transaction may have completed -// even though this error was generated. This may be the case when a -// client error occurs (like timeout) after the command was sent to the server. -func (ase *AerospikeError) setInDoubt(isRead bool, commandSentCounter int) Error { - ase.InDoubt = !isRead && (commandSentCounter > 1 || (commandSentCounter == 1 && (ase.ResultCode == types.TIMEOUT || ase.ResultCode <= 0))) - return ase -} - -func (ase *AerospikeError) setNode(node *Node) Error { - ase.Node = node - return ase -} - -func (ase *AerospikeError) markInDoubt(v bool) Error { - ase.InDoubt = v - return ase -} - -func (ase *AerospikeError) markInDoubtIf(inDoubt bool) Error { - ase.InDoubt = inDoubt - return ase -} - -func (ase *AerospikeError) resultCode() types.ResultCode { - return ase.ResultCode -} - -// Trace returns a stack trace of where the error originates from -func (ase *AerospikeError) Trace() string { - var sb strings.Builder - for i := range ase.stackFrames { - sb.WriteString(ase.stackFrames[i].String()) - sb.WriteString("\n") - } - - if ase.wrapped != nil { - ae := new(AerospikeError) - if errors.As(ase.wrapped, &ae) { - sb.WriteString("Embedded:\n") - sb.WriteString(ae.Trace()) - } - } - - return sb.String() -} - -// Error implements the error interface -func (ase *AerospikeError) Error() string { - const cErr = "ResultCode: %s, Iteration: %d, InDoubt: %t, Node: %s: %s" - const cErrNL = cErr + "\n %s" - if ase.wrapped != nil { - return fmt.Sprintf(cErrNL, ase.ResultCode.String(), ase.Iteration, ase.InDoubt, ase.Node, ase.msg, ase.wrapped.Error()) - } - return fmt.Sprintf(cErr, ase.ResultCode.String(), ase.Iteration, ase.InDoubt, ase.Node, ase.msg) -} - -func (ase *AerospikeError) wrap(err error) Error { - ase.wrapped = err - return ase -} - -func (ase *AerospikeError) iter(i int) Error { - if ase == nil { - return nil - } - // TODO: Make iteration 1-based - ase.Iteration = i - 1 - return ase -} - -// IsInDoubt signifies that the write operation may have gone through on the server -// but the client is not able to confirm that due an error. -func (ase *AerospikeError) IsInDoubt() bool { - return ase.InDoubt -} - -// Matches returns true if the error or any of its wrapped errors contains -// any of the passed results codes. -// For convenience, it will return false if the error is nil. -func (ase *AerospikeError) Matches(rcs ...types.ResultCode) bool { - // don't panic on nil error, and don't go ahead - // if no result codes are provided - if ase == nil || len(rcs) == 0 { - return false - } - - for i := range rcs { - if ase.ResultCode == rcs[i] { - return true - } - } - - ae := &AerospikeError{} - if ase.wrapped != nil && errors.As(ase.wrapped, &ae) { - return ae.Matches(rcs...) - } - - return false -} - -// As implements the interface for errors.As function. -func (ase *AerospikeError) As(target interface{}) bool { - ae, ok := target.(*AerospikeError) - if !ok { - return false - } - - ae.wrapped = ase.wrapped - ae.msg = ase.msg - ae.ResultCode = ase.ResultCode - ae.InDoubt = ase.InDoubt - ae.Node = ase.Node - return true -} - -// Is compares an error with the AerospikeError. -// If the error is not of type *AerospikeError, it will return false. -// Otherwise, it will compare ResultCode and Node (if it exists), and -// will return a result accordingly. -// If passed error's InDoubt is set to true, the InDoubt property will -// also be checked. You should not check if the error's InDoubt is false, since -// it is not checked when the passed error's InDoubt is false. -func (ase *AerospikeError) Is(e error) bool { - if ase == nil || e == nil { - return false - } - - var target *AerospikeError - - switch t := e.(type) { - case *AerospikeError: - target = t - case *constAerospikeError: - target = &t.AerospikeError - default: - return false - } - - res := (ase.ResultCode == target.ResultCode) && - (ase.Node == target.Node || target.Node == nil) - - if target.InDoubt { - res = res && (ase.InDoubt == target.InDoubt) - } - - return res -} - -// Unwrap will return the error wrapped inside the error, or nil. -func (ase *AerospikeError) Unwrap() error { - return ase.wrapped -} - -/* - Node Error -*/ - -func newNodeError(node *Node, err Error) Error { - if err == nil { - return nil - } - - ae := new(AerospikeError) - errors.As(err, &ae) - - res := *ae - res.Node = node - res.wrap(err) - return &res -} - -func newCustomNodeError(node *Node, code types.ResultCode, messages ...string) Error { - ne := newError(code, messages...) - ne.setNode(node) - return ne -} - -func newWrapNetworkError(err error, messages ...string) Error { - ne := newError(types.NETWORK_ERROR, messages...) - ne.wrap(err) - return ne -} - -func newInvalidNodeError(clusterSize int, partition *Partition) Error { - // important to check for clusterSize first, since partition may be nil sometimes - if clusterSize == 0 { - return ErrClusterIsEmpty.err() - } - res := newError(types.INVALID_NODE_ERROR, "Node not found for partition "+partition.String()+" in partition table.") - res.wrap(nil) - return res -} - -/* - constAerospikeError -*/ - -var _ Error = newError(0) - -// constAerospikeError makes sure that constant errors are not chained and invalidated. -// By having a new type, the compiler will enforce the constants. -type constAerospikeError struct { - AerospikeError -} - -func newConstError(code types.ResultCode, messages ...string) *constAerospikeError { - if len(messages) == 0 { - messages = []string{types.ResultCodeToString(code)} - } - - return &constAerospikeError{AerospikeError{msg: strings.Join(messages, " "), ResultCode: code}} -} - -func (ase *constAerospikeError) err() Error { - v := ase.AerospikeError - v.wrap(nil) - return &v -} - -//revive:disable - -var ( - ErrServerNotAvailable = newConstError(types.SERVER_NOT_AVAILABLE) - ErrInvalidPartitionMap = newConstError(types.INVALID_CLUSTER_PARTITION_MAP, "Partition map errors normally occur when the cluster has partitioned due to network anomaly or node crash, or is not configured properly. Refer to https://www.aerospike.com/docs/operations/configure for more information.") - ErrKeyNotFound = newConstError(types.KEY_NOT_FOUND_ERROR) - ErrRecordsetClosed = newConstError(types.RECORDSET_CLOSED) - ErrConnectionPoolEmpty = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "connection pool is empty. This happens when no connections were available") - ErrConnectionPoolExhausted = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Connection pool is exhausted. This happens when all connection are in-use already, and opening more connections is not allowed due to the limits set in policy.ConnectionQueueSize and policy.LimitConnectionsToQueueSize") - ErrTooManyConnectionsForNode = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "connection limit reached for this node. This value is controlled via ClientPolicy.LimitConnectionsToQueueSize") - ErrTooManyOpeningConnections = newConstError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "too many connections are trying to open at once. This value is controlled via ClientPolicy.OpeningConnectionThreshold") - ErrTimeout = newConstError(types.TIMEOUT, "command execution timed out on client: See `Policy.Timeout`") - ErrNetTimeout = newConstError(types.TIMEOUT, "network timeout") - ErrUDFBadResponse = newConstError(types.UDF_BAD_RESPONSE, "invalid UDF return value") - ErrNoOperationsSpecified = newConstError(types.INVALID_COMMAND, "no operations were passed to QueryExecute") - ErrNoBinNamesAllowedInQueryExecute = newConstError(types.INVALID_COMMAND, "`Statement.BinNames` must be empty for QueryExecute") - ErrFilteredOut = newConstError(types.FILTERED_OUT) - ErrPartitionScanQueryNotSupported = newConstError(types.PARAMETER_ERROR, "partition Scans/Queries are not supported by all nodes in this cluster") - ErrScanTerminated = newConstError(types.SCAN_TERMINATED) - ErrQueryTerminated = newConstError(types.QUERY_TERMINATED) - ErrClusterIsEmpty = newConstError(types.INVALID_NODE_ERROR, "cluster is empty") - ErrInvalidUser = newConstError(types.INVALID_USER) - ErrNotAuthenticated = newConstError(types.NOT_AUTHENTICATED) - ErrNetwork = newConstError(types.NETWORK_ERROR) - ErrInvalidObjectType = newConstError(types.SERIALIZE_ERROR, "invalid type for result object. It should be of type struct pointer or addressable") - ErrMaxRetriesExceeded = newConstError(types.MAX_RETRIES_EXCEEDED, "command execution timed out on client: Exceeded number of retries. See `Policy.MaxRetries`.") - ErrInvalidParam = newConstError(types.PARAMETER_ERROR) - ErrLuaPoolEmpty = newConstError(types.COMMON_ERROR, "Error fetching a lua instance from pool") - - errGRPCStreamEnd = newError(types.OK, "GRPC Steam was ended successfully") -) - -//revive:enable - -// chainErrors wraps an error inside a new error. The new (outer) error cannot be nil. -// if the old error is nil, the new error will be returned. -func chainErrors(outer Error, inner error) Error { - if inner == nil && outer == nil { - return nil - } else if inner == nil { - return outer - } else if outer == nil { - if e, ok := inner.(Error); ok { - return e - } - return newCommonError(inner) - } - - var ae *AerospikeError - switch outer.(type) { - case *constAerospikeError: - t := outer.(*constAerospikeError).AerospikeError - ae = &t - case *AerospikeError: - // copy the reference to avoid issues with checking the last error - // when it is chained. - t := *outer.(*AerospikeError) - ae = &t - } - - if inner == nil { - return ae - } - - ae.wrapped = inner - return ae -} - -type stackFrame struct { - fl, fn string - ln int -} - -func (st *stackFrame) String() string { - return st.fl + ":" + strconv.Itoa(st.ln) + " " + st.fn + "()" -} - -func stackTrace(err Error) []stackFrame { - const maxDepth = 10 - sFrames := make([]stackFrame, 0, maxDepth) - for i := 3; i <= maxDepth+3; i++ { - pc, fl, ln, ok := runtime.Caller(i) - if !ok { - break - } - fn := runtime.FuncForPC(pc) - sFrame := stackFrame{ - fl: fl, - fn: fn.Name(), - ln: ln, - } - sFrames = append(sFrames, sFrame) - } - - if len(sFrames) > 0 { - return sFrames - } - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/error_test.go b/aerospike-tls/vendor-aerospike-client-go/error_test.go deleted file mode 100644 index e541c726..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/error_test.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "errors" - - ast "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Aerospike Error Tests", func() { - - gg.Context("Matches()", func() { - - gg.It("should handle simple case", func() { - err := newError(ast.UDF_BAD_RESPONSE) - - res := err.Matches(ast.UDF_BAD_RESPONSE) - gm.Expect(res).To(gm.BeTrue()) - }) - - gg.It("should handle simple case", func() { - inner := newError(ast.UDF_BAD_RESPONSE) - err := newError(ast.TIMEOUT).wrap(inner) - - res := err.Matches(ast.UDF_BAD_RESPONSE) - gm.Expect(res).To(gm.BeTrue()) - - res = err.Matches(ast.TIMEOUT) - gm.Expect(res).To(gm.BeTrue()) - - res = err.Matches(ast.UDF_BAD_RESPONSE, ast.TIMEOUT) - gm.Expect(res).To(gm.BeTrue()) - }) - - }) - - gg.Context("chainErrors()", func() { - - gg.It("should handle nil for inner error", func() { - outer := newError(ast.UDF_BAD_RESPONSE) - err := chainErrors(outer, nil) - - res := err.Matches(ast.UDF_BAD_RESPONSE) - gm.Expect(res).To(gm.BeTrue()) - }) - - gg.It("should handle nil for inner error", func() { - inner := newError(ast.UDF_BAD_RESPONSE) - err := chainErrors(nil, inner) - - res := err.Matches(ast.UDF_BAD_RESPONSE) - gm.Expect(res).To(gm.BeTrue()) - }) - - }) - - gg.Context("errors.Is", func() { - - gg.It("should handle simple case", func() { - err := newError(ast.UDF_BAD_RESPONSE) - - res := errors.Is(err, ErrUDFBadResponse) - gm.Expect(res).To(gm.BeTrue()) - }) - - gg.It("should handle complex case", func() { - err := newError(ast.UDF_BAD_RESPONSE) - - res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE}) - gm.Expect(res).To(gm.BeTrue()) - - }) - - gg.It("should handle complex case with inDoubt", func() { - err := newError(ast.UDF_BAD_RESPONSE) - - res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) - gm.Expect(res).To(gm.BeFalse()) - - }) - - gg.It("should handle wrapped cases", func() { - inner := newError(ast.UDF_BAD_RESPONSE) - err := newError(ast.TIMEOUT).wrap(inner) - - res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) - gm.Expect(res).To(gm.BeFalse()) - }) - - gg.It("should handle chained cases", func() { - inner1 := newError(ast.UDF_BAD_RESPONSE) - inner2 := newError(ast.BATCH_DISABLED) - inner := chainErrors(inner2, inner1) - outer := newError(ast.TIMEOUT) - err := chainErrors(outer, inner) - - res := errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true}) - gm.Expect(res).To(gm.BeFalse()) - }) - - }) // Context - - gg.Context("errors.As", func() { - - gg.It("should handle simple case", func() { - err := newError(ast.UDF_BAD_RESPONSE) - - ae := new(AerospikeError) - res := errors.As(err, &ae) - gm.Expect(res).To(gm.BeTrue()) - gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE})).To(gm.BeTrue()) - }) - - gg.It("should handle chained case", func() { - inner := newError(ast.UDF_BAD_RESPONSE).setInDoubt(false, 2) - outer := newError(ast.TIMEOUT) - err := chainErrors(outer, inner) - - ae := new(AerospikeError) - res := errors.As(err, &ae) - gm.Expect(res).To(gm.BeTrue()) - gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE})).To(gm.BeTrue()) - gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: true})).To(gm.BeTrue()) - gm.Expect(errors.Is(err, &AerospikeError{ResultCode: ast.UDF_BAD_RESPONSE, InDoubt: false})).To(gm.BeTrue()) - }) - - }) - -}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/example_client_test.go b/aerospike-tls/vendor-aerospike-client-go/example_client_test.go deleted file mode 100644 index df884991..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_client_test.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike_test - -import ( - "fmt" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func ExampleClient_Add() { - key, err := as.NewKey(*namespace, "test", "addkey") - if err != nil { - log.Fatal(err) - } - - if _, err = client.Delete(nil, key); err != nil { - log.Fatal(err) - } - - // Add to a non-existing record/bin, should create a record - bin := as.NewBin("bin", 10) - if err = client.AddBins(nil, key, bin); err != nil { - log.Fatal(err) - } - - // Add to 5 to the original 10 - bin = as.NewBin("bin", 5) - if err = client.AddBins(nil, key, bin); err != nil { - log.Fatal(err) - } - - // Check the result - record, err := client.Get(nil, key, bin.Name) - if err != nil { - log.Fatal(err) - } - fmt.Println(record.Bins["bin"]) - - // Demonstrate add and get combined. - bin = as.NewBin("bin", 30) - if record, err = client.Operate(nil, key, as.AddOp(bin), as.GetOp()); err != nil { - log.Fatal(err) - } - - fmt.Println(record.Bins["bin"]) - // Output: - // 15 - // 45 -} - -func ExampleClient_Append() { - key, err := as.NewKey(*namespace, "test", "appendkey") - if err != nil { - log.Fatal(err) - } - - if _, err = client.Delete(nil, key); err != nil { - log.Fatal(err) - } - - // Create by appending to non-existing value - bin1 := as.NewBin("myBin", "Hello") - if err = client.AppendBins(nil, key, bin1); err != nil { - log.Fatal(err) - } - - // Append World - bin2 := as.NewBin("myBin", " World") - if err = client.AppendBins(nil, key, bin2); err != nil { - log.Fatal(err) - } - - record, err := client.Get(nil, key) - if err != nil { - log.Fatal(err) - } - - fmt.Println(record.Bins["myBin"]) - // Output: - // Hello World -} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go deleted file mode 100644 index 13e44515..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_listiter_int_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -/* -myListInt -*/ -var _ as.ListIter = myListInt([]int{}) - -// your custom list -type myListInt []int - -func (ml myListInt) PackList(buf as.BufferEx) (int, error) { - size := 0 - for _, elem := range ml { - n, err := as.PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - - return size, nil -} - -func (ml myListInt) Len() int { - return len(ml) -} - -func ExampleListIter_int() { - // Setup the client here - // client, err := as.NewClient("127.0.0.1", 3000) - // if err != nil { - // log.Fatal(err) - // } - - var v as.Value = as.NewValue(myListInt([]int{1, 2, 3})) - key, err := as.NewKey(*namespace, "test", 1) - if err != nil { - log.Fatal(err) - } - - err = client.Put(nil, key, as.BinMap{"myBin": v}) - if err != nil { - log.Fatal(err) - } - - rec, err := client.Get(nil, key) - if err != nil { - log.Fatal(err) - } - - fmt.Println(rec.Bins["myBin"]) - // Output: - // [1 2 3] -} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go deleted file mode 100644 index 8d7a4232..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_listiter_string_test.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -/* -myListString -*/ -var _ as.ListIter = myListString([]string{}) - -// your custom list -type myListString []string - -func (ml myListString) PackList(buf as.BufferEx) (int, error) { - size := 0 - for _, elem := range ml { - n, err := as.PackString(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -func (ml myListString) Len() int { - return len(ml) -} - -func ExampleListIter_string() { - // Setup the client here - // client, err := as.NewClient("127.0.0.1", 3000) - // if err != nil { - // log.Fatal(err) - // } - - var v as.Value = as.NewValue(myListString([]string{"a", "b", "c"})) - key, err := as.NewKey(*namespace, "test", 1) - if err != nil { - log.Fatal(err) - } - - err = client.Put(nil, key, as.BinMap{"myBin": v}) - if err != nil { - log.Fatal(err) - } - - rec, err := client.Get(nil, key) - if err != nil { - log.Fatal(err) - } - - fmt.Println(rec.Bins["myBin"]) - // Output: - // [a b c] -} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go b/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go deleted file mode 100644 index 9fb41538..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_listiter_time_test.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -/* -myListTime -*/ -var _ as.ListIter = myListTime([]time.Time{}) - -// your custom list -type myListTime []time.Time - -func (ml myListTime) PackList(buf as.BufferEx) (int, error) { - size := 0 - for _, elem := range ml { - n, err := as.PackInt64(buf, elem.UnixNano()) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -func (ml myListTime) Len() int { - return len(ml) -} - -func ExampleListIter_time() { - // Setup the client here - // client, err := as.NewClient("127.0.0.1", 3000) - // if err != nil { - // log.Fatal(err) - // } - - now1 := time.Unix(123123123, 0) - now2 := time.Unix(123123124, 0) - now3 := time.Unix(123123125, 0) - var v as.Value = as.NewValue(myListTime([]time.Time{now1, now2, now3})) - key, err := as.NewKey(*namespace, "test", 1) - if err != nil { - log.Fatal(err) - } - - err = client.Put(nil, key, as.BinMap{"myBin": v}) - if err != nil { - log.Fatal(err) - } - - rec, err := client.Get(nil, key) - if err != nil { - log.Fatal(err) - } - - fmt.Println(rec.Bins["myBin"]) - // Output: - // [123123123000000000 123123124000000000 123123125000000000] -} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go b/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go deleted file mode 100644 index 8da567a5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_mapiter_test.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -/* -myMapStringTime -*/ -var _ as.MapIter = myMapStringTime(map[string]time.Time{}) - -// your custom list -type myMapStringTime map[string]time.Time - -func (mm myMapStringTime) PackMap(buf as.BufferEx) (int, error) { - size := 0 - for key, val := range mm { - n, err := as.PackString(buf, key) - size += n - if err != nil { - return size, err - } - - n, err = as.PackInt64(buf, val.UnixNano()) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -func (mm myMapStringTime) Len() int { - return len(mm) -} - -func ExampleMapIter() { - // Setup the client here - // client, err := as.NewClient("127.0.0.1", 3000) - // if err != nil { - // log.Fatal(err) - // } - - now := time.Unix(123123123, 0) - var v as.Value = as.NewValue(myMapStringTime(map[string]time.Time{"now": now})) - key, err := as.NewKey(*namespace, "test", 1) - if err != nil { - log.Fatal(err) - } - - err = client.Put(nil, key, as.BinMap{"myBin": v}) - if err != nil { - log.Fatal(err) - } - - rec, err := client.Get(nil, key) - if err != nil { - log.Fatal(err) - } - - fmt.Println(rec.Bins["myBin"]) - // Output: - // map[now:123123123000000000] -} diff --git a/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go b/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go deleted file mode 100644 index 6da9dac7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/example_pagination_cursor_test.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func ExamplePartitionFilter_EncodeCursor() { - // Setup the client here - // client, err := as.NewClient("127.0.0.1", 3000) - // if err != nil { - // log.Fatal(err) - // } - - var ns = *namespace - var set = randString(50) - - // initialize the records - keyCount := 1000 - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, i) - if err != nil { - log.Fatal(err) - } - - err = client.Put(nil, key, as.BinMap{"bin": i}) - if err != nil { - log.Fatal(err) - } - } - - // Set up the scan policy - spolicy := as.NewScanPolicy() - spolicy.MaxRecords = 30 - - received := 0 - var buf []byte - for received < keyCount { - pf := as.NewPartitionFilterAll() - - if len(buf) > 0 { - err = pf.DecodeCursor(buf) - if err != nil { - log.Fatal(err) - } - } - - recordset, err := client.ScanPartitions(spolicy, pf, ns, set) - if err != nil { - log.Fatal(err) - } - - counter := 0 - for range recordset.Results() { - counter++ - received++ - } - - if counter > 30 { - log.Fatal("More records received than requested.") - } - - buf, err = pf.EncodeCursor() - if err != nil { - log.Fatal(err) - } - } - - fmt.Println(received) - // Output: - // 1000 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go b/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go deleted file mode 100644 index a3f561f4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/add/add.go +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "addkey") - shared.PanicOnError(err) - - binName := "addbin" - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - // Perform some adds and check results. - bin := as.NewBin(binName, 10) - log.Println("Initial add will create record. Initial value is ", bin.Value, ".") - client.AddBins(shared.WritePolicy, key, bin) - - bin = as.NewBin(binName, 5) - log.Println("Add ", bin.Value, " to existing record.") - client.AddBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - // The value received from the server is an unsigned byte stream. - // Convert to an integer before comparing with expected. - received := record.Bins[bin.Name] - expected := 15 - - if received == expected { - log.Printf("Add successful: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Add mismatch: Expected %d. Received %d.", expected, received) - } - - // Demonstrate add and get combined. - bin = as.NewBin(binName, 30) - log.Println("Add ", bin.Value, " to existing record.") - record, err = client.Operate(shared.WritePolicy, key, as.AddOp(bin), as.GetOp()) - shared.PanicOnError(err) - - expected = 45 - received = record.Bins[bin.Name] - - if received == expected { - log.Printf("Add successful: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Add mismatch: Expected %d. Received %d.", expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go b/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go deleted file mode 100644 index e106bc33..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/append/append.go +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "appendkey") - shared.PanicOnError(err) - - binName := "appendbin" - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - bin := as.NewBin(binName, "Hello") - log.Println("Initial append will create record. Initial value is ", bin.Value, ".") - client.AppendBins(shared.WritePolicy, key, bin) - - bin = as.NewBin(binName, " World") - log.Println("Append \"", bin.Value, "\" to existing record.") - client.AppendBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - received := record.Bins[bin.Name] - expected := "Hello World" - - if received == expected { - log.Printf("Append successful: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Append mismatch: Expected %s. Received %s.", expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go b/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go deleted file mode 100644 index 7d875d3e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/batch/batch.go +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "strconv" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - asl "github.com/aerospike/aerospike-client-go/v7/logger" -) - -func main() { - keyPrefix := "batchkey" - valuePrefix := "batchvalue" - binName := "batchbin" - size := 8 - - writeRecords(shared.Client, keyPrefix, binName, valuePrefix, size) - // batchExists(shared.Client, keyPrefix, size) - // batchReads(shared.Client, keyPrefix, binName, size) - // batchReadHeaders(shared.Client, keyPrefix, size) - - log.Println("Example finished successfully.") -} - -/** - * Write records individually. - */ -func writeRecords( - client *as.Client, - keyPrefix string, - binName string, - valuePrefix string, - size int, -) { - for i := 1; i <= size; i++ { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i)) - bin := as.NewBin(binName, valuePrefix+strconv.Itoa(i)) - - log.Printf("Put: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) - - client.PutBins(shared.WritePolicy, key, bin) - } -} - -/** - * Check existence of records in one batch. - */ -func batchExists( - client *as.Client, - - keyPrefix string, - size int, -) { - // Batch into one call. - keys := make([]*as.Key, size) - for i := 0; i < size; i++ { - keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) - } - - existsArray, err := client.BatchExists(nil, keys) - shared.PanicOnError(err) - - for i := 0; i < len(existsArray); i++ { - key := keys[i] - exists := existsArray[i] - log.Printf("Record: ns=%s set=%s key=%s exists=%t", - key.Namespace(), key.SetName(), key.Value(), exists) - } -} - -/** - * Read records in one batch. - */ -func batchReads( - client *as.Client, - keyPrefix string, - binName string, - size int, -) { - // Batch gets into one call. - keys := make([]*as.Key, size) - for i := 0; i < size; i++ { - keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) - } - - records, err := client.BatchGet(nil, keys, binName) - shared.PanicOnError(err) - - for i := 0; i < len(records); i++ { - key := keys[i] - record := records[i] - level := asl.ERR - var value interface{} - - if record != nil { - level = asl.INFO - value = record.Bins[binName] - } - asl.Logger.LogAtLevel(level, "Record: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), binName, value) - } - - if len(records) != size { - log.Fatalf("Record size mismatch. Expected %d. Received %d.", size, len(records)) - } -} - -/** - * Read record header data in one batch. - */ -func batchReadHeaders( - client *as.Client, - keyPrefix string, - size int, -) { - // Batch gets into one call. - keys := make([]*as.Key, size) - for i := 0; i < size; i++ { - keys[i], _ = as.NewKey(*shared.Namespace, *shared.Set, keyPrefix+strconv.Itoa(i+1)) - } - - records, err := client.BatchGetHeader(nil, keys) - shared.PanicOnError(err) - - for i := 0; i < len(records); i++ { - key := keys[i] - record := records[i] - level := asl.ERR - generation := uint32(0) - expiration := uint32(0) - - if record != nil && (record.Generation > 0 || record.Expiration > 0) { - level = asl.INFO - generation = record.Generation - expiration = record.Expiration - } - asl.Logger.LogAtLevel(level, "Record: ns=%s set=%s key=%s generation=%d expiration=%d", - key.Namespace(), key.SetName(), key.Value(), generation, expiration) - } - - if len(records) != size { - log.Fatalf("Record size mismatch. Expected %d. Received %d.", size, len(records)) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go b/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go deleted file mode 100644 index 6f9de262..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/blob/blob.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - as "github.com/aerospike/aerospike-client-go/v7" -) - -// Person is a custom data type to be converted to a blob -type Person struct { - name string -} - -// EncodeBlob defines The AerospikeBlob interface -func (p Person) EncodeBlob() ([]byte, error) { - return []byte(p.name), nil -} - -// DecodeBlob is optional, and should be used manually -func (p *Person) DecodeBlob(buf []byte) error { - p.name = string(buf) - return nil -} - -func main() { - // define a client to connect to - client, err := as.NewClient("127.0.0.1", 3000) - panicOnError(err) - - namespace := "test" - setName := "people" - key, err := as.NewKey(namespace, setName, "key") // user key can be of any supported type - panicOnError(err) - - // define some bins - bins := as.BinMap{ - "bin1": Person{name: "Albert Einstein"}, - "bin2": &Person{name: "Richard Feynman"}, - } - - // write the bins - writePolicy := as.NewWritePolicy(0, 0) - err = client.Put(writePolicy, key, bins) - panicOnError(err) - - // read it back! - readPolicy := as.NewPolicy() - rec, err := client.Get(readPolicy, key) - panicOnError(err) - - result := &Person{} - - // decode first object - result.DecodeBlob(rec.Bins["bin1"].([]byte)) - - // decode second object - result.DecodeBlob(rec.Bins["bin2"].([]byte)) -} - -func panicOnError(err error) { - if err != nil { - panic(err) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go b/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go deleted file mode 100644 index f5cb04a8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/count_set_objects/count_set_objects_using_request_info.go +++ /dev/null @@ -1,104 +0,0 @@ -package main - -import ( - "fmt" - "log" - "strconv" - "strings" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - replFactor, err := replicationFactor(client, *shared.Namespace) - shared.PanicOnError(err) - log.Println("Replication Factor:", replFactor) - - totalObjects, err := countSetObjects(client, *shared.Namespace, *shared.Set) - shared.PanicOnError(err) - log.Println("Total Objects:", totalObjects) - - totalUniqueObjects := totalObjects / replFactor - log.Println("Total Unique Object Count:", totalUniqueObjects) -} - -func countSetObjects(client *as.Client, ns, set string) (int, error) { - const statKey = "objects" - - // get the list of cluster nodes - nodes := client.GetNodes() - - infop := as.NewInfoPolicy() - - objCount := 0 - - // iterate over nodes -N: - for _, n := range nodes { - cmd := fmt.Sprintf("sets/%s/%s", ns, set) - info, err := n.RequestInfo(infop, cmd) - if err != nil { - return -1, err - } - vals := strings.Split(info[cmd], ":") - for _, val := range vals { - if i := strings.Index(val, statKey); i > -1 { - cnt, err := strconv.Atoi(val[i+len(statKey)+1:]) - if err != nil { - return -1, err - } - objCount += cnt - continue N - } - } - } - - return objCount, nil -} - -func replicationFactor(client *as.Client, ns string) (int, error) { - const statKey = "effective_replication_factor" - - // get the list of cluster nodes - nodes := client.GetNodes() - - infop := as.NewInfoPolicy() - - replFactor := -1 - - // iterate over nodes -N: - for _, n := range nodes { - cmd := fmt.Sprintf("namespace/%s", ns) - info, err := n.RequestInfo(infop, cmd) - if err != nil { - return -1, err - } - vals := strings.Split(info[cmd], ";") - // fmt.Println(vals) - for _, val := range vals { - if i := strings.Index(val, statKey); i > -1 { - rf, err := strconv.Atoi(val[i+len(statKey)+1:]) - if err != nil { - return -1, err - } - - if replFactor == -1 { - replFactor = rf - } else if replFactor != rf { - return -1, fmt.Errorf("Inconsistent replication factor for namespace %s in cluster", ns) - } - - continue N - } - } - } - - return replFactor, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go b/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go deleted file mode 100644 index 041d7050..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/custom_list_iter/custom_list_iter.go +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "reflect" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -var ( - ll = [][]int64{{40937, 1388370, 1543094673, 26, 1545655173}, {40937, 523757, 1543094673, 26, 1545655173}, {40937, 639127, 1543094673, 26, 1545655173}, {16626, 516619, 1545372572, 2, 1545547652}, {16626, 516616, 1545372572, 2, 1545547652}, {8787, 489902, 1543897224, 23, 1545655164}, {8787, 489899, 1543897224, 23, 1545655164}, {8787, 408082, 1543897224, 23, 1545655164}, {8787, 407868, 1543897224, 23, 1545655164}, {20487, 963712, 1545372572, 1, 1545655172}, {20487, 856483, 1545372572, 1, 1545655172}, {20487, 690802, 1545372572, 1, 1545655172}, {40937, 773994, 1545372572, 1, 1545655172}, {40937, 773992, 1545372572, 1, 1545655172}, {40937, 773965, 1545372572, 1, 1545655172}, {40937, 773399, 1545372572, 1, 1545655172}, {40937, 773369, 1545372572, 1, 1545655172}, {40937, 671901, 1545372572, 1, 1545655172}, {40937, 368122, 1545372572, 1, 1545655172}, {40937, 368110, 1545372572, 1, 1545655172}, {40937, 368055, 1545372572, 1, 1545655172}, {40937, 368052, 1545372572, 1, 1545655172}, {40937, 368047, 1545372572, 1, 1545655172}, {40937, 368046, 1545372572, 1, 1545655172}, {40937, 367852, 1545372572, 1, 1545655172}, {40937, 367845, 1545372572, 1, 1545655172}, {40937, 367819, 1545372572, 1, 1545655172}, {40937, 367799, 1545372572, 1, 1545655172}, {40937, 366992, 1545372572, 1, 1545655172}, {40937, 358050, 1545372572, 1, 1545655172}, {40937, 356916, 1545372572, 1, 1545655172}, {40937, 356914, 1545372572, 1, 1545655172}, {40937, 356884, 1545372572, 1, 1545655172}, {40937, 24148, 1545372572, 1, 1545655172}, {40937, 14970, 1545372572, 1, 1545655172}, {27768, 1081131, 1544417593, 1, 1544417593}, {27768, 1081125, 1544417593, 1, 1544417593}, {27768, 1081117, 1544417593, 1, 1544417593}, {27768, 1081111, 1544417593, 1, 1544417593}, {27768, 614520, 1544417593, 1, 1544417593}, {27768, 550328, 1544417593, 1, 1544417593}, {16016, 516619, 1544270206, 1, 1544270206}, {16016, 516616, 1544270206, 1, 1544270206}, {11510, 516619, 1544270101, 1, 1544270101}, {11510, 516616, 1544270101, 1, 1544270101}, {11510, 287241, 1544270101, 1, 1544270101}, {11510, 179159, 1544270101, 1, 1544270101}, {11510, 158627, 1544270101, 1, 1544270101}, {11510, 158623, 1544270101, 1, 1544270101}, {11510, 142416, 1544270101, 1, 1544270101}, {9980, 1142192, 1544270101, 1, 1544270101}, {11510, 191410, 1544270101, 1, 1544270101}, {11510, 152422, 1544270101, 1, 1544270101}, {11510, 32104, 1544270101, 1, 1544270101}, {11510, 1116, 1544270101, 1, 1544270101}, {8787, 38845, 1544270101, 2, 1545655201}, {9980, 1082750, 1544270101, 2, 1545655201}, {19506, 516619, 1544270101, 2, 1545655201}, {19506, 516616, 1544270101, 2, 1545655201}, {19506, 287241, 1544270101, 2, 1545655201}, {19506, 179159, 1544270101, 2, 1545655201}, {19506, 158627, 1544270101, 2, 1545655201}, {19506, 158623, 1544270101, 2, 1545655201}, {19506, 142416, 1544270101, 2, 1545655201}, {9980, 1142179, 1544270101, 2, 1545655201}, {19506, 422943, 1544270101, 2, 1545655201}, {19506, 345569, 1544270101, 2, 1545655201}, {19506, 63617, 1544270101, 2, 1545655201}, {19506, 1116, 1544270101, 2, 1545655201}, {20932, 516619, 1543990832, 1, 1543990832}, {20932, 516616, 1543990832, 1, 1543990832}, {20932, 458514, 1543990832, 1, 1543990832}, {20932, 369986, 1543990832, 1, 1543990832}, {20932, 203333, 1543990832, 1, 1543990832}, {20932, 1116, 1543990832, 1, 1543990832}, {12057, 516619, 1543917498, 1, 1543917498}, {12057, 516616, 1543917498, 1, 1543917498}, {12057, 422964, 1543917498, 1, 1543917498}, {12057, 191957, 1543917498, 1, 1543917498}, {12057, 161051, 1543917498, 1, 1543917498}, {12057, 1116, 1543917498, 1, 1543917498}, {38311, 516619, 1543664706, 1, 1543664706}, {38311, 516616, 1543664706, 1, 1543664706}, {38311, 670098, 1543664706, 1, 1543664706}, {38311, 638284, 1543664706, 1, 1543664706}, {38311, 1116, 1543664706, 1, 1543664706}, {23179, 516619, 1543563095, 1, 1543563095}, {23179, 516616, 1543563095, 1, 1543563095}, {23179, 413003, 1543563095, 1, 1543563095}, {23179, 412965, 1543563095, 1, 1543563095}, {23179, 1116, 1543563095, 1, 1543563095}, {40937, 494200, 1543094673, 1, 1545655173}, {40937, 494199, 1543094673, 1, 1545655173}, {40937, 494194, 1543094673, 1, 1545655173}, {40937, 494152, 1543094673, 1, 1545655173}, {40937, 494147, 1543094673, 1, 1545655173}, {40937, 494135, 1543094673, 1, 1545655173}, {11673, 516619, 1541558619, 1, 1541558619}, {11673, 516616, 1541558619, 1, 1541558619}, {11673, 191573, 1541558619, 1, 1541558619}, {11673, 141981, 1541558619, 1, 1541558619}, {11673, 1116, 1541558619, 1, 1541558619}, {8787, 800649, 1540008292, 8, 1541558572}, {8787, 800648, 1540008292, 8, 1541558572}, {28570, 839888, 1541517901, 1, 1541517901}, {28570, 839887, 1541517901, 1, 1541517901}, {28570, 839877, 1541517901, 1, 1541517901}, {28570, 502177, 1541517901, 1, 1541517901}, {28570, 437522, 1541517901, 1, 1541517901}, {28570, 196361, 1541517901, 1, 1541517901}, {28570, 155579, 1541517901, 1, 1541517901}, {28570, 129720, 1541517901, 1, 1541517901}, {28570, 129716, 1541517901, 1, 1541517901}, {28570, 74510, 1541517901, 1, 1541517901}, {28570, 44089, 1541517901, 1, 1541517901}, {28570, 44078, 1541517901, 1, 1541517901}, {28570, 36454, 1541517901, 1, 1541517901}, {28570, 34133, 1541517901, 1, 1541517901}, {28570, 34127, 1541517901, 1, 1541517901}, {28570, 31089, 1541517901, 1, 1541517901}, {28570, 31038, 1541517901, 1, 1541517901}, {28570, 30789, 1541517901, 1, 1541517901}, {28570, 120446, 1541517901, 1, 1541517901}, {28570, 30740, 1541517901, 1, 1541517901}, {28570, 973402, 1540008922, 2, 1541517862}, {28570, 973401, 1540008922, 2, 1541517862}, {28570, 838084, 1540008922, 2, 1541517862}, {28570, 838080, 1540008922, 2, 1541517862}, {28570, 196353, 1540008922, 2, 1541517862}, {28570, 195519, 1540008922, 2, 1541517862}, {28570, 43878, 1540008922, 2, 1541517862}, {28570, 43876, 1540008922, 2, 1541517862}, {28570, 516619, 1540008922, 2, 1541517862}, {28570, 516616, 1540008922, 2, 1541517862}, {28570, 973303, 1540008922, 2, 1541517862}, {28570, 839958, 1540008922, 2, 1541517862}, {28570, 839864, 1540008922, 2, 1541517862}, {28570, 671901, 1540008922, 2, 1541517862}, {28570, 129719, 1540008922, 2, 1541517862}, {28570, 34115, 1540008922, 2, 1541517862}, {28570, 31026, 1540008922, 2, 1541517862}, {28570, 24148, 1540008922, 2, 1541517862}, {28570, 6463, 1540008922, 2, 1541517862}, {28570, 5915, 1540008922, 2, 1541517862}, {28569, 497873, 1540008922, 2, 1541517862}, {28569, 26031, 1540008922, 2, 1541517862}, {28569, 1116, 1540008922, 2, 1541517862}, {10071, 516619, 1540008295, 2, 1541516935}, {10071, 516616, 1540008295, 2, 1541516935}, {10071, 1122656, 1540008295, 2, 1541516935}, {10071, 188230, 1540008295, 2, 1541516935}, {10071, 26031, 1540008295, 2, 1541516935}, {10071, 1116, 1540008295, 2, 1541516935}, {67930, 516619, 1539958836, 3, 1540180956}, {67930, 516616, 1539958836, 3, 1540180956}, {67930, 1384048, 1539958836, 3, 1540180956}, {67930, 1384044, 1539958836, 3, 1540180956}, {67930, 1116, 1539958836, 3, 1540180956}, {28570, 839869, 1540008922, 1, 1540008922}, {28570, 839866, 1540008922, 1, 1540008922}, {28570, 839865, 1540008922, 1, 1540008922}, {28570, 685624, 1540008922, 1, 1540008922}, {28570, 678302, 1540008922, 1, 1540008922}, {28570, 678266, 1540008922, 1, 1540008922}, {28570, 678263, 1540008922, 1, 1540008922}, {28570, 678186, 1540008922, 1, 1540008922}, {28570, 502150, 1540008922, 1, 1540008922}, {28570, 502132, 1540008922, 1, 1540008922}, {28570, 437443, 1540008922, 1, 1540008922}, {28570, 437413, 1540008922, 1, 1540008922}, {28570, 417952, 1540008922, 1, 1540008922}, {28570, 417939, 1540008922, 1, 1540008922}, {28570, 219690, 1540008922, 1, 1540008922}, {28570, 196479, 1540008922, 1, 1540008922}, {28570, 149483, 1540008922, 1, 1540008922}, {28570, 120450, 1540008922, 1, 1540008922}, {28570, 120449, 1540008922, 1, 1540008922}, {28570, 120448, 1540008922, 1, 1540008922}, {28570, 101942, 1540008922, 1, 1540008922}, {28570, 54949, 1540008922, 1, 1540008922}, {28570, 54938, 1540008922, 1, 1540008922}, {28570, 54926, 1540008922, 1, 1540008922}, {28570, 54921, 1540008922, 1, 1540008922}, {28570, 43912, 1540008922, 1, 1540008922}, {28570, 43886, 1540008922, 1, 1540008922}, {28570, 43880, 1540008922, 1, 1540008922}, {28570, 34124, 1540008922, 1, 1540008922}, {28570, 34123, 1540008922, 1, 1540008922}, {28570, 34121, 1540008922, 1, 1540008922}, {28570, 32042, 1540008922, 1, 1540008922}, {28570, 31007, 1540008922, 1, 1540008922}, {28570, 30984, 1540008922, 1, 1540008922}, {28570, 30983, 1540008922, 1, 1540008922}, {28570, 30957, 1540008922, 1, 1540008922}, {28570, 30730, 1540008922, 1, 1540008922}, {28570, 25315, 1540008922, 1, 1540008922}, {28570, 25231, 1540008922, 1, 1540008922}, {28570, 1315277, 1540008922, 1, 1540008922}, {28570, 1315276, 1540008922, 1, 1540008922}, {28570, 1315275, 1540008922, 1, 1540008922}, {28570, 1315273, 1540008922, 1, 1540008922}, {28570, 1315272, 1540008922, 1, 1540008922}, {28570, 1084896, 1540008922, 1, 1540008922}, {28570, 1084894, 1540008922, 1, 1540008922}, {28570, 1084766, 1540008922, 1, 1540008922}, {28570, 1084765, 1540008922, 1, 1540008922}, {28570, 973557, 1540008922, 1, 1540008922}, {28570, 973497, 1540008922, 1, 1540008922}, {28570, 956784, 1540008922, 1, 1540008922}, {28570, 956775, 1540008922, 1, 1540008922}, {28570, 956774, 1540008922, 1, 1540008922}, {28570, 946292, 1540008922, 1, 1540008922}, {28570, 946286, 1540008922, 1, 1540008922}, {28570, 946267, 1540008922, 1, 1540008922}, {28570, 842371, 1540008922, 1, 1540008922}, {28570, 765557, 1540008922, 1, 1540008922}, {28570, 697212, 1540008922, 1, 1540008922}, {28570, 679835, 1540008922, 1, 1540008922}, {28570, 678299, 1540008922, 1, 1540008922}, {28570, 671925, 1540008922, 1, 1540008922}, {28570, 671924, 1540008922, 1, 1540008922}, {28570, 501723, 1540008922, 1, 1540008922}, {28570, 296271, 1540008922, 1, 1540008922}, {28570, 149481, 1540008922, 1, 1540008922}, {28570, 129721, 1540008922, 1, 1540008922}, {28570, 120439, 1540008922, 1, 1540008922}, {28570, 36903, 1540008922, 1, 1540008922}, {28570, 34128, 1540008922, 1, 1540008922}, {28570, 25320, 1540008922, 1, 1540008922}, {28570, 25253, 1540008922, 1, 1540008922}, {28570, 25222, 1540008922, 1, 1540008922}, {28570, 2090, 1540008922, 1, 1540008922}, {23594, 516619, 1540008299, 1, 1540008299}, {23594, 516616, 1540008299, 1, 1540008299}, {23594, 417719, 1540008299, 1, 1540008299}, {23594, 401813, 1540008299, 1, 1540008299}, {23594, 1116, 1540008299, 1, 1540008299}, {26358, 516619, 1540008299, 1, 1540008299}, {26358, 516616, 1540008299, 1, 1540008299}, {26358, 287241, 1540008299, 1, 1540008299}, {26358, 179159, 1540008299, 1, 1540008299}, {26358, 158627, 1540008299, 1, 1540008299}, {26358, 158623, 1540008299, 1, 1540008299}, {26358, 142416, 1540008299, 1, 1540008299}, {26358, 828103, 1540008299, 1, 1540008299}, {26358, 819629, 1540008299, 1, 1540008299}, {26358, 1113411, 1540008299, 1, 1540008299}, {26358, 453015, 1540008299, 1, 1540008299}, {26358, 453011, 1540008299, 1, 1540008299}, {26358, 1116, 1540008299, 1, 1540008299}, {9516, 516619, 1540008299, 1, 1540008299}, {9516, 516616, 1540008299, 1, 1540008299}, {9516, 422962, 1540008299, 1, 1540008299}, {9516, 187674, 1540008299, 1, 1540008299}, {9516, 3007, 1540008299, 1, 1540008299}, {9516, 1116, 1540008299, 1, 1540008299}, {16646, 516619, 1540008299, 1, 1540008299}, {16646, 516616, 1540008299, 1, 1540008299}, {16646, 279385, 1540008299, 1, 1540008299}, {16646, 244293, 1540008299, 1, 1540008299}, {16646, 1116, 1540008299, 1, 1540008299}, {43982, 516619, 1540008298, 1, 1540008298}, {43982, 516616, 1540008298, 1, 1540008298}, {43982, 833456, 1540008298, 1, 1540008298}, {43982, 832740, 1540008298, 1, 1540008298}, {43982, 1116, 1540008298, 1, 1540008298}, {7732, 516619, 1540008294, 1, 1540008294}, {7732, 516616, 1540008294, 1, 1540008294}, {8787, 1315277, 1540008294, 1, 1540008294}, {8787, 1315276, 1540008294, 1, 1540008294}, {8787, 1315275, 1540008294, 1, 1540008294}, {8787, 1315273, 1540008294, 1, 1540008294}, {8787, 1315272, 1540008294, 1, 1540008294}, {8787, 1084896, 1540008294, 1, 1540008294}, {8787, 1084894, 1540008294, 1, 1540008294}, {8787, 1084766, 1540008294, 1, 1540008294}, {8787, 1084765, 1540008294, 1, 1540008294}, {8787, 973557, 1540008294, 1, 1540008294}, {8787, 973497, 1540008294, 1, 1540008294}, {8787, 973303, 1540008294, 1, 1540008294}, {8787, 765557, 1540008294, 1, 1540008294}, {8787, 697212, 1540008294, 1, 1540008294}, {8787, 685730, 1540008294, 1, 1540008294}, {8787, 685727, 1540008294, 1, 1540008294}, {8787, 685723, 1540008294, 1, 1540008294}, {8787, 685624, 1540008294, 1, 1540008294}, {8787, 671901, 1540008294, 1, 1540008294}, {8787, 287241, 1540008294, 1, 1540008294}, {8787, 179159, 1540008294, 1, 1540008294}, {8787, 158627, 1540008294, 1, 1540008294}, {8787, 158623, 1540008294, 1, 1540008294}, {8787, 142416, 1540008294, 1, 1540008294}, {8787, 36903, 1540008294, 1, 1540008294}, {8787, 2090, 1540008294, 1, 1540008294}, {9980, 1082754, 1540008294, 1, 1540008294}, {7732, 185880, 1540008294, 1, 1540008294}, {7732, 1119, 1540008294, 1, 1540008294}, {7732, 1116, 1540008294, 1, 1540008294}, {20487, 516619, 1540008292, 1, 1540008292}, {20487, 516616, 1540008292, 1, 1540008292}, {20487, 364206, 1540008292, 1, 1540008292}, {20487, 358960, 1540008292, 1, 1540008292}, {20487, 1116, 1540008292, 1, 1540008292}, {41111, 516619, 1540008292, 3, 1540008292}, {41111, 516616, 1540008292, 3, 1540008292}, {41111, 742014, 1540008292, 3, 1540008292}, {41111, 740077, 1540008292, 3, 1540008292}, {41111, 1116, 1540008292, 3, 1540008292}, {29860, 516619, 1538708906, 1, 1538708906}, {29860, 516616, 1538708906, 1, 1538708906}, {29860, 514572, 1538708906, 1, 1538708906}, {29860, 496357, 1538708906, 1, 1538708906}, {29860, 1116, 1538708906, 1, 1538708906}} - cll = SliceListInt64(ll) -) - -// SliceInt64 is a custom data type -type SliceInt64 []int64 - -// Len implements the ListIter interface -func (sli SliceInt64) Len() int { - return len(sli) -} - -// PackList implements the ListIter interface -func (sli SliceInt64) PackList(buf as.BufferEx) (int, error) { - size := 0 - for _, elem := range sli { - n, err := as.PackInt64(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// SliceListInt64 is a custom data type -type SliceListInt64 [][]int64 - -// Len returns the length of the array -func (sli SliceListInt64) Len() int { - return len(sli) -} - -// PackList implements the ListIter interface -func (sli SliceListInt64) PackList(buf as.BufferEx) (int, error) { - size := 0 - for _, l := range sli { - n, err := as.PackList(buf, SliceInt64(l)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "addkey") - shared.PanicOnError(err) - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - bin := as.NewBin("bin", ll) - b := time.Now() - for i := 0; i < 10000; i++ { - if err := client.PutBins(shared.WritePolicy, key, bin); err != nil { - log.Panicf("Get failed %s: %s", key, err) - } - } - t := time.Since(b) - log.Println("Performance WITHOUT custom iterator:", t) - - bin = as.NewBin("bin", cll) - b = time.Now() - for i := 0; i < 10000; i++ { - if err := client.PutBins(shared.WritePolicy, key, bin); err != nil { - log.Panicf("Get failed %s: %s", key, err) - } - } - t = time.Since(b) - log.Println("Performance WITH custom iterator:", t) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - // The value received from the server is an unsigned byte stream. - // Convert to an integer before comparing with expected. - received := [][]int64{} // returns as [][]interface{}, need to be converted - for _, l1 := range record.Bins[bin.Name].([]interface{}) { - l := []int64{} - for _, l2 := range l1.([]interface{}) { - l = append(l, int64(l2.(int))) - } - received = append(received, l) - } - expected := ll - - if reflect.DeepEqual(received, expected) { - log.Printf("Packing successful: ns=%s set=%s key=%s bin=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name) - } else { - log.Fatalf("Packing mismatch: Expected %#v.\n Received %#v.", expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go b/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go deleted file mode 100644 index 59e70437..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/expire/expire.go +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "math" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -func main() { - expireExample(shared.Client) - noExpireExample(shared.Client) - - log.Println("Example finished successfully.") -} - -/** - * Write and twice read an expiration record. - */ -func expireExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "expirekey") - bin := as.NewBin("expirebin", "expirevalue") - - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expiration=2", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) - - // Specify that record expires 2 seconds after it's written. - writePolicy := as.NewWritePolicy(0, 2) - client.PutBins(writePolicy, key, bin) - - // Read the record before it expires, showing it is there. - log.Printf("Get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - if record == nil { - log.Fatalf( - "Failed to get record: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - received := record.Bins[bin.Name] - expected := bin.Value.String() - if received == expected { - log.Printf("Get record successful: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Expire record mismatch: Expected %s. Received %s.", - expected, received) - } - - // Read the record after it expires, showing it's gone. - log.Printf("Sleeping for 3 seconds ...") - time.Sleep(3 * time.Second) - record, err = client.Get(shared.Policy, key, bin.Name) - if ae, ok := err.(*as.AerospikeError); !ok || ae.ResultCode != ast.KEY_NOT_FOUND_ERROR { - shared.PanicOnError(err) - } - if record == nil { - log.Printf("Expiry of record successful. Record not found.") - } else { - log.Fatalf("Found record when it should have expired.") - } -} - -/** - * Write and twice read a non-expiring tuple using the new "NoExpire" value (-1). - * This example is most effective when the Default Namespace Time To Live (TTL) - * is set to a small value, such as 5 seconds. When we sleep beyond that - * time, we show that the NoExpire TTL flag actually works. - */ -func noExpireExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "expirekey") - bin := as.NewBin("expirebin", "noexpirevalue") - - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expiration=NoExpire", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) - - // Specify that record NEVER expires. - // The "Never Expire" value is -1, or 0xFFFFFFFF. - writePolicy := as.NewWritePolicy(0, 2) - writePolicy.Expiration = math.MaxUint32 - client.PutBins(writePolicy, key, bin) - - // Read the record, showing it is there. - log.Printf("Get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - if record == nil { - log.Fatalf( - "Failed to get record: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - received := record.Bins[bin.Name] - expected := bin.Value.String() - if received == expected { - log.Printf("Get record successful: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Expire record mismatch: Expected %s. Received %s.", - expected, received) - } - - // Read this Record after the Default Expiration, showing it is still there. - // We should have set the Namespace TTL at 5 sec. - log.Printf("Sleeping for 10 seconds ...") - time.Sleep(10 * time.Second) - record, err = client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf("Record expired and should NOT have.") - } - log.Printf("Found Record (correctly) after default TTL.") - -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go b/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go deleted file mode 100644 index 4b8a8dee..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/expressions/expressions.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "strings" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - testKeyRegex(shared.Client) - - log.Println("Example finished successfully.") -} - -/** - * Use an expression to regex compare on a key - */ -func testKeyRegex(client *as.Client) { - wp := as.NewWritePolicy(0, 0) - wp.SendKey = true - - if err := client.Truncate(nil, *shared.Namespace, *shared.Set, nil); err != nil { - log.Fatalln(err.Error()) - } - - putBins(wp, "jacksapplekey1", as.BinMap{"Jack": 26}) - putBins(wp, "jillgrapekey2", as.BinMap{"Jill": 20}) - putBins(wp, "mangokey3", as.BinMap{"James": 38}) - putBins(wp, "Jimkey4apple", as.BinMap{"Jim": 46}) - putBins(wp, "JuliaGrapekey5", as.BinMap{"Julia": 62}) - putBins(wp, "SallyMANGOkey6", as.BinMap{"Sally": 32}) - putBins(wp, "SeanaPPlekey7", as.BinMap{"Sean": 24}) - putBins(wp, "SamGRAPEkey8", as.BinMap{"Sam": 12}) - putBins(wp, "Susankey9", as.BinMap{"Susan": 42}) - putBins(wp, "SandraPeachkey0", as.BinMap{"Sandra": 34}) - - stmt := as.NewStatement(*shared.Namespace, *shared.Set) - exp := as.ExpRegexCompare("^.*apple.*", as.ExpRegexFlagICASE, as.ExpKey(as.ExpTypeSTRING)) - - qp := as.NewQueryPolicy() - qp.FilterExpression = exp - rs, err := client.Query(qp, stmt) - if err != nil { - log.Fatalln(err.Error()) - } - - for res := range rs.Results() { - if res.Err != nil { - log.Fatalln(err.Error()) - } - log.Println(res.Record) - if !strings.Contains(strings.ToLower(res.Record.Key.Value().GetObject().(string)), "apple") { - log.Fatalf("Wrong key returned: %s. Expected to include 'apple' (case-insensitive)", res.Record.Key.Value()) - } - } -} - -func putBins(wp *as.WritePolicy, akey string, bins as.BinMap) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, akey) - if err != nil { - log.Fatalln(err.Error()) - } - if err = shared.Client.Put(wp, key, bins); err != nil { - log.Fatalln(err.Error()) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go b/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go deleted file mode 100644 index fa4f9a14..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/generation/generation.go +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "errors" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -func main() { - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "genkey") - binName := "genbin" - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - // Set some values for the same record. - bin := as.NewBin(binName, "genvalue1") - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) - - client.PutBins(shared.WritePolicy, key, bin) - - bin = as.NewBin(binName, "genvalue2") - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value) - - client.PutBins(shared.WritePolicy, key, bin) - - // Retrieve record and its generation count. - record, err := client.Get(shared.Policy, key, bin.Name) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - received := record.Bins[bin.Name] - expected := bin.Value.String() - - if received == expected { - log.Printf("Get successful: namespace=%s set=%s key=%s bin=%s value=%s generation=%d", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received, record.Generation) - } else { - log.Fatalf("Get mismatch: Expected %s. Received %s.", - expected, received) - } - - // Set record and fail if it's not the expected generation. - bin = as.NewBin(binName, "genvalue3") - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expected generation=%d", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, record.Generation) - - writePolicy := as.NewWritePolicy(0, 2) - writePolicy.GenerationPolicy = as.EXPECT_GEN_EQUAL - writePolicy.Generation = record.Generation - client.PutBins(writePolicy, key, bin) - - // Set record with invalid generation and check results . - bin = as.NewBin(binName, "genvalue4") - writePolicy.Generation = 9999 - log.Printf("Put: namespace=%s set=%s key=%s bin=%s value=%s expected generation=%d", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, writePolicy.Generation) - - err = client.PutBins(writePolicy, key, bin) - if err != nil { - if ae, ok := err.(*as.AerospikeError); ok && ae.ResultCode != ast.GENERATION_ERROR { - shared.PanicOnError(errors.New("Should have received generation error instead of success")) - } - log.Printf("Success: Generation error returned as expected.") - } else { - log.Fatalf( - "Unexpected set return code: namespace=%s set=%s key=%s bin=%s value=%s code=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, bin.Value, err) - } - - // Verify results. - record, err = client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - received = record.Bins[bin.Name] - expected = "genvalue3" - - if received == expected { - log.Printf("Get successful: namespace=%s set=%s key=%s bin=%s value=%s generation=%d", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received, record.Generation) - } else { - log.Fatalf("Get mismatch: Expected %s. Received %s.", - expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go b/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go deleted file mode 100644 index 1afece68..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/geojson_query/geojson_query.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package main - -import ( - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - prepareExample(shared.Client) - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func prepareExample(client *as.Client) { - // The Data - bins := []as.BinMap{ - { - "name": "Bike Shop", - "demand": 17923, - "capacity": 17, - "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.009318762,80.003157854]}`), - }, - { - "name": "Residential Block", - "demand": 2429, - "capacity": 2974, - "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.00961276, 80.003422154]}`), - }, - { - "name": "Restaurant", - "demand": 49589, - "capacity": 4231, - "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.009318762,80.003157854]}`), - }, - { - "name": "Cafe", - "demand": 247859, - "capacity": 26, - "coord": as.GeoJSONValue(`{"type" : "Point", "coordinates": [13.00961276, 80.003422154]}`), - }, - } - - // write the records to the database - for i, b := range bins { - // define some bins - key, _ := as.NewKey(*shared.Namespace, *shared.Set, i) - err := client.Put(nil, key, b) - shared.PanicOnError(err) - } - - log.Println("Sample records were written to the disk...") - - // queries only work on indices; you should create the index only once - // The index is created on the namespace, set and bin that should be indexed. - client.CreateIndex(nil, *shared.Namespace, *shared.Set, "testset_geo_index", "coord", as.GEO2DSPHERE) -} - -func runExample(client *as.Client) { - stm := as.NewStatement(*shared.Namespace, *shared.Set) - // there are multiple different types of filters. You can find the list in the docs. - stm.SetFilter(as.NewGeoWithinRadiusFilter("coord", float64(13.009318762), float64(80.003157854), float64(50000))) - recordset, err := client.Query(nil, stm) - shared.PanicOnError(err) - - count := 0 - for res := range recordset.Results() { - shared.PanicOnError(res.Err) - log.Println(res.Record.Bins) - count++ - } - - // 4 region should be found - log.Println("Records found:", count) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore b/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore deleted file mode 100644 index bb69de41..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/get/.gitignore +++ /dev/null @@ -1 +0,0 @@ -get \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go b/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go deleted file mode 100644 index 4c6847b3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/get/get.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "flag" - "fmt" - "os" - "strconv" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var ( - host = "127.0.0.1" - port = 3000 - namespace = "test" - set = "demo" -) - -func main() { - - var err error - - // arguments - flag.StringVar(&host, "host", host, "Remote host") - flag.IntVar(&port, "port", port, "Remote port") - flag.StringVar(&namespace, "namespace", namespace, "Namespace") - flag.StringVar(&set, "set", set, "Set name") - - // parse flags - flag.Parse() - - // args - args := flag.Args() - - if len(args) < 1 { - printError("Missing argument") - } - - client, err := as.NewClient(host, port) - panicOnError(err) - - var key *as.Key - - skey := flag.Arg(0) - ikey, err := strconv.ParseInt(skey, 10, 64) - if err == nil { - key, err = as.NewKey(namespace, set, ikey) - panicOnError(err) - } else { - key, err = as.NewKey(namespace, set, skey) - panicOnError(err) - } - - policy := as.NewPolicy() - rec, err := client.Get(policy, key) - panicOnError(err) - if rec != nil { - printOK("%v", rec.Bins) - } else { - printError("record not found: namespace=%s set=%s key=%v", key.Namespace(), key.SetName(), key.Value()) - } -} - -func panicOnError(err error) { - if err != nil { - panic(err) - } -} - -func printOK(format string, a ...interface{}) { - fmt.Printf("ok: "+format+"\n", a...) - os.Exit(0) -} - -func printError(format string, a ...interface{}) { - fmt.Printf("error: "+format+"\n", a...) - os.Exit(1) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go b/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go deleted file mode 100644 index 8a24b309..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/info/info.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func main() { - // remove timestamps from log messages - log.SetFlags(0) - - // connect to the host - cp := as.NewClientPolicy() - cp.Timeout = 10 * time.Second - - // cp.User = "admin" - // cp.Password = "admin" - - conn, err := as.NewConnection(cp, as.NewHost("localhost", 3000)) - if err != nil { - log.Fatalln(err.Error()) - } - - // Login if needed - // if err := conn.Login(cp); err != nil { - // log.Fatalln(err.Error()) - // } - - infoMap, err := conn.RequestInfo("") - if err != nil { - log.Fatalln(err.Error()) - } - - cnt := 1 - for k, v := range infoMap { - log.Printf("%d : %s\n %s\n", cnt, k, v) - cnt++ - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go b/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go deleted file mode 100644 index 9ad559ab..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/list_map/list_map.go +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "bytes" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - testListStrings(shared.Client) - testListComplex(shared.Client) - testMapStrings(shared.Client) - testMapComplex(shared.Client) - testListMapCombined(shared.Client) - testListOperate(shared.Client) - - log.Println("Example finished successfully.") -} - -/** - * Write/Read []string directly instead of relying on java serializer. - */ -func testListStrings(client *as.Client) { - log.Printf("Read/Write []string") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey1") - client.Delete(shared.WritePolicy, key) - - list := []string{"string1", "string2", "string3"} - - bin := as.NewBin("listbin1", list) - client.PutBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - receivedList := record.Bins[bin.Name].([]interface{}) - - validateSize(3, len(receivedList)) - validate("string1", receivedList[0]) - validate("string2", receivedList[1]) - validate("string3", receivedList[2]) - - log.Printf("Read/Write []string successful.") -} - -/** - * Write/Read []interface{} directly instead of relying on java serializer. - */ -func testListComplex(client *as.Client) { - log.Printf("Read/Write []interface{}") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey2") - client.Delete(shared.WritePolicy, key) - - blob := []byte{3, 52, 125} - list := []interface{}{"string1", 2, blob} - - bin := as.NewBin("listbin2", list) - client.PutBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - receivedList := record.Bins[bin.Name].([]interface{}) - - validateSize(3, len(receivedList)) - validate("string1", receivedList[0]) - // Server convert numbers to long, so must expect long. - validate(2, receivedList[1]) - validateBytes(blob, receivedList[2].([]byte)) - - log.Printf("Read/Write []interface{} successful.") -} - -/** - * Write/Read map[string]string directly instead of relying on java serializer. - */ -func testMapStrings(client *as.Client) { - log.Printf("Read/Write map[string]string") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "mapkey1") - client.Delete(shared.WritePolicy, key) - - amap := map[string]string{"key1": "string1", - "key2": "string2", - "key3": "string3", - } - bin := as.NewBin("mapbin1", amap) - client.PutBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - receivedMap := record.Bins[bin.Name].(map[interface{}]interface{}) - - validateSize(3, len(receivedMap)) - validate("string1", receivedMap["key1"]) - validate("string2", receivedMap["key2"]) - validate("string3", receivedMap["key3"]) - - log.Printf("Read/Write map[string]string successful") -} - -/** - * Write/Read map[interface{}]interface{} directly instead of relying on java serializer. - */ -func testMapComplex(client *as.Client) { - log.Printf("Read/Write map[interface{}]interface{}") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "mapkey2") - client.Delete(shared.WritePolicy, key) - - blob := []byte{3, 52, 125} - list := []int{ - 100034, - 12384955, - 3, - 512, - } - - amap := map[interface{}]interface{}{ - "key1": "string1", - "key2": 2, - "key3": blob, - "key4": list, - } - - bin := as.NewBin("mapbin2", amap) - client.PutBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - receivedMap := record.Bins[bin.Name].(map[interface{}]interface{}) - - validateSize(4, len(receivedMap)) - validate("string1", receivedMap["key1"]) - // Server convert numbers to long, so must expect long. - validate(2, receivedMap["key2"]) - validateBytes(blob, receivedMap["key3"].([]byte)) - - receivedInner := receivedMap["key4"].([]interface{}) - validateSize(4, len(receivedInner)) - validate(100034, receivedInner[0]) - validate(12384955, receivedInner[1]) - validate(3, receivedInner[2]) - validate(512, receivedInner[3]) - - log.Printf("Read/Write map[interface{}]interface{} successful") -} - -/** - * Write/Read Array/Map combination directly instead of relying on java serializer. - */ -func testListMapCombined(client *as.Client) { - log.Printf("Read/Write Array/Map") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listmapkey") - client.Delete(shared.WritePolicy, key) - - blob := []byte{3, 52, 125} - inner := []interface{}{ - "string2", - 5, - } - - innerMap := map[interface{}]interface{}{ - "a": 1, - 2: "b", - 3: blob, - "list": inner, - } - - list := []interface{}{ - "string1", - 8, - inner, - innerMap, - } - - bin := as.NewBin("listmapbin", list) - client.PutBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - received := record.Bins[bin.Name].([]interface{}) - - validateSize(4, len(received)) - validate("string1", received[0]) - // Server convert numbers to long, so must expect long. - validate(8, received[1]) - - receivedInner := received[2].([]interface{}) - validateSize(2, len(receivedInner)) - validate("string2", receivedInner[0]) - validate(5, receivedInner[1]) - - receivedMap := received[3].(map[interface{}]interface{}) - validateSize(4, len(receivedMap)) - validate(1, receivedMap["a"]) - validate("b", receivedMap[2]) - validateBytes(blob, receivedMap[3].([]byte)) - - receivedInner2 := receivedMap["list"].([]interface{}) - validateSize(2, len(receivedInner2)) - validate("string2", receivedInner2[0]) - validate(5, receivedInner2[1]) - - log.Printf("Read/Write Array/Map successful") -} - -/** - * Write/Read a single item into a list using the operate command - */ -func testListOperate(client *as.Client) { - log.Printf("Read/Write List operate") - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "listkey1") - client.Delete(shared.WritePolicy, key) - - alist := []string{"string1", "string2", "string3"} - - // Create a list as a bin - bin := as.NewBin("listbin1", alist) - client.PutBins(shared.WritePolicy, key, bin) - - writePolicy := as.NewWritePolicy(0, 0) - listPolicy := as.NewListPolicy(as.ListOrderUnordered, as.ListWriteFlagsAddUnique|as.ListWriteFlagsNoFail) - - // add a unique item to the list as an operate command - _, err := client.Operate(writePolicy, key, - as.ListAppendWithPolicyOp(listPolicy, "listbin1", "string4")) - shared.PanicOnError(err) - - // add (ignore) duplicate value in the list - _, err = client.Operate(writePolicy, key, - as.ListAppendWithPolicyOp(listPolicy, "listbin1", "string4")) - shared.PanicOnError(err) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - receivedList := record.Bins[bin.Name].([]interface{}) - validateSize(4, len(receivedList)) - validate("string1", receivedList[0]) - validate("string2", receivedList[1]) - validate("string3", receivedList[2]) - validate("string4", receivedList[3]) - - log.Printf("Read/Write list operate successful") -} - -func validateSize(expected, received int) { - if received != expected { - log.Fatalf( - "Size mismatch: expected=%d received=%d", expected, received) - } -} - -func validate(expected, received interface{}) { - if !(received == expected) { - log.Fatalf( - "Mismatch: expected=%v received=%v", expected, received) - } -} - -func validateBytes(expected []byte, received []byte) { - if !bytes.Equal(expected, received) { - log.Fatalf( - "Mismatch: expected=%v received=%v", expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go b/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go deleted file mode 100644 index c180a277..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/operate/operate.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - // Write initial record. - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "opkey") - bin1 := as.NewBin("optintbin", 7) - bin2 := as.NewBin("optstringbin", "string value") - log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", - key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) - client.PutBins(shared.WritePolicy, key, bin1, bin2) - - // Add integer, write new string and read record. - bin3 := as.NewBin(bin1.Name, 4) - bin4 := as.NewBin(bin2.Name, "new string") - log.Println("Add: ", bin3.Value) - log.Println("Write: ", bin4.Value) - log.Println("Read:") - - record, err := client.Operate(shared.WritePolicy, key, as.AddOp(bin3), as.PutOp(bin4), as.GetOp()) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - binExpected := as.NewBin(bin3.Name, 11) - shared.ValidateBin(key, binExpected, record) - shared.ValidateBin(key, bin4, record) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go b/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go deleted file mode 100644 index 430d3ce3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/prepend/prepend.go +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "prependkey") - shared.PanicOnError(err) - - binName := "prependbin" - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - bin := as.NewBin(binName, "World") - log.Println("Initial prepend will create record. Initial value is ", bin.Value, ".") - client.PrependBins(shared.WritePolicy, key, bin) - - bin = as.NewBin(binName, "Hello ") - log.Println("Prepend \"", bin.Value, "\" to existing record.") - client.PrependBins(shared.WritePolicy, key, bin) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - // The value received from the server is an unsigned byte stream. - // Convert to an integer before comparing with expected. - received := record.Bins[bin.Name] - expected := "Hello World" - - if received == expected { - log.Printf("Prepend successful: ns=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Fatalf("Prepend mismatch: Expected %s. Received %s.", expected, received) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore b/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore deleted file mode 100644 index a232311c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/put/.gitignore +++ /dev/null @@ -1 +0,0 @@ -put \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go b/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go deleted file mode 100644 index ea1a42a1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/put/put.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "encoding/json" - "flag" - "fmt" - "os" - "strconv" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var ( - host = "127.0.0.1" - port = 3000 - namespace = "test" - set = "demo" -) - -func main() { - - var err error - - // arguments - flag.StringVar(&host, "host", host, "Remote host") - flag.IntVar(&port, "port", port, "Remote port") - flag.StringVar(&namespace, "namespace", namespace, "Namespace") - flag.StringVar(&set, "set", set, "Set name") - - // parse flags - flag.Parse() - - // args - args := flag.Args() - - if len(args) < 2 { - printError("Missing argument(s)") - } - - client, err := as.NewClient(host, port) - panicOnError(err) - - var key *as.Key - var rec as.BinMap - - skey := flag.Arg(0) - ikey, err := strconv.ParseInt(skey, 10, 64) - if err == nil { - key, err = as.NewKey(namespace, set, ikey) - panicOnError(err) - } else { - key, err = as.NewKey(namespace, set, skey) - panicOnError(err) - } - - srec := flag.Arg(1) - json.Unmarshal([]byte(srec), &rec) - - for k, v := range rec { - switch w := v.(type) { - case float64: - rec[k] = int64(w) - case bool: - if w { - rec[k] = int64(1) - } else { - rec[k] = int64(0) - } - } - } - - policy := as.NewWritePolicy(0, 0) - err = client.Put(policy, key, rec) - panicOnError(err) - if rec != nil { - printError("record updated: namespace=%s set=%s key=%v", key.Namespace(), key.SetName(), key.Value()) - } -} - -func panicOnError(err error) { - if err != nil { - panic(err) - } -} - -func printOK(format string, a ...interface{}) { - fmt.Printf("ok: "+format+"\n", a...) - os.Exit(0) -} - -func printError(format string, a ...interface{}) { - fmt.Printf("error: "+format+"\n", a...) - os.Exit(1) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go b/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go deleted file mode 100644 index ede57ee9..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/putget/putget.go +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License") you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "fmt" - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runSingleBinExample(shared.Client) - runMultiBinExample(shared.Client) - runGetHeaderExample(shared.Client) - - log.Println("Example finished successfully.") -} - -// Execute put and get on a server configured as multi-bin. This is the server default. -func runMultiBinExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") - bin1 := as.NewBin("bin1", "value1") - bin2 := as.NewBin("bin2", "value2") - - log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", - key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) - - client.PutBins(shared.WritePolicy, key, bin1, bin2) - - log.Printf("Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) - - record, err := client.Get(shared.Policy, key) - shared.PanicOnError(err) - - if record == nil { - panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) - } - - shared.ValidateBin(key, bin1, record) - shared.ValidateBin(key, bin2, record) -} - -// Execute put and get on a server configured as single-bin. -func runSingleBinExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") - bin := as.NewBin("", "value") - - log.Printf("Single Put: namespace=%s set=%s key=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Value) - - client.PutBins(shared.WritePolicy, key, bin) - - log.Printf("Single Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) - - record, err := client.Get(shared.Policy, key) - shared.PanicOnError(err) - - if record == nil { - panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) - } - - shared.ValidateBin(key, bin, record) -} - -// Read record header data. -func runGetHeaderExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "putgetkey") - - log.Printf("Get record header: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) - record, err := client.GetHeader(shared.Policy, key) - shared.PanicOnError(err) - - if record == nil { - panic(fmt.Errorf("Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value())) - } - - // Generation should be greater than zero. Make sure it's populated. - if record.Generation == 0 { - panic(fmt.Errorf("Invalid record header: generation=%d expiration=%d", record.Generation, record.Expiration)) - } - log.Printf("Received: generation=%d expiration=%d (%s)\n", record.Generation, record.Expiration, time.Duration(record.Expiration)*time.Second) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go deleted file mode 100644 index e5b39060..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/average/average.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "os" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -const keyCount = 1000 - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - // Set LuaPath - luaPath, _ := os.Getwd() - luaPath += "/udf/" - as.SetLuaPath(luaPath) - - filename := "average" - regTask, err := client.RegisterUDFFromFile(nil, luaPath+filename+".lua", filename+".lua", as.LUA) - shared.PanicOnError(err) - - // wait until UDF is created - shared.PanicOnError(<-regTask.OnComplete()) - - sum := 0 - for i := 1; i <= keyCount; i++ { - sum += i - key, err := as.NewKey(*shared.Namespace, *shared.Set, i) - shared.PanicOnError(err) - - bin1 := as.NewBin("bin1", i) - client.PutBins(nil, key, bin1) - } - - average := float64(sum) / float64(keyCount) - - t := time.Now() - stm := as.NewStatement(*shared.Namespace, *shared.Set) - res, err := client.QueryAggregate(nil, stm, filename, filename, as.StringValue("bin1")) - shared.PanicOnError(err) - - for rec := range res.Results() { - res := rec.Record.Bins["SUCCESS"].(map[interface{}]interface{}) - log.Printf("Result from Map/Reduce: %v\n", res) - log.Printf("Result %f should equal %f\n", res["sum"].(float64)/res["count"].(float64), average) - } - log.Println("Map/Reduce took", time.Now().Sub(t)) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go deleted file mode 100644 index 9099aeb8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/single_bin_sum/single_bin_sum.go +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "os" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -const keyCount = 1000 - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - // Set LuaPath - luaPath, _ := os.Getwd() - luaPath += "/udf/" - as.SetLuaPath(luaPath) - - filename := "sum_single_bin" - regTask, err := client.RegisterUDFFromFile(nil, luaPath+filename+".lua", filename+".lua", as.LUA) - shared.PanicOnError(err) - - // wait until UDF is created - shared.PanicOnError(<-regTask.OnComplete()) - - sum := 0 - for i := 1; i <= keyCount; i++ { - sum += i - key, err := as.NewKey(*shared.Namespace, *shared.Set, i) - shared.PanicOnError(err) - - bin1 := as.NewBin("bin1", i) - client.PutBins(nil, key, bin1) - } - - t := time.Now() - stm := as.NewStatement(*shared.Namespace, *shared.Set) - res, err := client.QueryAggregate(nil, stm, filename, filename, as.StringValue("bin1")) - shared.PanicOnError(err) - - for rec := range res.Results() { - log.Printf("Result %f should equal %d\n", rec.Record.Bins["SUCCESS"], sum) - } - log.Println("Map/Reduce took", time.Now().Sub(t)) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua deleted file mode 100644 index 053e3ca1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/average.lua +++ /dev/null @@ -1,18 +0,0 @@ -function average(s, name) - - local function mapper(out, rec) - out['sum'] = (out['sum'] or 0) + (rec[name] or 0) - out['count'] = (out['count'] or 0) + 1 - return out - end - - local function reducer(a, b) - local out = map() - - out['sum'] = a['sum'] + b['sum'] - out['count'] = a['count'] + b['count'] - return out - end - - return s : aggregate(map{sum = 0, count = 0}, mapper) : reduce(reducer) -end diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua b/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua deleted file mode 100644 index d273521e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/query-aggregate/udf/sum_single_bin.lua +++ /dev/null @@ -1,11 +0,0 @@ -local function reducer(val1,val2) - return val1 + val2 -end - -function sum_single_bin(stream,name) - local function mapper(rec) - return rec[name] - end - - return stream : map(mapper) : reduce(reducer) -end diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go b/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go deleted file mode 100644 index 8966a3ae..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/replace/replace.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "errors" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -func main() { - runReplaceExample(shared.Client) - runReplaceOnlyExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func runReplaceExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "replacekey") - shared.PanicOnError(err) - bin1 := as.NewBin("bin1", "value1") - bin2 := as.NewBin("bin2", "value2") - bin3 := as.NewBin("bin3", "value3") - - log.Printf("Put: namespace=%s set=%s key=%s bin1=%s value1=%s bin2=%s value2=%s", - key.Namespace(), key.SetName(), key.Value(), bin1.Name, bin1.Value, bin2.Name, bin2.Value) - - shared.PanicOnError(client.PutBins(shared.WritePolicy, key, bin1, bin2)) - - log.Printf("Replace with: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin3.Name, bin3.Value) - - wpolicy := as.NewWritePolicy(0, 0) - wpolicy.RecordExistsAction = as.REPLACE - client.PutBins(wpolicy, key, bin3) - - log.Printf("Get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) - - record, err := client.Get(shared.Policy, key) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", key.Namespace(), key.SetName(), key.Value()) - } - - if record.Bins[bin1.Name] == nil { - log.Printf(bin1.Name + " was deleted as expected.") - } else { - log.Fatalln(bin1.Name + " found when it should have been deleted.") - } - - if record.Bins[bin2.Name] == nil { - log.Printf(bin2.Name + " was deleted as expected.") - } else { - log.Fatalln(bin2.Name + " found when it should have been deleted.") - } - shared.ValidateBin(key, bin3, record) -} - -func runReplaceOnlyExample(client *as.Client) { - key, err := as.NewKey(*shared.Namespace, *shared.Set, "replaceonlykey") - shared.PanicOnError(err) - bin := as.NewBin("bin", "value") - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - log.Printf("Replace record requiring that it exists: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - - wpolicy := as.NewWritePolicy(0, 0) - wpolicy.RecordExistsAction = as.REPLACE_ONLY - err = client.PutBins(wpolicy, key, bin) - if errors.Is(err, &as.AerospikeError{ResultCode: ast.KEY_NOT_FOUND_ERROR}) { - log.Printf("Success. `Not found` error returned as expected.") - } else { - log.Fatalln("Failure. This command should have resulted in an error.") - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go deleted file mode 100644 index d95adeb3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/scan_paginate/scan_paginate.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - log.Printf("Scan parallel: namespace=" + *shared.Namespace + " set=" + *shared.Set) - recordCount := 0 - begin := time.Now() - policy := as.NewScanPolicy() - policy.MaxRecords = 30 - - pf := as.NewPartitionFilterAll() - - receivedRecords := 1 - for receivedRecords > 0 { - receivedRecords = 0 - - log.Println("Scanning Page:", recordCount/int(policy.MaxRecords)) - recordset, err := client.ScanPartitions(policy, pf, *shared.Namespace, *shared.Set) - shared.PanicOnError(err) - - for rec := range recordset.Results() { - if rec.Err != nil { - // if there was an error, handle it if needed - // Scans are retried in Aerospike servers v5+ - log.Println(err) - continue - } - - recordCount++ - receivedRecords++ - } - } - - log.Println("Total records returned: ", recordCount) - log.Println("Elapsed time: ", time.Since(begin), " seconds") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go deleted file mode 100644 index 3dd36128..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/scan_parallel/scan_parallel.go +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - log.Printf("Scan parallel: namespace=" + *shared.Namespace + " set=" + *shared.Set) - - recordCount := 0 - begin := time.Now() - policy := as.NewScanPolicy() - recordset, err := client.ScanAll(policy, *shared.Namespace, *shared.Set) - shared.PanicOnError(err) - - for rec := range recordset.Results() { - if rec.Err != nil { - // if there was an error, handle it if needed - // Scans are retried in Aerospike servers v5+ - log.Println(err) - continue - } - - recordCount++ - - if (recordCount % 100000) == 0 { - log.Println("Records ", recordCount) - } - } - - end := time.Now() - seconds := float64(end.Sub(begin)) / float64(time.Second) - log.Println("Total records returned: ", recordCount) - log.Println("Elapsed time: ", seconds, " seconds") - performance := shared.Round(float64(recordCount)/float64(seconds), 0.5, 0) - log.Println("Records/second: ", performance) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go b/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go deleted file mode 100644 index 3f2d0092..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/scan_serial/scan_serial.go +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - - log.Println("Example finished successfully.") -} - -// Metrics is a custom data type -type Metrics struct { - count int - total int -} - -var setMap = make(map[string]Metrics) - -func runExample(client *as.Client) { - log.Println("Scan series: namespace=", *shared.Namespace, " set=", *shared.Set) - - // Limit scan to recordsPerSecond. This will take more time, but it will reduce - // the load on the server. - policy := as.NewScanPolicy() - policy.RecordsPerSecond = 5000 - - nodeList := client.GetNodes() - begin := time.Now() - - for _, node := range nodeList { - log.Println("Scan node ", node.GetName()) - recordset, err := client.ScanNode(policy, node, *shared.Namespace, *shared.Set) - shared.PanicOnError(err) - - for res := range recordset.Results() { - if res.Err != nil { - // if there was an error, stop - shared.PanicOnError(err) - } - - rec := res.Record - metrics, exists := setMap[rec.Key.SetName()] - - if !exists { - metrics = Metrics{} - } - metrics.count++ - metrics.total++ - setMap[rec.Key.SetName()] = metrics - } - - for k, v := range setMap { - log.Println("Node ", node, " set ", k, " count: ", v.count) - v.count = 0 - } - } - - end := time.Now() - seconds := float64(end.Sub(begin)) / float64(time.Second) - log.Println("Elapsed time: ", seconds, " seconds") - - total := 0 - - for k, v := range setMap { - log.Println("Total set ", k, " count: ", v.total) - total += v.total - } - log.Println("Grand total: ", total) - performance := shared.Round(float64(total)/seconds, 0.5, 0) - log.Println("Records/second: ", performance) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go b/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go deleted file mode 100644 index 47daa04d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/shared/shared.go +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package shared - -import ( - "bytes" - "flag" - "fmt" - "log" - "math" - "os" - "runtime" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -// WritePolicy is shared for all examples -var WritePolicy = as.NewWritePolicy(0, 0) - -// Policy is shared for all examples -var Policy = as.NewPolicy() - -// Host is shared for all examples -var Host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") - -// Port is shared for all examples -var Port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") - -// User is shared for all examples -var User = flag.String("U", "", "Aerospike username.") - -// Password is shared for all examples -var Password = flag.String("P", "", "Aerospike password.") - -// Namespace is shared for all examples -var Namespace = flag.String("n", "test", "Aerospike namespace.") - -// Set is shared for all examples -var Set = flag.String("s", "testset", "Aerospike set name.") -var showUsage = flag.Bool("u", false, "Show usage information.") - -// Client is shared for all examples -var Client *as.Client - -// ValidateBin takes the original bin and the record retrieved from the database -// and compares their values -func ValidateBin(key *as.Key, bin *as.Bin, record *as.Record) { - if !bytes.Equal(record.Key.Digest(), key.Digest()) { - log.Fatalln(fmt.Sprintf("key `%s` is not the same as key `%s`.", key, record.Key)) - } - - if record.Bins[bin.Name] != bin.Value.GetObject() { - log.Fatalln(fmt.Sprintf("bin `%s: %v` is not the same as bin `%v`.", bin.Name, bin.Value, record.Bins[bin.Name])) - } -} - -// PanicOnError will exit if the error is not nil -func PanicOnError(err error) { - if err != nil { - log.Fatalln(err.Error()) - } -} - -func printParams() { - log.Printf("hosts:\t\t%s", *Host) - log.Printf("port:\t\t%d", *Port) - log.Printf("user:\t\t%s", *User) - log.Printf("password:\t\t%s", "*") - log.Printf("namespace:\t\t%s", *Namespace) - log.Printf("set:\t\t%s", *Set) -} - -// Round takes a float64 nu,ber and rounds it to the parameters -func Round(val float64, roundOn float64, places int) (newVal float64) { - var round float64 - pow := math.Pow(10, float64(places)) - digit := pow * val - _, div := math.Modf(digit) - _div := math.Copysign(div, val) - _roundOn := math.Copysign(roundOn, val) - if _div >= _roundOn { - round = math.Ceil(digit) - } else { - round = math.Floor(digit) - } - newVal = round / pow - return -} - -// reads input flags and interprets the complex ones -func init() { - // use all cpus in the system for concurrency - runtime.GOMAXPROCS(runtime.NumCPU()) - - log.SetOutput(os.Stdout) - - flag.Parse() - - if *showUsage { - flag.Usage() - os.Exit(0) - } - - printParams() - - cp := as.NewClientPolicy() - cp.User = *User - cp.Password = *Password - cp.Timeout = 3 * time.Second - - var err error - Client, err = as.NewClientWithPolicy(cp, *Host, *Port) - if err != nil { - PanicOnError(err) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go b/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go deleted file mode 100644 index 2107840f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/simple/simple.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "fmt" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -func main() { - // define a client to connect to - client, err := as.NewClient("127.0.0.1", 3000) - panicOnError(err) - - namespace := "test" - setName := "aerospike" - key, err := as.NewKey(namespace, setName, "key") // user key can be of any supported type - panicOnError(err) - - // define some bins - bins := as.BinMap{ - "bin1": 42, // you can pass any supported type as bin value - "bin2": "An elephant is a mouse with an operating system", - "bin3": []interface{}{"Go", 17981}, - } - - // write the bins - writePolicy := as.NewWritePolicy(0, 0) - err = client.Put(writePolicy, key, bins) - panicOnError(err) - - // read it back! - readPolicy := as.NewPolicy() - rec, err := client.Get(readPolicy, key) - panicOnError(err) - - fmt.Printf("%#v\n", *rec) - - // Add to bin1 - err = client.Add(writePolicy, key, as.BinMap{"bin1": 1}) - panicOnError(err) - - rec2, err := client.Get(readPolicy, key) - panicOnError(err) - - fmt.Printf("value of %s: %v\n", "bin1", rec2.Bins["bin1"]) - - // prepend and append to bin2 - err = client.Prepend(writePolicy, key, as.BinMap{"bin2": "Frankly: "}) - panicOnError(err) - err = client.Append(writePolicy, key, as.BinMap{"bin2": "."}) - panicOnError(err) - - rec3, err := client.Get(readPolicy, key) - panicOnError(err) - - fmt.Printf("value of %s: %v\n", "bin2", rec3.Bins["bin2"]) - - // delete bin3 - err = client.Put(writePolicy, key, as.BinMap{"bin3": nil}) - rec4, err := client.Get(readPolicy, key) - panicOnError(err) - - fmt.Printf("bin3 does not exist anymore: %#v\n", *rec4) - - // check if key exists - exists, err := client.Exists(readPolicy, key) - panicOnError(err) - fmt.Printf("key exists in the database: %#v\n", exists) - - // delete the key, and check if key exists - existed, err := client.Delete(writePolicy, key) - panicOnError(err) - fmt.Printf("did key exist before delete: %#v\n", existed) - - exists, err = client.Exists(readPolicy, key) - panicOnError(err) - fmt.Printf("key exists: %#v\n", exists) -} - -func panicOnError(err error) { - if err != nil { - panic(err) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go b/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go deleted file mode 100644 index 4cdbb4c6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/tls_secure_connection/tls_secure_connection.go +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License") you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "crypto/tls" - "crypto/x509" - "flag" - "log" - "os" - "path/filepath" - - as "github.com/aerospike/aerospike-client-go/v7" -) - -var host = flag.String("h", "127.0.0.1", "Aerospike server seed hostnames or IP addresses") -var port = flag.Int("p", 3000, "Aerospike server seed hostname or IP address port number.") -var showUsage = flag.Bool("u", false, "Show usage information.") - -var tlsName = flag.String("tlsName", "", "Aerospike server TLS name") -var encryptOnly = flag.Bool("encryptOnly", false, "Should the TLS connection be encrypted only without authentication?") - -var useSystemCerts = flag.Bool("useSystemCerts", false, "Add system certificates to the RootCA list?") -var serverCertDir = flag.String("serverCertDir", "", "Server certificate dir.") -var clientCertFile = flag.String("clientCertFile", "", "Client Cert File") -var clientKeyFile = flag.String("clientKeyFile", "", "Client Key File") - -func printParams() { - log.Printf("hosts:\t\t%s", *host) - log.Printf("port:\t\t%d", *port) -} - -func main() { - log.SetOutput(os.Stdout) - - flag.Parse() - - if *showUsage { - flag.Usage() - os.Exit(0) - } - - printParams() - serverCertPool, clientCertPool := readCertificates(*serverCertDir, *clientCertFile, *clientKeyFile) - - clientPolicy := as.NewClientPolicy() - - if len(*tlsName) > 0 || *encryptOnly == true { - // Setup TLS Config - tlsConfig := &tls.Config{ - Certificates: clientCertPool, - RootCAs: serverCertPool, - InsecureSkipVerify: *encryptOnly, - PreferServerCipherSuites: true, - } - tlsConfig.BuildNameToCertificate() - - clientPolicy.TlsConfig = tlsConfig - } - - client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) - if err != nil { - log.Fatalln("Failed to connect to the server cluster: ", err) - } - - log.Println("Connection successful. Discovered nodes:", client.Cluster().GetNodes()) - - log.Println("Example finished successfully.") -} - -func readCertificates(serverCertDir string, clientCertFile, clientKeyFile string) (serverPool *x509.CertPool, clientPool []tls.Certificate) { - var err error - - if *useSystemCerts { - // Try to load system CA certs, otherwise just make an empty pool - serverPool, err = x509.SystemCertPool() - if serverPool == nil || err != nil { - log.Printf("FAILED: Adding system certificates to the pool failed: %s", err) - serverPool = x509.NewCertPool() - } - } - - // Load server certs from directory - if len(serverCertDir) > 0 { - serverCerts := dirFiles(serverCertDir) - // Adding server certificates to the pool. - // These certificates are used to verify the identity of the server nodes to the client. - for _, caFile := range serverCerts { - caCert, err := os.ReadFile(caFile) - if err != nil { - log.Fatalf("FAILED: Adding server certificate %s to the pool failed: %s", caFile, err) - } - - log.Printf("Adding server certificate %s to the pool...", caFile) - serverPool.AppendCertsFromPEM(caCert) - } - } - - // Try to load client cert - if len(clientCertFile)+len(clientKeyFile) > 0 { - // Loading the client certificate. - // This certificate is used to verify the identity of the client to the server nodes. - cert, err := tls.LoadX509KeyPair(clientCertFile, clientKeyFile) - if err != nil { - log.Fatalf("FAILED: Adding client certificate %s to the pool failed: %s", clientCertFile, err) - } - - log.Printf("Adding client certificate %s to the pool...", clientCertFile) - clientPool = append(clientPool, cert) - } - - return serverPool, clientPool -} - -func dirFiles(root string) (files []string) { - err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - files = append(files, path) - return nil - }) - if err != nil { - log.Fatalln(err) - } - - return files -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go b/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go deleted file mode 100644 index 9b9ab62c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/touch/touch.go +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "log" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -func main() { - runExample(shared.Client) - log.Println("Example finished successfully.") -} - -func runExample(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "touchkey") - bin := as.NewBin("touchbin", "touchvalue") - - log.Printf("Create record with 2 second expiration.") - writePolicy := as.NewWritePolicy(0, 2) - client.PutBins(writePolicy, key, bin) - - log.Printf("Touch same record with 5 second expiration.") - writePolicy.Expiration = 5 - record, err := client.Operate(writePolicy, key, as.TouchOp(), as.GetHeaderOp()) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s bin=%s value=nil", - key.Namespace(), key.SetName(), key.Value(), bin.Name) - } - - if record.Expiration == 0 { - log.Fatalf( - "Failed to get record expiration: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - log.Printf("Sleep 3 seconds.") - time.Sleep(3 * time.Second) - - record, err = client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Fatalf( - "Failed to get: namespace=%s set=%s key=%s", - key.Namespace(), key.SetName(), key.Value()) - } - - log.Printf("Success. Record still exists.") - log.Printf("Sleep 4 seconds.") - time.Sleep(4 * time.Second) - - record, err = client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - - if record == nil { - log.Printf("Success. Record expired as expected.") - } else { - log.Fatalf("Found record when it should have expired.") - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go b/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go deleted file mode 100644 index dc0a5115..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/examples/udf/udf.go +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package main - -import ( - "bytes" - "log" - - as "github.com/aerospike/aerospike-client-go/v7" - shared "github.com/aerospike/aerospike-client-go/v7/examples/shared" -) - -const udf = ` -local function putBin(r,name,value) - if not aerospike:exists(r) then aerospike:create(r) end - r[name] = value - aerospike:update(r) -end - --- Set a particular bin -function writeBin(r,name,value) - putBin(r,name,value) -end - --- Get a particular bin -function readBin(r,name) - return r[name] -end - --- Return generation count of record -function getGeneration(r) - return record.gen(r) -end - --- Update record only if gen hasn't changed -function writeIfGenerationNotChanged(r,name,value,gen) - if record.gen(r) == gen then - r[name] = value - aerospike:update(r) - end -end - --- Set a particular bin only if record does not already exist. -function writeUnique(r,name,value) - if not aerospike:exists(r) then - aerospike:create(r) - r[name] = value - aerospike:update(r) - end -end - --- Validate value before writing. -function writeWithValidation(r,name,value) - if (value >= 1 and value <= 10) then - putBin(r,name,value) - else - error("1000:Invalid value") - end -end - --- Record contains two integer bins, name1 and name2. --- For name1 even integers, add value to existing name1 bin. --- For name1 integers with a multiple of 5, delete name2 bin. --- For name1 integers with a multiple of 9, delete record. -function processRecord(r,name1,name2,addValue) - local v = r[name1] - - if (v % 9 == 0) then - aerospike:remove(r) - return - end - - if (v % 5 == 0) then - r[name2] = nil - aerospike:update(r) - return - end - - if (v % 2 == 0) then - r[name1] = v + addValue - aerospike:update(r) - end -end - --- Set expiration of record --- function expire(r,ttl) --- if record.ttl(r) == gen then --- r[name] = value --- aerospike:update(r) --- end --- end -` - -func main() { - register(shared.Client) - writeUsingUdf(shared.Client) - writeIfGenerationNotChanged(shared.Client) - writeIfNotExists(shared.Client) - writeWithValidation(shared.Client) - writeListMapUsingUdf(shared.Client) - writeBlobUsingUdf(shared.Client) - - log.Println("Example finished successfully.") -} - -func register(client *as.Client) { - task, err := client.RegisterUDF(shared.WritePolicy, []byte(udf), "record_example.lua", as.LUA) - shared.PanicOnError(err) - <-task.OnComplete() -} - -func writeUsingUdf(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey1") - bin := as.NewBin("udfbin1", "string value") - - client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(bin.Name), bin.Value) - - record, err := client.Get(shared.Policy, key, bin.Name) - shared.PanicOnError(err) - expected := bin.Value.String() - received := record.Bins[bin.Name].(string) - - if received == expected { - log.Printf("Data matched: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), bin.Name, received) - } else { - log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) - } -} - -func writeIfGenerationNotChanged(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey2") - bin := as.NewBin("udfbin2", "string value") - - // Seed record. - client.PutBins(shared.WritePolicy, key, bin) - - // Get record generation. - gen, err := client.Execute(shared.WritePolicy, key, "record_example", "getGeneration") - shared.PanicOnError(err) - - // Write record if generation has not changed. - client.Execute(shared.WritePolicy, key, "record_example", "writeIfGenerationNotChanged", as.NewValue(bin.Name), bin.Value, as.NewValue(gen)) - log.Printf("Record written.") -} - -func writeIfNotExists(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey3") - binName := "udfbin3" - - // Delete record if it already exists. - client.Delete(shared.WritePolicy, key) - - // Write record only if not already exists. This should succeed. - client.Execute(shared.WritePolicy, key, "record_example", "writeUnique", as.NewValue(binName), as.NewValue("first")) - - // Verify record written. - record, err := client.Get(shared.Policy, key, binName) - shared.PanicOnError(err) - expected := "first" - received := record.Bins[binName].(string) - - if received == expected { - log.Printf("Record written: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), binName, received) - } else { - log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) - } - - // Write record second time. This should fail. - log.Printf("Attempt second write.") - client.Execute(shared.WritePolicy, key, "record_example", "writeUnique", as.NewValue(binName), as.NewValue("second")) - - // Verify record not written. - record, err = client.Get(shared.Policy, key, binName) - shared.PanicOnError(err) - received = record.Bins[binName].(string) - - if received == expected { - log.Printf("Success. Record remained unchanged: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), binName, received) - } else { - log.Printf("Data mismatch: Expected %s. Received %s.", expected, received) - } -} - -func writeWithValidation(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey4") - binName := "udfbin4" - - // Lua function writeWithValidation accepts number between 1 and 10. - // Write record with valid value. - log.Printf("Write with valid value.") - client.Execute(shared.WritePolicy, key, "record_example", "writeWithValidation", as.NewValue(binName), as.NewValue(4)) - - // Write record with invalid value. - log.Printf("Write with invalid value.") - - _, err := client.Execute(shared.WritePolicy, key, "record_example", "writeWithValidation", as.NewValue(binName), as.NewValue(11)) - if err == nil { - log.Printf("UDF should not have succeeded!") - } else { - log.Printf("Success. UDF resulted in exception as expected.") - } -} - -func writeListMapUsingUdf(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey5") - - inner := []interface{}{"string2", int64(8)} - innerMap := map[interface{}]interface{}{"a": int64(1), int64(2): "b", "list": inner} - list := []interface{}{"string1", int64(4), inner, innerMap} - - binName := "udfbin5" - - client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(binName), as.NewValue(list)) - - received, err := client.Execute(shared.WritePolicy, key, "record_example", "readBin", as.NewValue(binName)) - shared.PanicOnError(err) - - if testEq(received.([]interface{}), list) { - log.Printf("UDF data matched: namespace=%s set=%s key=%s bin=%s value=%s", - key.Namespace(), key.SetName(), key.Value(), binName, received) - } else { - log.Println("UDF data mismatch") - log.Println("Expected ", list) - log.Println("Received ", received) - } -} - -func writeBlobUsingUdf(client *as.Client) { - key, _ := as.NewKey(*shared.Namespace, *shared.Set, "udfkey6") - binName := "udfbin6" - - // Create packed blob using standard java tools. - dos := bytes.Buffer{} - // dos.Write(9845) - dos.WriteString("Hello world.") - blob := dos.Bytes() - - client.Execute(shared.WritePolicy, key, "record_example", "writeBin", as.NewValue(binName), as.NewValue(blob)) - received, err := client.Execute(shared.WritePolicy, key, "record_example", "readBin", as.NewValue(binName)) - shared.PanicOnError(err) - - if bytes.Equal(blob, received.([]byte)) { - log.Printf("Blob data matched: namespace=%s set=%s key=%s bin=%v value=%v", - key.Namespace(), key.SetName(), key.Value(), binName, received) - } else { - log.Fatalf( - "Mismatch: expected=%v received=%v", blob, received) - } -} - -func testEq(a, b []interface{}) bool { - if len(a) != len(b) { - return false - } - - for i := range a { - if a[i] != b[i] { - return false - } - } - - return true -} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_command.go b/aerospike-tls/vendor-aerospike-client-go/execute_command.go deleted file mode 100644 index 9877a70c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/execute_command.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type executeCommand struct { - readCommand - - // overwrite - policy *WritePolicy - packageName string - functionName string - args *ValueArray -} - -func newExecuteCommand( - cluster *Cluster, - policy *WritePolicy, - key *Key, - packageName string, - functionName string, - args *ValueArray, -) (executeCommand, Error) { - var err Error - var partition *Partition - if cluster != nil { - partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) - if err != nil { - return executeCommand{}, err - } - } - - readCommand, err := newReadCommand(cluster, &policy.BasePolicy, key, nil, partition) - if err != nil { - return executeCommand{}, err - } - - return executeCommand{ - readCommand: readCommand, - policy: policy, - packageName: packageName, - functionName: functionName, - args: args, - }, nil -} - -func (cmd *executeCommand) writeBuffer(ifc command) Error { - return cmd.setUdf(cmd.policy, cmd.key, cmd.packageName, cmd.functionName, cmd.args) -} - -func (cmd *executeCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeWrite(cmd.cluster) -} - -func (cmd *executeCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryWrite(isTimeout) - return true -} - -func (cmd *executeCommand) isRead() bool { - return false -} - -func (cmd *executeCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *executeCommand) transactionType() transactionType { - return ttUDF -} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_task.go b/aerospike-tls/vendor-aerospike-client-go/execute_task.go deleted file mode 100644 index 9d441f24..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/execute_task.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "strconv" - "strings" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// ExecuteTask is used to poll for long running server execute job completion. -type ExecuteTask struct { - *baseTask - - taskID uint64 - scan bool - - clnt ClientIfc - - // The following map keeps an account of what nodes were ever observed with the job registered on them. - // If the job was ever observed, the task will return true for it is not found anymore (purged from task queue after completion) - observed map[string]struct{} -} - -// NewExecuteTask initializes task with fields needed to query server nodes. -func NewExecuteTask(cluster *Cluster, statement *Statement) *ExecuteTask { - return &ExecuteTask{ - baseTask: newTask(cluster), - taskID: statement.TaskId, - scan: statement.IsScan(), - observed: make(map[string]struct{}, len(cluster.GetNodes())), - } -} - -// TaskId returns the task id that was sent to the server. -func (etsk *ExecuteTask) TaskId() uint64 { - return etsk.taskID -} - -// IsDone queries all nodes for task completion status. -func (etsk *ExecuteTask) IsDone() (bool, Error) { - if etsk.clnt != nil { - return etsk.grpcIsDone() - } - - var module string - if etsk.scan { - module = "scan" - } else { - module = "query" - } - - taskId := strconv.FormatUint(etsk.taskID, 10) - - cmd1 := "query-show:trid=" + taskId - cmd2 := module + "-show:trid=" + taskId - cmd3 := "jobs:module=" + module + ";cmd=get-job;trid=" + taskId - - nodes := etsk.cluster.GetNodes() - - for _, node := range nodes { - var command string - if node.SupportsPartitionQuery() { - // query-show works for both scan and query. - command = cmd1 - } else if node.SupportsQueryShow() { - command = cmd2 - } else { - command = cmd3 - } - - responseMap, err := node.requestInfoWithRetry(&etsk.cluster.infoPolicy, 5, command) - if err != nil { - return false, err - } - response := responseMap[command] - - if strings.HasPrefix(response, "ERROR:2") { - // If the server node is v6+, it will immediately put the job on queue, so if it is not found, - // it means that it is completed. - if !node.SupportsPartitionQuery() { - // Task not found. On server prior to v6, this could mean task was already completed or not started yet. - // If the job was not observed before, its completion is in doubt. - // Otherwise it means it was completed. - if _, existed := etsk.observed[node.GetName()]; !existed && etsk.retries.Get() < 20 { - // If the job was not found in some nodes, it may mean that the job was not started yet. - // So we will keep retrying. - return false, nil - } - } - - // Assume the task was completed. - continue - } - - if strings.HasPrefix(response, "ERROR:") { - // Mark done and quit immediately. - return false, newError(types.UDF_BAD_RESPONSE, response) - } - - // mark the node as observed - etsk.observed[node.GetName()] = struct{}{} - - find := "status=" - index := strings.Index(response, find) - - if index < 0 { - return false, nil - } - - begin := index + len(find) - response = response[begin:] - find = ":" - index = strings.Index(response, find) - - if index < 0 { - continue - } - - status := strings.ToLower(response[:index]) - if !strings.HasPrefix(status, "done") { - return false, nil - } - } - - return true, nil -} - -// OnComplete returns a channel which will be closed when the task is -// completed. -// If an error is encountered while performing the task, an error -// will be sent on the channel. -func (etsk *ExecuteTask) OnComplete() chan Error { - return etsk.onComplete(etsk) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go b/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go deleted file mode 100644 index cbd62d7b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/execute_task_native.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build !as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -func (etsk *ExecuteTask) grpcIsDone() (bool, Error) { - // should not be called out of the grpc proxy server context - panic("UNREACHABLE") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exists_command.go b/aerospike-tls/vendor-aerospike-client-go/exists_command.go deleted file mode 100644 index 6eebbf9d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exists_command.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// guarantee existsCommand implements command interface -var _ command = &existsCommand{} - -type existsCommand struct { - singleCommand - - policy *BasePolicy - exists bool -} - -func newExistsCommand(cluster *Cluster, policy *BasePolicy, key *Key) (*existsCommand, Error) { - var err Error - var partition *Partition - if cluster != nil { - partition, err = PartitionForRead(cluster, policy, key) - if err != nil { - return nil, err - } - } - - return &existsCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - policy: policy, - }, nil -} - -func (cmd *existsCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *existsCommand) writeBuffer(ifc command) Error { - return cmd.setExists(cmd.policy, cmd.key) -} - -func (cmd *existsCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeRead(cmd.cluster) -} - -func (cmd *existsCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryRead(isTimeout) - return true -} - -func (cmd *existsCommand) parseResult(ifc command, conn *Connection) Error { - // Read header. - if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { - return err - } - - header := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(header); err != nil { - return err - } - - resultCode := cmd.dataBuffer[13] & 0xFF - - switch types.ResultCode(resultCode) { - case 0: - cmd.exists = true - case types.KEY_NOT_FOUND_ERROR: - cmd.exists = false - case types.FILTERED_OUT: - if err := cmd.emptySocket(conn); err != nil { - return err - } - cmd.exists = true - return ErrFilteredOut.err() - default: - return newError(types.ResultCode(resultCode)) - } - - return cmd.emptySocket(conn) -} - -func (cmd *existsCommand) Exists() bool { - return cmd.exists -} - -func (cmd *existsCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *existsCommand) transactionType() transactionType { - return ttExists -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_bit.go b/aerospike-tls/vendor-aerospike-client-go/exp_bit.go deleted file mode 100644 index 9c392915..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_bit.go +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License.package aerospike - -package aerospike - -const bitwiseMODULE = 1 -const bitwiseINT_FLAGS_SIGNED = 1 - -const ( - _BitExpOpRESIZE = 0 - _BitExpOpINSERT = 1 - _BitExpOpREMOVE = 2 - _BitExpOpSET = 3 - _BitExpOpOR = 4 - _BitExpOpXOR = 5 - _BitExpOpAND = 6 - _BitExpOpNOT = 7 - _BitExpOpLSHIFT = 8 - _BitExpOpRSHIFT = 9 - _BitExpOpADD = 10 - _BitExpOpSUBTRACT = 11 - _BitExpOpSETINT = 12 - _BitExpOpGET = 50 - _BitExpOpCOUNT = 51 - _BitExpOpLSCAN = 52 - _BitExpOpRSCAN = 53 - _BitExpOpGETINT = 54 -) - -// ExpBitResize creates an expression that resizes []byte to byteSize according to resizeFlags -// and returns []byte. -func ExpBitResize( - policy *BitPolicy, - byteSize *Expression, - resizeFlags BitResizeFlags, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpRESIZE), - byteSize, - IntegerValue(policy.flags), - IntegerValue(resizeFlags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitInsert creates an expression that inserts value bytes into []byte bin at byteOffset and returns []byte. -func ExpBitInsert( - policy *BitPolicy, - byteOffset *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpINSERT), - byteOffset, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitRemove creates an expression that removes bytes from []byte bin at byteOffset for byteSize and returns []byte. -func ExpBitRemove( - policy *BitPolicy, - byteOffset *Expression, - byteSize *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpREMOVE), - byteOffset, - byteSize, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitSet creates an expression that sets value on []byte bin at bitOffset for bitSize and returns []byte. -func ExpBitSet( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpSET), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitOr creates an expression that performs bitwise "or" on value and []byte bin at bitOffset for bitSize -// and returns []byte. -func ExpBitOr( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpOR), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitXor creates an expression that performs bitwise "xor" on value and []byte bin at bitOffset for bitSize -// and returns []byte. -func ExpBitXor( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpXOR), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitAnd creates an expression that performs bitwise "and" on value and []byte bin at bitOffset for bitSize -// and returns []byte. -// -// bin = [0b00000001, 0b01000010, 0b00000011, 0b00000100, 0b00000101] -// bitOffset = 23 -// bitSize = 9 -// value = [0b00111100, 0b10000000] -// bin result = [0b00000001, 0b01000010, 0b00000010, 0b00000000, 0b00000101] -func ExpBitAnd( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpAND), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitNot creates an expression that negates []byte bin starting at bitOffset for bitSize and returns []byte. -func ExpBitNot( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpNOT), - bitOffset, - bitSize, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitLShift creates an expression that shifts left []byte bin starting at bitOffset for bitSize and returns []byte. -func ExpBitLShift( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - shift *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpLSHIFT), - bitOffset, - bitSize, - shift, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitRShift creates an expression that shifts right []byte bin starting at bitOffset for bitSize and returns []byte. -func ExpBitRShift( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - shift *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpRSHIFT), - bitOffset, - bitSize, - shift, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitAdd creates an expression that adds value to []byte bin starting at bitOffset for bitSize and returns []byte. -// `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. -// If add overflows/underflows, `BitOverflowAction` is used. -func ExpBitAdd( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - signed bool, - action BitOverflowAction, - bin *Expression, -) *Expression { - flags := byte(action) - if signed { - flags |= bitwiseINT_FLAGS_SIGNED - } - args := []ExpressionArgument{ - IntegerValue(_BitExpOpADD), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - IntegerValue(flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitSubtract creates an expression that subtracts value from []byte bin starting at bitOffset for bitSize and returns []byte. -// `BitSize` must be <= 64. Signed indicates if bits should be treated as a signed number. -// If add overflows/underflows, `BitOverflowAction` is used. -func ExpBitSubtract( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - signed bool, - action BitOverflowAction, - bin *Expression, -) *Expression { - flags := byte(action) - if signed { - flags |= bitwiseINT_FLAGS_SIGNED - } - args := []ExpressionArgument{ - IntegerValue(_BitExpOpSUBTRACT), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - IntegerValue(flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitSetInt creates an expression that sets value to []byte bin starting at bitOffset for bitSize and returns []byte. -// `BitSize` must be <= 64. -func ExpBitSetInt( - policy *BitPolicy, - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpSETINT), - bitOffset, - bitSize, - value, - IntegerValue(policy.flags), - } - - return expBitAddWrite(bin, args) -} - -// ExpBitGet creates an expression that returns bits from []byte bin starting at bitOffset for bitSize. -func ExpBitGet( - bitOffset *Expression, - bitSize *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpGET), - bitOffset, - bitSize, - } - - return expBitAddRead(bin, ExpTypeBLOB, args) -} - -// ExpBitCount creates an expression that returns integer count of set bits from []byte bin starting at -// bitOffset for bitSize. -func ExpBitCount( - bitOffset *Expression, - bitSize *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpCOUNT), - bitOffset, - bitSize, - } - - return expBitAddRead(bin, ExpTypeINT, args) -} - -// ExpBitLScan creates an expression that returns integer bit offset of the first specified value bit in []byte bin -// starting at bitOffset for bitSize. -func ExpBitLScan( - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpLSCAN), - bitOffset, - bitSize, - value, - } - - return expBitAddRead(bin, ExpTypeINT, args) -} - -// ExpBitRScan creates an expression that returns integer bit offset of the last specified value bit in []byte bin -// starting at bitOffset for bitSize. -func ExpBitRScan( - bitOffset *Expression, - bitSize *Expression, - value *Expression, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpRSCAN), - bitOffset, - bitSize, - value, - } - - return expBitAddRead(bin, ExpTypeINT, args) -} - -// ExpBitGetInt Create expression that returns integer from []byte bin starting at bitOffset for bitSize. -// Signed indicates if bits should be treated as a signed number. -func ExpBitGetInt( - bitOffset *Expression, - bitSize *Expression, - signed bool, - bin *Expression, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_BitExpOpGETINT), - bitOffset, - bitSize, - } - if signed { - args = append(args, IntegerValue(bitwiseINT_FLAGS_SIGNED)) - } - - return expBitAddRead(bin, ExpTypeINT, args) -} - -func expBitAddWrite(bin *Expression, arguments []ExpressionArgument) *Expression { - flags := int64(bitwiseMODULE | _MODIFY) - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &ExpTypeBLOB, - exps: nil, - arguments: arguments, - } -} - -func expBitAddRead( - bin *Expression, - returnType ExpType, - arguments []ExpressionArgument, -) *Expression { - flags := int64(bitwiseMODULE) - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go deleted file mode 100644 index c0cef8f7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_bit_test.go +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Filters - Bitwise", gg.Ordered, func() { - - const keyCount = 100 - - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - var qpolicy = as.NewQueryPolicy() - - gg.BeforeAll(func() { - for ii := 0; ii < keyCount; ii++ { - key, _ := as.NewKey(ns, set, ii) - bin := as.BinMap{"bin": []byte{0b00000001, 0b01000010}} - client.Delete(wpolicy, key) - err := client.Put(nil, key, bin) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - data := []as.Value{as.NewValue("asd"), as.NewValue(ii)} - data2 := []as.Value{as.NewValue("asd"), as.NewValue(ii), as.NewValue(ii + 1)} - - ops := []*as.Operation{ - as.HLLAddOp( - as.DefaultHLLPolicy(), - "hllbin", - data, - 8, - 0, - ), - as.HLLAddOp( - as.DefaultHLLPolicy(), - "hllbin2", - data2, - 8, - 0, - ), - } - - _, err = client.Operate(nil, key, ops...) - gm.Expect(err).NotTo(gm.HaveOccurred()) - } - }) - - runQuery := func(filter *as.Expression, set_name string) *as.Recordset { - qpolicy.FilterExpression = filter - stmt := as.NewStatement(ns, set_name) - rs, err := client.Query(qpolicy, stmt) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - return rs - } - - countResults := func(rs *as.Recordset) int { - count := 0 - - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - - return count - } - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(16), - as.ExpBlobBin("bin"), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(16), - as.ExpBitResize( - as.DefaultBitPolicy(), - as.ExpIntVal(4), - as.BitResizeFlagsDefault, - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(16), - as.ExpBitInsert( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpBlobVal([]byte{0b11111111}), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(9), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitRemove( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitSet( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobVal([]byte{0b10101010}), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(4), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitOr( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobVal([]byte{0b10101010}), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(5), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitXor( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobVal([]byte{0b10101011}), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(4), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitAnd( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobVal([]byte{0b10101011}), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitNot( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(7), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitLShift( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(16), - as.ExpIntVal(9), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitRShift( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpIntVal(3), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitAdd( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpIntVal(128), - false, - as.BitOverflowActionWrap, - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitSubtract( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpIntVal(1), - false, - as.BitOverflowActionWrap, - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitCount( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBitSetInt( - as.DefaultBitPolicy(), - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpIntVal(255), - as.ExpBlobBin("bin"), - ), - ), - as.ExpIntVal(8), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitGet( - as.ExpIntVal(0), - as.ExpIntVal(8), - as.ExpBlobBin("bin"), - ), - as.ExpBlobVal([]byte{0b00000001}), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitLScan( - as.ExpIntVal(8), - as.ExpIntVal(8), - as.ExpBoolVal(true), - as.ExpBlobBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitRScan( - as.ExpIntVal(8), - as.ExpIntVal(8), - as.ExpBoolVal(true), - as.ExpBlobBin("bin"), - ), - as.ExpIntVal(6), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It(" should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBitGetInt( - as.ExpIntVal(0), - as.ExpIntVal(8), - false, - as.ExpBlobBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_hll.go b/aerospike-tls/vendor-aerospike-client-go/exp_hll.go deleted file mode 100644 index 27764513..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_hll.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -const hllMODULE int64 = 2 - -var ( - _HllExpOpINIT = 0 - _HllExpOpADD = 1 - _HllExpOpCOUNT = 50 - _HllExpOpUNION = 51 - _HllExpOpUNIONCOUNT = 52 - _HllExpOpINTERSECTCOUNT = 53 - _HllExpOpSIMILARITY = 54 - _HllExpOpDESCRIBE = 55 - _HllExpOpMAYCONTAIN = 56 -) - -// ExpHLLInit creates expression that creates a new HLL or resets an existing HLL. -func ExpHLLInit( - policy *HLLPolicy, - indexBitCount *Expression, - bin *Expression, -) *Expression { - return ExpHLLInitWithMinHash(policy, indexBitCount, ExpIntVal(-1), bin) -} - -// ExpHLLInitWithMinHash creates expression that creates a new HLL or resets an existing HLL with minhash bits. -// indexBitCount + minHashBitCount must be <= 64. -func ExpHLLInitWithMinHash( - policy *HLLPolicy, - indexBitCount *Expression, - minHashCount *Expression, - bin *Expression, -) *Expression { - return expHLLAddWrite( - bin, - []ExpressionArgument{ - IntegerValue(_HllExpOpINIT), - indexBitCount, - minHashCount, - IntegerValue(policy.flags), - }, - ) -} - -// ExpHLLAdd creates an expression that adds list values to a HLL set and returns HLL set. -// The function assumes HLL bin already exists. -// indexBitCount + minHashBitCount must be <= 64. -func ExpHLLAdd(policy *HLLPolicy, list *Expression, bin *Expression) *Expression { - return ExpHLLAddWithIndexAndMinHash(policy, list, ExpIntVal(-1), ExpIntVal(-1), bin) -} - -// ExpHLLAddWithIndex creates an expression that adds values to a HLL set and returns HLL set. -// If HLL bin does not exist, use `indexBitCount` to create HLL bin. -func ExpHLLAddWithIndex( - policy *HLLPolicy, - list *Expression, - indexBitCount *Expression, - bin *Expression, -) *Expression { - return ExpHLLAddWithIndexAndMinHash(policy, list, indexBitCount, ExpIntVal(-1), bin) -} - -// ExpHLLAddWithIndexAndMinHash creates an expression that adds values to a HLL set and returns HLL set. If HLL bin does not -// exist, use `indexBitCount` and `minHashBitCount` to create HLL set. -// indexBitCount + minHashBitCount must be <= 64. -func ExpHLLAddWithIndexAndMinHash( - policy *HLLPolicy, - list *Expression, - indexBitCount *Expression, - minHashCount *Expression, - bin *Expression, -) *Expression { - return expHLLAddWrite( - bin, - []ExpressionArgument{ - IntegerValue(_HllExpOpADD), - list, - indexBitCount, - minHashCount, - IntegerValue(policy.flags), - }, - ) -} - -// ExpHLLGetCount creates an expression that returns estimated number of elements in the HLL bin. -func ExpHLLGetCount(bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeINT, - []ExpressionArgument{ - IntegerValue(_HllExpOpCOUNT), - }, - ) -} - -// ExpHLLGetUnion creates an expression that returns a HLL object that is the union of all specified HLL objects -// in the list with the HLL bin. -func ExpHLLGetUnion(list *Expression, bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeHLL, - []ExpressionArgument{ - IntegerValue(_HllExpOpUNION), - list, - }, - ) -} - -// ExpHLLGetUnionCount creates an expression that returns estimated number of elements that would be contained by -// the union of these HLL objects. -func ExpHLLGetUnionCount(list *Expression, bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeINT, - []ExpressionArgument{ - IntegerValue(_HllExpOpUNIONCOUNT), - list, - }, - ) -} - -// ExpHLLGetIntersectCount creates an expression that returns estimated number of elements that would be contained by -// the intersection of these HLL objects. -func ExpHLLGetIntersectCount(list *Expression, bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeINT, - []ExpressionArgument{ - IntegerValue(_HllExpOpINTERSECTCOUNT), - list, - }, - ) -} - -// ExpHLLGetSimilarity creates an expression that returns estimated similarity of these HLL objects as a 64 bit float. -func ExpHLLGetSimilarity(list *Expression, bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeFLOAT, - []ExpressionArgument{ - IntegerValue(_HllExpOpSIMILARITY), - list, - }, - ) -} - -// ExpHLLDescribe creates an expression that returns `indexBitCount` and `minHashBitCount` used to create HLL bin -// in a list of longs. `list[0]` is `indexBitCount` and `list[1]` is `minHashBitCount`. -func ExpHLLDescribe(bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeLIST, - []ExpressionArgument{ - IntegerValue(_HllExpOpDESCRIBE), - }, - ) -} - -// ExpHLLMayContain creates an expression that returns one if HLL bin may contain all items in the list. -func ExpHLLMayContain(list *Expression, bin *Expression) *Expression { - return expHLLAddRead( - bin, - ExpTypeINT, - []ExpressionArgument{ - IntegerValue(_HllExpOpMAYCONTAIN), - list, - }, - ) -} - -func expHLLAddRead( - bin *Expression, - returnType ExpType, - arguments []ExpressionArgument, -) *Expression { - flags := hllMODULE - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} - -func expHLLAddWrite(bin *Expression, arguments []ExpressionArgument) *Expression { - flags := hllMODULE | _MODIFY - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &ExpTypeHLL, - exps: nil, - arguments: arguments, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go deleted file mode 100644 index 9b8410c5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_hll_test.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Filters - HLL", gg.Ordered, func() { - - const keyCount = 100 - - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - var qpolicy = as.NewQueryPolicy() - - gg.BeforeAll(func() { - for ii := 0; ii < keyCount; ii++ { - key, _ := as.NewKey(ns, set, ii) - bin := as.BinMap{"bin": ii, "lbin": []interface{}{ii, "a"}} - client.Delete(wpolicy, key) - err := client.Put(nil, key, bin) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - data := []as.Value{as.NewValue("asd"), as.NewValue(ii)} - data2 := []as.Value{as.NewValue("asd"), as.NewValue(ii), as.NewValue(ii + 1)} - - ops := []*as.Operation{ - as.HLLAddOp( - as.DefaultHLLPolicy(), - "hllbin", - data, - 8, - 0, - ), - as.HLLAddOp( - as.DefaultHLLPolicy(), - "hllbin2", - data2, - 8, - 0, - ), - } - - _, err = client.Operate(nil, key, ops...) - gm.Expect(err).NotTo(gm.HaveOccurred()) - } - }) - - runQuery := func(filter *as.Expression, set_name string) *as.Recordset { - qpolicy.FilterExpression = filter - stmt := as.NewStatement(ns, set_name) - rs, err := client.Query(qpolicy, stmt) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - return rs - } - - countResults := func(rs *as.Recordset) int { - count := 0 - - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - - return count - } - - gg.It("ExpHLLGetCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpHLLGetCount( - as.ExpHLLAddWithIndexAndMinHash( - as.DefaultHLLPolicy(), - as.ExpListVal(as.NewValue(48715414)), - as.ExpIntVal(8), - as.ExpIntVal(0), - as.ExpHLLBin("hllbin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpHLLMayContain should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpHLLMayContain( - as.ExpListVal(as.NewValue(55)), - as.ExpHLLBin("hllbin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpListGetByIndex should work", func() { - rs := runQuery( - as.ExpLess( - as.ExpListGetByIndex( - as.ListReturnTypeValue, - as.ExpTypeINT, - as.ExpIntVal(0), - as.ExpHLLDescribe(as.ExpHLLBin("hllbin")), - ), - as.ExpIntVal(10), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpHLLGetUnion should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpHLLGetCount( - as.ExpHLLGetUnion( - as.ExpHLLBin("hllbin"), - as.ExpHLLBin("hllbin2"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ExpHLLGetUnionCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpHLLGetUnionCount( - as.ExpHLLBin("hllbin"), - as.ExpHLLBin("hllbin2"), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ExpHLLGetIntersectCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpHLLGetIntersectCount( - as.ExpHLLBin("hllbin"), - as.ExpHLLBin("hllbin2"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpHLLGetSimilarity should work", func() { - rs := runQuery( - as.ExpGreater( - as.ExpHLLGetSimilarity( - as.ExpHLLBin("hllbin"), - as.ExpHLLBin("hllbin2"), - ), - as.ExpFloatVal(0.5), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_list.go b/aerospike-tls/vendor-aerospike-client-go/exp_list.go deleted file mode 100644 index a48b0747..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_list.go +++ /dev/null @@ -1,675 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License.package aerospike - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const expListMODULE int64 = 0 - -// ExpListAppend creates an expression that appends value to end of list. -func ExpListAppend( - policy *ListPolicy, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_APPEND), - value, - IntegerValue(policy.attributes), - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListAppendItems creates an expression that appends list items to end of list. -func ExpListAppendItems( - policy *ListPolicy, - list *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_APPEND_ITEMS), - list, - IntegerValue(policy.attributes), - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListInsert creates an expression that inserts value to specified index of list. -func ExpListInsert( - policy *ListPolicy, - index *Expression, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_INSERT), - index, - value, - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListInsertItems creates an expression that inserts each input list item starting at specified index of list. -func ExpListInsertItems( - policy *ListPolicy, - index *Expression, - list *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_INSERT_ITEMS), - index, - list, - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListIncrement creates an expression that increments `list[index]` by value. -// Value expression should resolve to a number. -func ExpListIncrement( - policy *ListPolicy, - index *Expression, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_INCREMENT), - index, - value, - IntegerValue(policy.attributes), - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListSet creates an expression that sets item value at specified index in list. -func ExpListSet( - policy *ListPolicy, - index *Expression, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_SET), - index, - value, - IntegerValue(policy.flags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListClear creates an expression that removes all items in list. -func ExpListClear(bin *Expression, ctx ...*CDTContext) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_CLEAR), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListSort creates an expression that sorts list according to sortFlags. -func ExpListSort( - sortFlags ListSortFlags, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_SORT), - IntegerValue(sortFlags), - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByValue creates an expression that removes list items identified by value. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByValue( - returnType ListReturnType, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_VALUE), - IntegerValue(returnType), - value, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByValueList creates an expression that removes list items identified by values. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByValueList( - returnType ListReturnType, - values *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_LIST), - IntegerValue(returnType), - values, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByValueRange creates an expression that removes list items identified by value range (valueBegin inclusive, valueEnd exclusive). -// If valueBegin is nil, the range is less than valueEnd. If valueEnd is nil, the range is -// greater than equal to valueBegin. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByValueRange( - returnType ListReturnType, - valueBegin *Expression, - valueEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_INTERVAL), - IntegerValue(returnType), - } - if valueBegin != nil { - args = append(args, valueBegin) - } else { - args = append(args, nullValue) - } - if valueEnd != nil { - args = append(args, valueEnd) - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByValueRelativeRankRange creates an expression that removes list items nearest to value and greater by relative rank. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -// -// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: -// -// (value,rank) = [removed items] -// (5,0) = [5,9,11,15] -// (5,1) = [9,11,15] -// (5,-1) = [4,5,9,11,15] -// (3,0) = [4,5,9,11,15] -// (3,3) = [11,15] -// (3,-3) = [0,4,5,9,11,15] -func ExpListRemoveByValueRelativeRankRange( - returnType ListReturnType, - value *Expression, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE), - IntegerValue(returnType), - value, - rank, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByValueRelativeRankRangeCount creates an expression that removes list items nearest to value and greater by relative rank with a count limit. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -// -// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: -// -// (value,rank,count) = [removed items] -// (5,0,2) = [5,9] -// (5,1,1) = [9] -// (5,-1,2) = [4,5] -// (3,0,1) = [4] -// (3,3,7) = [11,15] -// (3,-3,2) = [] -func ExpListRemoveByValueRelativeRankRangeCount( - returnType ListReturnType, - value *Expression, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_VALUE_REL_RANK_RANGE), - IntegerValue(returnType), - value, - rank, - count, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByIndex creates an expression that removes list item identified by index. -func ExpListRemoveByIndex( - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_INDEX), - IntegerValue(ListReturnTypeNone), - index, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByIndexRange creates an expression that removes list items starting at specified index to the end of list. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByIndexRange( - returnType ListReturnType, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_INDEX_RANGE), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByIndexRangeCount creates an expression that removes "count" list items starting at specified index. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByIndexRangeCount( - returnType ListReturnType, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_INDEX_RANGE), - IntegerValue(returnType), - index, - count, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByRank creates an expression that removes list item identified by rank. -func ExpListRemoveByRank( - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_RANK), - IntegerValue(ListReturnTypeNone), - rank, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByRankRange creates an expression that removes list items starting at specified rank to the last ranked item. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByRankRange( - returnType ListReturnType, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_RANK_RANGE), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListRemoveByRankRangeCount creates an expression that removes "count" list items starting at specified rank. -// Valid returnType values are ListReturnTypeNone or ListReturnTypeInverted. -func ExpListRemoveByRankRangeCount( - returnType ListReturnType, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_REMOVE_BY_RANK_RANGE), - IntegerValue(returnType), - rank, - count, - cdtContextList(ctx), - } - return cdtListAddWrite(bin, args, ctx...) -} - -// ExpListSize creates an expression that returns list size. -func ExpListSize(bin *Expression, ctx ...*CDTContext) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_SIZE), - cdtContextList(ctx), - } - return cdtListAddRead(bin, ExpTypeINT, args) -} - -// ExpListGetByValue creates an expression that selects list items identified by value and returns selected -// data specified by returnType. -func ExpListGetByValue( - returnType ListReturnType, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_VALUE), - IntegerValue(returnType), - value, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByValueRange creates an expression that selects list items identified by value range and returns selected data -// specified by returnType. -func ExpListGetByValueRange( - returnType ListReturnType, - valueBegin *Expression, - valueEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(_CDT_LIST_GET_BY_VALUE_INTERVAL), - IntegerValue(returnType), - } - if valueBegin != nil { - args = append(args, valueBegin) - } else { - args = append(args, nullValue) - } - if valueEnd != nil { - args = append(args, valueEnd) - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByValueList creates an expression that selects list items identified by values and returns selected data -// specified by returnType. -func ExpListGetByValueList( - returnType ListReturnType, - values *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_VALUE_LIST), - IntegerValue(returnType), - values, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByValueRelativeRankRange creates an expression that selects list items nearest to value and greater by relative rank -// and returns selected data specified by returnType. -// -// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: -// -// (value,rank) = [selected items] -// (5,0) = [5,9,11,15] -// (5,1) = [9,11,15] -// (5,-1) = [4,5,9,11,15] -// (3,0) = [4,5,9,11,15] -// (3,3) = [11,15] -// (3,-3) = [0,4,5,9,11,15] -func ExpListGetByValueRelativeRankRange( - returnType ListReturnType, - value *Expression, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE), - IntegerValue(returnType), - value, - rank, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByValueRelativeRankRangeCount creates an expression that selects list items nearest to value and greater by relative rank with a count limit -// and returns selected data specified by returnType. -// -// Examples for ordered list \[0, 4, 5, 9, 11, 15\]: -// -// (value,rank,count) = [selected items] -// (5,0,2) = [5,9] -// (5,1,1) = [9] -// (5,-1,2) = [4,5] -// (3,0,1) = [4] -// (3,3,7) = [11,15] -// (3,-3,2) = [] -func ExpListGetByValueRelativeRankRangeCount( - returnType ListReturnType, - value *Expression, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_VALUE_REL_RANK_RANGE), - IntegerValue(returnType), - value, - rank, - count, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByIndex creates an expression that selects list item identified by index and returns -// selected data specified by returnType. -func ExpListGetByIndex( - returnType ListReturnType, - valueType ExpType, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_INDEX), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return cdtListAddRead(bin, valueType, args) -} - -// ExpListGetByIndexRange creates an expression that selects list items starting at specified index to the end of list -// and returns selected data specified by returnType . -func ExpListGetByIndexRange( - returnType ListReturnType, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_INDEX_RANGE), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByIndexRangeCount creates an expression that selects "count" list items starting at specified index -// and returns selected data specified by returnType. -func ExpListGetByIndexRangeCount( - returnType ListReturnType, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_INDEX_RANGE), - IntegerValue(returnType), - index, - count, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByRank creates an expression that selects list item identified by rank and returns selected -// data specified by returnType. -func ExpListGetByRank( - returnType ListReturnType, - valueType ExpType, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_RANK), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return cdtListAddRead(bin, valueType, args) -} - -// ExpListGetByRankRange creates an expression that selects list items starting at specified rank to the last ranked item -// and returns selected data specified by returnType. -func ExpListGetByRankRange( - returnType ListReturnType, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_RANK_RANGE), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -// ExpListGetByRankRangeCount creates an expression that selects "count" list items starting at specified rank and returns -// selected data specified by returnType. -func ExpListGetByRankRangeCount( - returnType ListReturnType, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(_CDT_LIST_GET_BY_RANK_RANGE), - IntegerValue(returnType), - rank, - count, - cdtContextList(ctx), - } - return cdtListAddRead(bin, expListGetValueType(returnType), args) -} - -func cdtListAddRead( - bin *Expression, - returnType ExpType, - arguments []ExpressionArgument, -) *Expression { - flags := expListMODULE - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} - -func cdtListAddWrite( - bin *Expression, - arguments []ExpressionArgument, - ctx ...*CDTContext, -) *Expression { - var returnType ExpType - if len(ctx) == 0 { - returnType = ExpTypeLIST - } else if (ctx[0].Id & ctxTypeListIndex) == 0 { - returnType = ExpTypeMAP - } else { - returnType = ExpTypeLIST - } - - flags := expListMODULE | _MODIFY - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} - -func expListGetValueType(returnType ListReturnType) ExpType { - rt := returnType & (^ListReturnTypeInverted) - switch rt { - case ListReturnTypeIndex, ListReturnTypeReverseIndex, ListReturnTypeRank, ListReturnTypeReverseRank: - // This method only called from expressions that can return multiple integers (ie list). - return ExpTypeLIST - case ListReturnTypeCount: - return ExpTypeINT - - case ListReturnTypeValue: - // This method only called from expressions that can return multiple objects (ie list). - return ExpTypeLIST - - case ListReturnTypeExists: - return ExpTypeBOOL - } - panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid ListReturnType: %d", returnType))) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go deleted file mode 100644 index dd78e7fd..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_list_test.go +++ /dev/null @@ -1,569 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Filters - Lists", gg.Ordered, func() { - - const keyCount = 100 - - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - var qpolicy = as.NewQueryPolicy() - - gg.BeforeAll(func() { - for ii := 0; ii < keyCount; ii++ { - key, _ := as.NewKey(ns, set, ii) - ibin := as.NewBin("bin", []int{1, 2, 3, ii}) - client.Delete(wpolicy, key) - err := client.PutBins(wpolicy, key, ibin) - gm.Expect(err).NotTo(gm.HaveOccurred()) - } - }) - - runQuery := func(filter *as.Expression, set_name string) *as.Recordset { - qpolicy.FilterExpression = filter - stmt := as.NewStatement(ns, set_name) - rs, err := client.Query(qpolicy, stmt) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - return rs - } - - countResults := func(rs *as.Recordset) int { - count := 0 - - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - - return count - } - - gg.It("ExpListAppend should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListAppend( - as.DefaultListPolicy(), - as.ExpIntVal(999), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(5), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListAppendItems should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListAppendItems( - as.DefaultListPolicy(), - as.ExpListVal(as.NewValue(555), as.NewValue("asd")), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(6), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListClear should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListClear(as.ExpListBin("bin")), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ListReturnTypeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByValue( - as.ListReturnTypeCount, - as.ExpIntVal(234), - as.ExpListInsert( - as.DefaultListPolicy(), - as.ExpIntVal(1), - as.ExpIntVal(234), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ListReturnTypeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByValueList( - as.ListReturnTypeCount, - as.ExpListVal(as.NewValue(51), as.NewValue(52)), - as.ExpListBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(2)) - }) - - gg.It("ExpListInsertItems should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListInsertItems( - as.DefaultListPolicy(), - as.ExpIntVal(4), - as.ExpListVal(as.NewValue(222), as.NewValue(223)), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(6), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByIndex( - as.ListReturnTypeValue, - as.ExpTypeINT, - as.ExpIntVal(3), - as.ExpListIncrement( - as.DefaultListPolicy(), - as.ExpIntVal(3), - as.ExpIntVal(100), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(102), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByIndex( - as.ListReturnTypeValue, - as.ExpTypeINT, - as.ExpIntVal(3), - as.ExpListSet( - as.DefaultListPolicy(), - as.ExpIntVal(3), - as.ExpIntVal(100), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(100), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByIndexRangeCount( - as.ListReturnTypeValue, - as.ExpIntVal(2), - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(3), as.NewValue(15)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByIndexRange( - as.ListReturnTypeValue, - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(3), as.NewValue(15)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByRank( - as.ListReturnTypeValue, - as.ExpTypeINT, - as.ExpIntVal(3), - as.ExpListBin("bin"), - ), - as.ExpIntVal(25), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByRankRange( - as.ListReturnTypeValue, - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(3), as.NewValue(25)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByRankRangeCount( - as.ListReturnTypeValue, - as.ExpIntVal(2), - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(3), as.NewValue(3)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByValueRange( - as.ListReturnTypeValue, - as.ExpIntVal(1), - as.ExpIntVal(3), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(1), as.NewValue(2)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ListReturnTypeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByValueRelativeRankRange( - as.ListReturnTypeCount, - as.ExpIntVal(2), - as.ExpIntVal(0), - as.ExpListBin("bin"), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ListReturnTypeValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListGetByValueRelativeRankRangeCount( - as.ListReturnTypeValue, - as.ExpIntVal(2), - as.ExpIntVal(1), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - as.ExpListVal(as.NewValue(3)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpListRemoveByValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByValue( - as.ListReturnTypeNone, - as.ExpIntVal(3), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpListRemoveByValueList should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByValueList( - as.ListReturnTypeNone, - as.ExpListVal(as.NewValue(1), as.NewValue(2)), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ExpListRemoveByValueRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByValueRange( - as.ListReturnTypeNone, - as.ExpIntVal(1), - as.ExpIntVal(3), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ExpListRemoveByValueRelativeRankRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByValueRelativeRankRange( - as.ListReturnTypeNone, - as.ExpIntVal(3), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(97)) - }) - - gg.It("ExpListRemoveByValueRelativeRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByValueRelativeRankRangeCount( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpIntVal(1), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByIndex should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByIndex( - as.ExpIntVal(0), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByIndexRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByIndexRange( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByIndexRangeCount( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByIndexRangeCount( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByRank should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByRank( - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByRankRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByRankRange( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpListRemoveByRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpListSize( - as.ExpListRemoveByRankRangeCount( - as.ListReturnTypeNone, - as.ExpIntVal(2), - as.ExpIntVal(1), - as.ExpListBin("bin"), - ), - ), - as.ExpIntVal(3), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_map.go b/aerospike-tls/vendor-aerospike-client-go/exp_map.go deleted file mode 100644 index 7eb27219..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_map.go +++ /dev/null @@ -1,926 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const expMapMODULE int64 = 0 - -// Map expression generator. See {@link com.aerospike.client.exp.Exp}. -// -// The bin expression argument in these methods can be a reference to a bin or the -// result of another expression. Expressions that modify bin values are only used -// for temporary expression evaluation and are not permanently applied to the bin. -// -// Map modify expressions return the bin's value. This value will be a map except -// when the map is nested within a list. In that case, a list is returned for the -// map modify expression. -// -// Valid map key types are: -// -// String -// Integer -// []byte -// -// The server will validate map key types in an upcoming release. -// -// All maps maintain an index and a rank. The index is the item offset from the start of the map, -// for both unordered and ordered maps. The rank is the sorted index of the value component. -// Map supports negative indexing for index and rank. -// -// Index examples: -// -// Index 0: First item in map. -// Index 4: Fifth item in map. -// Index -1: Last item in map. -// Index -3: Third to last item in map. -// Index 1 Count 2: Second and third items in map. -// Index -3 Count 3: Last three items in map. -// Index -5 Count 4: Range between fifth to last item to second to last item inclusive. -// -// -// Rank examples: -// -// Rank 0: Item with lowest value rank in map. -// Rank 4: Fifth lowest ranked item in map. -// Rank -1: Item with highest ranked value in map. -// Rank -3: Item with third highest ranked value in map. -// Rank 1 Count 2: Second and third lowest ranked items in map. -// Rank -3 Count 3: Top three ranked items in map. -// -// -// Nested expressions are supported by optional CTX context arguments. Example: -// -// bin = {key1={key11=9,key12=4}, key2={key21=3,key22=5}} -// Set map value to 11 for map key "key21" inside of map key "key2". -// Get size of map key2. -// ExpMapSize(ExpMapBin("bin"), CtxMapKey(StringValue("key2")) -// result = 2 - -// ExpMapPut creates an expression that writes key/value item to map bin. -func ExpMapPut( - policy *MapPolicy, - key *Expression, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - var args []ExpressionArgument - op := mapWriteOp(policy, false) - if op == cdtMapOpTypeReplace { - args = []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(op), - key, - value, - } - } else { - args = []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(op), - key, - value, - IntegerValue(policy.attributes.attr), - } - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapPutItems creates an expression that writes each map item to map bin. -func ExpMapPutItems( - policy *MapPolicy, - amap *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - var args []ExpressionArgument - var op = mapWriteOp(policy, true) - if op == cdtMapOpTypeReplace { - args = []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(op), - amap, - } - } else { - args = []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(op), - amap, - IntegerValue(policy.attributes.attr), - } - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapIncrement creates an expression that increments values by incr for all items identified by key. -// Valid only for numbers. -func ExpMapIncrement( - policy *MapPolicy, - key *Expression, - incr *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeIncrement), - key, - incr, - cdtContextList(ctx), - IntegerValue(policy.attributes.attr), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapClear creates an expression that removes all items in map. -func ExpMapClear(bin *Expression, ctx ...*CDTContext) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeClear), - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByKey creates an expression that removes map item identified by key. -func ExpMapRemoveByKey( - key *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByKey), - IntegerValue(MapReturnType.NONE), - key, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByKeyList creates an expression that removes map items identified by keys. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByKeyList( - returnType MapReturnTypes, - keys *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveKeyList), - IntegerValue(returnType), - keys, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByKeyRange creates an expression that removes map items identified by key range (keyBegin inclusive, keyEnd exclusive). -// If keyBegin is nil, the range is less than keyEnd. -// If keyEnd is nil, the range is greater than equal to keyBegin. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByKeyRange( - returnType MapReturnTypes, - keyBegin *Expression, - keyEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - var args = []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(cdtMapOpTypeRemoveByKeyInterval), - IntegerValue(returnType), - } - if keyBegin != nil { - args = append(args, keyBegin) - } else { - args = append(args, nullValue) - } - if keyEnd != nil { - args = append(args, keyEnd) - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByKeyRelativeIndexRange creates an expression that removes map items nearest to key and greater by index. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -// -// Examples for map [{0=17},{4=2},{5=15},{9=10}]: -// -// * (value,index) = [removed items] -// * (5,0) = [{5=15},{9=10}] -// * (5,1) = [{9=10}] -// * (5,-1) = [{4=2},{5=15},{9=10}] -// * (3,2) = [{9=10}] -// * (3,-2) = [{0=17},{4=2},{5=15},{9=10}] -func ExpMapRemoveByKeyRelativeIndexRange( - returnType MapReturnTypes, - key *Expression, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByKeyRelIndexRange), - IntegerValue(returnType), - key, - index, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByKeyRelativeIndexRangeCount creates an expression that removes map items nearest to key and greater by index with a count limit. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -// -// Examples for map [{0=17},{4=2},{5=15},{9=10}]: -// -// (value,index,count) = [removed items] -// * (5,0,1) = [{5=15}] -// * (5,1,2) = [{9=10}] -// * (5,-1,1) = [{4=2}] -// * (3,2,1) = [{9=10}] -// * (3,-2,2) = [{0=17}] -func ExpMapRemoveByKeyRelativeIndexRangeCount( - returnType MapReturnTypes, - key *Expression, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByKeyRelIndexRange), - IntegerValue(returnType), - key, - index, - count, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByValue creates an expression that removes map items identified by value. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByValue( - returnType MapReturnTypes, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByValue), - IntegerValue(returnType), - value, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByValueList creates an expression that removes map items identified by values. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByValueList( - returnType MapReturnTypes, - values *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveValueList), - IntegerValue(returnType), - values, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByValueRange creates an expression that removes map items identified by value range (valueBegin inclusive, valueEnd exclusive). -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByValueRange( - returnType MapReturnTypes, - valueBegin *Expression, - valueEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(cdtMapOpTypeRemoveByValueInterval), - IntegerValue(returnType), - } - if valueBegin != nil { - args = append(args, valueBegin) - } else { - args = append(args, nullValue) - } - if valueEnd != nil { - args = append(args, valueEnd) - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByValueRelativeRankRange creates an expression that removes map items nearest to value and greater by relative rank. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// * (value,rank) = [removed items] -// * (11,1) = [{0=17}] -// * (11,-1) = [{9=10},{5=15},{0=17}] -func ExpMapRemoveByValueRelativeRankRange( - returnType MapReturnTypes, - value *Expression, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByValueRelRankRange), - IntegerValue(returnType), - value, - rank, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByValueRelativeRankRangeCount creates an expression that removes map items nearest to value and greater by relative rank with a count limit. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// * (value,rank,count) = [removed items] -// * (11,1,1) = [{0=17}] -// * (11,-1,1) = [{9=10}] -func ExpMapRemoveByValueRelativeRankRangeCount( - returnType MapReturnTypes, - value *Expression, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByValueRelRankRange), - IntegerValue(returnType), - value, - rank, - count, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByIndex creates an expression that removes map item identified by index. -func ExpMapRemoveByIndex( - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByIndex), - IntegerValue(MapReturnType.NONE), - index, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByIndexRange creates an expression that removes map items starting at specified index to the end of map. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByIndexRange( - returnType MapReturnTypes, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByIndexRange), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByIndexRangeCount creates an expression that removes "count" map items starting at specified index. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByIndexRangeCount( - returnType MapReturnTypes, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByIndexRange), - IntegerValue(returnType), - index, - count, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByRank creates an expression that removes map item identified by rank. -func ExpMapRemoveByRank( - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByRank), - IntegerValue(MapReturnType.NONE), - rank, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByRankRange creates an expression that removes map items starting at specified rank to the last ranked item. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByRankRange( - returnType MapReturnTypes, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByRankRange), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapRemoveByRankRangeCount creates an expression that removes "count" map items starting at specified rank. -// Valid returnType values are MapReturnType.NONE or MapReturnType.INVERTED. -func ExpMapRemoveByRankRangeCount( - returnType MapReturnTypes, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeRemoveByRankRange), - IntegerValue(returnType), - rank, - count, - cdtContextList(ctx), - } - return expMapAddWrite(bin, args, ctx...) -} - -// ExpMapSize creates an expression that returns list size. -func ExpMapSize(bin *Expression, ctx ...*CDTContext) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeSize), - cdtContextList(ctx), - } - return expMapAddRead(bin, ExpTypeINT, args) -} - -// ExpMapGetByKey creates an expression that selects map item identified by key and returns selected data -// specified by returnType. -func ExpMapGetByKey( - returnType MapReturnTypes, - valueType ExpType, - key *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByKey), - IntegerValue(returnType), - key, - cdtContextList(ctx), - } - return expMapAddRead(bin, valueType, args) -} - -// ExpMapGetByKeyRange creates an expression that selects map items identified by key range (keyBegin inclusive, keyEnd exclusive). -// If keyBegin is nil, the range is less than keyEnd. -// If keyEnd is nil, the range is greater than equal to keyBegin. -// Expression returns selected data specified by returnType. -func ExpMapGetByKeyRange( - returnType MapReturnTypes, - keyBegin *Expression, - keyEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(cdtMapOpTypeGetByKeyInterval), - IntegerValue(returnType), - } - if keyBegin != nil { - args = append(args, keyBegin) - } else { - args = append(args, nullValue) - } - if keyEnd != nil { - args = append(args, keyEnd) - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByKeyList creates an expression that selects map items identified by keys and returns selected data specified by returnType -func ExpMapGetByKeyList( - returnType MapReturnTypes, - keys *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByKeyList), - IntegerValue(returnType), - keys, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByKeyRelativeIndexRange creates an expression that selects map items nearest to key and greater by index. -// Expression returns selected data specified by returnType. -// -// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: -// -// * (value,index) = [selected items] -// * (5,0) = [{5=15},{9=10}] -// * (5,1) = [{9=10}] -// * (5,-1) = [{4=2},{5=15},{9=10}] -// * (3,2) = [{9=10}] -// * (3,-2) = [{0=17},{4=2},{5=15},{9=10}] -func ExpMapGetByKeyRelativeIndexRange( - returnType MapReturnTypes, - key *Expression, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByKeyRelIndexRange), - IntegerValue(returnType), - key, - index, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByKeyRelativeIndexRangeCount creates an expression that selects map items nearest to key and greater by index with a count limit. -// Expression returns selected data specified by returnType. -// -// Examples for ordered map [{0=17},{4=2},{5=15},{9=10}]: -// -// * (value,index,count) = [selected items] -// * (5,0,1) = [{5=15}] -// * (5,1,2) = [{9=10}] -// * (5,-1,1) = [{4=2}] -// * (3,2,1) = [{9=10}] -// * (3,-2,2) = [{0=17}] -func ExpMapGetByKeyRelativeIndexRangeCount( - returnType MapReturnTypes, - key *Expression, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByKeyRelIndexRange), - IntegerValue(returnType), - key, - index, - count, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByValue creates an expression that selects map items identified by value and returns selected data -// specified by returnType. -func ExpMapGetByValue( - returnType MapReturnTypes, - value *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByValue), - IntegerValue(returnType), - value, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByValueRange creates an expression that selects map items identified by value range (valueBegin inclusive, valueEnd exclusive) -// If valueBegin is nil, the range is less than valueEnd. -// If valueEnd is nil, the range is greater than equal to valueBegin. -// -// Expression returns selected data specified by returnType. -func ExpMapGetByValueRange( - returnType MapReturnTypes, - valueBegin *Expression, - valueEnd *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - cdtContextList(ctx), - IntegerValue(cdtMapOpTypeGetByValueInterval), - IntegerValue(returnType), - } - if valueBegin != nil { - args = append(args, valueBegin) - } else { - args = append(args, nullValue) - } - if valueEnd != nil { - args = append(args, valueEnd) - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByValueList creates an expression that selects map items identified by values and returns selected data specified by returnType. -func ExpMapGetByValueList( - returnType MapReturnTypes, - values *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByValueList), - IntegerValue(returnType), - values, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByValueRelativeRankRange creates an expression that selects map items nearest to value and greater by relative rank. -// Expression returns selected data specified by returnType. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// * (value,rank) = [selected items] -// * (11,1) = [{0=17}] -// * (11,-1) = [{9=10},{5=15},{0=17}] -func ExpMapGetByValueRelativeRankRange( - returnType MapReturnTypes, - value *Expression, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByValueRelRankRange), - IntegerValue(returnType), - value, - rank, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByValueRelativeRankRangeCount creates an expression that selects map items nearest to value and greater by relative rank with a count limit. -// Expression returns selected data specified by returnType. -// -// Examples for map [{4=2},{9=10},{5=15},{0=17}]: -// -// * (value,rank,count) = [selected items] -// * (11,1,1) = [{0=17}] -// * (11,-1,1) = [{9=10}] -func ExpMapGetByValueRelativeRankRangeCount( - returnType MapReturnTypes, - value *Expression, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByValueRelRankRange), - IntegerValue(returnType), - value, - rank, - count, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByIndex creates an expression that selects map item identified by index and returns selected data specified by returnType. -func ExpMapGetByIndex( - returnType MapReturnTypes, - valueType ExpType, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByIndex), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return expMapAddRead(bin, valueType, args) -} - -// ExpMapGetByIndexRange creates an expression that selects map items starting at specified index to the end of map and returns selected -// data specified by returnType. -func ExpMapGetByIndexRange( - returnType MapReturnTypes, - index *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByIndexRange), - IntegerValue(returnType), - index, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByIndexRangeCount creates an expression that selects "count" map items starting at specified index and returns selected data -// specified by returnType. -func ExpMapGetByIndexRangeCount( - returnType MapReturnTypes, - index *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByIndexRange), - IntegerValue(returnType), - index, - count, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByRank creates an expression that selects map item identified by rank and returns selected data specified by returnType. -func ExpMapGetByRank( - returnType MapReturnTypes, - valueType ExpType, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByRank), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return expMapAddRead(bin, valueType, args) -} - -// ExpMapGetByRankRange creates an expression that selects map items starting at specified rank to the last ranked item and -// returns selected data specified by returnType. -func ExpMapGetByRankRange( - returnType MapReturnTypes, - rank *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByRankRange), - IntegerValue(returnType), - rank, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -// ExpMapGetByRankRangeCount creates an expression that selects "count" map items starting at specified rank and returns selected -// data specified by returnType. -func ExpMapGetByRankRangeCount( - returnType MapReturnTypes, - rank *Expression, - count *Expression, - bin *Expression, - ctx ...*CDTContext, -) *Expression { - args := []ExpressionArgument{ - IntegerValue(cdtMapOpTypeGetByRankRange), - IntegerValue(returnType), - rank, - count, - cdtContextList(ctx), - } - return expMapAddRead(bin, expMapGetValueType(returnType), args) -} - -func expMapAddRead( - bin *Expression, - returnType ExpType, - arguments []ExpressionArgument, -) *Expression { - flags := expMapMODULE - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} - -func expMapAddWrite( - bin *Expression, - arguments []ExpressionArgument, - ctx ...*CDTContext, -) *Expression { - var returnType ExpType - if len(ctx) == 0 { - returnType = ExpTypeMAP - } else if (ctx[0].Id & ctxTypeListIndex) == 0 { - returnType = ExpTypeMAP - } else { - returnType = ExpTypeLIST - } - - flags := expMapMODULE | _MODIFY - return &Expression{ - cmd: &expOpCALL, - val: nil, - bin: bin, - flags: &flags, - module: &returnType, - exps: nil, - arguments: arguments, - } -} - -func expMapGetValueType(returnType mapReturnType) ExpType { - t := returnType & (^MapReturnType.INVERTED) - switch t { - case MapReturnType.INDEX, MapReturnType.REVERSE_INDEX, MapReturnType.RANK, MapReturnType.REVERSE_RANK: - // This method only called from expressions that can return multiple integers (ie list). - return ExpTypeLIST - - case MapReturnType.COUNT: - return ExpTypeINT - case MapReturnType.KEY, MapReturnType.VALUE: - // This method only called from expressions that can return multiple objects (ie list). - return ExpTypeLIST - - case MapReturnType.KEY_VALUE, MapReturnType.ORDERED_MAP, MapReturnType.UNORDERED_MAP: - return ExpTypeMAP - - case MapReturnType.EXISTS: - return ExpTypeBOOL - - } - panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid MapReturnType: %d", returnType))) -} - -// Determines the correct operation to use when setting one or more map values, depending on the -// map policy. -func mapWriteOp(policy *MapPolicy, multi bool) int { - switch policy.flags { - default: - fallthrough - case MapWriteFlagsDefault: - if multi { - return cdtMapOpTypePutItems - } - return cdtMapOpTypePut - case MapWriteFlagsUpdateOnly: - if multi { - return cdtMapOpTypeReplaceItems - } - return cdtMapOpTypeReplace - case MapWriteFlagsCreateOnly: - if multi { - return cdtMapOpTypeAddItems - } - return cdtMapOpTypeAdd - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go deleted file mode 100644 index fa7f7633..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_map_test.go +++ /dev/null @@ -1,674 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Filters - Maps", gg.Ordered, func() { - - const keyCount = 100 - - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - var qpolicy = as.NewQueryPolicy() - - gg.BeforeAll(func() { - for ii := 0; ii < keyCount; ii++ { - key, _ := as.NewKey(ns, set, ii) - ibin := as.BinMap{"bin": map[string]interface{}{"test": ii, "test2": "a"}} - client.Delete(wpolicy, key) - err := client.Put(wpolicy, key, ibin) - gm.Expect(err).NotTo(gm.HaveOccurred()) - } - }) - - runQuery := func(filter *as.Expression, set_name string) *as.Recordset { - qpolicy.FilterExpression = filter - stmt := as.NewStatement(ns, set_name) - rs, err := client.Query(qpolicy, stmt) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - return rs - } - - countResults := func(rs *as.Recordset) int { - count := 0 - - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - - return count - } - - gg.It("ExpMapGetByKey should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByKey( - as.MapReturnType.VALUE, - as.ExpTypeINT, - as.ExpStringVal("test3"), - as.ExpMapPut( - as.DefaultMapPolicy(), - as.ExpStringVal("test3"), - as.ExpIntVal(999), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(999), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByKeyList should work", func() { - amap := map[interface{}]interface{}{ - "test4": 333, - "test5": 444, - } - rs := runQuery( - as.ExpEq( - as.ExpMapGetByKeyList( - as.MapReturnType.VALUE, - as.ExpListVal(as.NewValue("test4"), as.NewValue("test5")), - as.ExpMapPutItems( - as.DefaultMapPolicy(), - as.ExpMapVal(amap), - as.ExpMapBin("bin"), - ), - ), - as.ExpListVal(as.NewValue(333), as.NewValue(444)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValue( - as.MapReturnType.COUNT, - as.ExpIntVal(5), - as.ExpMapIncrement( - as.DefaultMapPolicy(), - as.ExpStringVal("test"), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapClear should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapClear(as.ExpMapBin("bin")), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByValueList should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueList( - as.MapReturnType.COUNT, - as.ExpListVal(as.NewValue(1), as.NewValue("a")), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapGetByValueRelativeRankRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRelativeRankRange( - as.MapReturnType.COUNT, - as.ExpIntVal(1), - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRelativeRankRangeCount( - as.MapReturnType.COUNT, - as.ExpIntVal(1), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRelativeRankRangeCount( - as.MapReturnType.COUNT, - as.ExpIntVal(1), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRelativeRankRangeCount( - as.MapReturnType.COUNT, - as.ExpIntVal(1), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByValueRelativeRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRelativeRankRangeCount( - as.MapReturnType.COUNT, - as.ExpIntVal(1), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByIndex should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByIndex( - as.MapReturnType.VALUE, - as.ExpTypeINT, - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapGetByIndexRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByIndexRange( - as.MapReturnType.COUNT, - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByIndexRangeCount( - as.MapReturnType.VALUE, - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpListVal(as.NewValue(2)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapGetByRank should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByRank( - as.MapReturnType.VALUE, - as.ExpTypeINT, - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapGetByRankRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByRankRange( - as.MapReturnType.VALUE, - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpListVal(as.NewValue("a")), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByRankRangeCount( - as.MapReturnType.VALUE, - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpListVal(as.NewValue(15)), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapGetByValueRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByValueRange( - as.MapReturnType.COUNT, - as.ExpIntVal(0), - as.ExpIntVal(18), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(18)) - }) - - gg.It("ExpMapGetByKeyRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByKeyRange( - as.MapReturnType.COUNT, - nil, - as.ExpStringVal("test25"), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByKeyRelativeIndexRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByKeyRelativeIndexRange( - as.MapReturnType.COUNT, - as.ExpStringVal("test"), - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapGetByKeyRelativeIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapGetByKeyRelativeIndexRangeCount( - as.MapReturnType.COUNT, - as.ExpStringVal("test"), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByKey should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByKey( - as.ExpStringVal("test"), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByKeyList should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByKeyList( - as.MapReturnType.NONE, - as.ExpListVal(as.NewValue("test"), as.NewValue("test2")), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByKeyRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByKeyRange( - as.MapReturnType.NONE, - as.ExpStringVal("test"), - nil, - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByKeyRelativeIndexRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByKeyRelativeIndexRange( - as.MapReturnType.NONE, - as.ExpStringVal("test"), - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByKeyRelativeIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByKeyRelativeIndexRangeCount( - as.MapReturnType.NONE, - as.ExpStringVal("test"), - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByValue should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByValue( - as.MapReturnType.NONE, - as.ExpIntVal(5), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapRemoveByValueList should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByValueList( - as.MapReturnType.NONE, - as.ExpListVal(as.NewValue("a"), as.NewValue(15)), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpMapRemoveByValueRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByValueRange( - as.MapReturnType.NONE, - as.ExpIntVal(5), - as.ExpIntVal(15), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(10)) - }) - - gg.It("ExpMapRemoveByIndex should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByIndex( - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByIndexRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByIndexRange( - as.MapReturnType.NONE, - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByIndexRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByIndexRangeCount( - as.MapReturnType.NONE, - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByRank should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByRank( - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByRankRange should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByRankRange( - as.MapReturnType.NONE, - as.ExpIntVal(0), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapRemoveByRankRangeCount should work", func() { - rs := runQuery( - as.ExpEq( - as.ExpMapSize( - as.ExpMapRemoveByRankRangeCount( - as.MapReturnType.NONE, - as.ExpIntVal(0), - as.ExpIntVal(1), - as.ExpMapBin("bin"), - ), - ), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_operation.go b/aerospike-tls/vendor-aerospike-client-go/exp_operation.go deleted file mode 100644 index e3d5d291..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_operation.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License.package aerospike - -package aerospike - -// ExpReadFlags is used to change mode in expression reads. -type ExpReadFlags int - -const ( - // ExpReadFlagDefault is the default - ExpReadFlagDefault ExpReadFlags = 0 - - // ExpReadFlagEvalNoFail means: - // Ignore failures caused by the expression resolving to unknown or a non-bin type. - ExpReadFlagEvalNoFail ExpReadFlags = 1 << 4 -) - -// ExpWriteFlags is used to change mode in expression writes. -type ExpWriteFlags int - -// Expression write Flags -const ( - // ExpWriteFlagDefault is the default. Allows create or update. - ExpWriteFlagDefault ExpWriteFlags = 0 - - // ExpWriteFlagCreateOnly means: - // If bin does not exist, a new bin will be created. - // If bin exists, the operation will be denied. - // If bin exists, fail with Bin Exists - ExpWriteFlagCreateOnly ExpWriteFlags = 1 << 0 - - // ExpWriteFlagUpdateOnly means: - // If bin exists, the bin will be overwritten. - // If bin does not exist, the operation will be denied. - // If bin does not exist, fail with Bin Not Found - ExpWriteFlagUpdateOnly ExpWriteFlags = 1 << 1 - - // ExpWriteFlagAllowDelete means: - // If expression results in nil value, then delete the bin. - // Otherwise, return OP Not Applicable when NoFail is not set - ExpWriteFlagAllowDelete ExpWriteFlags = 1 << 2 - - // ExpWriteFlagPolicyNoFail means: - // Do not raise error if operation is denied. - ExpWriteFlagPolicyNoFail ExpWriteFlags = 1 << 3 - - // ExpWriteFlagEvalNoFail means: - // Ignore failures caused by the expression resolving to unknown or a non-bin type. - ExpWriteFlagEvalNoFail ExpWriteFlags = 1 << 4 -) - -// ExpWriteOp creates an operation with an expression that writes to record bin. -func ExpWriteOp(binName string, exp *Expression, flags ExpWriteFlags) *Operation { - val, err := encodeExpOperation(exp, int(flags)) - if err != nil { - panic(err) - } - return &Operation{ - opType: _EXP_MODIFY, - binName: binName, - binValue: NewValue(val), - encoder: nil, - } -} - -// ExpReadOp creates an operation with an expression that reads from a record. -func ExpReadOp(name string, exp *Expression, flags ExpReadFlags) *Operation { - val, err := encodeExpOperation(exp, int(flags)) - if err != nil { - panic(err) - } - return &Operation{ - opType: _EXP_READ, - binName: name, - binValue: NewValue(val), - encoder: nil, - } -} - -// newExpOperationEncoder is used to encode the operation expression wire protocol -func encodeExpOperation(exp *Expression, flags int) ([]byte, Error) { - // expression is double packed: first normally, and then as a BLOB in operation - // find the size of packed expression and pack it in temp buffer - tsz, err := exp.size() - if err != nil { - return nil, err - } - - // header + packed bytes + flags = 16 + len bytes max - buf := newBuffer(tsz + 16) - - if _, err = packArrayBegin(buf, 2); err != nil { - return nil, err - } - - if _, err = exp.pack(buf); err != nil { - return nil, err - } - - if _, err = packAInt(buf, flags); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go b/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go deleted file mode 100644 index 2b62ba64..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/exp_ops_test.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "errors" - "sync" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -const udfPredexpBody = `local function putBin(r,name,value) - if not aerospike:exists(r) then aerospike:create(r) end - r[name] = value - aerospike:update(r) -end - --- Set a particular bin -function writeBin(r,name,value) - putBin(r,name,value) -end - --- Get a particular bin -function readBin(r,name) - return r[name] -end - --- Return generation count of record -function getGeneration(r) - return record.gen(r) -end - --- Update record only if gen hasn't changed -function writeIfGenerationNotChanged(r,name,value,gen) - if record.gen(r) == gen then - r[name] = value - aerospike:update(r) - end -end - --- Set a particular bin only if record does not already exist. -function writeUnique(r,name,value) - if not aerospike:exists(r) then - aerospike:create(r) - r[name] = value - aerospike:update(r) - end -end - --- Validate value before writing. -function writeWithValidation(r,name,value) - if (value >= 1 and value <= 10) then - putBin(r,name,value) - else - error("1000:Invalid value") - end -end - --- Record contains two integer bins, name1 and name2. --- For name1 even integers, add value to existing name1 bin. --- For name1 integers with a multiple of 5, delete name2 bin. --- For name1 integers with a multiple of 9, delete record. -function processRecord(r,name1,name2,addValue) - local v = r[name1] - - if (v % 9 == 0) then - aerospike:remove(r) - return - end - - if (v % 5 == 0) then - r[name2] = nil - aerospike:update(r) - return - end - - if (v % 2 == 0) then - r[name1] = v + addValue - aerospike:update(r) - end -end - --- Append to end of regular list bin -function appendListBin(r, binname, value) - local l = r[binname] - - if l == nil then - l = list() - end - - list.append(l, value) - r[binname] = l - aerospike:update(r) -end - --- Set expiration of record --- function expire(r,ttl) --- if record.ttl(r) == gen then --- r[name] = value --- aerospike:update(r) --- end --- end -` - -var _ = gg.Describe("PredExp in Transactions Test", func() { - - gg.BeforeEach(func() { - if !isEnterpriseEdition() { - gg.Skip("Predexp Tests for All transactions are not supported in the Community Edition.") - return - } - }) - - gg.BeforeEach(func() { - if serverIsNewerThan("5.8") { - gg.Skip("Server has removed Predexp") - return - } - }) - - var udfReg sync.Once - - var registerUDF = func() { - udfReg.Do(func() { - regTask, err := client.RegisterUDF(nil, []byte(udfPredexpBody), "udf1.lua", as.LUA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - gm.Expect(<-regTask.OnComplete()).NotTo(gm.HaveOccurred()) - }) - } - - // connection data - var ns = *namespace - var set string - var keyA, keyB *as.Key - - set = randString(50) - keyA, _ = as.NewKey(ns, set, randString(50)) - keyB, _ = as.NewKey(ns, set, randString(50)) - - var binAName string - - var predAEq1WPolicy *as.WritePolicy - var predAEq1BPolicy *as.BatchPolicy - var predAEq1RPolicy *as.BasePolicy - - var binA1 *as.Bin - var binA2 *as.Bin - var binA3 *as.Bin - - binAName = "binAName" - binA1 = as.NewBin(binAName, 1) - binA2 = as.NewBin(binAName, 2) - binA3 = as.NewBin(binAName, 3) - - gg.Describe("PredExp in Transactions Test", func() { - - gg.AfterEach(func() { - _, err := client.Delete(nil, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - _, err = client.Delete(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.BeforeEach(func() { - predAEq1WPolicy = as.NewWritePolicy(0, 0) - predAEq1BPolicy = as.NewBatchPolicy() - predAEq1RPolicy = as.NewPolicy() - - predAEq1BPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) - predAEq1RPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) - predAEq1WPolicy.FilterExpression = as.ExpEq(as.ExpIntBin(binAName), as.ExpIntVal(1)) - - _, err := client.Delete(nil, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - _, err = client.Delete(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(nil, keyA, binA1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.PutBins(nil, keyB, binA2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("should work for Put", func() { - err := client.PutBins(predAEq1WPolicy, keyA, binA3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - r, err := client.Get(nil, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) - - client.PutBins(predAEq1WPolicy, keyB, binA3) - r, err = client.Get(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) - }) - - gg.It("should work for Put Except...", func() { - err := client.PutBins(predAEq1WPolicy, keyA, binA3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(predAEq1WPolicy, keyB, binA3) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for Get", func() { - r, err := client.Get(predAEq1RPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) - - r, err = client.Get(predAEq1RPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - gm.Expect(r).To(gm.BeNil()) - }) - - gg.It("should work for Get Except...", func() { - _, err := client.Get(predAEq1RPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Get(predAEq1RPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for BatchGet", func() { - keys := []*as.Key{keyA, keyB} - - records, err := client.BatchGet(predAEq1BPolicy, keys) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(errors.Is(err, as.ErrFilteredOut)).To(gm.BeTrue()) - - gm.Expect(records[0].Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) - gm.Expect(records[1]).To(gm.BeNil()) - }) - - gg.It("should work for Delete", func() { - existed, err := client.Delete(predAEq1WPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(existed).To(gm.BeTrue()) - - _, err = client.Get(nil, keyA) - gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) - - _, err = client.Delete(predAEq1WPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - - r, err = client.Get(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) - }) - - gg.It("should work for Delete Except...", func() { - _, err := client.Delete(predAEq1WPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Delete(predAEq1WPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for Durable Delete", func() { - predAEq1WPolicy.DurableDelete = true - - _, err := client.Delete(predAEq1WPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - r, err := client.Get(nil, keyA) - gm.Expect(errors.Is(err, as.ErrKeyNotFound)).To(gm.BeTrue()) - gm.Expect(r).To(gm.BeNil()) - - _, err = client.Delete(predAEq1WPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - - r, err = client.Get(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) - }) - - gg.It("should work for Durable Delete Except...", func() { - predAEq1WPolicy.DurableDelete = true - - _, err := client.Delete(predAEq1WPolicy, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Delete(predAEq1WPolicy, keyB) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for Operate Read", func() { - r, err := client.Operate(predAEq1WPolicy, keyA, as.GetBinOp(binAName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(r.Bins[binA1.Name]).To(gm.Equal(binA1.Value.GetObject())) - - r, err = client.Operate(predAEq1WPolicy, keyB, as.GetBinOp(binAName)) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - gm.Expect(r).To(gm.BeNil()) - }) - - gg.It("should work for Operate Read Except...", func() { - _, err := client.Operate(predAEq1WPolicy, keyA, as.GetBinOp(binAName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Operate(predAEq1WPolicy, keyB, as.GetBinOp(binAName)) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for Operate Write", func() { - r, err := client.Operate(predAEq1WPolicy, keyA, as.PutOp(binA3), as.GetBinOp(binAName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) - - r, err = client.Operate(predAEq1WPolicy, keyB, as.PutOp(binA3), as.GetBinOp(binAName)) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - gm.Expect(r).To(gm.BeNil()) - }) - - gg.It("should work for Operate Write Except...", func() { - _, err := client.Operate(predAEq1WPolicy, keyA, as.PutOp(binA3), as.GetBinOp(binAName)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Operate(predAEq1WPolicy, keyB, as.PutOp(binA3), as.GetBinOp(binAName)) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - gg.It("should work for UDF", func() { - registerUDF() - - _, err := client.Execute(predAEq1WPolicy, keyA, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - r, err := client.Get(nil, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(r.Bins[binA3.Name]).To(gm.Equal(binA3.Value.GetObject())) - - _, err = client.Execute(predAEq1WPolicy, keyB, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - - r, err = client.Get(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins[binA2.Name]).To(gm.Equal(binA2.Value.GetObject())) - }) - - gg.It("should work for UDF Except...", func() { - registerUDF() - - _, err := client.Execute(predAEq1WPolicy, keyA, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Execute(predAEq1WPolicy, keyB, "udf1", "writeBin", as.StringValue(binA3.Name), binA3.Value) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - }) - - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/expression.go b/aerospike-tls/vendor-aerospike-client-go/expression.go deleted file mode 100644 index 89a2bfd7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/expression.go +++ /dev/null @@ -1,1430 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License.package aerospike - -package aerospike - -import ( - "encoding/base64" - - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" -) - -// ExpressionArgument is used for passing arguments to filter expressions. -// The accptable arguments are: -// Value, ExpressionFilter, []*CDTContext -type ExpressionArgument interface { - pack(BufferEx) (int, Error) -} - -// ExpType defines the expression's data type. -type ExpType uint - -var ( - // ExpTypeNIL is NIL Expression Type - ExpTypeNIL ExpType = 0 - // ExpTypeBOOL is BOOLEAN Expression Type - ExpTypeBOOL ExpType = 1 - // ExpTypeINT is INTEGER Expression Type - ExpTypeINT ExpType = 2 - // ExpTypeSTRING is STRING Expression Type - ExpTypeSTRING ExpType = 3 - // ExpTypeLIST is LIST Expression Type - ExpTypeLIST ExpType = 4 - // ExpTypeMAP is MAP Expression Type - ExpTypeMAP ExpType = 5 - // ExpTypeBLOB is BLOB Expression Type - ExpTypeBLOB ExpType = 6 - // ExpTypeFLOAT is FLOAT Expression Type - ExpTypeFLOAT ExpType = 7 - // ExpTypeGEO is GEO String Expression Type - ExpTypeGEO ExpType = 8 - // ExpTypeHLL is HLL Expression Type - ExpTypeHLL ExpType = 9 -) - -type expOp uint - -var ( - expOpUnknown expOp = 0 - expOpEQ expOp = 1 - expOpNE expOp = 2 - expOpGT expOp = 3 - expOpGE expOp = 4 - expOpLT expOp = 5 - expOpLE expOp = 6 - expOpREGEX expOp = 7 - expOpGEO expOp = 8 - expOpAND expOp = 16 - expOpOR expOp = 17 - expOpNOT expOp = 18 - expOpExclusive expOp = 19 - expOpAdd expOp = 20 - expOpSub expOp = 21 - expOpMul expOp = 22 - expOpDiv expOp = 23 - expOpPow expOp = 24 - expOpLog expOp = 25 - expOpMod expOp = 26 - expOpAbs expOp = 27 - expOpFloor expOp = 28 - expOpCeil expOp = 29 - expOpToInt expOp = 30 - expOpToFloat expOp = 31 - expOpIntAnd expOp = 32 - expOpIntOr expOp = 33 - expOpIntXor expOp = 34 - expOpIntNot expOp = 35 - expOpIntLShift expOp = 36 - expOpIntRShift expOp = 37 - expOpIntARShift expOp = 38 - expOpIntCount expOp = 39 - expOpIntLscan expOp = 40 - expOpIntRscan expOp = 41 - expOpMin expOp = 50 - expOpMax expOp = 51 - expOpDIGEST_MODULO expOp = 64 - expOpDEVICE_SIZE expOp = 65 - expOpLAST_UPDATE expOp = 66 - expOpSINCE_UPDATE expOp = 67 - expOpVOID_TIME expOp = 68 - expOpTTL expOp = 69 - expOpSET_NAME expOp = 70 - expOpKEY_EXISTS expOp = 71 - expOpIS_TOMBSTONE expOp = 72 - expOpMEMORY_SIZE expOp = 73 - expOpRECORD_SIZE expOp = 74 - expOpKEY expOp = 80 - expOpBIN expOp = 81 - expOpBIN_TYPE expOp = 82 - expOpCond expOp = 123 - expOpVar expOp = 124 - expOpLet expOp = 125 - expOpQUOTED expOp = 126 - expOpCALL expOp = 127 -) - -const _MODIFY = 0x40 - -// ExpRegexFlags is used to change the Regex Mode in Expression Filters. -type ExpRegexFlags int - -const ( - // ExpRegexFlagNONE uses regex defaults. - ExpRegexFlagNONE ExpRegexFlags = 0 - - // ExpRegexFlagEXTENDED uses POSIX Extended Regular Expression syntax when interpreting regex. - ExpRegexFlagEXTENDED ExpRegexFlags = 1 << 0 - - // ExpRegexFlagICASE does not differentiate cases. - ExpRegexFlagICASE ExpRegexFlags = 1 << 1 - - // ExpRegexFlagNOSUB does not report position of matches. - ExpRegexFlagNOSUB ExpRegexFlags = 1 << 2 - - // ExpRegexFlagNEWLINE does not Match-any-character operators don't match a newline. - ExpRegexFlagNEWLINE ExpRegexFlags = 1 << 3 -) - -// Expression which can be applied to most commands, to control which records are -// affected by the command. -type Expression struct { - // The Operation code - cmd *expOp - // The Primary Value of the Operation - val Value - // The Bin to use it on (REGEX for example) - bin *Expression - // The additional flags for the Operation (REGEX or return_type of Module for example) - flags *int64 - // The optional Module flag for Module operations or Bin Types - module *ExpType - // Sub commands for the CmdExp operation - exps []*Expression - - arguments []ExpressionArgument - - // ready to use buffer to write directly on the wire - bytes []byte -} - -func newFilterExpression( - cmd *expOp, - val Value, - bin *Expression, - flags *int64, - module *ExpType, - exps []*Expression, -) *Expression { - return &Expression{ - cmd: cmd, - val: val, - bin: bin, - flags: flags, - module: module, - exps: exps, - arguments: nil, - } -} - -func (fe *Expression) packExpression( - exps []*Expression, - buf BufferEx, -) (int, Error) { - size := 0 - - if fe.val != nil { - // DEF expression - sz, err := packRawString(buf, fe.val.String()) - size += sz - if err != nil { - return size, err - } - - sz, err = exps[0].pack(buf) - size += sz - if err != nil { - return size, err - } - } else { - if fe.cmd == &expOpLet { - // Let wire format: LET , , , , ..., - count := (len(exps)-1)*2 + 2 - sz, err := packArrayBegin(buf, count) - size += sz - if err != nil { - return size, err - } - } else { - sz, err := packArrayBegin(buf, len(exps)+1) - size += sz - if err != nil { - return size, err - } - } - - sz, err := packAInt64(buf, int64(*fe.cmd)) - size += sz - if err != nil { - return size, err - } - - for _, exp := range exps { - sz, err = exp.pack(buf) - size += sz - if err != nil { - return size, err - } - } - } - return size, nil -} - -func (fe *Expression) packCommand(cmd *expOp, buf BufferEx) (int, Error) { - size := 0 - - switch cmd { - case &expOpREGEX: - sz, err := packArrayBegin(buf, 4) - if err != nil { - return size, err - } - size += sz - // The Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - // Regex Flags - sz, err = packAInt64(buf, *fe.flags) - if err != nil { - return size, err - } - size += sz - // Raw String is needed instead of the msgpack String that the pack_value method would use. - sz, err = packRawString(buf, fe.val.String()) - if err != nil { - return size, err - } - size += sz - // The Bin - sz, err = fe.bin.pack(buf) - if err != nil { - return size, err - } - size += sz - case &expOpCALL: - // Packing logic for Module - sz, err := packArrayBegin(buf, 5) - if err != nil { - return size, err - } - size += sz - // The Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - // The Module Operation - sz, err = packAInt64(buf, int64(*fe.module)) - if err != nil { - return size, err - } - size += sz - // The Module (List/Map or Bitwise) - sz, err = packAInt64(buf, *fe.flags) - if err != nil { - return size, err - } - size += sz - // Encoding the Arguments - if args := fe.arguments; len(args) > 0 { - argLen := 0 - for _, arg := range args { - // First match to estimate the Size and write the Context - switch v := arg.(type) { - case Value, *Expression: - argLen++ - case cdtContextList: - if len(v) > 0 { - sz, err = packArrayBegin(buf, 3) - if err != nil { - return size, err - } - size += sz - - sz, err = packAInt64(buf, 0xff) - if err != nil { - return size, err - } - size += sz - - sz, err = packArrayBegin(buf, len(v)*2) - if err != nil { - return size, err - } - size += sz - - for _, c := range v { - sz, err = c.pack(buf) - if err != nil { - return size, err - } - size += sz - } - } - default: - panic("Value `%v` is not acceptable in Expression Filters as an argument") - } - } - sz, err = packArrayBegin(buf, argLen) - if err != nil { - return size, err - } - size += sz - // Second match to write the real values - for _, arg := range args { - switch val := arg.(type) { - case Value: - sz, err = val.pack(buf) - if err != nil { - return size, err - } - size += sz - case *Expression: - sz, err = val.pack(buf) - if err != nil { - return size, err - } - size += sz - default: - } - } - } else { - // No Arguments - sz, err = fe.val.pack(buf) - if err != nil { - return size, err - } - size += sz - } - // Write the Bin - sz, err = fe.bin.pack(buf) - if err != nil { - return size, err - } - size += sz - case &expOpBIN: - // Bin Encoder - sz, err := packArrayBegin(buf, 3) - if err != nil { - return size, err - } - size += sz - // The Bin Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - // The Bin Type (INT/String etc.) - sz, err = packAInt64(buf, int64(*fe.module)) - if err != nil { - return size, err - } - size += sz - // The name - Raw String is needed instead of the msgpack String that the pack_value method would use. - sz, err = packRawString(buf, fe.val.String()) - if err != nil { - return size, err - } - size += sz - case &expOpVar: - fallthrough - case &expOpBIN_TYPE: - // BinType encoder - sz, err := packArrayBegin(buf, 2) - if err != nil { - return size, err - } - size += sz - // BinType Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - // The name - Raw String is needed instead of the msgpack String that the pack_value method would use. - sz, err = packRawString(buf, fe.val.String()) - if err != nil { - return size, err - } - size += sz - default: - // Packing logic for all other Ops - if value := fe.val; value != nil { - // Operation has a Value - sz, err := packArrayBegin(buf, 2) - if err != nil { - return size, err - } - size += sz - // Write the Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - // Write the Value - sz, err = value.pack(buf) - if err != nil { - return size, err - } - size += sz - } else { - // Operation has no Value - sz, err := packArrayBegin(buf, 1) - if err != nil { - return size, err - } - size += sz - // Write the Operation - sz, err = packAInt64(buf, int64(*cmd)) - if err != nil { - return size, err - } - size += sz - } - } - - return size, nil -} - -func (fe *Expression) packValue(buf BufferEx) (int, Error) { - // Packing logic for Value based Ops - return fe.val.pack(buf) -} - -func (fe *Expression) size() (int, Error) { - return fe.pack(nil) -} - -func (fe *Expression) pack(buf BufferEx) (int, Error) { - if len(fe.bytes) > 0 { - if buf != nil { - return buf.Write(fe.bytes) - } - // return the size - return len(fe.bytes), nil - } else if len(fe.exps) > 0 { - return fe.packExpression(fe.exps, buf) - } else if fe.cmd != nil { - return fe.packCommand(fe.cmd, buf) - } - return fe.packValue(buf) -} - -func (fe *Expression) Base64() (string, Error) { - buf := fe.grpc() - return base64.StdEncoding.EncodeToString(buf), nil -} - -func (fe *Expression) grpc() []byte { - if fe == nil { - return nil - } - - sz, err := fe.size() - if err != nil { - panic(err) - } - - buf := newBuffer(sz) - _, err = fe.pack(buf) - if err != nil { - panic(err) - } - - return buf.Bytes() -} - -// ExpFromBase64 creates an expression from an encoded base64 expression. -func ExpFromBase64(str string) (*Expression, Error) { - b := make([]byte, base64.StdEncoding.DecodedLen(len(str))) - n, err := base64.StdEncoding.Decode(b, []byte(str)) - if err != nil { - return nil, newError(types.PARSE_ERROR, err.Error()) - } - - return &Expression{bytes: b[:n]}, nil -} - -// ExpKey creates a record key expression of specified type. -func ExpKey(expType ExpType) *Expression { - return newFilterExpression( - &expOpKEY, - IntegerValue(int64(expType)), - nil, - nil, - nil, - nil, - ) -} - -// ExpKeyExists creates a function that returns if the primary key is stored in the record meta data -// as a boolean expression. This would occur when `send_key` is true on record write. -func ExpKeyExists() *Expression { - return newFilterExpression(&expOpKEY_EXISTS, nil, nil, nil, nil, nil) -} - -// ExpIntBin creates a 64 bit int bin expression. -func ExpIntBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeINT, - nil, - ) -} - -// ExpStringBin creates a string bin expression. -func ExpStringBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeSTRING, - nil, - ) -} - -// ExpBlobBin creates a blob bin expression. -func ExpBlobBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeBLOB, - nil, - ) -} - -// ExpBoolBin creates a boolean bin expression. -func ExpBoolBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeBOOL, - nil, - ) -} - -// ExpFloatBin creates a 64 bit float bin expression. -func ExpFloatBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeFLOAT, - nil, - ) -} - -// ExpGeoBin creates a geo bin expression. -func ExpGeoBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeGEO, - nil, - ) -} - -// ExpListBin creates a list bin expression. -func ExpListBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeLIST, - nil, - ) -} - -// ExpMapBin creates a map bin expression. -func ExpMapBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeMAP, - nil, - ) -} - -// ExpHLLBin creates a a HLL bin expression -func ExpHLLBin(name string) *Expression { - return newFilterExpression( - &expOpBIN, - StringValue(name), - nil, - nil, - &ExpTypeHLL, - nil, - ) -} - -// ExpBinExists creates a function that returns if bin of specified name exists. -func ExpBinExists(name string) *Expression { - return ExpNotEq(ExpBinType(name), ExpIntVal(ParticleType.NULL)) -} - -// ExpBinType creates a function that returns bin's integer particle type. Valid values are: -// -// NULL = 0 -// INTEGER = 1 -// FLOAT = 2 -// STRING = 3 -// BLOB = 4 -// DIGEST = 6 -// BOOL = 17 -// HLL = 18 -// MAP = 19 -// LIST = 20 -// LDT = 21 -// GEOJSON = 23 -func ExpBinType(name string) *Expression { - // TODO: Improve documentation and provide examples. - return newFilterExpression( - &expOpBIN_TYPE, - StringValue(name), - nil, - nil, - nil, - nil, - ) -} - -// ExpSetName creates a function that returns record set name string. -func ExpSetName() *Expression { - return newFilterExpression(&expOpSET_NAME, nil, nil, nil, nil, nil) -} - -// ExpRecordSize creates an expression that returns the record size. -// This expression usually evaluates quickly because record meta data is cached in memory. -// -// Requires server version 7.0+. This expression replaces [ExpDeviceSize] and -// [ExpMemorySize] since those older expressions are equivalent on server version 7.0+. -func ExpRecordSize() *Expression { - return newFilterExpression(&expOpRECORD_SIZE, nil, nil, nil, nil, nil) -} - -// ExpDeviceSize creates a function that returns record size on disk. -// If server storage-engine is memory, then zero is returned. -// -// This expression should only be used for server versions less than 7.0. Use -// [ExpRecordSize] for server version 7.0+. -func ExpDeviceSize() *Expression { - return newFilterExpression(&expOpDEVICE_SIZE, nil, nil, nil, nil, nil) -} - -// ExpMemorySize creates expression that returns record size in memory. If server storage-engine is -// not memory nor data-in-memory, then zero is returned. This expression usually evaluates -// quickly because record meta data is cached in memory. -// -// Requires server version between 5.3 inclusive and 7.0 exclusive. -// Use [ExpRecordSize] for server version 7.0+. -func ExpMemorySize() *Expression { - return newFilterExpression(&expOpMEMORY_SIZE, nil, nil, nil, nil, nil) -} - -// ExpLastUpdate creates a function that returns record last update time expressed as 64 bit integer -// nanoseconds since 1970-01-01 epoch. -func ExpLastUpdate() *Expression { - return newFilterExpression(&expOpLAST_UPDATE, nil, nil, nil, nil, nil) -} - -// ExpSinceUpdate creates a expression that returns milliseconds since the record was last updated. -// This expression usually evaluates quickly because record meta data is cached in memory. -func ExpSinceUpdate() *Expression { - return newFilterExpression(&expOpSINCE_UPDATE, nil, nil, nil, nil, nil) -} - -// ExpVoidTime creates a function that returns record expiration time expressed as 64 bit integer -// nanoseconds since 1970-01-01 epoch. -func ExpVoidTime() *Expression { - return newFilterExpression(&expOpVOID_TIME, nil, nil, nil, nil, nil) -} - -// ExpTTL creates a function that returns record expiration time (time to live) in integer seconds. -func ExpTTL() *Expression { - return newFilterExpression(&expOpTTL, nil, nil, nil, nil, nil) -} - -// ExpIsTombstone creates a expression that returns if record has been deleted and is still in tombstone state. -// This expression usually evaluates quickly because record meta data is cached in memory. -func ExpIsTombstone() *Expression { - return newFilterExpression(&expOpIS_TOMBSTONE, nil, nil, nil, nil, nil) -} - -// ExpDigestModulo creates a function that returns record digest modulo as integer. -func ExpDigestModulo(modulo int64) *Expression { - return newFilterExpression( - &expOpDIGEST_MODULO, - NewValue(modulo), - nil, - nil, - nil, - nil, - ) -} - -// ExpRegexCompare creates a function like regular expression string operation. -func ExpRegexCompare(regex string, flags ExpRegexFlags, bin *Expression) *Expression { - iflags := int64(flags) - return newFilterExpression( - &expOpREGEX, - StringValue(regex), - bin, - &iflags, - nil, - nil, - ) -} - -// ExpGeoCompare creates a compare geospatial operation. -func ExpGeoCompare(left *Expression, right *Expression) *Expression { - return newFilterExpression( - &expOpGEO, - nil, - nil, - nil, - nil, - []*Expression{left, right}, - ) -} - -// ExpIntVal creates a 64 bit integer value -func ExpIntVal(val int64) *Expression { - return newFilterExpression(nil, IntegerValue(val), nil, nil, nil, nil) -} - -// ExpBoolVal creates a Boolean value -func ExpBoolVal(val bool) *Expression { - return newFilterExpression(nil, BoolValue(val), nil, nil, nil, nil) -} - -// ExpStringVal creates a String bin value -func ExpStringVal(val string) *Expression { - return newFilterExpression(nil, StringValue(val), nil, nil, nil, nil) -} - -// ExpFloatVal creates a 64 bit float bin value -func ExpFloatVal(val float64) *Expression { - return newFilterExpression(nil, FloatValue(val), nil, nil, nil, nil) -} - -// ExpBlobVal creates a Blob bin value -func ExpBlobVal(val []byte) *Expression { - return newFilterExpression(nil, BytesValue(val), nil, nil, nil, nil) -} - -// ExpListVal creates a List bin Value -func ExpListVal(val ...Value) *Expression { - return newFilterExpression( - &expOpQUOTED, - ValueArray(val), - nil, - nil, - nil, - nil, - ) -} - -// ExpValueArrayVal creates a List bin Value -func ExpValueArrayVal(val ValueArray) *Expression { - return newFilterExpression( - &expOpQUOTED, - val, - nil, - nil, - nil, - nil, - ) -} - -// ExpListValueVal creates a List bin Value -func ExpListValueVal(val ...interface{}) *Expression { - return newFilterExpression( - &expOpQUOTED, - NewListValue(val), - nil, - nil, - nil, - nil, - ) -} - -// ExpMapVal creates a Map bin Value -func ExpMapVal(val MapValue) *Expression { - return newFilterExpression(nil, val, nil, nil, nil, nil) -} - -// ExpGeoVal creates a geospatial json string value. -func ExpGeoVal(val string) *Expression { - return newFilterExpression(nil, GeoJSONValue(val), nil, nil, nil, nil) -} - -// ExpNilValue creates a a Nil Value -func ExpNilValue() *Expression { - return newFilterExpression(nil, nullValue, nil, nil, nil, nil) -} - -// ExpInfinityValue creates an Infinity Value -func ExpInfinityValue() *Expression { - return newFilterExpression(nil, infinityValue, nil, nil, nil, nil) -} - -// ExpWildCardValue creates a WildCard Value -func ExpWildCardValue() *Expression { - return newFilterExpression(nil, wildCardValue, nil, nil, nil, nil) -} - -// ExpNot creates a "not" operator expression. -func ExpNot(exp *Expression) *Expression { - return &Expression{ - cmd: &expOpNOT, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{exp}, - arguments: nil, - } -} - -// ExpAnd creates a "and" (&&) operator that applies to a variable number of expressions. -func ExpAnd(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpAND, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpOr creates a "or" (||) operator that applies to a variable number of expressions. -func ExpOr(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpOR, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpExclusive creates an expression that returns true if only one of the expressions are true. -// Requires server version 5.6.0+. -func ExpExclusive(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpExclusive, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpEq creates a equal (==) expression. -func ExpEq(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpEQ, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpNotEq creates a not equal (!=) expression -func ExpNotEq(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpNE, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpGreater creates a greater than (>) operation. -func ExpGreater(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpGT, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpGreaterEq creates a greater than or equal (>=) operation. -func ExpGreaterEq(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpGE, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpLess creates a less than (<) operation. -func ExpLess(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpLT, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpLessEq creates a less than or equals (<=) operation. -func ExpLessEq(left *Expression, right *Expression) *Expression { - return &Expression{ - cmd: &expOpLE, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{left, right}, - arguments: nil, - } -} - -// ExpNumAdd creates "add" (+) operator that applies to a variable number of expressions. -// Return sum of all `FilterExpressions` given. All arguments must resolve to the same type (integer or float). -// Requires server version 5.6.0+. -func ExpNumAdd(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpAdd, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpNumSub creates "subtract" (-) operator that applies to a variable number of expressions. -// If only one `FilterExpressions` is provided, return the negation of that argument. -// Otherwise, return the sum of the 2nd to Nth `FilterExpressions` subtracted from the 1st -// `FilterExpressions`. All `FilterExpressions` must resolve to the same type (integer or float). -// Requires server version 5.6.0+. -func ExpNumSub(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpSub, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpNumMul creates "multiply" (*) operator that applies to a variable number of expressions. -// Return the product of all `FilterExpressions`. If only one `FilterExpressions` is supplied, return -// that `FilterExpressions`. All `FilterExpressions` must resolve to the same type (integer or float). -// Requires server version 5.6.0+. -func ExpNumMul(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpMul, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpNumDiv creates "divide" (/) operator that applies to a variable number of expressions. -// If there is only one `FilterExpressions`, returns the reciprocal for that `FilterExpressions`. -// Otherwise, return the first `FilterExpressions` divided by the product of the rest. -// All `FilterExpressions` must resolve to the same type (integer or float). -// Requires server version 5.6.0+. -func ExpNumDiv(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpDiv, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpNumPow creates "power" operator that raises a "base" to the "exponent" power. -// All arguments must resolve to floats. -// Requires server version 5.6.0+. -func ExpNumPow(base *Expression, exponent *Expression) *Expression { - return &Expression{ - cmd: &expOpPow, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{base, exponent}, - arguments: nil, - } -} - -// ExpNumLog creates "log" operator for logarithm of "num" with base "base". -// All arguments must resolve to floats. -// Requires server version 5.6.0+. -func ExpNumLog(num *Expression, base *Expression) *Expression { - return &Expression{ - cmd: &expOpLog, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{num, base}, - arguments: nil, - } -} - -// ExpNumMod creates "modulo" (%) operator that determines the remainder of "numerator" -// divided by "denominator". All arguments must resolve to integers. -// Requires server version 5.6.0+. -func ExpNumMod(numerator *Expression, denominator *Expression) *Expression { - return &Expression{ - cmd: &expOpMod, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{numerator, denominator}, - arguments: nil, - } -} - -// ExpNumAbs creates operator that returns absolute value of a number. -// All arguments must resolve to integer or float. -// Requires server version 5.6.0+. -func ExpNumAbs(value *Expression) *Expression { - return &Expression{ - cmd: &expOpAbs, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value}, - arguments: nil, - } -} - -// ExpNumFloor creates expression that rounds a floating point number down to the closest integer value. -// The return type is float. -// Requires server version 5.6.0+. -func ExpNumFloor(num *Expression) *Expression { - return &Expression{ - cmd: &expOpFloor, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{num}, - arguments: nil, - } -} - -// ExpNumCeil creates expression that rounds a floating point number up to the closest integer value. -// The return type is float. -// Requires server version 5.6.0+. -func ExpNumCeil(num *Expression) *Expression { - return &Expression{ - cmd: &expOpCeil, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{num}, - arguments: nil, - } -} - -// ExpToInt creates expression that converts an integer to a float. -// Requires server version 5.6.0+. -func ExpToInt(num *Expression) *Expression { - return &Expression{ - cmd: &expOpToInt, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{num}, - arguments: nil, - } -} - -// ExpToFloat creates expression that converts a float to an integer. -// Requires server version 5.6.0+. -func ExpToFloat(num *Expression) *Expression { - return &Expression{ - cmd: &expOpToFloat, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{num}, - arguments: nil, - } -} - -// ExpIntAnd creates integer "and" (&) operator that is applied to two or more integers. -// All arguments must resolve to integers. -// Requires server version 5.6.0+. -func ExpIntAnd(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpIntAnd, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpIntOr creates integer "or" (|) operator that is applied to two or more integers. -// All arguments must resolve to integers. -// Requires server version 5.6.0+. -func ExpIntOr(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpIntOr, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpIntXor creates integer "xor" (^) operator that is applied to two or more integers. -// All arguments must resolve to integers. -// Requires server version 5.6.0+. -func ExpIntXor(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpIntXor, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpIntNot creates integer "not" (~) operator. -// Requires server version 5.6.0+. -func ExpIntNot(exp *Expression) *Expression { - return &Expression{ - cmd: &expOpIntNot, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{exp}, - arguments: nil, - } -} - -// ExpIntLShift creates integer "left shift" (<<) operator. -// Requires server version 5.6.0+. -func ExpIntLShift(value *Expression, shift *Expression) *Expression { - return &Expression{ - cmd: &expOpIntLShift, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value, shift}, - arguments: nil, - } -} - -// ExpIntRShift creates integer "logical right shift" (>>>) operator. -// Requires server version 5.6.0+. -func ExpIntRShift(value *Expression, shift *Expression) *Expression { - return &Expression{ - cmd: &expOpIntRShift, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value, shift}, - arguments: nil, - } -} - -// ExpIntARShift creates integer "arithmetic right shift" (>>) operator. -// The sign bit is preserved and not shifted. -// Requires server version 5.6.0+. -func ExpIntARShift(value *Expression, shift *Expression) *Expression { - return &Expression{ - cmd: &expOpIntARShift, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value, shift}, - arguments: nil, - } -} - -// ExpIntCount creates expression that returns count of integer bits that are set to 1. -// Requires server version 5.6.0+. -func ExpIntCount(exp *Expression) *Expression { - return &Expression{ - cmd: &expOpIntCount, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{exp}, - arguments: nil, - } -} - -// ExpIntLScan creates expression that scans integer bits from left (most significant bit) to -// right (least significant bit), looking for a search bit value. When the -// search value is found, the index of that bit (where the most significant bit is -// index 0) is returned. If "search" is true, the scan will search for the bit -// value 1. If "search" is false it will search for bit value 0. -// Requires server version 5.6.0+. -func ExpIntLScan(value *Expression, search *Expression) *Expression { - return &Expression{ - cmd: &expOpIntLscan, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value, search}, - arguments: nil, - } -} - -// ExpIntRScan creates expression that scans integer bits from right (least significant bit) to -// left (most significant bit), looking for a search bit value. When the -// search value is found, the index of that bit (where the most significant bit is -// index 0) is returned. If "search" is true, the scan will search for the bit -// value 1. If "search" is false it will search for bit value 0. -// Requires server version 5.6.0+. -func ExpIntRScan(value *Expression, search *Expression) *Expression { - return &Expression{ - cmd: &expOpIntRscan, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value, search}, - arguments: nil, - } -} - -// ExpMin creates expression that returns the minimum value in a variable number of expressions. -// All arguments must be the same type (integer or float). -// Requires server version 5.6.0+. -func ExpMin(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpMin, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpMax creates expression that returns the maximum value in a variable number of expressions. -// All arguments must be the same type (integer or float). -// Requires server version 5.6.0+. -func ExpMax(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpMax, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -//-------------------------------------------------- -// Variables -//-------------------------------------------------- - -// ExpCond will conditionally select an action expression from a variable number of expression pairs -// followed by a default action expression. Every action expression must return the same type. -// The only exception is Unknown() which can be mixed with other types. -// -// Requires server version 5.6.0+. -func ExpCond(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpCond, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpLet will define variables and expressions in scope. -// Requires server version 5.6.0+. -func ExpLet(exps ...*Expression) *Expression { - return &Expression{ - cmd: &expOpLet, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: exps, - arguments: nil, - } -} - -// ExpDef will assign variable to an expression that can be accessed later. -// Requires server version 5.6.0+. -func ExpDef(name string, value *Expression) *Expression { - return &Expression{ - cmd: nil, - val: StringValue(name), - bin: nil, - flags: nil, - module: nil, - exps: []*Expression{value}, - arguments: nil, - } -} - -// ExpVar will retrieve expression value from a variable. -// Requires server version 5.6.0+. -func ExpVar(name string) *Expression { - return &Expression{ - cmd: &expOpVar, - val: StringValue(name), - bin: nil, - flags: nil, - module: nil, - exps: nil, - arguments: nil, - } -} - -// ExpUnknown creates unknown value. Used to intentionally fail an expression. -// The failure can be ignored with `ExpWriteFlags` `EVAL_NO_FAIL` -// or `ExpReadFlags` `EVAL_NO_FAIL`. -// Requires server version 5.6.0+. -func ExpUnknown() *Expression { - return &Expression{ - cmd: &expOpUnknown, - val: nil, - bin: nil, - flags: nil, - module: nil, - exps: nil, - arguments: nil, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go b/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go deleted file mode 100644 index d4e39811..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/expression_ops_test.go +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Operations", func() { - - var ns = *namespace - var set = randString(50) - - binA := "A" - binB := "B" - binC := "C" - binD := "D" - binH := "H" - expVar := "EV" - - keyA, _ := as.NewKey(ns, set, "A") - keyB, _ := as.NewKey(ns, set, []byte{'B'}) - - gg.BeforeEach(func() { - _, err := client.Delete(nil, keyA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - _, err = client.Delete(nil, keyB) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(nil, keyA, as.NewBin(binA, 1), as.NewBin(binD, 2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.PutBins(nil, keyB, as.NewBin(binB, 2), as.NewBin(binD, 2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("Expression ops on lists should work", func() { - list := []as.Value{as.StringValue("a"), as.StringValue("b"), as.StringValue("c"), as.StringValue("d")} - exp := as.ExpListVal(list...) - rec, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp("var", exp, as.ExpReadFlagDefault), - ) - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins).To(gm.Equal(as.BinMap{"C": []interface{}{nil, []interface{}{"a", "b", "c", "d"}}, "var": []interface{}{"a", "b", "c", "d"}})) - }) - - gg.It("Read Eval error should work", func() { - exp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) - - r, err := client.Operate(nil, keyA, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - _, err = client.Operate(nil, keyB, as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault)) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyB, as.ExpReadOp(expVar, exp, as.ExpReadFlagEvalNoFail)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("Read On Write Eval error should work", func() { - rexp := as.ExpIntBin(binD) - wexp := as.ExpIntBin(binA) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binD, wexp, as.ExpWriteFlagDefault), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - _, err = client.Operate(nil, keyB, - as.ExpWriteOp(binD, wexp, as.ExpWriteFlagDefault), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyB, - as.ExpWriteOp(binD, wexp, as.ExpWriteFlagEvalNoFail), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagEvalNoFail), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("Write Eval error should work", func() { - wexp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) - rexp := as.ExpIntBin(binC) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagDefault), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - _, err = client.Operate(nil, keyB, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagDefault), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagDefault), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyB, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagEvalNoFail), - as.ExpReadOp(expVar, rexp, as.ExpReadFlagEvalNoFail), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("Write Policy error should work", func() { - wexp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) - - _, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.BIN_NOT_FOUND)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly|as.ExpWriteFlagPolicyNoFail), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - _, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - _, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.BIN_EXISTS_ERROR)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagUpdateOnly|as.ExpWriteFlagPolicyNoFail), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - dexp := as.ExpNilValue() - - _, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, dexp, as.ExpWriteFlagDefault), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, dexp, as.ExpWriteFlagPolicyNoFail), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - r, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, dexp, as.ExpWriteFlagAllowDelete), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - r, err = client.Operate(nil, keyA, - as.ExpWriteOp(binC, wexp, as.ExpWriteFlagCreateOnly), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("Return Unknown should work", func() { - exp := as.ExpCond( - as.ExpEq(as.ExpIntBin(binC), as.ExpIntVal(5)), as.ExpUnknown(), - as.ExpBinExists(binA), as.ExpIntVal(5), - as.ExpUnknown(), - ) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - ) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Matches(ast.OP_NOT_APPLICABLE)).To(gm.BeTrue()) - - r, err = client.Operate(nil, keyB, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagEvalNoFail), - as.GetBinOp(binC), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(r.Bins)).To(gm.BeNumerically(">", 0)) - - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{binC: []interface{}{nil, nil}})) - }) - - gg.It("Return Nil should work", func() { - exp := as.ExpNilValue() - - r, err := client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - as.GetBinOp(binC), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: nil, binC: nil})) - }) - - gg.It("Return Int should work", func() { - exp := as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntVal(4)) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5, binC: []interface{}{nil, 5}})) - - r, err = client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5})) - }) - - gg.It("Return Float should work", func() { - exp := as.ExpNumAdd(as.ExpToFloat(as.ExpIntBin(binA)), as.ExpFloatVal(4.1)) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1, binC: []interface{}{nil, 5.1}})) - - r, err = client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: 5.1})) - }) - - gg.It("Return String should work", func() { - str := "xxx" - exp := as.ExpStringVal(str) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str, binC: []interface{}{nil, str}})) - - r, err = client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: str})) - }) - - gg.It("Return BLOB should work", func() { - blob := []byte{0x78, 0x78, 0x78} - exp := as.ExpBlobVal(blob) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob, binC: []interface{}{nil, blob}})) - - r, err = client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: blob})) - }) - - gg.It("Return Boolean should work", func() { - exp := as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)) - - r, err := client.Operate(nil, keyA, - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{expVar: true, binC: []interface{}{nil, true}})) - }) - - gg.It("Return HLL should work", func() { - exp := as.ExpHLLInit(as.DefaultHLLPolicy(), as.ExpIntVal(4), as.ExpNilValue()) - - r, err := client.Operate(nil, keyA, - as.HLLInitOp(as.DefaultHLLPolicy(), binH, 4, -1), - as.ExpWriteOp(binC, exp, as.ExpWriteFlagDefault), - as.GetBinOp(binH), - as.GetBinOp(binC), - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{ - binH: []interface{}{ - nil, - as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), - }, - binC: []interface{}{ - nil, - as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), - }, - expVar: as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), - })) - - r, err = client.Operate(nil, keyA, - as.ExpReadOp(expVar, exp, as.ExpReadFlagDefault), - ) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r.Bins).To(gm.Equal(as.BinMap{ - expVar: as.HLLValue([]uint8{0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}), - })) - }) - -}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/expression_test.go b/aerospike-tls/vendor-aerospike-client-go/expression_test.go deleted file mode 100644 index 6af030c0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/expression_test.go +++ /dev/null @@ -1,1058 +0,0 @@ -// Copyright 2017-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Expression Filters", func() { - - var ns = *namespace - var set = randString(50) - // var rpolicy = as.NewPolicy() - var wpolicy = as.NewWritePolicy(0, 0) - var qpolicy = as.NewQueryPolicy() - - var _ = gg.Context("Generic", gg.Ordered, func() { - - var set = "expression_tests" // The name of the set should be consistent because of predexp_modulo tests, since set name is a part of the digest - - const keyCount = 1000 - - gg.AfterAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - dropIndex(nil, ns, set, "intval") - dropIndex(nil, ns, set, "strval") - }) - - gg.BeforeAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - dropIndex(nil, ns, set, "intval") - dropIndex(nil, ns, set, "strval") - - starbucks := [][2]float64{ - {-122.1708441, 37.4241193}, - {-122.1492040, 37.4273569}, - {-122.1441078, 37.4268202}, - {-122.1251714, 37.4130590}, - {-122.0964289, 37.4218102}, - {-122.0776641, 37.4158199}, - {-122.0943475, 37.4114654}, - {-122.1122861, 37.4028493}, - {-122.0947230, 37.3909250}, - {-122.0831037, 37.3876090}, - {-122.0707119, 37.3787855}, - {-122.0303178, 37.3882739}, - {-122.0464861, 37.3786236}, - {-122.0582128, 37.3726980}, - {-122.0365083, 37.3676930}, - } - - for ii := 0; ii < keyCount; ii++ { - - // On iteration 333 we pause for a few mSec and note the - // time. Later we can check last_update time for either - // side of this gap ... - // - // Also, we update the WritePolicy to never expire so - // records w/ 0 TTL can be counted later. - // - - key, err := as.NewKey(ns, set, ii) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - lng := -122.0 + (0.01 * float64(ii)) - lat := 37.5 + (0.01 * float64(ii)) - pointstr := fmt.Sprintf( - "{ \"type\": \"Point\", \"coordinates\": [%f, %f] }", - lng, lat) - - var regionstr string - if ii < len(starbucks) { - regionstr = fmt.Sprintf( - "{ \"type\": \"AeroCircle\", "+ - " \"coordinates\": [[%f, %f], 3000.0 ] }", - starbucks[ii][0], starbucks[ii][1]) - } else { - // Somewhere off Africa ... - regionstr = - "{ \"type\": \"AeroCircle\", " + - " \"coordinates\": [[0.0, 0.0], 3000.0 ] }" - } - - // Accumulate prime factors of the index into a list and map. - listval := []int{} - mapval := map[int]string{} - for _, ff := range []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31} { - if ii >= ff && ii%ff == 0 { - listval = append(listval, ff) - mapval[ff] = fmt.Sprintf("0x%04x", ff) - } - } - - ballast := make([]byte, ii*16) - - bins := as.BinMap{ - "intval": ii, - "strval": fmt.Sprintf("0x%04x", ii), - "modval": ii % 10, - "locval": as.NewGeoJSONValue(pointstr), - "rgnval": as.NewGeoJSONValue(regionstr), - "lstval": listval, - "mapval": mapval, - "ballast": ballast, - } - err = client.Put(wpolicy, key, bins) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - createIndex(wpolicy, ns, set, "intval", "intval", as.NUMERIC) - createIndex(wpolicy, ns, set, "strval", "strval", as.STRING) - }) - - gg.BeforeEach(func() { - qpolicy.FilterExpression = nil - }) - - gg.It("server error with top level expression value node", func() { - // This statement doesn't form a predicate expression. - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter("intval", 0, 400)) - - qpolicy.FilterExpression = as.ExpIntVal(8) - recordset, err := client.Query(qpolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - for res := range recordset.Results() { - gm.Expect(res.Err).To(gm.HaveOccurred()) - } - }) - - gg.It("expression must additionally filter indexed query results", func() { - - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter("intval", 0, 400)) - qpolicy.FilterExpression = as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)) - recordset, err := client.Query(qpolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // The query clause selects [0, 1, ... 400, 401] The predexp - // only takes mod 8 and 9, should be 2 pre decade or 80 total. - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 80)) - }) - - gg.It("expression must work with implied scan", func() { - - stm := as.NewStatement(ns, set) - qpolicy.FilterExpression = as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001")) - recordset, err := client.Query(qpolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 1)) - }) - - gg.It("expression and or and not must all work", func() { - - stm := as.NewStatement(ns, set) - qpolicy.FilterExpression = as.ExpOr( - as.ExpAnd( - as.ExpNot(as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001"))), - as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)), - ), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0104")), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0105")), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0106")), - ) - - recordset, err := client.Query(qpolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 203)) - }) - - gg.It("Base64 encode/decode must work", func() { - - stm := as.NewStatement(ns, set) - - exp := as.ExpOr( - as.ExpAnd( - as.ExpNot(as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0001"))), - as.ExpGreaterEq(as.ExpIntBin("modval"), as.ExpIntVal(8)), - ), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0104")), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0105")), - as.ExpEq(as.ExpStringBin("strval"), as.ExpStringVal("0x0106")), - ) - - bexp, err := exp.Base64() - gm.Expect(err).ToNot(gm.HaveOccurred()) - - qpolicy.FilterExpression, err = as.ExpFromBase64(bexp) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recordset, err := client.Query(qpolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 203)) - }) - }) - - runQuery := func(filter *as.Expression, set_name string) *as.Recordset { - qpolicy.FilterExpression = filter - stmt := as.NewStatement(ns, set_name) - rs, err := client.Query(qpolicy, stmt) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - return rs - } - - countResults := func(rs *as.Recordset) int { - count := 0 - - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - - return count - } - - var _ = gg.Describe("Expressions", gg.Ordered, func() { - const keyCount = 100 - set = randString(50) - - gg.BeforeAll(func() { - for ii := 0; ii < keyCount; ii++ { - key, _ := as.NewKey(ns, set, ii) - ibin := as.BinMap{ - "bin": ii, - "bin2": fmt.Sprintf("%d", ii), - "bin3": float64(ii) / 3, - "bin4": []byte(fmt.Sprintf("blob%d", ii)), - "bin5": []interface{}{"a", "b", ii}, - "bin6": map[string]interface{}{"a": "test", "b": ii}, - } - client.Delete(wpolicy, key) - client.Put(wpolicy, key, ibin) - - } - }) - - var _ = gg.Context("Data Types", func() { - - gg.It("ExpIntBin must work", func() { - // INT - rs := runQuery( - as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - - }) - - gg.It("ExpStringBin must work", func() { - // STRING - rs := runQuery( - as.ExpEq( - as.ExpStringBin("bin2"), - as.ExpStringVal("1"), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - - }) - - gg.It("ExpFloatBin must work", func() { - rs := runQuery( - as.ExpEq( - as.ExpFloatBin("bin3"), - as.ExpFloatVal(2), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - - }) - - gg.It("ExpBlobBin must work", func() { - rs := runQuery( - as.ExpEq( - as.ExpBlobBin("bin4"), - as.ExpBlobVal([]byte("blob5")), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - - }) - - gg.It("ExpBinType must work", func() { - rs := runQuery( - as.ExpNotEq( - as.ExpBinType("bin"), - as.ExpIntVal(0), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMapReturnType must work", func() { - rs := runQuery( - as.ExpMapGetByValue( - as.MapReturnType.EXISTS, - as.ExpStringVal("test"), - as.ExpMapBin("bin6"), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - }) - - var _ = gg.Context("Logical Ops", func() { - // AND - gg.It("ExpAnd must work", func() { - rs := runQuery( - as.ExpAnd( - as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - as.ExpEq( - as.ExpStringBin("bin2"), - as.ExpStringVal("1"), - ), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - // OR - gg.It("ExpOr must work", func() { - rs := runQuery( - as.ExpOr( - as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(3), - ), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(2)) - }) - // NOT - gg.It("ExpNot must work", func() { - rs := runQuery( - as.ExpNot(as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - )), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - }) - - var _ = gg.Context("Comparisons", func() { - - gg.It("ExpEq must work", func() { - // EQ - rs := runQuery( - as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("ExpNotEq must work", func() { - // NE - rs := runQuery( - as.ExpNotEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - gg.It("ExpLess must work", func() { - // LT - rs := runQuery( - as.ExpLess( - as.ExpIntBin("bin"), - as.ExpIntVal(100), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpLessEq must work", func() { - // LE - rs := runQuery( - as.ExpLessEq( - as.ExpIntBin("bin"), - as.ExpIntVal(100), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpGreater must work", func() { - // GT - rs := runQuery( - as.ExpGreater( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(98)) - }) - - gg.It("ExpGreaterEq must work", func() { - // GE - rs := runQuery( - as.ExpGreaterEq( - as.ExpIntBin("bin"), - as.ExpIntVal(1), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(99)) - }) - - }) // gg.Context - - var _ = gg.Context("Record Ops", func() { - - gg.It("ExpRecordSize must work", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if serverIsOlderThan("7") { - gg.Skip("Not supported servers before v7") - } - - // storage-engine could be memory for which deviceSize() returns zero. - // This just tests that the expression was sent correctly - // because all device sizes are effectively allowed. - rs := runQuery( - as.ExpGreaterEq(as.ExpRecordSize(), as.ExpIntVal(0)), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpDeviceSize must work", func() { - // storage-engine could be memory for which deviceSize() returns zero. - // This just tests that the expression was sent correctly - // because all device sizes are effectively allowed. - rs := runQuery( - as.ExpGreaterEq(as.ExpDeviceSize(), as.ExpIntVal(0)), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpMemorySize must work", func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if len(nsInfo(ns, "device_total_bytes")) > 0 { - gg.Skip("Skipping ExpDeviceSize test since the namespace is persisted and the test works only for Memory-Only namespaces.") - } - - // storage-engine could be disk/device for which memorySize() returns zero. - // This just tests that the expression was sent correctly - // because all device sizes are effectively allowed. - rs := runQuery( - as.ExpGreaterEq(as.ExpMemorySize(), as.ExpIntVal(0)), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpLastUpdate must work", func() { - rs := runQuery( - as.ExpGreater(as.ExpLastUpdate(), as.ExpIntVal(15000)), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpSinceUpdate must work", func() { - time.Sleep(time.Millisecond * 150) - rs := runQuery( - as.ExpGreater(as.ExpSinceUpdate(), as.ExpIntVal(150)), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - // gg.It("ExpVoidTime must work", func() { - // // Records dont expire - // rs := runQuery( - // as.ExpLessEq(as.ExpVoidTime(), as.ExpIntVal(0)), - // set, - // ) - // count := countResults(rs) - // gm.Expect(count).To(gm.Equal(100)) - // }) - - // gg.It("ExpTTL must work", func() { - // rs := runQuery( - // as.ExpLessEq(as.ExpTTL(), as.ExpIntVal(0)), - // set, - // ) - // count := countResults(rs) - // gm.Expect(count).To(gm.Equal(100)) - // }) - - gg.It("ExpIsTombstone must work", func() { - rs := runQuery( - as.ExpNot(as.ExpIsTombstone()), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpSetName must work", func() { - rs := runQuery( - as.ExpEq( - as.ExpSetName(), - as.ExpStringVal(set), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpBinExists must work", func() { - rs := runQuery(as.ExpBinExists("bin4"), set) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpDigestModulo must work", func() { - rs := runQuery( - as.ExpEq(as.ExpDigestModulo(3), as.ExpIntVal(1)), - set, - ) - count := countResults(rs) - gm.Expect(count > 0 && count < 100).To(gm.BeTrue()) - }) - - gg.It("ExpKey must work", func() { - rs := runQuery( - as.ExpEq(as.ExpKey(as.ExpTypeINT), as.ExpIntVal(50)), - set, - ) - count := countResults(rs) - // 0 because key is not saved - gm.Expect(count).To(gm.Equal(0)) - }) - - gg.It("ExpKeyExists must work", func() { - rs := runQuery(as.ExpKeyExists(), set) - count := countResults(rs) - // 0 because key is not saved - gm.Expect(count).To(gm.Equal(0)) - }) - - gg.It("ExpEq Nil test must work", func() { - rs := runQuery( - as.ExpEq(as.ExpNilValue(), as.ExpNilValue()), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(100)) - }) - - gg.It("ExpRegexCompare must work", func() { - rs := runQuery( - as.ExpRegexCompare( - "[1-5]", - as.ExpRegexFlagICASE, - as.ExpStringBin("bin2"), - ), - set, - ) - count := countResults(rs) - gm.Expect(count).To(gm.Equal(75)) - }) - }) - - var _ = gg.Context("Commands", func() { - - rpolicy := as.NewPolicy() - wpolicy := as.NewWritePolicy(0, 0) - spolicy := as.NewScanPolicy() - bpolicy := as.NewBatchPolicy() - - gg.BeforeEach(func() { - for i := 0; i < keyCount; i++ { - key, _ := as.NewKey(ns, set, i) - ibin := as.BinMap{"bin": i} - - client.Delete(wpolicy, key) - client.Put(nil, key, ibin) - } - }) - - gg.It("Delete must work", func() { - // DELETE - key, _ := as.NewKey(ns, set, 15) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(16), - ) - _, err := client.Delete(wpolicy, key) - gm.Expect(err).To(gm.HaveOccurred()) - - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - _, err = client.Delete(wpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Put must work", func() { - // PUT - key, _ := as.NewKey(ns, set, 25) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - err := client.PutBins(wpolicy, key, as.NewBin("bin", 26)) - gm.Expect(err).To(gm.HaveOccurred()) - - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(25), - ) - err = client.PutBins(wpolicy, key, as.NewBin("bin", 26)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Get must work", func() { - // GET - key, _ := as.NewKey(ns, set, 35) - rpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - _, err := client.Get(rpolicy, key) - gm.Expect(err).To(gm.HaveOccurred()) - - rpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(35), - ) - _, err = client.Get(rpolicy, key, "bin") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Exists must work", func() { - // EXISTS - key, _ := as.NewKey(ns, set, 45) - rpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - _, err := client.Exists(rpolicy, key) - gm.Expect(err).To(gm.HaveOccurred()) - - rpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(45), - ) - _, err = client.Exists(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Add must work", func() { - // APPEND - key, _ := as.NewKey(ns, set, 55) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - err := client.AddBins(wpolicy, key, as.NewBin("test55", "test")) - gm.Expect(err).To(gm.HaveOccurred()) - - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(55), - ) - err = client.AddBins(wpolicy, key, as.NewBin("test55", "test")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Prepend must work", func() { - // PREPEND - key, _ := as.NewKey(ns, set, 55) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - err := client.PrependBins(wpolicy, key, as.NewBin("test55", "test")) - gm.Expect(err).To(gm.HaveOccurred()) - - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(55), - ) - err = client.PrependBins(wpolicy, key, as.NewBin("test55", "test")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - }) - - gg.It("Touch must work", func() { - // TOUCH - key, _ := as.NewKey(ns, set, 65) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - err := client.Touch(wpolicy, key) - gm.Expect(err).To(gm.HaveOccurred()) - - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(65), - ) - err = client.Touch(wpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("Scan must work", func() { - // SCAN - spolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(75), - ) - - rs, err := client.ScanAll(spolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - count := 0 - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - count += 1 - } - gm.Expect(count).To(gm.Equal(1)) - }) - - gg.It("Operate must work", func() { - // OPERATE - bin := as.NewBin("test85", 85) - - key, _ := as.NewKey(ns, set, 85) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(15), - ) - _, err := client.Operate(wpolicy, key, as.AddOp(bin)) - gm.Expect(err).To(gm.HaveOccurred()) - - key, _ = as.NewKey(ns, set, 85) - wpolicy.FilterExpression = as.ExpEq( - as.ExpIntBin("bin"), - as.ExpIntVal(85), - ) - _, err = client.Operate(wpolicy, key, as.AddOp(bin)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("Batch must work", func() { - // BATCH GET - keys := []*as.Key{} - for i := 85; i < 90; i++ { - key, _ := as.NewKey(ns, set, i) - keys = append(keys, key) - } - results, err := client.BatchGet(bpolicy, keys) - // all keys other than one are filtered out, so error is returned - gm.Expect(err).ToNot(gm.HaveOccurred()) - - count := 0 - for _, result := range results { - if result != nil { - count++ - } - } - gm.Expect(count).To(gm.Equal(5)) - bpolicy.FilterExpression = as.ExpGreater( - as.ExpIntBin("bin"), - as.ExpIntVal(88), - ) - results, err = client.BatchGet(bpolicy, keys) - // all keys other than one are filtered out, so error is returned - gm.Expect(err).To(gm.HaveOccurred()) - - count = 0 - for _, result := range results { - if result != nil { - count++ - } - } - gm.Expect(count).To(gm.Equal(1)) - }) - }) - - }) // Describe - - var _ = gg.Describe("Expression Filter Operations", gg.Ordered, func() { - binA := "A" - binB := "B" - binC := "C" - binD := "D" - binE := "E" - - keyA, _ := as.NewKey(ns, set, "A") - keyB, _ := as.NewKey(ns, set, []byte{'B'}) - keyC, _ := as.NewKey(ns, set, "C") - - type testParams struct { - desc string - exp *as.Expression - key, expKey *as.Key - bin string - expected int - reverseExp bool - } - matrix := []testParams{ - {"Exclusive", as.ExpExclusive(as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)), as.ExpEq(as.ExpIntBin(binD), as.ExpIntVal(1))), keyA, keyB, binA, 2, false}, - {"AddInt", as.ExpEq(as.ExpNumAdd(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntVal(1)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, - {"SubInt", as.ExpEq(as.ExpNumSub(as.ExpIntVal(1), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(-2)), keyA, keyB, binA, 2, false}, - {"MulInt", as.ExpEq(as.ExpNumMul(as.ExpIntVal(2), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, - {"DivInt", as.ExpEq(as.ExpNumDiv(as.ExpIntVal(8), as.ExpIntBin(binA), as.ExpIntBin(binD)), as.ExpIntVal(4)), keyA, keyB, binA, 2, false}, - {"ModInt", as.ExpEq(as.ExpNumMod(as.ExpIntBin(binA), as.ExpIntVal(2)), as.ExpIntVal(0)), keyA, keyB, binA, 2, false}, - {"AbsInt", as.ExpEq(as.ExpNumAbs(as.ExpIntBin(binE)), as.ExpIntVal(2)), keyA, keyB, binA, 2, false}, - {"Floor", as.ExpEq(as.ExpNumFloor(as.ExpFloatBin(binB)), as.ExpFloatVal(2)), keyA, keyB, binA, 2, false}, - {"Ceil", as.ExpEq(as.ExpNumCeil(as.ExpFloatBin(binB)), as.ExpFloatVal(3)), keyA, keyB, binA, 2, false}, - {"ToInt", as.ExpEq(as.ExpToInt(as.ExpFloatBin(binB)), as.ExpIntVal(2)), keyA, keyB, binA, 2, false}, - {"ToFloat", as.ExpEq(as.ExpToFloat(as.ExpIntBin(binA)), as.ExpFloatVal(2)), keyA, keyB, binA, 2, false}, - {"IntAnd", as.ExpNot( - as.ExpAnd( - as.ExpEq( - as.ExpIntAnd(as.ExpIntBin(binA), as.ExpIntVal(0)), - as.ExpIntVal(0)), - as.ExpEq( - as.ExpIntAnd(as.ExpIntBin(binA), as.ExpIntVal(0xFFFF)), - as.ExpIntVal(1), - ))), keyA, keyA, binA, 1, true}, - {"IntOr", as.ExpNot( - as.ExpAnd( - as.ExpEq( - as.ExpIntOr(as.ExpIntBin(binA), as.ExpIntVal(0)), - as.ExpIntVal(1)), - as.ExpEq( - as.ExpIntOr(as.ExpIntBin(binA), as.ExpIntVal(0xFF)), - as.ExpIntVal(0xFF), - ))), keyA, keyA, binA, 1, true}, - {"IntXor", as.ExpNot( - as.ExpAnd( - as.ExpEq( - as.ExpIntXor(as.ExpIntBin(binA), as.ExpIntVal(0)), - as.ExpIntVal(1)), - as.ExpEq( - as.ExpIntXor(as.ExpIntBin(binA), as.ExpIntVal(0xFF)), - as.ExpIntVal(0xFE), - ))), keyA, keyA, binA, 1, true}, - {"IntNot", as.ExpNot( - as.ExpEq( - as.ExpIntNot(as.ExpIntBin(binA)), - as.ExpIntVal(-2))), keyA, keyA, binA, 1, true}, - {"LShift", as.ExpNot( - as.ExpEq( - as.ExpIntLShift(as.ExpIntBin(binA), as.ExpIntVal(2)), - as.ExpIntVal(4))), keyA, keyA, binA, 1, true}, - {"RShift", as.ExpNot( - as.ExpEq( - as.ExpIntRShift(as.ExpIntBin(binE), as.ExpIntVal(62)), - as.ExpIntVal(3))), keyB, keyB, binE, -2, true}, - {"ARShift", as.ExpNot( - as.ExpEq( - as.ExpIntARShift(as.ExpIntBin(binE), as.ExpIntVal(62)), - as.ExpIntVal(-1))), keyB, keyB, binE, -2, true}, - {"BitCount", as.ExpNot( - as.ExpEq( - as.ExpIntCount(as.ExpIntBin(binA)), - as.ExpIntVal(1))), keyA, keyA, binA, 1, true}, - {"LScan", as.ExpNot( - as.ExpEq( - as.ExpIntLScan(as.ExpIntBin(binA), as.ExpBoolVal(true)), - as.ExpIntVal(63))), keyA, keyA, binA, 1, true}, - {"RScan", as.ExpNot( - as.ExpEq( - as.ExpIntRScan(as.ExpIntBin(binA), as.ExpBoolVal(true)), - as.ExpIntVal(63))), keyA, keyA, binA, 1, true}, - {"Min", as.ExpNot( - as.ExpEq( - as.ExpMin(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntBin(binE)), - as.ExpIntVal(-1))), keyA, keyA, binA, 1, true}, - {"Max", as.ExpNot( - as.ExpEq( - as.ExpMax(as.ExpIntBin(binA), as.ExpIntBin(binD), as.ExpIntBin(binE)), - as.ExpIntVal(1))), keyA, keyA, binA, 1, true}, - {"Cond", as.ExpNot( - as.ExpEq( - as.ExpCond( - as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(0)), as.ExpNumAdd(as.ExpIntBin(binD), as.ExpIntBin(binE)), - as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(1)), as.ExpNumSub(as.ExpIntBin(binD), as.ExpIntBin(binE)), - as.ExpEq(as.ExpIntBin(binA), as.ExpIntVal(2)), as.ExpNumMul(as.ExpIntBin(binD), as.ExpIntBin(binE)), - as.ExpIntVal(-1)), - as.ExpIntVal(2))), keyA, keyA, binA, 1, true}, - - {"AddFloat", as.ExpLet( - as.ExpDef("val", as.ExpNumAdd(as.ExpFloatBin(binB), as.ExpFloatVal(1.1))), - as.ExpAnd( - as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(3.2999)), - as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(3.3001)), - )), - keyA, keyB, binA, 2, false}, - {"LogFloat", as.ExpLet( - as.ExpDef("val", as.ExpNumLog(as.ExpFloatBin(binB), as.ExpFloatVal(2.0))), - as.ExpAnd( - as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(1.1374)), - as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(1.1376)))), keyA, keyB, binA, 2, false}, - {"PowFloat", as.ExpLet( - as.ExpDef("val", as.ExpNumPow(as.ExpFloatBin(binB), as.ExpFloatVal(2.0))), - as.ExpAnd( - as.ExpGreaterEq(as.ExpVar("val"), as.ExpFloatVal(4.8399)), - as.ExpLessEq(as.ExpVar("val"), as.ExpFloatVal(4.8401)))), keyA, keyB, binA, 2, false}, - } - - gg.BeforeAll(func() { - err := client.Put(nil, keyA, as.BinMap{binA: 1, binB: 1.1, binC: "abcde", binD: 1, binE: -1}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.Put(nil, keyB, as.BinMap{binA: 2, binB: 2.2, binC: "abcdeabcde", binD: 1, binE: -2}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.Put(nil, keyC, as.BinMap{binA: 0, binB: -1, binC: 1}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - assertBinEqual := func(key *as.Key, r as.BinMap, binName string, expected interface{}) { - _, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(r[binName]).To(gm.Equal(expected)) - } - - gg.It("Filtering via expressions should work", func() { - for _, params := range matrix { - policy := as.NewPolicy() - policy.FilterExpression = params.exp - _, err := client.Get(policy, params.key) - gm.Expect(err.Matches(ast.FILTERED_OUT)).To(gm.BeTrue()) - - if params.reverseExp { - policy.FilterExpression = as.ExpNot(policy.FilterExpression) - } - - r, err := client.Get(policy, params.expKey) - gm.Expect(err).ToNot(gm.HaveOccurred()) - assertBinEqual(params.key, r.Bins, params.bin, params.expected) - } - }) - - }) - -}) // Describe diff --git a/aerospike-tls/vendor-aerospike-client-go/field_type.go b/aerospike-tls/vendor-aerospike-client-go/field_type.go deleted file mode 100644 index 84ff3382..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/field_type.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// FieldType represents the type of the field in Aerospike Wire Protocol -type FieldType int - -// FieldType constants used in the Aerospike Wire Protocol. -const ( - NAMESPACE FieldType = 0 - TABLE FieldType = 1 - KEY FieldType = 2 - - //BIN FieldType = 3; - - DIGEST_RIPE FieldType = 4 - - //GU_TID FieldType = 5; - - DIGEST_RIPE_ARRAY FieldType = 6 - TRAN_ID FieldType = 7 // user supplied transaction id, which is simply passed back - SCAN_OPTIONS FieldType = 8 - SOCKET_TIMEOUT FieldType = 9 - RECORDS_PER_SECOND FieldType = 10 - PID_ARRAY FieldType = 11 - DIGEST_ARRAY FieldType = 12 - MAX_RECORDS FieldType = 13 - BVAL_ARRAY FieldType = 15 - INDEX_NAME FieldType = 21 - INDEX_RANGE FieldType = 22 - INDEX_CONTEXT FieldType = 23 - INDEX_TYPE FieldType = 26 - UDF_PACKAGE_NAME FieldType = 30 - UDF_FUNCTION FieldType = 31 - UDF_ARGLIST FieldType = 32 - UDF_OP FieldType = 33 - QUERY_BINLIST FieldType = 40 - BATCH_INDEX FieldType = 41 - BATCH_INDEX_WITH_SET FieldType = 42 - FILTER_EXP FieldType = 43 -) diff --git a/aerospike-tls/vendor-aerospike-client-go/filter.go b/aerospike-tls/vendor-aerospike-client-go/filter.go deleted file mode 100644 index a07c0634..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/filter.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" -) - -// Filter specifies a query filter definition. -type Filter struct { - name string - idxType IndexCollectionType - valueParticleType int - begin Value - end Value - ctx []*CDTContext -} - -// NewEqualFilter creates a new equality filter instance for query. -// Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+. -func NewEqualFilter(binName string, value interface{}, ctx ...*CDTContext) *Filter { - val := NewValue(value) - return NewFilter(binName, ICT_DEFAULT, val.GetType(), val, val, ctx) -} - -// NewRangeFilter creates a range filter for query. -// Range arguments must be int64 values. -// String ranges are not supported. -func NewRangeFilter(binName string, begin int64, end int64, ctx ...*CDTContext) *Filter { - vBegin, vEnd := NewValue(begin), NewValue(end) - return NewFilter(binName, ICT_DEFAULT, vBegin.GetType(), vBegin, vEnd, ctx) -} - -// NewContainsFilter creates a contains filter for query on collection index. -// Value can be an integer, string or a blob (byte array). Byte arrays are only supported on server v7+. -func NewContainsFilter(binName string, indexCollectionType IndexCollectionType, value interface{}, ctx ...*CDTContext) *Filter { - v := NewValue(value) - return NewFilter(binName, indexCollectionType, v.GetType(), v, v, ctx) -} - -// NewContainsRangeFilter creates a contains filter for query on ranges of data in a collection index. -func NewContainsRangeFilter(binName string, indexCollectionType IndexCollectionType, begin, end int64, ctx ...*CDTContext) *Filter { - vBegin, vEnd := NewValue(begin), NewValue(end) - return NewFilter(binName, indexCollectionType, vBegin.GetType(), vBegin, vEnd, ctx) -} - -// NewGeoWithinRegionFilter creates a geospatial "within region" filter for query. -// Argument must be a valid GeoJSON region. -func NewGeoWithinRegionFilter(binName, region string, ctx ...*CDTContext) *Filter { - v := NewStringValue(region) - return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, v, v, ctx) -} - -// NewGeoWithinRegionForCollectionFilter creates a geospatial "within region" filter for query on collection index. -// Argument must be a valid GeoJSON region. -func NewGeoWithinRegionForCollectionFilter(binName string, collectionType IndexCollectionType, region string, ctx ...*CDTContext) *Filter { - v := NewStringValue(region) - return NewFilter(binName, collectionType, ParticleType.GEOJSON, v, v, ctx) -} - -// NewGeoRegionsContainingPointFilter creates a geospatial "containing point" filter for query. -// Argument must be a valid GeoJSON point. -func NewGeoRegionsContainingPointFilter(binName, point string, ctx ...*CDTContext) *Filter { - v := NewStringValue(point) - return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, v, v, ctx) -} - -// NewGeoRegionsContainingPointForCollectionFilter creates a geospatial "containing point" filter for query on collection index. -// Argument must be a valid GeoJSON point. -func NewGeoRegionsContainingPointForCollectionFilter(binName string, collectionType IndexCollectionType, point string, ctx ...*CDTContext) *Filter { - v := NewStringValue(point) - return NewFilter(binName, collectionType, ParticleType.GEOJSON, v, v, ctx) -} - -// NewGeoWithinRadiusFilter creates a geospatial "within radius" filter for query. -// Arguments must be valid longitude/latitude/radius (meters) values. -func NewGeoWithinRadiusFilter(binName string, lng, lat, radius float64, ctx ...*CDTContext) *Filter { - rgnStr := fmt.Sprintf("{ \"type\": \"AeroCircle\", "+"\"coordinates\": [[%.8f, %.8f], %f] }", lng, lat, radius) - return NewFilter(binName, ICT_DEFAULT, ParticleType.GEOJSON, NewValue(rgnStr), NewValue(rgnStr), ctx) -} - -// NewGeoWithinRadiusForCollectionFilter creates a geospatial "within radius" filter for query on collection index. -// Arguments must be valid longitude/latitude/radius (meters) values. -func NewGeoWithinRadiusForCollectionFilter(binName string, collectionType IndexCollectionType, lng, lat, radius float64, ctx ...*CDTContext) *Filter { - rgnStr := fmt.Sprintf("{ \"type\": \"AeroCircle\", "+"\"coordinates\": [[%.8f, %.8f], %f] }", lng, lat, radius) - return NewFilter(binName, collectionType, ParticleType.GEOJSON, NewValue(rgnStr), NewValue(rgnStr), ctx) -} - -// Create a filter for query. -// Range arguments must be longs or integers which can be cast to longs. -// String ranges are not supported. -func NewFilter(name string, indexCollectionType IndexCollectionType, valueParticleType int, begin Value, end Value, ctx []*CDTContext) *Filter { - return &Filter{ - name: name, - idxType: indexCollectionType, - valueParticleType: valueParticleType, - begin: begin, - end: end, - ctx: ctx, - } -} - -func (fltr *Filter) String() string { - return fmt.Sprintf("Filter: {name: %s, index type: %s, value particle type: %d, begin: %s, end: %s, context: %v}", - fltr.name, - fltr.idxType, - fltr.valueParticleType, - fltr.begin, - fltr.end, - fltr.ctx, - ) -} - -// IndexCollectionType returns filter's index type. -func (fltr *Filter) IndexCollectionType() IndexCollectionType { - return fltr.idxType -} - -// EstimateSize will estimate the size of the filter for wire protocol -func (fltr *Filter) EstimateSize() (int, Error) { - // bin name size(1) + particle type size(1) + begin particle size(4) + end particle size(4) = 10 - szBegin, err := fltr.begin.EstimateSize() - if err != nil { - return szBegin, err - } - - szEnd, err := fltr.end.EstimateSize() - if err != nil { - return szEnd, err - } - - return len(fltr.name) + szBegin + szEnd + 10, nil -} - -func (fltr *Filter) grpcPackCtxPayload() []byte { - sz, err := fltr.estimatePackedCtxSize() - if err != nil { - panic(err) - } - buf := newBuffer(sz) - if _, err := fltr.packCtx(buf); err != nil { - panic(err) - } - return buf.Bytes() -} - -// Retrieve packed Context. -// For internal use only. -func (fltr *Filter) packCtx(cmd BufferEx) (sz int, err Error) { - if len(fltr.ctx) > 0 { - sz, err = cdtContextList(fltr.ctx).packArray(cmd) - } - return sz, err -} - -// Retrieve packed Context size. -// For internal use only. -func (fltr *Filter) estimatePackedCtxSize() (sz int, err Error) { - if len(fltr.ctx) > 0 { - sz, err = cdtContextList(fltr.ctx).packArray(nil) - } - return sz, err -} - -func (fltr *Filter) write(cmd *baseCommand) (int, Error) { - size := 0 - - // Write name length - cmd.WriteByte(byte(len(fltr.name))) - size++ - - // Write Name - n, err := cmd.WriteString(fltr.name) - if err != nil { - return size + n, err - } - size += n - - // Write particle type. - cmd.WriteByte(byte(fltr.valueParticleType)) - size++ - - // Write filter begin. - esz, err := fltr.begin.EstimateSize() - if err != nil { - return size, err - } - - n = cmd.WriteInt32(int32(esz)) - size += n - - n, err = fltr.begin.write(cmd) - if err != nil { - return size + n, err - } - size += n - - // Write filter end. - esz, err = fltr.end.EstimateSize() - if err != nil { - return size, err - } - - n = cmd.WriteInt32(int32(esz)) - size += n - - n, err = fltr.end.write(cmd) - if err != nil { - return size + n, err - } - size += n - - return size, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/generation_policy.go b/aerospike-tls/vendor-aerospike-client-go/generation_policy.go deleted file mode 100644 index 94efbc8d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/generation_policy.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// GenerationPolicy determines how to handle record writes based on record generation. -type GenerationPolicy int - -const ( - // NONE means: Do not use record generation to restrict writes. - NONE GenerationPolicy = iota - - // EXPECT_GEN_EQUAL means: Update/Delete record if expected generation is equal to server generation. Otherwise, fail. - EXPECT_GEN_EQUAL - - // EXPECT_GEN_GT means: Update/Delete record if expected generation greater than the server generation. Otherwise, fail. - // This is useful for restore after backup. - EXPECT_GEN_GT -) diff --git a/aerospike-tls/vendor-aerospike-client-go/generics.go b/aerospike-tls/vendor-aerospike-client-go/generics.go deleted file mode 100644 index a3964798..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/generics.go +++ /dev/null @@ -1,3643 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type stringSlice []string - -// PackList packs StringSlice as msgpack. -func (ts stringSlice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackString(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of StringSlice -func (ts stringSlice) Len() int { - return len(ts) -} - -type intSlice []int - -// PackList packs IntSlice as msgpack. -func (ts intSlice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of IntSlice -func (ts intSlice) Len() int { - return len(ts) -} - -type int8Slice []int8 - -// PackList packs Int8Slice as msgpack. -func (ts int8Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Int8Slice -func (ts int8Slice) Len() int { - return len(ts) -} - -type int16Slice []int16 - -// PackList packs Int16Slice as msgpack. -func (ts int16Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Int16Slice -func (ts int16Slice) Len() int { - return len(ts) -} - -type int32Slice []int32 - -// PackList packs Int32Slice as msgpack. -func (ts int32Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Int32Slice -func (ts int32Slice) Len() int { - return len(ts) -} - -type int64Slice []int64 - -// PackList packs Int64Slice as msgpack. -func (ts int64Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Int64Slice -func (ts int64Slice) Len() int { - return len(ts) -} - -type uint16Slice []uint16 - -// PackList packs Uint16Slice as msgpack. -func (ts uint16Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Uint16Slice -func (ts uint16Slice) Len() int { - return len(ts) -} - -type uint32Slice []uint32 - -// PackList packs Uint32Slice as msgpack. -func (ts uint32Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackInt64(buf, int64(elem)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Uint32Slice -func (ts uint32Slice) Len() int { - return len(ts) -} - -type uint64Slice []uint64 - -// PackList packs Uint64Slice as msgpack. -func (ts uint64Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackUInt64(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Uint64Slice -func (ts uint64Slice) Len() int { - return len(ts) -} - -type float32Slice []float32 - -// PackList packs Float32Slice as msgpack. -func (ts float32Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackFloat32(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Float32Slice -func (ts float32Slice) Len() int { - return len(ts) -} - -type float64Slice []float64 - -// PackList packs Float64Slice as msgpack. -func (ts float64Slice) PackList(buf BufferEx) (int, error) { - size := 0 - for _, elem := range ts { - n, err := PackFloat64(buf, elem) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of Float64Slice -func (ts float64Slice) Len() int { - return len(ts) -} - -/////////////////////////////////////////////////////////////////////////////////////////// - -type stringStringMap map[string]string - -// PackMap packs TypeMap as msgpack. -func (tm stringStringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringStringMap) Len() int { - return len(tm) -} - -type stringIntMap map[string]int - -// PackMap packs TypeMap as msgpack. -func (tm stringIntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringIntMap) Len() int { - return len(tm) -} - -type stringInt8Map map[string]int8 - -// PackMap packs TypeMap as msgpack. -func (tm stringInt8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringInt8Map) Len() int { - return len(tm) -} - -type stringInt16Map map[string]int16 - -// PackMap packs TypeMap as msgpack. -func (tm stringInt16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringInt16Map) Len() int { - return len(tm) -} - -type stringInt32Map map[string]int32 - -// PackMap packs TypeMap as msgpack. -func (tm stringInt32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringInt32Map) Len() int { - return len(tm) -} - -type stringInt64Map map[string]int64 - -// PackMap packs TypeMap as msgpack. -func (tm stringInt64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringInt64Map) Len() int { - return len(tm) -} - -type stringUint16Map map[string]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm stringUint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringUint16Map) Len() int { - return len(tm) -} - -type stringUint32Map map[string]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm stringUint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringUint32Map) Len() int { - return len(tm) -} - -type stringFloat32Map map[string]float32 - -// PackMap packs TypeMap as msgpack. -func (tm stringFloat32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringFloat32Map) Len() int { - return len(tm) -} - -type stringFloat64Map map[string]float64 - -// PackMap packs TypeMap as msgpack. -func (tm stringFloat64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringFloat64Map) Len() int { - return len(tm) -} - -type intStringMap map[int]string - -// PackMap packs TypeMap as msgpack. -func (tm intStringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intStringMap) Len() int { - return len(tm) -} - -type intIntMap map[int]int - -// PackMap packs TypeMap as msgpack. -func (tm intIntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intIntMap) Len() int { - return len(tm) -} - -type intInt8Map map[int]int8 - -// PackMap packs TypeMap as msgpack. -func (tm intInt8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intInt8Map) Len() int { - return len(tm) -} - -type intInt16Map map[int]int16 - -// PackMap packs TypeMap as msgpack. -func (tm intInt16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intInt16Map) Len() int { - return len(tm) -} - -type intInt32Map map[int]int32 - -// PackMap packs TypeMap as msgpack. -func (tm intInt32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intInt32Map) Len() int { - return len(tm) -} - -type intInt64Map map[int]int64 - -// PackMap packs TypeMap as msgpack. -func (tm intInt64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intInt64Map) Len() int { - return len(tm) -} - -type intUint16Map map[int]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm intUint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intUint16Map) Len() int { - return len(tm) -} - -type intUint32Map map[int]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm intUint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intUint32Map) Len() int { - return len(tm) -} - -type intFloat32Map map[int]float32 - -// PackMap packs TypeMap as msgpack. -func (tm intFloat32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intFloat32Map) Len() int { - return len(tm) -} - -type intFloat64Map map[int]float64 - -// PackMap packs TypeMap as msgpack. -func (tm intFloat64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intFloat64Map) Len() int { - return len(tm) -} - -type intInterfaceMap map[int]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm intInterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intInterfaceMap) Len() int { - return len(tm) -} - -type int8StringMap map[int8]string - -// PackMap packs TypeMap as msgpack. -func (tm int8StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8StringMap) Len() int { - return len(tm) -} - -type int8IntMap map[int8]int - -// PackMap packs TypeMap as msgpack. -func (tm int8IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8IntMap) Len() int { - return len(tm) -} - -type int8Int8Map map[int8]int8 - -// PackMap packs TypeMap as msgpack. -func (tm int8Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Int8Map) Len() int { - return len(tm) -} - -type int8Int16Map map[int8]int16 - -// PackMap packs TypeMap as msgpack. -func (tm int8Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Int16Map) Len() int { - return len(tm) -} - -type int8Int32Map map[int8]int32 - -// PackMap packs TypeMap as msgpack. -func (tm int8Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Int32Map) Len() int { - return len(tm) -} - -type int8Int64Map map[int8]int64 - -// PackMap packs TypeMap as msgpack. -func (tm int8Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Int64Map) Len() int { - return len(tm) -} - -type int8Uint16Map map[int8]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm int8Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Uint16Map) Len() int { - return len(tm) -} - -type int8Uint32Map map[int8]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm int8Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Uint32Map) Len() int { - return len(tm) -} - -type int8Float32Map map[int8]float32 - -// PackMap packs TypeMap as msgpack. -func (tm int8Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Float32Map) Len() int { - return len(tm) -} - -type int8Float64Map map[int8]float64 - -// PackMap packs TypeMap as msgpack. -func (tm int8Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Float64Map) Len() int { - return len(tm) -} - -type int8InterfaceMap map[int8]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm int8InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8InterfaceMap) Len() int { - return len(tm) -} - -type int16StringMap map[int16]string - -// PackMap packs TypeMap as msgpack. -func (tm int16StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16StringMap) Len() int { - return len(tm) -} - -type int16IntMap map[int16]int - -// PackMap packs TypeMap as msgpack. -func (tm int16IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16IntMap) Len() int { - return len(tm) -} - -type int16Int8Map map[int16]int8 - -// PackMap packs TypeMap as msgpack. -func (tm int16Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Int8Map) Len() int { - return len(tm) -} - -type int16Int16Map map[int16]int16 - -// PackMap packs TypeMap as msgpack. -func (tm int16Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Int16Map) Len() int { - return len(tm) -} - -type int16Int32Map map[int16]int32 - -// PackMap packs TypeMap as msgpack. -func (tm int16Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Int32Map) Len() int { - return len(tm) -} - -type int16Int64Map map[int16]int64 - -// PackMap packs TypeMap as msgpack. -func (tm int16Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Int64Map) Len() int { - return len(tm) -} - -type int16Uint16Map map[int16]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm int16Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Uint16Map) Len() int { - return len(tm) -} - -type int16Uint32Map map[int16]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm int16Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Uint32Map) Len() int { - return len(tm) -} - -type int16Float32Map map[int16]float32 - -// PackMap packs TypeMap as msgpack. -func (tm int16Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Float32Map) Len() int { - return len(tm) -} - -type int16Float64Map map[int16]float64 - -// PackMap packs TypeMap as msgpack. -func (tm int16Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Float64Map) Len() int { - return len(tm) -} - -type int16InterfaceMap map[int16]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm int16InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16InterfaceMap) Len() int { - return len(tm) -} - -type int32StringMap map[int32]string - -// PackMap packs TypeMap as msgpack. -func (tm int32StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32StringMap) Len() int { - return len(tm) -} - -type int32IntMap map[int32]int - -// PackMap packs TypeMap as msgpack. -func (tm int32IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32IntMap) Len() int { - return len(tm) -} - -type int32Int8Map map[int32]int8 - -// PackMap packs TypeMap as msgpack. -func (tm int32Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Int8Map) Len() int { - return len(tm) -} - -type int32Int16Map map[int32]int16 - -// PackMap packs TypeMap as msgpack. -func (tm int32Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Int16Map) Len() int { - return len(tm) -} - -type int32Int32Map map[int32]int32 - -// PackMap packs TypeMap as msgpack. -func (tm int32Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Int32Map) Len() int { - return len(tm) -} - -type int32Int64Map map[int32]int64 - -// PackMap packs TypeMap as msgpack. -func (tm int32Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Int64Map) Len() int { - return len(tm) -} - -type int32Uint16Map map[int32]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm int32Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Uint16Map) Len() int { - return len(tm) -} - -type int32Uint32Map map[int32]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm int32Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Uint32Map) Len() int { - return len(tm) -} - -type int32Float32Map map[int32]float32 - -// PackMap packs TypeMap as msgpack. -func (tm int32Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Float32Map) Len() int { - return len(tm) -} - -type int32Float64Map map[int32]float64 - -// PackMap packs TypeMap as msgpack. -func (tm int32Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Float64Map) Len() int { - return len(tm) -} - -type int32InterfaceMap map[int32]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm int32InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32InterfaceMap) Len() int { - return len(tm) -} - -type int64StringMap map[int64]string - -// PackMap packs TypeMap as msgpack. -func (tm int64StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64StringMap) Len() int { - return len(tm) -} - -type int64IntMap map[int64]int - -// PackMap packs TypeMap as msgpack. -func (tm int64IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64IntMap) Len() int { - return len(tm) -} - -type int64Int8Map map[int64]int8 - -// PackMap packs TypeMap as msgpack. -func (tm int64Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Int8Map) Len() int { - return len(tm) -} - -type int64Int16Map map[int64]int16 - -// PackMap packs TypeMap as msgpack. -func (tm int64Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Int16Map) Len() int { - return len(tm) -} - -type int64Int32Map map[int64]int32 - -// PackMap packs TypeMap as msgpack. -func (tm int64Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Int32Map) Len() int { - return len(tm) -} - -type int64Int64Map map[int64]int64 - -// PackMap packs TypeMap as msgpack. -func (tm int64Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Int64Map) Len() int { - return len(tm) -} - -type int64Uint16Map map[int64]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm int64Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Uint16Map) Len() int { - return len(tm) -} - -type int64Uint32Map map[int64]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm int64Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Uint32Map) Len() int { - return len(tm) -} - -type int64Float32Map map[int64]float32 - -// PackMap packs TypeMap as msgpack. -func (tm int64Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Float32Map) Len() int { - return len(tm) -} - -type int64Float64Map map[int64]float64 - -// PackMap packs TypeMap as msgpack. -func (tm int64Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Float64Map) Len() int { - return len(tm) -} - -type int64InterfaceMap map[int64]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm int64InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64InterfaceMap) Len() int { - return len(tm) -} - -type uint16StringMap map[uint16]string - -// PackMap packs TypeMap as msgpack. -func (tm uint16StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16StringMap) Len() int { - return len(tm) -} - -type uint16IntMap map[uint16]int - -// PackMap packs TypeMap as msgpack. -func (tm uint16IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16IntMap) Len() int { - return len(tm) -} - -type uint16Int8Map map[uint16]int8 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Int8Map) Len() int { - return len(tm) -} - -type uint16Int16Map map[uint16]int16 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Int16Map) Len() int { - return len(tm) -} - -type uint16Int32Map map[uint16]int32 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Int32Map) Len() int { - return len(tm) -} - -type uint16Int64Map map[uint16]int64 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Int64Map) Len() int { - return len(tm) -} - -type uint16Uint16Map map[uint16]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Uint16Map) Len() int { - return len(tm) -} - -type uint16Uint32Map map[uint16]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Uint32Map) Len() int { - return len(tm) -} - -type uint16Float32Map map[uint16]float32 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Float32Map) Len() int { - return len(tm) -} - -type uint16Float64Map map[uint16]float64 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Float64Map) Len() int { - return len(tm) -} - -type uint16InterfaceMap map[uint16]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm uint16InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16InterfaceMap) Len() int { - return len(tm) -} - -type uint32StringMap map[uint32]string - -// PackMap packs TypeMap as msgpack. -func (tm uint32StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32StringMap) Len() int { - return len(tm) -} - -type uint32IntMap map[uint32]int - -// PackMap packs TypeMap as msgpack. -func (tm uint32IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32IntMap) Len() int { - return len(tm) -} - -type uint32Int8Map map[uint32]int8 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Int8Map) Len() int { - return len(tm) -} - -type uint32Int16Map map[uint32]int16 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Int16Map) Len() int { - return len(tm) -} - -type uint32Int32Map map[uint32]int32 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Int32Map) Len() int { - return len(tm) -} - -type uint32Int64Map map[uint32]int64 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Int64Map) Len() int { - return len(tm) -} - -type uint32Uint16Map map[uint32]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Uint16Map) Len() int { - return len(tm) -} - -type uint32Uint32Map map[uint32]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Uint32Map) Len() int { - return len(tm) -} - -type uint32Float32Map map[uint32]float32 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Float32Map) Len() int { - return len(tm) -} - -type uint32Float64Map map[uint32]float64 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Float64Map) Len() int { - return len(tm) -} - -type uint32InterfaceMap map[uint32]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm uint32InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32InterfaceMap) Len() int { - return len(tm) -} - -type float32StringMap map[float32]string - -// PackMap packs TypeMap as msgpack. -func (tm float32StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32StringMap) Len() int { - return len(tm) -} - -type float32IntMap map[float32]int - -// PackMap packs TypeMap as msgpack. -func (tm float32IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32IntMap) Len() int { - return len(tm) -} - -type float32Int8Map map[float32]int8 - -// PackMap packs TypeMap as msgpack. -func (tm float32Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Int8Map) Len() int { - return len(tm) -} - -type float32Int16Map map[float32]int16 - -// PackMap packs TypeMap as msgpack. -func (tm float32Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Int16Map) Len() int { - return len(tm) -} - -type float32Int32Map map[float32]int32 - -// PackMap packs TypeMap as msgpack. -func (tm float32Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Int32Map) Len() int { - return len(tm) -} - -type float32Int64Map map[float32]int64 - -// PackMap packs TypeMap as msgpack. -func (tm float32Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Int64Map) Len() int { - return len(tm) -} - -type float32Uint16Map map[float32]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm float32Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Uint16Map) Len() int { - return len(tm) -} - -type float32Uint32Map map[float32]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm float32Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Uint32Map) Len() int { - return len(tm) -} - -type float32Float32Map map[float32]float32 - -// PackMap packs TypeMap as msgpack. -func (tm float32Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Float32Map) Len() int { - return len(tm) -} - -type float32Float64Map map[float32]float64 - -// PackMap packs TypeMap as msgpack. -func (tm float32Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Float64Map) Len() int { - return len(tm) -} - -type float32InterfaceMap map[float32]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm float32InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32InterfaceMap) Len() int { - return len(tm) -} - -type float64StringMap map[float64]string - -// PackMap packs TypeMap as msgpack. -func (tm float64StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64StringMap) Len() int { - return len(tm) -} - -type float64IntMap map[float64]int - -// PackMap packs TypeMap as msgpack. -func (tm float64IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64IntMap) Len() int { - return len(tm) -} - -type float64Int8Map map[float64]int8 - -// PackMap packs TypeMap as msgpack. -func (tm float64Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Int8Map) Len() int { - return len(tm) -} - -type float64Int16Map map[float64]int16 - -// PackMap packs TypeMap as msgpack. -func (tm float64Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Int16Map) Len() int { - return len(tm) -} - -type float64Int32Map map[float64]int32 - -// PackMap packs TypeMap as msgpack. -func (tm float64Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Int32Map) Len() int { - return len(tm) -} - -type float64Int64Map map[float64]int64 - -// PackMap packs TypeMap as msgpack. -func (tm float64Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Int64Map) Len() int { - return len(tm) -} - -type float64Uint16Map map[float64]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm float64Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Uint16Map) Len() int { - return len(tm) -} - -type float64Uint32Map map[float64]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm float64Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Uint32Map) Len() int { - return len(tm) -} - -type float64Float32Map map[float64]float32 - -// PackMap packs TypeMap as msgpack. -func (tm float64Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Float32Map) Len() int { - return len(tm) -} - -type float64Float64Map map[float64]float64 - -// PackMap packs TypeMap as msgpack. -func (tm float64Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Float64Map) Len() int { - return len(tm) -} - -type float64InterfaceMap map[float64]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm float64InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64InterfaceMap) Len() int { - return len(tm) -} - -type stringUint64Map map[string]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm stringUint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackString(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm stringUint64Map) Len() int { - return len(tm) -} - -type intUint64Map map[int]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm intUint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm intUint64Map) Len() int { - return len(tm) -} - -type int8Uint64Map map[int8]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm int8Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int8Uint64Map) Len() int { - return len(tm) -} - -type int16Uint64Map map[int16]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm int16Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int16Uint64Map) Len() int { - return len(tm) -} - -type int32Uint64Map map[int32]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm int32Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int32Uint64Map) Len() int { - return len(tm) -} - -type int64Uint64Map map[int64]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm int64Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm int64Uint64Map) Len() int { - return len(tm) -} - -type uint16Uint64Map map[uint16]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm uint16Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint16Uint64Map) Len() int { - return len(tm) -} - -type uint32Uint64Map map[uint32]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm uint32Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackInt64(buf, int64(k)) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint32Uint64Map) Len() int { - return len(tm) -} - -type float32Uint64Map map[float32]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm float32Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat32(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float32Uint64Map) Len() int { - return len(tm) -} - -type float64Uint64Map map[float64]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm float64Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackFloat64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm float64Uint64Map) Len() int { - return len(tm) -} - -type uint64StringMap map[uint64]string - -// PackMap packs TypeMap as msgpack. -func (tm uint64StringMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackString(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64StringMap) Len() int { - return len(tm) -} - -type uint64IntMap map[uint64]int - -// PackMap packs TypeMap as msgpack. -func (tm uint64IntMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64IntMap) Len() int { - return len(tm) -} - -type uint64Int8Map map[uint64]int8 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Int8Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Int8Map) Len() int { - return len(tm) -} - -type uint64Int16Map map[uint64]int16 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Int16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Int16Map) Len() int { - return len(tm) -} - -type uint64Int32Map map[uint64]int32 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Int32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Int32Map) Len() int { - return len(tm) -} - -type uint64Int64Map map[uint64]int64 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Int64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Int64Map) Len() int { - return len(tm) -} - -type uint64Uint16Map map[uint64]uint16 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Uint16Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Uint16Map) Len() int { - return len(tm) -} - -type uint64Uint32Map map[uint64]uint32 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Uint32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackInt64(buf, int64(v)) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Uint32Map) Len() int { - return len(tm) -} - -type uint64Uint64Map map[uint64]uint64 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Uint64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackUInt64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Uint64Map) Len() int { - return len(tm) -} - -type uint64Float32Map map[uint64]float32 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Float32Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat32(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Float32Map) Len() int { - return len(tm) -} - -type uint64Float64Map map[uint64]float64 - -// PackMap packs TypeMap as msgpack. -func (tm uint64Float64Map) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = PackFloat64(buf, v) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64Float64Map) Len() int { - return len(tm) -} - -type uint64InterfaceMap map[uint64]interface{} - -// PackMap packs TypeMap as msgpack. -func (tm uint64InterfaceMap) PackMap(buf BufferEx) (int, error) { - size := 0 - for k, v := range tm { - n, err := PackUInt64(buf, k) - size += n - if err != nil { - return size, err - } - - n, err = packObject(buf, v, false) - size += n - if err != nil { - return size, err - } - } - return size, nil -} - -// Len return the length of TypeSlice -func (tm uint64InterfaceMap) Len() int { - return len(tm) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/geo_test.go b/aerospike-tls/vendor-aerospike-client-go/geo_test.go deleted file mode 100644 index 1e5793ec..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/geo_test.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Geo Spacial Tests", gg.Ordered, func() { - - gg.BeforeEach(func() { - if !featureEnabled("geo") { - gg.Skip("Geo Tests will not run since feature is not supported by the server.") - return - } - }) - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - var size = 20 - const keyCount = 1000 - - var binName = "GeoBin" - - gg.BeforeAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - // queries only work on indices - dropIndex(wpolicy, ns, set, set+binName) - createIndex(wpolicy, ns, set, set+binName, binName, as.GEO2DSPHERE) - }) - - gg.AfterAll(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - dropIndex(wpolicy, ns, set, set+binName) - }) - - gg.It("must Query a specific Region Containing a Point and get only relevant records back", func() { - - regions := []as.GeoJSONValue{ - as.NewGeoJSONValue(`{ - "type": "Polygon", - "coordinates": [ - [[-122.500000, 37.000000],[-121.000000, 37.000000], - [-121.000000, 38.080000],[-122.500000, 38.080000], - [-122.500000, 37.000000]] - ] - }`), - // `{ - // "type": "Polygon", - // "coordinates": [ - // [[-125.500000, 33.000000],[-124.000000, 31.000000], - // [-123.000000, 32.080000],[-123.500000, 32.080000], - // [-126.500000, 34.000000]] - // ] - // }`, - } - - for i, ptsb := range regions { - key, _ := as.NewKey(ns, set, i) - bin := as.NewBin(binName, ptsb) - err := client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - points := []as.GeoJSONValue{ - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-122.000000, 37.500000] }`), - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.700000, 37.800000] }`), - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.900000, 37.600000] }`), - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.800000, 37.700000] }`), - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.600000, 37.900000] }`), - as.GeoJSONValue(`{ "type": "Point", "coordinates": [-121.500000, 38.000000] }`), - } - - for _, rgnsb := range points { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewGeoWithinRegionFilter(binName, string(rgnsb))) - recordset, err := client.Query(nil, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - count := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - gm.Expect(regions).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) - count++ - } - - // 1 region should be found - gm.Expect(count).To(gm.Equal(1)) - } - }) - - gg.It("must Query a specific Point in Region and get only relevant records back", func() { - - points := []as.GeoJSONValue{} - for i := 0; i < size; i++ { - lng := -122.0 + (0.1 * float64(i)) - lat := 37.5 + (0.1 * float64(i)) - ptsb := "{ \"type\": \"Point\", \"coordinates\": [" - ptsb += fmt.Sprintf("%f", lng) - ptsb += ", " - ptsb += fmt.Sprintf("%f", lat) - ptsb += "] }" - - points = append(points, as.NewGeoJSONValue(ptsb)) - - key, _ := as.NewKey(ns, set, i) - bin := as.NewBin(binName, as.NewGeoJSONValue(ptsb)) - err := client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - rgnsb := `{ - "type": "Polygon", - "coordinates": [ - [[-122.500000, 37.000000],[-121.000000, 37.000000], - [-121.000000, 38.080000],[-122.500000, 38.080000], - [-122.500000, 37.000000]] - ] - }` - - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewGeoRegionsContainingPointFilter(binName, rgnsb)) - recordset, err := client.Query(nil, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - count := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - gm.Expect(points).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) - count++ - } - - // 6 points should be found - gm.Expect(count).To(gm.Equal(6)) - }) - - gg.It("must Query specific Points in Region denoted by a point and radius and get only relevant records back", func() { - - points := []as.GeoJSONValue{} - for i := 0; i < size; i++ { - lng := -122.0 + (0.1 * float64(i)) - lat := 37.5 + (0.1 * float64(i)) - ptsb := "{ \"type\": \"Point\", \"coordinates\": [" - ptsb += fmt.Sprintf("%f", lng) - ptsb += ", " - ptsb += fmt.Sprintf("%f", lat) - ptsb += "] }" - - points = append(points, as.NewGeoJSONValue(ptsb)) - - key, _ := as.NewKey(ns, set, i) - bin := as.NewBin(binName, as.NewGeoJSONValue(ptsb)) - err := client.PutBins(wpolicy, key, bin) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - lon := float64(-122.0) - lat := float64(37.5) - radius := float64(50000.0) - - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewGeoWithinRadiusFilter(binName, lon, lat, radius)) - recordset, err := client.Query(nil, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - count := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - gm.Expect(points).To(gm.ContainElement(res.Record.Bins[binName].(as.GeoJSONValue))) - count++ - } - - // 6 points should be found - gm.Expect(count).To(gm.Equal(4)) - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/go.mod b/aerospike-tls/vendor-aerospike-client-go/go.mod deleted file mode 100644 index 6f2b6d8e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/go.mod +++ /dev/null @@ -1,35 +0,0 @@ -module github.com/aerospike/aerospike-client-go/v7 - -go 1.20 - -require ( - github.com/onsi/ginkgo/v2 v2.16.0 - github.com/onsi/gomega v1.32.0 - github.com/yuin/gopher-lua v1.1.1 - golang.org/x/sync v0.7.0 - google.golang.org/grpc v1.63.3 - google.golang.org/protobuf v1.34.2 -) - -require ( - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect - github.com/kr/pretty v0.1.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect - github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - -retract ( - v7.3.0 // `Client.BatchGetOperate` issue - v7.7.0 // nil deref in tend logic -) diff --git a/aerospike-tls/vendor-aerospike-client-go/go.sum b/aerospike-tls/vendor-aerospike-client-go/go.sum deleted file mode 100644 index b2dbf46a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/go.sum +++ /dev/null @@ -1,82 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= -github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0= -github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad/go.mod h1:Hy8o65+MXnS6EwGElrSRjUzQDLXreJlzYLlWiHtt8hM= -github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= -github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= -google.golang.org/grpc v1.63.3 h1:FGVegD7MHo/zhaGduk/R85WvSFJ+si70UQIJ0fg+BiU= -google.golang.org/grpc v1.63.3/go.mod h1:5FFeE/YiGPD2flWFCrCx8K3Ay7hALATnKiI8U3avIuw= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/aerospike-tls/vendor-aerospike-client-go/helper_test.go b/aerospike-tls/vendor-aerospike-client-go/helper_test.go deleted file mode 100644 index 30af0ba1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/helper_test.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -func ParseInfoErrorCode(response string) Error { - return parseInfoErrorCode(response) -} - -func (e *AerospikeError) Msg() string { - return e.msg -} - -func (clstr *Cluster) GetMasterNode(partition *Partition) (*Node, Error) { - return partition.getMasterNode(clstr) -} - -// implements GomegaStringer to avoid some of the pain points -// in formatting the code -func (nd *Node) GomegaString() string { - return nd.String() -} - -func (ptn *Partition) GetMasterNode(cluster *Cluster) (*Node, Error) { - return ptn.getMasterNode(cluster) -} - -func (ptn *Partition) GetMasterProlesNode(cluster *Cluster) (*Node, Error) { - return ptn.getMasterProlesNode(cluster) -} - -// fillMinCounts will fill the connection pool to the minimum required -// by the ClientPolicy.MinConnectionsPerNode -func (nd *Node) ConnsCount() int { - return nd.connectionCount.Get() -} - -// CloseConnections closes all the node connections -func (nd *Node) CloseConnections() { - nd.closeConnections() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_operation.go b/aerospike-tls/vendor-aerospike-client-go/hll_operation.go deleted file mode 100644 index c32e079c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/hll_operation.go +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import ( - "fmt" - - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" -) - -// HyperLogLog (HLL) operations. -// Requires server versions >= 4.9. -// -// HyperLogLog operations on HLL items nested in lists/maps are not currently -// supported by the server. -const ( - _HLL_INIT = 0 - _HLL_ADD = 1 - _HLL_SET_UNION = 2 - _HLL_SET_COUNT = 3 - _HLL_FOLD = 4 - _HLL_COUNT = 50 - _HLL_UNION = 51 - _HLL_UNION_COUNT = 52 - _HLL_INTERSECT_COUNT = 53 - _HLL_SIMILARITY = 54 - _HLL_DESCRIBE = 55 -) - -// HLLInitOp creates HLL init operation with minhash bits. -// Server creates a new HLL or resets an existing HLL. -// Server does not return a value. -// -// policy write policy, use DefaultHLLPolicy for default -// binName name of bin -// indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. -// minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. -// indexBitCount + minHashBitCount must be <= 64. -func HLLInitOp(policy *HLLPolicy, binName string, indexBitCount, minHashBitCount int) *Operation { - return &Operation{ - opType: _HLL_MODIFY, - binName: binName, - binValue: ListValue{_HLL_INIT, IntegerValue(indexBitCount), IntegerValue(minHashBitCount), IntegerValue(policy.flags)}, - encoder: newHLLEncoder, - } -} - -// HLLAddOp creates HLL add operation with minhash bits. -// Server adds values to HLL set. If HLL bin does not exist, use indexBitCount and minHashBitCount -// to create HLL bin. Server returns number of entries that caused HLL to update a register. -// -// policy write policy, use DefaultHLLPolicy for default -// binName name of bin -// list list of values to be added -// indexBitCount number of index bits. Must be between 4 and 16 inclusive. Pass -1 for default. -// minHashBitCount number of min hash bits. Must be between 4 and 58 inclusive. Pass -1 for default. -// indexBitCount + minHashBitCount must be <= 64. -func HLLAddOp(policy *HLLPolicy, binName string, list []Value, indexBitCount, minHashBitCount int) *Operation { - return &Operation{ - opType: _HLL_MODIFY, - binName: binName, - binValue: ListValue{_HLL_ADD, ValueArray(list), IntegerValue(indexBitCount), IntegerValue(minHashBitCount), IntegerValue(policy.flags)}, - encoder: newHLLEncoder, - } -} - -// HLLSetUnionOp creates HLL set union operation. -// Server sets union of specified HLL objects with HLL bin. -// Server does not return a value. -// -// policy write policy, use DefaultHLLPolicy for default -// binName name of bin -// list list of HLL objects -func HLLSetUnionOp(policy *HLLPolicy, binName string, list []HLLValue) *Operation { - return &Operation{ - opType: _HLL_MODIFY, - binName: binName, - binValue: ListValue{_HLL_SET_UNION, _HLLValueArray(list), IntegerValue(policy.flags)}, - encoder: newHLLEncoder, - } -} - -// HLLRefreshCountOp creates HLL refresh operation. -// Server updates the cached count (if stale) and returns the count. -// -// binName name of bin -func HLLRefreshCountOp(binName string) *Operation { - return &Operation{ - opType: _HLL_MODIFY, - binName: binName, - binValue: ListValue{_HLL_SET_COUNT}, - encoder: newHLLEncoder, - } -} - -// HLLFoldOp creates HLL fold operation. -// Servers folds indexBitCount to the specified value. -// This can only be applied when minHashBitCount on the HLL bin is 0. -// Server does not return a value. -// -// binName name of bin -// indexBitCount number of index bits. Must be between 4 and 16 inclusive. -func HLLFoldOp(binName string, indexBitCount int) *Operation { - return &Operation{ - opType: _HLL_MODIFY, - binName: binName, - binValue: ListValue{_HLL_FOLD, IntegerValue(indexBitCount)}, - encoder: newHLLEncoder, - } - -} - -// HLLGetCountOp creates HLL getCount operation. -// Server returns estimated number of elements in the HLL bin. -// -// binName name of bin -func HLLGetCountOp(binName string) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_COUNT}, - encoder: newHLLEncoder, - } - -} - -// HLLGetUnionOp creates HLL getUnion operation. -// Server returns an HLL object that is the union of all specified HLL objects in the list -// with the HLL bin. -// -// binName name of bin -// list list of HLL objects -func HLLGetUnionOp(binName string, list []HLLValue) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_UNION, _HLLValueArray(list)}, - encoder: newHLLEncoder, - } - -} - -// HLLGetUnionCountOp creates HLL getUnionCount operation. -// Server returns estimated number of elements that would be contained by the union of these -// HLL objects. -// -// binName name of bin -// list list of HLL objects -func HLLGetUnionCountOp(binName string, list []HLLValue) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_UNION_COUNT, _HLLValueArray(list)}, - encoder: newHLLEncoder, - } -} - -// HLLGetIntersectCountOp creates HLL getIntersectCount operation. -// Server returns estimated number of elements that would be contained by the intersection of -// these HLL objects. -// -// binName name of bin -// list list of HLL objects -func HLLGetIntersectCountOp(binName string, list []HLLValue) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_INTERSECT_COUNT, _HLLValueArray(list)}, - encoder: newHLLEncoder, - } -} - -// HLLGetSimilarityOp creates HLL getSimilarity operation. -// Server returns estimated similarity of these HLL objects. Return type is a double. -// -// binName name of bin -// list list of HLL objects -func HLLGetSimilarityOp(binName string, list []HLLValue) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_SIMILARITY, _HLLValueArray(list)}, - encoder: newHLLEncoder, - } -} - -// HLLDescribeOp creates HLL describe operation. -// Server returns indexBitCount and minHashBitCount used to create HLL bin in a list of longs. -// The list size is 2. -// -// binName name of bin -func HLLDescribeOp(binName string) *Operation { - return &Operation{ - opType: _HLL_READ, - binName: binName, - binValue: ListValue{_HLL_DESCRIBE}, - encoder: newHLLEncoder, - } -} - -// hllEncoder is used to encode the HLL operations to wire protocol -func newHLLEncoder(op *Operation, packer BufferEx) (int, Error) { - params := op.binValue.(ListValue) - opType := params[0].(int) - if len(op.binValue.(ListValue)) > 1 { - return packHLLIfcParamsAsArray(packer, int16(opType), params[1:]) - } - return packHLLIfcParamsAsArray(packer, int16(opType), nil) -} - -func packHLLIfcParamsAsArray(packer BufferEx, opType int16, params ListValue) (int, Error) { - return packHLLIfcVarParamsAsArray(packer, opType, []interface{}(params)...) -} - -func packHLLIfcVarParamsAsArray(packer BufferEx, opType int16, params ...interface{}) (int, Error) { - size := 0 - n, err := packArrayBegin(packer, len(params)+1) - if err != nil { - return size + n, err - } - size += n - - if n, err = packAInt(packer, int(opType)); err != nil { - return size + n, err - } - size += n - - if len(params) > 0 { - for i := range params { - if n, err = packObject(packer, params[i], false); err != nil { - return size + n, err - } - size += n - } - } - - return size, nil -} - -/////////////////////////////////////////////////////////////////////////////////////// - -// _HLLValueArray encapsulates an array of Value. -// Supported by Aerospike 3+ servers only. -type _HLLValueArray []HLLValue - -func (va _HLLValueArray) EstimateSize() (int, Error) { - return packHLLValueArray(nil, va) -} - -func (va _HLLValueArray) write(cmd BufferEx) (int, Error) { - return packHLLValueArray(cmd, va) -} - -func (va _HLLValueArray) pack(cmd BufferEx) (int, Error) { - return packHLLValueArray(cmd, va) -} - -// GetType returns wire protocol value type. -func (va _HLLValueArray) GetType() int { - return ParticleType.LIST -} - -// GetObject returns original value as an interface{}. -func (va _HLLValueArray) GetObject() interface{} { - return []HLLValue(va) -} - -// String implements Stringer interface. -func (va _HLLValueArray) String() string { - return fmt.Sprintf("%v", []HLLValue(va)) -} - -func packHLLValueArray(cmd BufferEx, list _HLLValueArray) (int, Error) { - size := 0 - n, err := packArrayBegin(cmd, len(list)) - if err != nil { - return n, err - } - size += n - - for i := range list { - n, err = list[i].pack(cmd) - if err != nil { - return 0, err - } - size += n - } - - return size, err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go b/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go deleted file mode 100644 index 8bbd63f4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/hll_operation_test.go +++ /dev/null @@ -1,901 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "strconv" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" -) - -var _ = gg.Describe("HyperLogLog Test", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var binName string = "ophbin" - var nEntries int = 1 << 8 - - var minIndexBits int = 4 - var maxIndexBits int = 16 - var minMinhashBits int = 4 - var maxMinhashBits int = 51 - - key, _ := as.NewKey(ns, set, "ophkey") - key0, _ := as.NewKey(ns, set, "ophkey0") - key1, _ := as.NewKey(ns, set, "ophkey1") - key2, _ := as.NewKey(ns, set, "ophkey2") - keys := []*as.Key{key0, key1, key2} - - var entries []as.Value - var legalIndexBits []int - var legalDescriptions [][]int - var illegalDescriptions [][]int - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - for i := 0; i < nEntries; i++ { - entries = append(entries, as.StringValue("key "+strconv.Itoa(i))) - } - - for index_bits := minIndexBits; index_bits <= maxIndexBits; index_bits += 4 { - combined_bits := maxMinhashBits + index_bits - max_allowed_minhash_bits := maxMinhashBits - - if combined_bits > 64 { - max_allowed_minhash_bits -= combined_bits - 64 - } - - mid_minhash_bits := (max_allowed_minhash_bits + index_bits) / 2 - var legal_zero []int - var legal_min []int - var legal_mid []int - var legal_max []int - - legalIndexBits = append(legalIndexBits, index_bits) - legal_zero = append(legal_zero, index_bits) - legal_min = append(legal_min, index_bits) - legal_mid = append(legal_mid, index_bits) - legal_max = append(legal_max, index_bits) - - legal_zero = append(legal_zero, 0) - legal_min = append(legal_min, minMinhashBits) - legal_mid = append(legal_mid, mid_minhash_bits) - legal_max = append(legal_max, max_allowed_minhash_bits) - - legalDescriptions = append(legalDescriptions, legal_zero) - legalDescriptions = append(legalDescriptions, legal_min) - legalDescriptions = append(legalDescriptions, legal_mid) - legalDescriptions = append(legalDescriptions, legal_max) - } - - for index_bits := minIndexBits - 1; index_bits <= maxIndexBits+5; index_bits += 4 { - if index_bits < minIndexBits || index_bits > maxIndexBits { - var illegal_zero []int - var illegal_min []int - var illegal_max []int - - illegal_zero = append(illegal_zero, index_bits) - illegal_min = append(illegal_min, index_bits) - illegal_max = append(illegal_max, index_bits) - - illegal_zero = append(illegal_zero, 0) - illegal_min = append(illegal_min, minMinhashBits-1) - illegal_max = append(illegal_max, maxMinhashBits) - - illegalDescriptions = append(illegalDescriptions, illegal_zero) - illegalDescriptions = append(illegalDescriptions, illegal_min) - illegalDescriptions = append(illegalDescriptions, illegal_max) - } else { - var illegal_min []int - var illegal_max []int - var illegal_max1 []int - - illegal_min = append(illegal_min, index_bits) - illegal_max = append(illegal_max, index_bits) - - illegal_min = append(illegal_min, minMinhashBits-1) - illegal_max = append(illegal_max, maxMinhashBits+1) - - illegalDescriptions = append(illegalDescriptions, illegal_min) - illegalDescriptions = append(illegalDescriptions, illegal_max) - - if index_bits+maxMinhashBits > 64 { - illegal_max1 = append(illegal_max1, index_bits) - illegal_max1 = append(illegal_max1, 1+maxMinhashBits-(64-(index_bits+maxMinhashBits))) - illegalDescriptions = append(illegalDescriptions, illegal_max1) - } - } - } - }) - - expectErrors := func(key *as.Key, eresult ast.ResultCode, ops ...*as.Operation) { - _, err := client.Operate(nil, key, ops...) - gm.Expect(err).To(gm.HaveOccurred()) - - gm.Expect(err.Matches(eresult)).To(gm.BeTrue()) - } - - expectSuccess := func(key *as.Key, ops ...*as.Operation) *as.Record { - record, err := client.Operate(nil, key, ops...) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(record).NotTo(gm.BeNil()) - return record - } - - checkBits := func(index_bits, minhash_bits int) bool { - return !(index_bits < minIndexBits || index_bits > maxIndexBits || - (minhash_bits != 0 && minhash_bits < minMinhashBits) || - minhash_bits > maxMinhashBits || index_bits+minhash_bits > 64) - } - - relativeCountError := func(n_index_bits int) float64 { - return 1.04 / math.Sqrt(math.Pow(2, float64(n_index_bits))) - } - - expectDescription := func(description []interface{}, index_bits, minhash_bits int) { - gm.Expect(index_bits).To(gm.Equal(description[0])) - gm.Expect(minhash_bits).To(gm.Equal(description[1])) - } - - expectInit := func(index_bits, minhash_bits int, should_pass bool) { - p := as.DefaultHLLPolicy() - ops := []*as.Operation{ - as.HLLInitOp(p, binName, index_bits, minhash_bits), - as.HLLGetCountOp(binName), - as.HLLRefreshCountOp(binName), - as.HLLDescribeOp(binName), - } - - if !should_pass { - expectErrors(key, ast.PARAMETER_ERROR, ops...) - return - } - - record := expectSuccess(key, ops...) - result_list := record.Bins[binName].([]interface{}) - count := result_list[1] - count1 := result_list[2] - description := result_list[3].([]interface{}) - - expectDescription(description, index_bits, minhash_bits) - gm.Expect(0).To(gm.Equal(count)) - gm.Expect(0).To(gm.Equal(count1)) - } - - gg.It("Init should work", func() { - _, err := client.Delete(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for _, desc := range legalDescriptions { - expectInit(desc[0], desc[1], true) - } - - for _, desc := range illegalDescriptions { - expectInit(desc[0], desc[1], false) - } - }) - - gg.It("HLL Flags should work", func() { - index_bits := 4 - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1)) - - // create_only - c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) - - expectSuccess(key, as.HLLInitOp(c, binName, index_bits, -1)) - expectErrors(key, ast.BIN_EXISTS_ERROR, - as.HLLInitOp(c, binName, index_bits, -1)) - - // update_only - u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) - - expectSuccess(key, as.HLLInitOp(u, binName, index_bits, -1)) - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - expectErrors(key, ast.BIN_NOT_FOUND, - as.HLLInitOp(u, binName, index_bits, -1)) - - // create_only no_fail - cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) - - expectSuccess(key, as.HLLInitOp(cn, binName, index_bits, -1)) - expectSuccess(key, as.HLLInitOp(cn, binName, index_bits, -1)) - - // update_only no_fail - un := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly | as.HLLWriteFlagsNoFail) - - expectSuccess(key, as.HLLInitOp(un, binName, index_bits, -1)) - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - expectSuccess(key, as.HLLInitOp(un, binName, index_bits, -1)) - - // fold - expectSuccess(key, as.HLLInitOp(c, binName, index_bits, -1)) - - f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) - - expectErrors(key, ast.PARAMETER_ERROR, - as.HLLInitOp(f, binName, index_bits, -1)) - }) - - gg.It("Bad Init should NOT work", func() { - p := as.DefaultHLLPolicy() - - expectSuccess(key, as.DeleteOp(), as.HLLInitOp(p, binName, maxIndexBits, 0)) - expectErrors(key, ast.OP_NOT_APPLICABLE, - as.HLLInitOp(p, binName, -1, maxMinhashBits)) - }) - - isWithinRelativeError := func(expected, estimate int, relative_error float64) bool { - return float64(expected)*(1-relative_error) <= float64(estimate) || float64(estimate) <= float64(expected)*(1+relative_error) - } - - expectHLLCount := func(index_bits int, hll_count, expected int) { - count_err_6sigma := relativeCountError(index_bits) * 6 - - gm.Expect(isWithinRelativeError(expected, hll_count, count_err_6sigma)).To(gm.BeTrue()) - } - - expectAddInit := func(index_bits, minhash_bits int) { - client.Delete(nil, key) - - p := as.DefaultHLLPolicy() - ops := []*as.Operation{ - as.HLLAddOp(p, binName, entries, index_bits, minhash_bits), - as.HLLGetCountOp(binName), - as.HLLRefreshCountOp(binName), - as.HLLDescribeOp(binName), - as.HLLAddOp(p, binName, entries, -1, -1), - } - - if !checkBits(index_bits, minhash_bits) { - expectErrors(key, ast.PARAMETER_ERROR, ops...) - return - } - - record := expectSuccess(key, ops...) - result_list := record.Bins[binName].([]interface{}) - count := result_list[1].(int) - count1 := result_list[2].(int) - description := result_list[3].([]interface{}) - n_added := result_list[4] - - expectDescription(description, index_bits, minhash_bits) - expectHLLCount(index_bits, count, len(entries)) - gm.Expect(count).To(gm.Equal(count1)) - gm.Expect(n_added).To(gm.Equal(0)) - } - - gg.It("Add Init should work", func() { - for _, desc := range legalDescriptions { - expectAddInit(desc[0], desc[1]) - } - }) - - gg.It("Add Flags should work", func() { - index_bits := 4 - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1)) - - // create_only - c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) - - expectSuccess(key, as.HLLAddOp(c, binName, entries, index_bits, -1)) - expectErrors(key, ast.BIN_EXISTS_ERROR, - as.HLLAddOp(c, binName, entries, index_bits, -1)) - - // update_only - u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) - - expectErrors(key, ast.PARAMETER_ERROR, - as.HLLAddOp(u, binName, entries, index_bits, -1)) - - // create_only no_fail - cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) - - expectSuccess(key, as.HLLAddOp(cn, binName, entries, index_bits, -1)) - expectSuccess(key, as.HLLAddOp(cn, binName, entries, index_bits, -1)) - - // fold - expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) - - f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) - - expectErrors(key, ast.PARAMETER_ERROR, - as.HLLAddOp(f, binName, entries, index_bits, -1)) - }) - - expectFold := func(vals0, vals1 []as.Value, index_bits int) { - p := as.DefaultHLLPolicy() - - for ix := minIndexBits; ix <= index_bits; ix++ { - if !checkBits(index_bits, 0) || !checkBits(ix, 0) { - // gm.Expected valid inputs - gm.Expect(true).To(gm.BeFalse()) - } - - recorda := expectSuccess(key, - as.DeleteOp(), - as.HLLAddOp(p, binName, vals0, index_bits, -1), - as.HLLGetCountOp(binName), - as.HLLRefreshCountOp(binName), - as.HLLDescribeOp(binName)) - - resulta_list := recorda.Bins[binName].([]interface{}) - counta := resulta_list[1].(int) - counta1 := resulta_list[2].(int) - descriptiona := resulta_list[3].([]interface{}) - - expectDescription(descriptiona, index_bits, 0) - expectHLLCount(index_bits, counta, len(vals0)) - gm.Expect(counta).To(gm.Equal(counta1)) - - recordb := expectSuccess(key, - as.HLLFoldOp(binName, ix), - as.HLLGetCountOp(binName), - as.HLLAddOp(p, binName, vals0, -1, -1), - as.HLLAddOp(p, binName, vals1, -1, -1), - as.HLLGetCountOp(binName), - as.HLLDescribeOp(binName)) - - resultb_list := recordb.Bins[binName].([]interface{}) - countb := resultb_list[1].(int) - n_added0 := resultb_list[2].(int) - countb1 := resultb_list[4].(int) - descriptionb := resultb_list[5].([]interface{}) - - gm.Expect(0).To(gm.Equal(n_added0)) - expectDescription(descriptionb, ix, 0) - expectHLLCount(ix, countb, len(vals0)) - expectHLLCount(ix, countb1, len(vals0)+len(vals1)) - } - } - - gg.It("Fold should work", func() { - var vals0 []as.Value - var vals1 []as.Value - - for i := 0; i < nEntries/2; i++ { - vals0 = append(vals0, as.StringValue("key "+strconv.Itoa(i))) - } - - for i := nEntries / 2; i < nEntries; i++ { - vals1 = append(vals1, as.StringValue("key "+strconv.Itoa(i))) - } - - for index_bits := 4; index_bits < maxIndexBits; index_bits++ { - expectFold(vals0, vals1, index_bits) - } - }) - - gg.It("Fold Exists should work", func() { - index_bits := 10 - fold_down := 4 - fold_up := 16 - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), - as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) - - // Exists. - expectSuccess(key, as.HLLFoldOp(binName, fold_down)) - expectErrors(key, ast.OP_NOT_APPLICABLE, - as.HLLFoldOp(binName, fold_up)) - - // Does not exist. - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - - expectErrors(key, ast.BIN_NOT_FOUND, - as.HLLFoldOp(binName, fold_down)) - }) - - expectSetUnion := func(vals [][]as.Value, index_bits int, folding, allow_folding bool) { - p := as.DefaultHLLPolicy() - u := as.DefaultHLLPolicy() - - if allow_folding { - u = as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) - } - - union_expected := 0 - folded := false - - for i := 0; i < len(keys); i++ { - ix := index_bits - - if folding { - ix -= i - - if ix < minIndexBits { - ix = minIndexBits - } - - if ix < index_bits { - folded = true - } - } - - sub_vals := vals[i] - - union_expected += len(sub_vals) - - record := expectSuccess(keys[i], - as.DeleteOp(), - as.HLLAddOp(p, binName, sub_vals, ix, -1), - as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) - count := result_list[1].(int) - - expectHLLCount(ix, count, len(sub_vals)) - } - - var hlls []as.HLLValue - - for i := 0; i < len(keys); i++ { - record := expectSuccess(keys[i], as.GetBinOp(binName), as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) - hll := result_list[0].(as.HLLValue) - - gm.Expect(hll).NotTo(gm.BeNil()) - hlls = append(hlls, hll) - } - - ops := []*as.Operation{ - as.DeleteOp(), - as.HLLInitOp(p, binName, index_bits, -1), - as.HLLSetUnionOp(u, binName, hlls), - as.HLLGetCountOp(binName), - as.DeleteOp(), // And recreate it to test creating empty. - as.HLLSetUnionOp(p, binName, hlls), - as.HLLGetCountOp(binName), - } - - if folded && !allow_folding { - expectErrors(key, ast.OP_NOT_APPLICABLE, ops...) - return - } - - record_union := expectSuccess(key, ops...) - union_result_list := record_union.Bins[binName].([]interface{}) - union_count := union_result_list[2].(int) - union_count2 := union_result_list[4].(int) - - expectHLLCount(index_bits, union_count, union_expected) - gm.Expect(union_count).To(gm.Equal(union_count2)) - - for i := 0; i < len(keys); i++ { - sub_vals := vals[i] - record := expectSuccess(key, - as.HLLAddOp(p, binName, sub_vals, index_bits, -1), - as.HLLGetCountOp(binName)) - result_list := record.Bins[binName].([]interface{}) - n_added := result_list[0].(int) - count := result_list[1].(int) - - gm.Expect(0).To(gm.Equal(n_added)) - gm.Expect(union_count).To(gm.Equal(count)) - expectHLLCount(index_bits, count, union_expected) - } - } - - gg.It("Set Union should work", func() { - var vals [][]as.Value - - for i := 0; i < len(keys); i++ { - var sub_vals []as.Value - - for j := 0; j < nEntries/3; j++ { - sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) - } - - vals = append(vals, sub_vals) - } - - for _, index_bits := range legalIndexBits { - expectSetUnion(vals, index_bits, false, false) - expectSetUnion(vals, index_bits, false, true) - expectSetUnion(vals, index_bits, true, false) - expectSetUnion(vals, index_bits, true, true) - } - }) - - gg.It("Set Union Flags should work", func() { - index_bits := 6 - low_n_bits := 4 - high_n_bits := 8 - otherName := binName + "o" - - // Keep record around win binName is removed. - var hlls []as.HLLValue - record := expectSuccess(key, - as.DeleteOp(), - as.HLLAddOp(as.DefaultHLLPolicy(), otherName, entries, index_bits, -1), - as.GetBinOp(otherName)) - result_list := record.Bins[otherName].([]interface{}) - hll := result_list[1].(as.HLLValue) - - hlls = append(hlls, hll) - - // create_only - c := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly) - - expectSuccess(key, as.HLLSetUnionOp(c, binName, hlls)) - expectErrors(key, ast.BIN_EXISTS_ERROR, - as.HLLSetUnionOp(c, binName, hlls)) - - // update_only - u := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly) - - expectSuccess(key, as.HLLSetUnionOp(u, binName, hlls)) - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - expectErrors(key, ast.BIN_NOT_FOUND, - as.HLLSetUnionOp(u, binName, hlls)) - - // create_only no_fail - cn := as.NewHLLPolicy(as.HLLWriteFlagsCreateOnly | as.HLLWriteFlagsNoFail) - - expectSuccess(key, as.HLLSetUnionOp(cn, binName, hlls)) - expectSuccess(key, as.HLLSetUnionOp(cn, binName, hlls)) - - // update_only no_fail - un := as.NewHLLPolicy(as.HLLWriteFlagsUpdateOnly | as.HLLWriteFlagsNoFail) - - expectSuccess(key, as.HLLSetUnionOp(un, binName, hlls)) - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - expectSuccess(key, as.HLLSetUnionOp(un, binName, hlls)) - - // fold - f := as.NewHLLPolicy(as.HLLWriteFlagsAllowFold) - - // fold down - expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, high_n_bits, -1)) - expectSuccess(key, as.HLLSetUnionOp(f, binName, hlls)) - - // fold up - expectSuccess(key, as.HLLInitOp(as.DefaultHLLPolicy(), binName, low_n_bits, -1)) - expectSuccess(key, as.HLLSetUnionOp(f, binName, hlls)) - }) - - gg.It("Refresh Count should work", func() { - index_bits := 6 - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), - as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, -1)) - - // Exists. - expectSuccess(key, as.HLLRefreshCountOp(binName), - as.HLLRefreshCountOp(binName)) - expectSuccess(key, as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, -1, -1)) - expectSuccess(key, as.HLLRefreshCountOp(binName), - as.HLLRefreshCountOp(binName)) - - // Does not exist. - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - expectErrors(key, ast.BIN_NOT_FOUND, - as.HLLRefreshCountOp(binName)) - }) - - gg.It("Get Count should work", func() { - index_bits := 6 - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, index_bits, -1)) - - // Exists. - record := expectSuccess(key, as.HLLGetCountOp(binName)) - count := record.Bins[binName].(int) - expectHLLCount(index_bits, count, len(entries)) - - // Does not exist. - expectSuccess(key, as.PutOp(as.NewBin(binName, nil))) - record = expectSuccess(key, as.HLLGetCountOp(binName)) - gm.Expect(record.Bins[binName]).To(gm.BeNil()) - }) - - gg.It("Get Union should work", func() { - index_bits := 14 - expected_union_count := 0 - var vals [][]as.Value - var hlls []as.HLLValue - - for i := 0; i < len(keys); i++ { - var sub_vals []as.Value - - for j := 0; j < nEntries/3; j++ { - sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) - } - - record := expectSuccess(keys[i], - as.DeleteOp(), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, sub_vals, index_bits, -1), - as.GetBinOp(binName)) - - result_list := record.Bins[binName].([]interface{}) - hlls = append(hlls, result_list[1].(as.HLLValue)) - expected_union_count += len(sub_vals) - vals = append(vals, sub_vals) - } - - // Keep record around win binName is removed. - expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, -1), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, vals[0], index_bits, -1)) - - record := expectSuccess(key, - as.HLLGetUnionOp(binName, hlls), - as.HLLGetUnionCountOp(binName, hlls)) - result_list := record.Bins[binName].([]interface{}) - union_count := result_list[1].(int) - - expectHLLCount(index_bits, union_count, expected_union_count) - - union_hll := result_list[0].(as.HLLValue) - - record = expectSuccess(key, - as.PutOp(as.NewBin(binName, union_hll)), - as.HLLGetCountOp(binName)) - result_list = record.Bins[binName].([]interface{}) - union_count_2 := result_list[1].(int) - - gm.Expect(union_count).To(gm.Equal(union_count_2)) - }) - - gg.It("Put should work", func() { - for _, desc := range legalDescriptions { - index_bits := desc[0] - minhash_bits := desc[1] - - expectSuccess(key, - as.DeleteOp(), as.HLLInitOp(as.DefaultHLLPolicy(), binName, index_bits, minhash_bits)) - - record, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - hll := record.Bins[binName].(as.HLLValue) - - client.Delete(nil, key) - client.PutBins(nil, key, as.NewBin(binName, hll)) - - record = expectSuccess(key, - as.HLLGetCountOp(binName), - as.HLLDescribeOp(binName)) - - result_list := record.Bins[binName].([]interface{}) - count := result_list[0].(int) - description := result_list[1].([]interface{}) - - gm.Expect(count).To(gm.Equal(0)) - expectDescription(description, index_bits, minhash_bits) - } - }) - - absoluteSimilarityError := func(index_bits, minhash_bits int, expected_similarity float64) float64 { - min_err_index := 1 / math.Sqrt(float64(int64(1< math.Abs(expected_similarity-similarity)).To(gm.BeTrue()) - gm.Expect(isWithinRelativeError(expected_intersect_count, intersect_count, sim_err_6sigma)).To(gm.BeTrue()) - } - - expectSimilarityOp := func(overlap float64, common []as.Value, vals [][]as.Value, index_bits, - minhash_bits int) { - var hlls []as.HLLValue - - for i := 0; i < len(keys); i++ { - record := expectSuccess(keys[i], - as.DeleteOp(), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, vals[i], index_bits, minhash_bits), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, common, index_bits, minhash_bits), - as.GetBinOp(binName)) - - result_list := record.Bins[binName].([]interface{}) - hlls = append(hlls, result_list[2].(as.HLLValue)) - } - - // Keep record around win binName is removed. - record := expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName+"other", index_bits, minhash_bits), - as.HLLSetUnionOp(as.DefaultHLLPolicy(), binName, hlls), - as.HLLDescribeOp(binName)) - result_list := record.Bins[binName].([]interface{}) - description := result_list[1].([]interface{}) - - expectDescription(description, index_bits, minhash_bits) - - record = expectSuccess(key, - as.HLLGetSimilarityOp(binName, hlls), - as.HLLGetIntersectCountOp(binName, hlls)) - result_list = record.Bins[binName].([]interface{}) - sim := result_list[0].(float64) - intersect_count := result_list[1].(int) - expected_similarity := overlap - expected_intersect_count := len(common) - - expectHMHSimilarity(index_bits, minhash_bits, sim, expected_similarity, intersect_count, - expected_intersect_count) - } - - gg.It("Similarity should work", func() { - if *proxy { - gg.Skip("Too long for the Proxy Client") - } - - overlaps := []float64{0.0001, 0.001, 0.01, 0.1, 0.5} - - nEntries := 1 << 18 - for _, overlap := range overlaps { - expected_intersect_count := int(math.Floor(float64(nEntries) * overlap)) - var common []as.Value - - for i := 0; i < expected_intersect_count; i++ { - common = append(common, as.StringValue("common"+strconv.Itoa(i))) - } - - var vals [][]as.Value - unique_entries_per_node := (nEntries - expected_intersect_count) / 3 - - for i := 0; i < len(keys); i++ { - var sub_vals []as.Value - - for j := 0; j < unique_entries_per_node; j++ { - sub_vals = append(sub_vals, as.StringValue("key"+strconv.Itoa(i)+" "+strconv.Itoa(j))) - } - - vals = append(vals, sub_vals) - } - - for _, desc := range legalDescriptions { - index_bits := desc[0] - minhash_bits := desc[1] - - if minhash_bits == 0 { - continue - } - - expectSimilarityOp(overlap, common, vals, index_bits, minhash_bits) - } - } - }) - - gg.It("Empty Similarity should work", func() { - for _, desc := range legalDescriptions { - nIndexBits := desc[0] - nMinhashBits := desc[1] - - record := expectSuccess(key, - as.DeleteOp(), - as.HLLInitOp(as.DefaultHLLPolicy(), binName, nIndexBits, nMinhashBits), - as.GetBinOp(binName)) - - resultList := record.Bins[binName].([]interface{}) - var hlls []as.HLLValue - - hlls = append(hlls, resultList[1].(as.HLLValue)) - - record = expectSuccess(key, - as.HLLGetSimilarityOp(binName, hlls), - as.HLLGetIntersectCountOp(binName, hlls)) - - resultList = record.Bins[binName].([]interface{}) - - sim := resultList[0].(float64) - intersectCount := resultList[1].(int) - - gm.Expect(0).To(gm.Equal(intersectCount)) - gm.Expect(math.IsNaN(sim)).To(gm.BeTrue()) - } - }) - - gg.It("Intersect should work", func() { - otherBinName := binName + "other" - - for _, desc := range legalDescriptions { - indexBits := desc[0] - minhashBits := desc[1] - - if minhashBits != 0 { - break - } - - record := expectSuccess(key, - as.DeleteOp(), - as.HLLAddOp(as.DefaultHLLPolicy(), binName, entries, indexBits, minhashBits), - as.GetBinOp(binName), - as.HLLAddOp(as.DefaultHLLPolicy(), otherBinName, entries, indexBits, 4), - as.GetBinOp(otherBinName)) - - var hlls []as.HLLValue - var hmhs []as.HLLValue - resultList := record.Bins[binName].([]interface{}) - - hlls = append(hlls, resultList[1].(as.HLLValue)) - hlls = append(hlls, hlls[0]) - - resultList = record.Bins[otherBinName].([]interface{}) - hmhs = append(hmhs, resultList[1].(as.HLLValue)) - hmhs = append(hmhs, hmhs[0]) - - record = expectSuccess(key, - as.HLLGetIntersectCountOp(binName, hlls), - as.HLLGetSimilarityOp(binName, hlls)) - resultList = record.Bins[binName].([]interface{}) - - intersectCount := resultList[0].(int) - - gm.Expect(float64(intersectCount) < 1.8*float64(len(entries))).To(gm.BeTrue()) - - hlls = append(hlls, hlls[0]) - - expectErrors(key, ast.PARAMETER_ERROR, - as.HLLGetIntersectCountOp(binName, hlls)) - expectErrors(key, ast.PARAMETER_ERROR, - as.HLLGetSimilarityOp(binName, hlls)) - - record = expectSuccess(key, - as.HLLGetIntersectCountOp(binName, hmhs), - as.HLLGetSimilarityOp(binName, hmhs)) - resultList = record.Bins[binName].([]interface{}) - intersectCount = resultList[0].(int) - - gm.Expect(float64(intersectCount) < 1.8*float64(len(entries))).To(gm.BeTrue()) - - hmhs = append(hmhs, hmhs[0]) - - expectErrors(key, ast.OP_NOT_APPLICABLE, - as.HLLGetIntersectCountOp(binName, hmhs)) - expectErrors(key, ast.OP_NOT_APPLICABLE, - as.HLLGetSimilarityOp(binName, hmhs)) - } - }) - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_policy.go b/aerospike-tls/vendor-aerospike-client-go/hll_policy.go deleted file mode 100644 index 12a24acd..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/hll_policy.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// HLLPolicy determines the HyperLogLog operation policy. -type HLLPolicy struct { - flags int -} - -// DefaultHLLPolicy uses the default policy when performing HLL operations. -func DefaultHLLPolicy() *HLLPolicy { - return &HLLPolicy{HLLWriteFlagsDefault} -} - -// NewHLLPolicy uses specified HLLWriteFlags when performing HLL operations. -func NewHLLPolicy(flags int) *HLLPolicy { - return &HLLPolicy{flags} -} diff --git a/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go b/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go deleted file mode 100644 index 4719044f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/hll_write_flags.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// HLLWriteFlags specifies the HLL write operation flags. - -const ( - // HLLWriteFlagsDefault is Default. Allow create or update. - HLLWriteFlagsDefault = 0 - - // HLLWriteFlagsCreateOnly behaves like the following: - // If the bin already exists, the operation will be denied. - // If the bin does not exist, a new bin will be created. - HLLWriteFlagsCreateOnly = 1 - - // HLLWriteFlagsUpdateOnly behaves like the following: - // If the bin already exists, the bin will be overwritten. - // If the bin does not exist, the operation will be denied. - HLLWriteFlagsUpdateOnly = 2 - - // HLLWriteFlagsNoFail does not raise error if operation is denied. - HLLWriteFlagsNoFail = 4 - - // HLLWriteFlagsAllowFold allows the resulting set to be the minimum of provided index bits. - // Also, allow the usage of less precise HLL algorithms when minHash bits - // of all participating sets do not match. - HLLWriteFlagsAllowFold = 8 -) diff --git a/aerospike-tls/vendor-aerospike-client-go/host.go b/aerospike-tls/vendor-aerospike-client-go/host.go deleted file mode 100644 index 0e3e969e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/host.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "net" - "strconv" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Host name/port of database server. -type Host struct { - - // Host name or IP address of database server. - Name string - - //TLSName defines the TLS certificate name used for secure connections. - TLSName string - - // Port of database server. - Port int -} - -// NewHost initializes new host instance. -func NewHost(name string, port int) *Host { - return &Host{Name: name, Port: port} -} - -// Implements stringer interface -func (h *Host) String() string { - return net.JoinHostPort(h.Name, strconv.Itoa(h.Port)) -} - -// Implements stringer interface -func (h *Host) equals(other *Host) bool { - return h.Name == other.Name && h.Port == other.Port -} - -// NewHosts initializes new host instances by a passed slice of addresses. -func NewHosts(addresses ...string) ([]*Host, Error) { - aerospikeHosts := make([]*Host, 0, len(addresses)) - for _, address := range addresses { - hostStr, portStr, err := net.SplitHostPort(address) - if err != nil { - return nil, newErrorAndWrap(err, types.PARAMETER_ERROR, fmt.Sprintf("error parsing address %s: %s", address, err)) - } - port, err := strconv.Atoi(portStr) - if err != nil { - return nil, newErrorAndWrap(err, types.PARAMETER_ERROR, fmt.Sprintf("error converting port %s: %s", address, err)) - } - - host := NewHost(hostStr, port) - aerospikeHosts = append(aerospikeHosts, host) - } - - return aerospikeHosts, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/host_test.go b/aerospike-tls/vendor-aerospike-client-go/host_test.go deleted file mode 100644 index 95c45f6b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/host_test.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2013-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - - gg.Describe("Host", func() { - - gg.It("must handle multiple valid host strings", func() { - // use the same client for all - hosts, err := as.NewHosts("host1:4000", "host2:3000", "127.0.0.1:1200", "[2001:0db8:85a3:0000:0000:8a2e:0370]:7334") - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(hosts).To(gm.Equal([]*as.Host{as.NewHost("host1", 4000), as.NewHost("host2", 3000), as.NewHost("127.0.0.1", 1200), as.NewHost("2001:0db8:85a3:0000:0000:8a2e:0370", 7334)})) - }) - - gg.It("must error on invalid host strings", func() { - // use the same client for all - hosts, err := as.NewHosts("host1:4000", "host2://+3000") - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(hosts).To(gm.BeNil()) - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go b/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go deleted file mode 100644 index dc85253d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/index_collection_type.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" -) - -// IndexCollectionType is the secondary index collection type. -type IndexCollectionType int - -const ( - - // ICT_DEFAULT is the Normal scalar index. - ICT_DEFAULT IndexCollectionType = iota - - // ICT_LIST is Index list elements. - ICT_LIST - - // ICT_MAPKEYS is Index map keys. - ICT_MAPKEYS - - // ICT_MAPVALUES is Index map values. - ICT_MAPVALUES -) - -func (ict IndexCollectionType) String() string { - switch ict { - // Normal scalar index. - case ICT_DEFAULT: - return "ICT_DEFAULT" - // Index list elements. - case ICT_LIST: - return "ICT_LIST" - // Index map keys. - case ICT_MAPKEYS: - return "ICT_MAPKEYS" - // Index map values. - case ICT_MAPVALUES: - return "ICT_MAPVALUES" - } - panic(unreachable) -} - -// ictToString converts IndexCollectionType to string representations -func ictToString(ict IndexCollectionType) string { - switch ict { - - case ICT_LIST: - return "LIST" - - case ICT_MAPKEYS: - return "MAPKEYS" - - case ICT_MAPVALUES: - return "MAPVALUES" - - default: - panic(fmt.Sprintf("Unknown IndexCollectionType value %v", ict)) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/index_test.go b/aerospike-tls/vendor-aerospike-client-go/index_test.go deleted file mode 100644 index 299f2688..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/index_test.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "math/rand" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Index operations test", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - }) - - gg.Describe("Index creation", func() { - - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - - const keyCount = 1000 - bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", randString(100)) - - gg.BeforeEach(func() { - for i := 0; i < keyCount; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - gg.Context("Create non-existing index", func() { - - gg.It("must create an Index", func() { - idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.DropIndex(wpolicy, ns, set, set+bin1.Name) - - // wait until index is created - <-idxTask.OnComplete() - - // no duplicate index is allowed - // _, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - // gm.Expect(err).To(gm.HaveOccurred()) - // gm.Expect(err.Matches(ast.INDEX_FOUND)).To(gm.BeTrue()) - }) - - gg.It("must drop an Index", func() { - idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until index is created - <-idxTask.OnComplete() - - err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.It("must drop an Index, and recreate it again to verify", func() { - idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until index is created - gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) - - // dropping second time is not expected to raise any errors - err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // create the index again; should not encounter any errors - idxTask, err = client.CreateIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.STRING) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until index is created - gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) - - err = client.DropIndex(wpolicy, ns, set, set+bin1.Name) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - }) - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/index_type.go b/aerospike-tls/vendor-aerospike-client-go/index_type.go deleted file mode 100644 index f3e060c1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/index_type.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// IndexType the type of the secondary index. -type IndexType string - -const ( - // NUMERIC specifies an index on numeric values. - NUMERIC IndexType = "NUMERIC" - - // STRING specifies an index on string values. - STRING IndexType = "STRING" - - // BLOB specifies a []byte index. Requires server version 7.0+. - BLOB IndexType = "BLOB" - - // GEO2DSPHERE specifies 2-dimensional spherical geospatial index. - GEO2DSPHERE IndexType = "GEO2DSPHERE" -) diff --git a/aerospike-tls/vendor-aerospike-client-go/info.go b/aerospike-tls/vendor-aerospike-client-go/info.go deleted file mode 100644 index 79bc4697..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/info.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "encoding/binary" - "strings" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const ( - _DEFAULT_TIMEOUT = 2 * time.Second - _NO_TIMEOUT = 365 * 24 * time.Hour -) - -// Access server's info monitoring protocol. -type info struct { - msg *types.Message -} - -// Send multiple commands to server and store results. -// Timeout should already be set on the connection. -func newInfo(conn *Connection, commands ...string) (*info, Error) { - commandStr := strings.Trim(strings.Join(commands, "\n"), " ") - if strings.Trim(commandStr, " ") != "" { - commandStr += "\n" - } - newInfo := &info{ - msg: types.NewMessage(types.MSG_INFO, []byte(commandStr)), - } - - if err := newInfo.sendCommand(conn); err != nil { - return nil, err - } - return newInfo, nil -} - -// Issue request and set results buffer. This method is used internally. -// The static request methods should be used instead. -func (nfo *info) sendCommand(conn *Connection) Error { - b, err := nfo.msg.Serialize() - if err != nil { - return newCommonError(err) - } - - // Write - if _, err = conn.Write(b); err != nil { - logger.Logger.Debug("Failed to send command: %s", err.Error()) - return errToAerospikeErr(nil, err) - } - - // Read - reuse input buffer. - header := bytes.NewBuffer(make([]byte, types.MSG_HEADER_SIZE)) - if _, err = conn.Read(header.Bytes(), types.MSG_HEADER_SIZE); err != nil { - return errToAerospikeErr(nil, err) - } - if err = binary.Read(header, binary.BigEndian, &nfo.msg.MessageHeader); err != nil { - logger.Logger.Debug("Failed to read command response.") - return newCommonError(err) - } - - //logger.Logger.Debug("Header Response: %v %v %v %v", t.Type, t.Version, t.Length(), t.DataLen) - if err = nfo.msg.Resize(nfo.msg.Length()); err != nil { - return newCommonError(err) - } - _, err = conn.Read(nfo.msg.Data, len(nfo.msg.Data)) - return errToAerospikeErr(nil, err) -} - -func (nfo *info) parseMultiResponse() (map[string]string, Error) { - responses := make(map[string]string) - data := strings.Trim(string(nfo.msg.Data), "\n") - - keyValuesArr := strings.Split(data, "\n") - for _, keyValueStr := range keyValuesArr { - KeyValArr := strings.Split(keyValueStr, "\t") - - switch len(KeyValArr) { - case 1: - responses[KeyValArr[0]] = "" - case 2: - responses[KeyValArr[0]] = KeyValArr[1] - default: - logger.Logger.Error("Requested info buffer does not adhere to the protocol: %s", data) - } - } - - return responses, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/info_policy.go b/aerospike-tls/vendor-aerospike-client-go/info_policy.go deleted file mode 100644 index 1442e010..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/info_policy.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// InfoPolicy contains attributes used for info commands. -type InfoPolicy struct { - - // Info command socket timeout. - // Default is 2 seconds. - Timeout time.Duration -} - -// NewInfoPolicy generates a new InfoPolicy with default values. -func NewInfoPolicy() *InfoPolicy { - return &InfoPolicy{ - Timeout: _DEFAULT_TIMEOUT, - } -} - -func (p *InfoPolicy) deadline() time.Time { - var deadline time.Time - if p != nil && p.Timeout > 0 { - deadline = time.Now().Add(p.Timeout) - } - - return deadline -} - -func (p *InfoPolicy) timeout() time.Duration { - if p != nil && p.Timeout > 0 { - return p.Timeout - } - - return _DEFAULT_TIMEOUT -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go deleted file mode 100644 index 6af02aac..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/array.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import ( - "fmt" - "sync" -) - -// Array implement a fixed width array with atomic semantics -type Array struct { - items []interface{} - length int - mutex sync.RWMutex -} - -// NewArray generates a new Array instance. -func NewArray(length int) *Array { - return &Array{ - length: length, - items: make([]interface{}, length), - } -} - -// Get atomically retrieves an element from the Array. -// If idx is out of range, it will return nil -func (aa *Array) Get(idx int) interface{} { - // do not lock if not needed - if idx < 0 || idx >= aa.length { - return nil - } - - aa.mutex.RLock() - res := aa.items[idx] - aa.mutex.RUnlock() - return res -} - -// Set atomically sets an element in the Array. -// If idx is out of range, it will return an error -func (aa *Array) Set(idx int, node interface{}) error { - // do not lock if not needed - if idx < 0 || idx >= aa.length { - return fmt.Errorf("index %d is larger than array size (%d)", idx, aa.length) - } - - aa.mutex.Lock() - aa.items[idx] = node - aa.mutex.Unlock() - return nil -} - -// Length returns the array size. -func (aa *Array) Length() int { - aa.mutex.RLock() - res := aa.length - aa.mutex.RUnlock() - - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go deleted file mode 100644 index 1607e9ba..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/atomic_test.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "testing" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func TestAerospike(t *testing.T) { - gm.RegisterFailHandler(gg.Fail) - gg.RunSpecs(t, "Atomic Types Suite") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go deleted file mode 100644 index 933fd459..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import ( - "sync" -) - -// Bool implements a synchronized boolean value -type Bool struct { - m sync.Mutex - val bool -} - -// NewBool generates a new Boolean instance. -func NewBool(value bool) *Bool { - return &Bool{ - val: value, - } -} - -// String implements the Stringer interface -func (ab *Bool) String() string { - res := ab.Get() - if res { - return "true" - } - return "false" -} - -// GomegaString implements the GomegaStringer interface -// to prevent race conditions in tests -func (ab *Bool) GomegaString() string { - return ab.String() -} - -// Get atomically retrieves the boolean value. -func (ab *Bool) Get() bool { - ab.m.Lock() - res := ab.val - ab.m.Unlock() - return res -} - -// Set atomically sets the boolean value. -func (ab *Bool) Set(newVal bool) { - ab.m.Lock() - ab.val = newVal - ab.m.Unlock() -} - -// Or atomically applies OR operation to the boolean value. -func (ab *Bool) Or(newVal bool) bool { - if !newVal { - return ab.Get() - } - ab.Set(newVal) - return true -} - -// CompareAndToggle atomically sets the boolean value if the current value is equal to updated value. -func (ab *Bool) CompareAndToggle(expect bool) bool { - res := false - ab.m.Lock() - if ab.val == expect { - res = true - ab.val = !ab.val - } - ab.m.Unlock() - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go deleted file mode 100644 index f78496e0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/bool_test.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "runtime" - "sync" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Atomic Bool", func() { - // atomic tests require actual parallelism - runtime.GOMAXPROCS(runtime.NumCPU()) - - var ab *atomic.Bool - - gg.BeforeEach(func() { - ab = atomic.NewBool(true) - }) - - gg.It("must CompareAndToggle correctly", func() { - gm.Expect(ab.CompareAndToggle(true)).To(gm.BeTrue()) - gm.Expect(ab.CompareAndToggle(true)).To(gm.BeFalse()) - }) - - gg.It("must CompareAndToggle correctly", func() { - var count int = 1e5 - wg := new(sync.WaitGroup) - wg.Add(count * 4) - for i := 0; i < count; i++ { - go func() { - defer wg.Done() - ab.Set(true) - }() - } - - for i := 0; i < count; i++ { - go func() { - defer wg.Done() - ab.Set(false) - }() - } - - for i := 0; i < count; i++ { - go func() { - defer wg.Done() - ab.Get() - }() - } - - for i := 0; i < count; i++ { - go func(i int) { - defer wg.Done() - ab.CompareAndToggle(i%2 == 0) - }(i) - } - - wg.Wait() - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go deleted file mode 100644 index 3e944f1f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import "sync" - -// Guard allows synchronized access to a value -type Guard[T any] struct { - val *T - m sync.Mutex -} - -// NewGuard creates a new instance of Guard -func NewGuard[T any](val *T) *Guard[T] { - return &Guard[T]{val: val} -} - -// Do calls the passed closure. -func (g *Guard[T]) Do(f func(*T)) { - g.m.Lock() - defer g.m.Unlock() - f(g.val) -} - -// DoVal calls the passed closure with a dereferenced internal value. -func (g *Guard[T]) DoVal(f func(T)) { - g.m.Lock() - defer g.m.Unlock() - f(*g.val) -} - -// Call the passed closure allowing to replace the content. -func (g *Guard[T]) Update(f func(**T)) { - g.m.Lock() - defer g.m.Unlock() - f(&g.val) -} - -// Calls the passed closure allowing to replace the content. -// It will call the init func if the internal values is nil. -func (g *Guard[T]) InitDo(init func() *T, f func(*T)) { - g.m.Lock() - defer g.m.Unlock() - if g.val == nil { - g.val = init() - } - f(g.val) -} - -// Calls the passed closure allowing to replace the content. -// It will call the init func if the internal values is nil. -// It is used for reference values like slices and maps. -func (g *Guard[T]) InitDoVal(init func() T, f func(T)) { - g.m.Lock() - defer g.m.Unlock() - if g.val == nil { - t := init() - g.val = &t - } - f(*g.val) -} - -// Release returns the internal value and sets it to nil -func (g *Guard[T]) Release() *T { - g.m.Lock() - defer g.m.Unlock() - res := g.val - g.val = nil - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go deleted file mode 100644 index dc868d79..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/guard_test.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "runtime" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Atomic Guard", func() { - // atomic tests require actual parallelism - runtime.GOMAXPROCS(runtime.NumCPU()) - - type S struct { - a int - b bool - } - - var grd *atomic.Guard[S] - - gg.BeforeEach(func() { - grd = atomic.NewGuard[S](&S{a: 1, b: true}) - }) - - gg.It("must pass internal value correctly", func() { - grd.Do(func(s *S) { - gm.Expect(*s).To(gm.Equal(S{a: 1, b: true})) - }) - - }) - - gg.It("must assign/copy internal value correctly", func() { - local := S{a: 99, b: false} - grd.Do(func(s *S) { - *s = local - }) - - grd.Do(func(s *S) { - gm.Expect(*s).To(gm.Equal(S{a: 99, b: false})) - }) - - }) - - gg.It("must initialize and assign internal value correctly", func() { - flocal := func() *S { return &S{a: 99, b: false} } - - var grd atomic.Guard[S] - grd.Do(func(s *S) { - gm.Expect(s).To(gm.BeNil()) - }) - - grd.InitDo(flocal, func(s *S) { - gm.Expect(*s).To(gm.Equal(S{a: 99, b: false})) - s.a++ - s.b = true - }) - - grd.InitDo(flocal, func(s *S) { - gm.Expect(*s).To(gm.Equal(S{a: 100, b: true})) - }) - - grd.Do(func(s *S) { - gm.Expect(*s).To(gm.Equal(S{a: 100, b: true})) - }) - }) - - gg.It("must initialize and assign internal value correctly", func() { - flocal := func() map[int]int { return map[int]int{1: 1, 2: 2, 3: 3} } - - var grd atomic.Guard[map[int]int] - grd.Do(func(s *map[int]int) { - gm.Expect(s).To(gm.BeNil()) - }) - - grd.InitDoVal(flocal, func(s map[int]int) { - gm.Expect(s).To(gm.Equal(map[int]int{1: 1, 2: 2, 3: 3})) - }) - - grd.InitDoVal(flocal, func(s map[int]int) { - gm.Expect(s).To(gm.Equal(map[int]int{1: 1, 2: 2, 3: 3})) - for i := 4; i < 100; i++ { - s[i] = i - } - }) - - grd.DoVal(func(s map[int]int) { - gm.Expect(len(s)).To(gm.Equal(99)) - }) - }) - - gg.It("must replace internal value's reference correctly", func() { - local := S{a: 99, b: false} - grd.Update(func(s **S) { - *s = &local - }) - - grd.Do(func(s *S) { - gm.Expect(s == &local).To(gm.BeTrue()) - }) - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go deleted file mode 100644 index ad783fbc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import ( - "strconv" - "sync" -) - -// Int implements an int value with atomic semantics -type Int struct { - m sync.Mutex - val int -} - -// NewInt generates a newVal Int instance. -func NewInt(value int) *Int { - return &Int{ - val: value, - } -} - -// String implements the Stringer interface -func (ai *Int) String() string { - res := ai.Get() - return strconv.Itoa(res) -} - -// GomegaString implements the GomegaStringer interface -// to prevent race conditions during tests -func (ai *Int) GomegaString() string { - return ai.String() -} - -// AddAndGet atomically adds the given value to the current value. -func (ai *Int) AddAndGet(delta int) int { - ai.m.Lock() - ai.val += delta - res := ai.val - ai.m.Unlock() - return res -} - -// CloneAndSet atomically clones the atomic Int and sets the value to the given updated value. -func (ai *Int) Clone() Int { - ai.m.Lock() - res := Int{ - val: ai.val, - } - ai.m.Unlock() - return res -} - -// CloneAndSet atomically clones the atomic Int and sets the value to the given updated value. -func (ai *Int) CloneAndSet(value int) Int { - ai.m.Lock() - res := Int{ - val: ai.val, - } - ai.val = value - ai.m.Unlock() - return res -} - -// CompareAndSet atomically sets the value to the given updated value if the current value == expected value. -// Returns true if the expectation was met -func (ai *Int) CompareAndSet(expect int, update int) bool { - res := false - ai.m.Lock() - if ai.val == expect { - ai.val = update - res = true - } - ai.m.Unlock() - return res -} - -// DecrementAndGet atomically decrements current value by one and returns the result. -func (ai *Int) DecrementAndGet() int { - ai.m.Lock() - ai.val-- - res := ai.val - ai.m.Unlock() - return res -} - -// Get atomically retrieves the current value. -func (ai *Int) Get() int { - ai.m.Lock() - res := ai.val - ai.m.Unlock() - return res -} - -// GetAndAdd atomically adds the given delta to the current value and returns the result. -func (ai *Int) GetAndAdd(delta int) int { - ai.m.Lock() - res := ai.val - ai.val += delta - ai.m.Unlock() - return res -} - -// GetAndDecrement atomically decrements the current value by one and returns the result. -func (ai *Int) GetAndDecrement() int { - ai.m.Lock() - res := ai.val - ai.val-- - ai.m.Unlock() - return res -} - -// GetAndIncrement atomically increments current value by one and returns the result. -func (ai *Int) GetAndIncrement() int { - ai.m.Lock() - res := ai.val - ai.val++ - ai.m.Unlock() - return res -} - -// GetAndSet atomically sets current value to the given value and returns the old value. -func (ai *Int) GetAndSet(newValue int) int { - ai.m.Lock() - res := ai.val - ai.val = newValue - ai.m.Unlock() - return res -} - -// IncrementAndGet atomically increments current value by one and returns the result. -func (ai *Int) IncrementAndGet() int { - ai.m.Lock() - ai.val++ - res := ai.val - ai.m.Unlock() - return res -} - -// Set atomically sets current value to the given value. -func (ai *Int) Set(newValue int) { - ai.m.Lock() - ai.val = newValue - ai.m.Unlock() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go deleted file mode 100644 index 6e3b2ef5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/int_test.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "runtime" - "sync" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Atomic Int", func() { - // atomic tests require actual parallelism - runtime.GOMAXPROCS(runtime.NumCPU()) - - var ai *atomic.Int - wg := new(sync.WaitGroup) - - gg.BeforeEach(func() { - ai = atomic.NewInt(0) - }) - - gg.It("must Offer() more elements than queue's capacity, and still not block", func() { - var count int = 1e6 - wg.Add(count) - for i := 0; i < count; i++ { - go func() { - defer wg.Done() - ai.IncrementAndGet() - }() - } - - wg.Wait() - gm.Expect(ai.Get()).To(gm.Equal(count)) - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go deleted file mode 100644 index 200c2ef3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/map/map.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import ( - "sync" -) - -// Map implements a Map with atomic semantics. -type Map[K comparable, V any] struct { - m map[K]V - mutex sync.RWMutex -} - -// New generates a new Map instance. -func New[K comparable, V any](length int) *Map[K, V] { - return &Map[K, V]{ - m: make(map[K]V, length), - } -} - -// Get atomically retrieves an element from the Map. -func (m *Map[K, V]) Get(k K) V { - m.mutex.RLock() - res := m.m[k] - m.mutex.RUnlock() - return res -} - -// Set atomically sets an element in the Map. -// If idx is out of range, it will return an error. -func (m *Map[K, V]) Set(k K, v V) { - m.mutex.Lock() - m.m[k] = v - m.mutex.Unlock() -} - -// Replace replaces the internal map with the provided one. -func (m *Map[K, V]) Replace(nm map[K]V) { - m.mutex.Lock() - m.m = nm - m.mutex.Unlock() -} - -// Length returns the Map size. -func (m *Map[K, V]) Length() int { - m.mutex.RLock() - res := len(m.m) - m.mutex.RUnlock() - - return res -} - -// Length returns the Map size. -func (m *Map[K, V]) Clone() map[K]V { - m.mutex.RLock() - res := make(map[K]V, len(m.m)) - for k, v := range m.m { - res[k] = v - } - m.mutex.RUnlock() - - return res -} - -// Delete will remove the key and return its value. -func (m *Map[K, V]) Delete(k K) V { - m.mutex.Lock() - res := m.m[k] - delete(m.m, k) - m.mutex.Unlock() - return res -} - -// DeleteDeref will dereference and remove the key and return its value. -func (m *Map[K, V]) DeleteDeref(k *K) V { - m.mutex.Lock() - res := m.m[*k] - delete(m.m, *k) - m.mutex.Unlock() - return res -} - -// DeleteAllDeref will dereferences and removes the keys. -func (m *Map[K, V]) DeleteAll(ks ...K) { - m.mutex.Lock() - for i := range ks { - delete(m.m, ks[i]) - } - m.mutex.Unlock() -} - -// DeleteAll will remove the keys. -func (m *Map[K, V]) DeleteAllDeref(ks ...*K) { - m.mutex.Lock() - for i := range ks { - delete(m.m, *ks[i]) - } - m.mutex.Unlock() -} - -func MapAllF[K comparable, V any, U any](m *Map[K, V], f func(map[K]V) U) U { - m.mutex.RLock() - defer m.mutex.RUnlock() - return f(m.m) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go deleted file mode 100644 index 3dbb5209..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic - -import "sync" - -// Queue is a non-blocking FIFO queue. -// If the queue is empty, nil is returned. -// if the queue is full, offer will return false -type Queue struct { - head, tail uint32 - data []interface{} - size uint32 - wrapped bool - mutex sync.Mutex -} - -// NewQueue creates a new queue with initial size. -func NewQueue(size int) *Queue { - if size <= 0 { - panic("Queue size cannot be less than 1") - } - - return &Queue{ - wrapped: false, - data: make([]interface{}, uint32(size)), - size: uint32(size), - } -} - -// Offer adds an item to the queue unless the queue is full. -// In case the queue is full, the item will not be added to the queue -// and false will be returned -func (q *Queue) Offer(obj interface{}) bool { - q.mutex.Lock() - - // make sure queue is not full - if q.tail == q.head && q.wrapped { - q.mutex.Unlock() - return false - } - - if q.head+1 == q.size { - q.wrapped = true - } - - q.head = (q.head + 1) % q.size - q.data[q.head] = obj - q.mutex.Unlock() - return true -} - -// Poll removes and returns an item from the queue. -// If the queue is empty, nil will be returned. -func (q *Queue) Poll() (res interface{}) { - q.mutex.Lock() - - // if queue is not empty - if q.wrapped || (q.tail != q.head) { - if q.tail+1 == q.size { - q.wrapped = false - } - q.tail = (q.tail + 1) % q.size - res = q.data[q.tail] - } - - q.mutex.Unlock() - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go deleted file mode 100644 index 3299489f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/queue_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "runtime" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -type testStruct struct{ i int } - -var _ = gg.Describe("Atomic Queue", func() { - // atomic tests require actual parallelism - runtime.GOMAXPROCS(runtime.NumCPU()) - - var qcap int - var q *atomic.Queue - var elem interface{} - - gg.BeforeEach(func() { - qcap = 10 - q = atomic.NewQueue(qcap) - }) - - gg.It("must Offer() more elements than queue's capacity, and still not block", func() { - for i := 0; i < 2*qcap; i++ { - q.Offer(&testStruct{}) - } - }) - - gg.It("must Poll() more elements than queue's capacity, and still not block", func() { - for i := 0; i < 2*qcap; i++ { - elem = q.Poll() - } - gm.Expect(elem).To(gm.BeNil()) - }) - - gg.It("must Offer() more elements than queue's capacity, and Poll() as many as capacity", func() { - // test for many iterations - for j := 0; j < 10; j++ { - for i := 0; i < 2*qcap; i++ { - q.Offer(&testStruct{i}) - } - - for i := 0; i < 2*qcap; i++ { - obj := q.Poll() - if i < qcap { - gm.Expect(obj.(*testStruct).i).To(gm.Equal(i)) - } else { - gm.Expect(obj).To(gm.BeNil()) - } - } - } - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go deleted file mode 100644 index c7d072bb..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/sync_val.go +++ /dev/null @@ -1,61 +0,0 @@ -package atomic - -import "sync" - -// SyncVal allows synchronized access to a value -type SyncVal[T any] struct { - val T - lock sync.RWMutex -} - -// NewSyncVal creates a new instance of SyncVal -func NewSyncVal[T any](val T) *SyncVal[T] { - return &SyncVal[T]{val: val} -} - -// Set updates the value of SyncVal with the passed argument -func (sv *SyncVal[T]) Set(val T) { - sv.lock.Lock() - sv.val = val - sv.lock.Unlock() -} - -// Get returns the value inside the SyncVal -func (sv *SyncVal[T]) Get() T { - sv.lock.RLock() - val := sv.val - sv.lock.RUnlock() - return val -} - -// GetSyncedVia returns the value returned by the function f. -func (sv *SyncVal[T]) GetSyncedVia(f func(T) (T, error)) (T, error) { - sv.lock.RLock() - defer sv.lock.RUnlock() - - val, err := f(sv.val) - return val, err -} - -// Update gets a function and passes the value of SyncVal to it. -// If the resulting err is nil, it will update the value of SyncVal. -// It will return the resulting error to the caller. -func (sv *SyncVal[T]) Update(f func(T) (T, error)) error { - sv.lock.Lock() - defer sv.lock.Unlock() - - val, err := f(sv.val) - if err == nil { - sv.val = val - } - return err -} - -// MapSyncValue returns the value returned by the function f. -func MapSyncValue[T any, U any](sv *SyncVal[T], f func(T) (U, error)) (U, error) { - sv.lock.RLock() - defer sv.lock.RUnlock() - - val, err := f(sv.val) - return val, err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go deleted file mode 100644 index 7c56a3ab..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val.go +++ /dev/null @@ -1,23 +0,0 @@ -package atomic - -import "sync/atomic" - -// TypedVal allows synchronized access to a value -type TypedVal[T any] atomic.Value - -// Set updates the value of TypedVal with the passed argument -func (sv *TypedVal[T]) Set(val T) { - (*atomic.Value)(sv).Store(&val) -} - -// Get returns the value inside the TypedVal -func (sv *TypedVal[T]) Get() T { - res := (*atomic.Value)(sv).Load() - if res != nil { - return *res.(*T) - } - - // return zero value; for pointers, it will be nil - var t T - return t -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go deleted file mode 100644 index e45e14a2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/atomic/typed_val_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package atomic_test - -import ( - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("TypedVal", func() { - - gg.Context("Storage must support", func() { - - gg.Context("Primitives", func() { - - gg.It("int", func() { - var t int = 5 - var tv atomic.TypedVal[int] - tv.Set(t) - gm.Expect(tv.Get()).To(gm.Equal(t)) - }) - - gg.It("string", func() { - var t string = "Hello!" - var tv atomic.TypedVal[string] - tv.Set(t) - gm.Expect(tv.Get()).To(gm.Equal(t)) - }) - - gg.It("slice", func() { - var t = []int{1, 2, 3} - var tv atomic.TypedVal[[]int] - tv.Set(t) - gm.Expect(tv.Get()).To(gm.Equal(t)) - - tv.Set(nil) - var tt []int - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - gg.It("map", func() { - var t = map[string]int{"a": 1, "b": 2, "c": 3} - var tv atomic.TypedVal[map[string]int] - tv.Set(t) - gm.Expect(tv.Get()).To(gm.Equal(t)) - - tv.Set(nil) - var tt map[string]int - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - }) - - gg.Context("Pointers", func() { - - gg.It("*int", func() { - var t int = 5 - var tv atomic.TypedVal[*int] - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - tv.Set(nil) - var tt *int - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - gg.It("*string", func() { - var t string = "Hello!" - var tv atomic.TypedVal[*string] - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - tv.Set(nil) - var tt *string - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - gg.It("slice", func() { - var t = []int{1, 2, 3} - var tv atomic.TypedVal[*[]int] - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - t = nil - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - tv.Set(nil) - var tt *[]int - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - gg.It("map", func() { - var t = map[string]int{"a": 1, "b": 2, "c": 3} - var tv atomic.TypedVal[*map[string]int] - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - t = nil - tv.Set(&t) - gm.Expect(tv.Get()).To(gm.Equal(&t)) - - tv.Set(nil) - var tt *map[string]int - gm.Expect(tv.Get()).To(gm.Equal(tt)) - }) - - }) - - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go deleted file mode 100644 index 7dba847b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/instance.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - luaLib "github.com/aerospike/aerospike-client-go/v7/internal/lua/resources" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - lua "github.com/yuin/gopher-lua" -) - -// SetPath sets the interpreter's current Lua Path -func SetPath(lpath string) { - lua.LuaPath = lpath -} - -// Path returns the interpreter's current Lua Path -func Path() string { - return lua.LuaPath -} - -// LuaPool is the global LState pool -var LuaPool = types.NewPool(64) - -func newInstance(params ...interface{}) interface{} { - L := lua.NewState() - - registerLuaAerospikeType(L) - registerLuaStreamType(L) - registerLuaListType(L) - registerLuaMapType(L) - - if err := L.DoString(luaLib.LibStreamOps); err != nil { - logger.Logger.Error(err.Error()) - return nil - } - - if err := L.DoString(luaLib.LibAerospike); err != nil { - logger.Logger.Error(err.Error()) - return nil - } - - return L -} - -func finalizeInstance(instance interface{}) { - if instance != nil { - instance.(*lua.LState).Close() - } -} - -func init() { - LuaPool.New = newInstance - LuaPool.Finalize = finalizeInstance -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go deleted file mode 100644 index dabb4a95..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - "fmt" - "reflect" - - lua "github.com/yuin/gopher-lua" -) - -// NewValue creates a value from interface{} in the interpreter -func NewValue(L *lua.LState, value interface{}) lua.LValue { - // Nils should return immediately - if value == nil { - return lua.LNil - } - - // if it is a LValue already, return it without delay - if lval, ok := value.(lua.LValue); ok { - return lval - } - - switch v := value.(type) { - case string: - return lua.LString(v) - case int: - return lua.LNumber(float64(v)) - case uint: - return lua.LNumber(float64(v)) - case int8: - return lua.LNumber(float64(v)) - case uint8: - return lua.LNumber(float64(v)) - case int16: - return lua.LNumber(float64(v)) - case uint16: - return lua.LNumber(float64(v)) - case int32: - return lua.LNumber(float64(v)) - case uint32: - return lua.LNumber(float64(v)) - case int64: - return lua.LNumber(float64(v)) - case uint64: - return lua.LNumber(float64(v)) - case float32: - return lua.LNumber(float64(v)) - case float64: - return lua.LNumber(v) - case bool: - return lua.LBool(v) - case map[interface{}]interface{}: - luaMap := &Map{m: v} - ud := L.NewUserData() - ud.Value = luaMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - return ud - - case []interface{}: - luaList := &List{l: v} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - return ud - } - - // check for array and map - rv := reflect.ValueOf(value) - switch rv.Kind() { - case reflect.Array, reflect.Slice: - l := rv.Len() - arr := make([]interface{}, l) - for i := 0; i < l; i++ { - arr[i] = rv.Index(i).Interface() - } - - return NewValue(L, arr) - case reflect.Map: - l := rv.Len() - amap := make(map[interface{}]interface{}, l) - for _, i := range rv.MapKeys() { - amap[i.Interface()] = rv.MapIndex(i).Interface() - } - - return NewValue(L, amap) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return NewValue(L, reflect.ValueOf(value).Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: - return NewValue(L, int64(reflect.ValueOf(value).Uint())) - case reflect.String: - return NewValue(L, rv.String()) - case reflect.Float32, reflect.Float64: - return NewValue(L, rv.Float()) - case reflect.Bool: - return NewValue(L, rv.Bool()) - } - - panic(fmt.Sprintf("unrecognized data type for lua: %#v\n", value)) -} - -// LValueToInterface converts a generic LValue to a native type -func LValueToInterface(val lua.LValue) interface{} { - switch val.Type() { - case lua.LTNil: - return nil - case lua.LTBool: - return lua.LVAsBool(val) - case lua.LTNumber: - return float64(lua.LVAsNumber(val)) - case lua.LTString: - return lua.LVAsString(val) - case lua.LTUserData: - ud := val.(*lua.LUserData).Value - switch v := ud.(type) { - case *Map: - return v.m - case *List: - return v.l - default: - return v - } - - case lua.LTTable: - t := val.(*lua.LTable) - m := make(map[interface{}]interface{}, t.Len()) - t.ForEach(func(k, v lua.LValue) { m[k] = v }) - return m - default: - panic(fmt.Sprintf("unrecognized data type %#v", val)) - } -} - -func allToString(L *lua.LState) int { - ud := L.CheckUserData(1) - value := ud.Value - if stringer, ok := value.(fmt.Stringer); ok { - L.Push(lua.LString(stringer.String())) - } else { - L.Push(lua.LString(fmt.Sprintf("%v", value))) - } - return 1 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go deleted file mode 100644 index 8ccb6973..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - "github.com/aerospike/aerospike-client-go/v7/logger" - lua "github.com/yuin/gopher-lua" -) - -const luaLuaAerospikeTypeName = "LuaAerospike" - -// Registers my luaAerospike type to given L. -func registerLuaAerospikeType(L *lua.LState) { - mt := L.NewTypeMetatable(luaLuaAerospikeTypeName) - - L.SetGlobal("aerospike", mt) - - // static attributes - L.SetField(mt, "log", L.NewFunction(luaAerospikeLog)) - - L.SetMetatable(mt, mt) -} - -func luaAerospikeLog(L *lua.LState) int { - if L.GetTop() < 2 || L.GetTop() > 3 { - L.ArgError(1, "2 arguments are expected for aerospike:log method") - return 0 - } - - // account for calling it on a table - paramIdx := 1 - if L.GetTop() == 3 { - paramIdx = 2 - } - - level := L.CheckInt(paramIdx) - str := L.CheckString(paramIdx + 1) - - switch level { - case 1: - logger.Logger.Warn(str) - case 2: - logger.Logger.Info(str) - case 3, 4: - logger.Logger.Debug(str) - } - - return 0 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go deleted file mode 100644 index db052b9e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_aerospike_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua_test - -import ( - lua "github.com/yuin/gopher-lua" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" -) - -var _ = gg.Describe("Lua Aerospike API Test", func() { - - // code vs result - testMatrix := map[string]interface{}{ - "aerospike.log(1, 'Warn')": nil, - "warn('Warn %d', 1)": nil, - - "aerospike.log(2, 'Info')": nil, - "info('Info %d', 2)": nil, - - "aerospike.log(3, 'Debug')": nil, - "trace('Trace %d', 3)": nil, - - "aerospike.log(4, 'Debug')": nil, - "debug('Debug %d', 4)": nil, - } - - gg.It("must run all code blocks", func() { - instance := ilua.LuaPool.Get().(*lua.LState) - defer instance.Close() - for source := range testMatrix { - err := instance.DoString(source) - gm.Expect(err).NotTo(gm.HaveOccurred()) - } - - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go deleted file mode 100644 index 2a1f939b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list.go +++ /dev/null @@ -1,404 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - "fmt" - - lua "github.com/yuin/gopher-lua" -) - -// List is the list data type to be used with a Lua instance -type List struct { - l []interface{} -} - -const luaLuaListTypeName = "LuaList" - -// Registers my luaList type to given L. -func registerLuaListType(L *lua.LState) { - mt := L.NewTypeMetatable(luaLuaListTypeName) - - // List package - L.SetGlobal("List", mt) - - // static attributes - - L.SetMetatable(mt, mt) - - // list package - mt = L.NewTypeMetatable(luaLuaListTypeName) - L.SetGlobal("list", mt) - - // static attributes - L.SetField(mt, "__call", L.NewFunction(newLuaList)) - L.SetField(mt, "create", L.NewFunction(createLuaList)) - - L.SetField(mt, "size", L.NewFunction(luaListSize)) - L.SetField(mt, "insert", L.NewFunction(luaListInsert)) - L.SetField(mt, "append", L.NewFunction(luaListAppend)) - L.SetField(mt, "prepend", L.NewFunction(luaListPrepend)) - L.SetField(mt, "take", L.NewFunction(luaListTake)) - L.SetField(mt, "remove", L.NewFunction(luaListRemove)) - L.SetField(mt, "drop", L.NewFunction(luaListDrop)) - L.SetField(mt, "trim", L.NewFunction(luaListTrim)) - L.SetField(mt, "clone", L.NewFunction(luaListClone)) - L.SetField(mt, "concat", L.NewFunction(luaListConcat)) - L.SetField(mt, "merge", L.NewFunction(luaListMerge)) - L.SetField(mt, "iterator", L.NewFunction(luaListIterator)) - - // methods - L.SetFuncs(mt, map[string]lua.LGFunction{ - "__index": luaListIndex, - "__newindex": luaListNewIndex, - "__len": luaListLen, - "__tostring": luaListToString, - }) - - L.SetMetatable(mt, mt) -} - -// Constructor -func createLuaList(L *lua.LState) int { - if L.GetTop() == 0 { - luaList := &List{l: []interface{}{}} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 - } else if L.GetTop() == 1 || L.GetTop() == 2 { - cp := L.CheckInt(1) - l := make([]interface{}, 0, cp) - - luaList := &List{l: l} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 - } - L.ArgError(1, "Only one argument expected for list#create method") - return 0 -} - -// Constructor -func newLuaList(L *lua.LState) int { - if L.GetTop() == 1 { - luaList := &List{l: []interface{}{}} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 - } else if L.GetTop() == 2 { - t := L.CheckTable(2) - l := make([]interface{}, t.Len()) - for i := 1; i <= t.Len(); i++ { - l[i-1] = LValueToInterface(t.RawGetInt(i)) - } - - luaList := &List{l: l} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 - } - L.ArgError(1, "Only one argument expected for list#create method") - return 0 -} - -// Checks whether the first lua argument is a *LUserData with *LuaList and returns this *LuaList. -func checkLuaList(L *lua.LState, arg int) *List { - ud := L.CheckUserData(arg) - if v, ok := ud.Value.(*List); ok { - return v - } - L.ArgError(1, "luaList expected") - return nil -} - -func luaListRemove(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for remove method") - return 0 - } - index := L.CheckInt(2) - 1 - - if index < 0 || index >= len(p.l) { - L.ArgError(1, "index out of range for list#remove") - return 0 - } - - for i := index; i < len(p.l)-1; i++ { - p.l[i] = p.l[i+1] - } - p.l = p.l[:len(p.l)-1] - - return 0 -} - -func luaListInsert(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 3 { - L.ArgError(1, "Only two arguments expected for insert method") - return 0 - } - index := L.CheckInt(2) - value := LValueToInterface(L.CheckAny(3)) - - if cap(p.l) > len(p.l) { - for i := len(p.l); i >= index; i-- { - p.l[i] = p.l[i-1] - } - p.l[index-1] = value - } else { - ln := len(p.l) * 2 - if ln > 256 { - ln = 256 - } - newList := make([]interface{}, len(p.l)+1, ln) - - copy(newList, p.l[:index-1]) - newList[index-1] = value - copy(newList[index:], p.l[index-1:len(p.l)]) - p.l = newList - } - - return 0 -} - -func luaListAppend(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for append method") - return 0 - } - value := LValueToInterface(L.CheckAny(2)) - p.l = append(p.l, value) - - return 0 -} - -func luaListPrepend(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for append method") - return 0 - } - value := LValueToInterface(L.CheckAny(2)) - - if cap(p.l) > len(p.l) { - p.l = append(p.l, nil) - for i := len(p.l) - 1; i > 0; i-- { - p.l[i] = p.l[i-1] - } - p.l[0] = value - } else { - ln := len(p.l) * 2 - if ln > 256 { - ln = 256 - } - newList := make([]interface{}, len(p.l)+1, ln) - - copy(newList[1:], p.l) - newList[0] = value - p.l = newList - } - - return 0 -} - -func luaListTake(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for take method") - return 0 - } - - count := L.CheckInt(2) - items := p.l - if count <= len(p.l) { - items = p.l[:count] - } - - luaList := &List{l: items} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 -} - -func luaListDrop(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for take method") - return 0 - } - - count := L.CheckInt(2) - var items []interface{} - if count < len(p.l) { - items = p.l[count:] - } else { - items = []interface{}{} - } - - luaList := &List{l: items} - ud := L.NewUserData() - ud.Value = luaList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 -} - -func luaListTrim(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for list#trim method") - return 0 - } - - count := L.CheckInt(2) - p.l = p.l[:count-1] - - return 0 -} - -func luaListConcat(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for list#concat method") - return 0 - } - - sp := checkLuaList(L, 2) - p.l = append(p.l, sp.l...) - return 0 -} - -// LuaList#clone() -func luaListClone(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "only one argument expected for list#clone method") - return 0 - } - - newList := &List{l: make([]interface{}, len(p.l))} - copy(newList.l, p.l) - - ud := L.NewUserData() - ud.Value = newList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - return 1 -} - -// LuaList#merge() -func luaListMerge(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for merge method") - return 0 - } - - sp := checkLuaList(L, 2) - - newList := &List{l: make([]interface{}, 0, len(p.l)+len(sp.l))} - newList.l = append(newList.l, p.l...) - newList.l = append(newList.l, sp.l...) - - ud := L.NewUserData() - ud.Value = newList - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaListTypeName)) - L.Push(ud) - - return 1 -} - -func luaListToString(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for tostring method") - return 0 - } - - L.Push(lua.LString(fmt.Sprintf("%v", p.l))) - return 1 -} - -func luaListSize(L *lua.LState) int { - p := checkLuaList(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for __size method") - return 0 - } - L.Push(lua.LNumber(len(p.l))) - return 1 -} - -func luaListIndex(L *lua.LState) int { - ref := checkLuaList(L, 1) - index := L.CheckInt(2) - - if index <= 0 || index > len(ref.l) { - L.Push(lua.LNil) - return 1 - } - - item := ref.l[index-1] - L.Push(NewValue(L, item)) - return 1 -} - -func luaListNewIndex(L *lua.LState) int { - ref := checkLuaList(L, 1) - index := L.CheckInt(2) - value := L.CheckAny(3) - - ref.l[index-1] = LValueToInterface(value) - return 0 -} - -func luaListLen(L *lua.LState) int { - ref := checkLuaList(L, 1) - L.Push(lua.LNumber(len(ref.l))) - return 1 -} - -func luaListIterator(L *lua.LState) int { - ref := checkLuaList(L, 1) - - // make an iterator - idx := 0 - llen := len(ref.l) - fn := func(L *lua.LState) int { - if idx < llen { - L.Push(NewValue(L, ref.l[idx])) - idx++ - return 1 - } - return 0 - } - L.Push(L.NewFunction(fn)) - return 1 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go deleted file mode 100644 index da097b83..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_list_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua_test - -import ( - lua "github.com/yuin/gopher-lua" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" -) - -var _ = gg.Describe("Lua List API Test", func() { - - // code vs result - testMatrix := map[string]interface{}{ - "l = List()\n return l": []interface{}{}, - "l = List.create()\n return l": []interface{}{}, - "l = List.create(100)\n return l": make([]interface{}, 0, 100), - - "l = list()\n return l": []interface{}{}, - "l = list.create()\n return l": []interface{}{}, - "l = list.create(100)\n return l": make([]interface{}, 0, 100), - "l = list({1,2})\n return l": []interface{}{float64(1), float64(2)}, - - "l = list({1,2})\n l[1] = 5\n return l": []interface{}{float64(5), float64(2)}, - "l = list({1,2})\n return l[1]": float64(1), - - "l = list()\n return list.size(l)": float64(0), - "l = list.create()\n return list.size(l)": float64(0), - "l = list.create(100)\n return list.size(l)": float64(0), - "l = list({1,2})\n return list.size(l)": float64(2), - - "l = list{1,2}\n list.insert(l, 1, 0)\n return l": []interface{}{float64(0), float64(1), float64(2)}, - "l = list{1,2}\n list.insert(l, 2, 0)\n return l": []interface{}{float64(1), float64(0), float64(2)}, - "l = list{1,2}\n list.insert(l, 3, 0)\n return l": []interface{}{float64(1), float64(2), float64(0)}, - - "l = list{1,2}\n list.append(l, 3)\n return l": []interface{}{float64(1), float64(2), float64(3)}, - "l = list{1,2}\n list.append(l, 3)\nlist.append(l, 4)\n return l": []interface{}{float64(1), float64(2), float64(3), float64(4)}, - - "l = list{1,2}\n list.prepend(l, 0)\n return l": []interface{}{float64(0), float64(1), float64(2)}, - "l = list{1,2}\n list.prepend(l, 3)\nlist.prepend(l, 4)\n return l": []interface{}{float64(4), float64(3), float64(1), float64(2)}, - - "l = list{1,2}\n return list.take(l, 1)": []interface{}{float64(1)}, - "l = list{1,2}\n return list.take(l, 2)": []interface{}{float64(1), float64(2)}, - "l = list{1,2}\n return list.take(l, 3)": []interface{}{float64(1), float64(2)}, - "l = list{1,2}\n list.take(l, 1)\nlist.take(l, 2)\n return l": []interface{}{float64(1), float64(2)}, - - "l = list{1,2}\n list.remove(l, 1)\n return l": []interface{}{float64(2)}, - "l = list{1,2}\n list.remove(l, 2)\n return l": []interface{}{float64(1)}, - "l = list{1,2}\n list.remove(l, 1)\nlist.remove(l, 1)\n return l": []interface{}{}, - - "l = list{1,2}\n list.drop(l, 1)\n return l": []interface{}{float64(1), float64(2)}, - "l = list{1,2}\n return list.drop(l, 1)": []interface{}{float64(2)}, - "l = list{1,2}\n return list.drop(l, 2)": []interface{}{}, - "l = list{1,2}\n return list.drop(l, 5)": []interface{}{}, - "l = list{1,2}\n list.drop(l, 1)\nreturn list.drop(l, 1)": []interface{}{float64(2)}, - - "l = list{1,2}\n list.trim(l, 1)\n return l": []interface{}{}, - "l = list{1,2}\n list.trim(l, 2)\n return l": []interface{}{float64(1)}, - - "l = list{1,2}\n return list.clone(l)": []interface{}{float64(1), float64(2)}, - - "l1 = list{1,2}\n l2 = list{3,4}\n list.concat(l1, l2)\n return l1": []interface{}{float64(1), float64(2), float64(3), float64(4)}, - "l1 = list{3,4}\n l2 = list{1,2}\n list.concat(l1, l2)\n return l1": []interface{}{float64(3), float64(4), float64(1), float64(2)}, - - "l1 = list{1,2}\n l2 = list{3,4}\n return list.merge(l1, l2)": []interface{}{float64(1), float64(2), float64(3), float64(4)}, - "l1 = list{3,4}\n l2 = list{1,2}\n return list.merge(l1, l2)": []interface{}{float64(3), float64(4), float64(1), float64(2)}, - - "l = list{1,2,3,4,5}\n cnt = 0\nfor value in list.iterator(l) do\n\t cnt = cnt + value\n end\n return cnt": float64(15), - - "l = list{1,2,3,4,5}\n return tostring(l)": "[1 2 3 4 5]", - } - - // following expressions should return an error - errMatrix := []string{ - "l = list{1,2}\n list.remove(l, 3)", - } - - gg.It("must run all code blocks", func() { - instance := ilua.LuaPool.Get().(*lua.LState) - defer instance.Close() - for source, expected := range testMatrix { - - err := instance.DoString(source) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - gg.By(source) - gm.Expect(ilua.LValueToInterface(instance.CheckAny(-1))).To(gm.Equal(expected)) - instance.Pop(1) // remove received value - } - - }) - - gg.It("must fail all code blocks", func() { - instance := ilua.LuaPool.Get().(*lua.LState) - defer instance.Close() - for _, source := range errMatrix { - gg.By(source) - - err := instance.DoString(source) - gm.Expect(err).To(gm.HaveOccurred()) - - } - - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go deleted file mode 100644 index 1ff1c474..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map.go +++ /dev/null @@ -1,393 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - "fmt" - - lua "github.com/yuin/gopher-lua" -) - -// Map is used internally for the Lua instance -type Map struct { - m map[interface{}]interface{} -} - -const luaLuaMapTypeName = "LuaMap" - -func registerLuaMapType(L *lua.LState) { - // Map package - mt := L.NewTypeMetatable(luaLuaMapTypeName) - - L.SetGlobal("Map", mt) - - // static attributes - L.SetField(mt, "__call", L.NewFunction(newLuaMap)) - - L.SetField(mt, "create", L.NewFunction(luaMapCreate)) - - // methods - L.SetMetatable(mt, mt) - - // map package - mt = L.NewTypeMetatable(luaLuaMapTypeName) - - L.SetGlobal("map", mt) - - // static attributes - L.SetField(mt, "__call", L.NewFunction(newLuaMap)) - - L.SetField(mt, "create", L.NewFunction(luaMapCreate)) - - L.SetField(mt, "pairs", L.NewFunction(luaMapPairs)) - L.SetField(mt, "size", L.NewFunction(luaMapSize)) - L.SetField(mt, "keys", L.NewFunction(luaMapKeys)) - L.SetField(mt, "values", L.NewFunction(luaMapValues)) - L.SetField(mt, "remove", L.NewFunction(luaMapRemove)) - L.SetField(mt, "clone", L.NewFunction(luaMapClone)) - L.SetField(mt, "merge", L.NewFunction(luaMapMerge)) - L.SetField(mt, "diff", L.NewFunction(luaMapDiff)) - - // methods - L.SetFuncs(mt, map[string]lua.LGFunction{ - "__index": luaMapIndex, - "__newindex": luaMapNewIndex, - "__len": luaMapSize, - "__tostring": luaMapToString, - }) - - L.SetMetatable(mt, mt) -} - -// Constructor -func luaMapCreate(L *lua.LState) int { - if L.GetTop() == 1 { - luaMap := &Map{m: map[interface{}]interface{}{}} - ud := L.NewUserData() - ud.Value = luaMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - return 1 - } else if L.GetTop() == 2 { - L.CheckTable(1) - sz := L.CheckInt(2) - luaMap := &Map{m: make(map[interface{}]interface{}, sz)} - ud := L.NewUserData() - ud.Value = luaMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - return 1 - } - L.ArgError(1, "Only one argument expected for map create method") - return 0 -} - -func newLuaMap(L *lua.LState) int { - if L.GetTop() == 1 { - luaMap := &Map{m: make(map[interface{}]interface{}, 4)} - ud := L.NewUserData() - ud.Value = luaMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - return 1 - } else if L.GetTop() == 2 { - L.CheckTable(1) - t := L.CheckTable(2) - m := make(map[interface{}]interface{}, t.Len()) - t.ForEach(func(k, v lua.LValue) { m[LValueToInterface(k)] = LValueToInterface(v) }) - - luaMap := &Map{m: m} - ud := L.NewUserData() - ud.Value = luaMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - return 1 - } - L.ArgError(1, "Only one argument expected for map create method") - return 0 -} - -// Checks whether the first lua argument is a *LUserData with *LuaMap and returns this *LuaMap. -func checkLuaMap(L *lua.LState, arg int) *Map { - ud := L.CheckUserData(arg) - if v, ok := ud.Value.(*Map); ok { - return v - } - L.ArgError(1, "luaMap expected") - return nil -} - -func luaMapRemove(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for remove method") - return 0 - } - key := L.CheckAny(2) - - delete(p.m, LValueToInterface(key)) - return 0 -} - -func luaMapClone(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for clone method") - return 0 - } - - newMap := &Map{m: make(map[interface{}]interface{}, len(p.m))} - for k, v := range p.m { - newMap.m[k] = v - } - - ud := L.NewUserData() - ud.Value = newMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - return 1 -} - -func luaMapMerge(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() < 2 || L.GetTop() > 3 { - L.ArgError(1, "Only 2 or 3 argument expected for merge method") - return 0 - } - - if L.GetTop() == 2 { - sp := checkLuaMap(L, 2) - - newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} - for k, v := range p.m { - newMap.m[k] = v - } - - for k, v := range sp.m { - newMap.m[k] = v - } - - ud := L.NewUserData() - ud.Value = newMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - } else { - sp := checkLuaMap(L, 2) - fn := L.CheckFunction(3) - - newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} - for k, v := range p.m { - if v2, exists := sp.m[k]; exists { - L.CallByParam(lua.P{Fn: fn, NRet: 1, Protect: true, Handler: nil}, NewValue(L, v), NewValue(L, v2)) - ret := L.CheckAny(-1) - L.Pop(1) // remove received value - newMap.m[k] = LValueToInterface(ret) - } else { - newMap.m[k] = v - } - } - - for k, v := range sp.m { - // only add keys that haven't been processed already - if _, exists := newMap.m[k]; !exists { - newMap.m[k] = v - } - } - - ud := L.NewUserData() - ud.Value = newMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - } - - return 1 -} - -func luaMapDiff(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for diff method") - return 0 - } - - sp := checkLuaMap(L, 2) - - newMap := &Map{m: make(map[interface{}]interface{}, len(p.m)+len(sp.m))} - - for k, v := range p.m { - if _, exists := sp.m[k]; !exists { - newMap.m[k] = v - } - } - - for k, v := range sp.m { - if _, exists := p.m[k]; !exists { - newMap.m[k] = v - } - } - - ud := L.NewUserData() - ud.Value = newMap - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaMapTypeName)) - L.Push(ud) - - return 1 -} - -func luaMapToString(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for tostring method") - return 0 - } - L.Push(lua.LString(fmt.Sprintf("%v", p.m))) - return 1 -} - -func luaMapSize(L *lua.LState) int { - p := checkLuaMap(L, 1) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for __size method") - return 0 - } - L.Push(lua.LNumber(len(p.m))) - return 1 -} - -func luaMapIndex(L *lua.LState) int { - ref := checkMap(L) - key := LValueToInterface(L.CheckAny(2)) - - v := ref.m[key] - if v == nil { - v = lua.LNil - } - - L.Push(NewValue(L, v)) - return 1 -} - -func luaMapNewIndex(L *lua.LState) int { - ref := checkMap(L) - key := LValueToInterface(L.CheckAny(2)) - value := LValueToInterface(L.CheckAny(3)) - - ref.m[key] = value - return 0 -} - -func luaMapLen(L *lua.LState) int { - ref := checkMap(L) - L.Push(lua.LNumber(len(ref.m))) - return 1 -} - -func luaMapPairs(L *lua.LState) int { - ref := checkMap(L) - - // make an iterator - iter := make(chan *struct{ k, v interface{} }) - - go func() { - for k, v := range ref.m { - iter <- &struct{ k, v interface{} }{k, v} - } - close(iter) - }() - - fn := func(L *lua.LState) int { - tuple := <-iter - if tuple == nil { - return 0 - } - - L.Push(NewValue(L, tuple.k)) - L.Push(NewValue(L, tuple.v)) - return 2 - } - L.Push(L.NewFunction(fn)) - return 1 -} - -func luaMapKeys(L *lua.LState) int { - ref := checkMap(L) - - // make an iterator - iter := make(chan interface{}) - - go func() { - for k := range ref.m { - iter <- k - } - close(iter) - }() - - fn := func(L *lua.LState) int { - tuple := <-iter - if tuple == nil { - return 0 - } - - L.Push(NewValue(L, tuple)) - return 1 - } - L.Push(L.NewFunction(fn)) - return 1 -} - -func luaMapValues(L *lua.LState) int { - ref := checkMap(L) - - // make an iterator - iter := make(chan interface{}) - - go func() { - for _, v := range ref.m { - iter <- v - } - close(iter) - }() - - fn := func(L *lua.LState) int { - tuple := <-iter - if tuple == nil { - return 0 - } - - L.Push(NewValue(L, tuple)) - return 1 - } - L.Push(L.NewFunction(fn)) - return 1 -} - -func luaMapEq(L *lua.LState) int { - map1 := checkMap(L) - map2 := checkMap(L) - L.Push(lua.LBool(map1 == map2)) - return 1 -} - -func checkMap(L *lua.LState) *Map { - ud := L.CheckUserData(1) - if v, ok := ud.Value.(*Map); ok { - return v - } - L.ArgError(1, "luaMap expected") - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go deleted file mode 100644 index d73529e4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_map_test.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua_test - -import ( - lua "github.com/yuin/gopher-lua" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - ilua "github.com/aerospike/aerospike-client-go/v7/internal/lua" -) - -var _ = gg.Describe("Lua Map API Test", func() { - - // code vs result - testMatrix := map[string]interface{}{ - "m = Map()\n return m": map[interface{}]interface{}{}, - - "m = map()\n return m": map[interface{}]interface{}{}, - "m = map{x = 1, y = 2}\n return m": map[interface{}]interface{}{"x": float64(1), "y": float64(2)}, - "m = map.create(100)\n return m": make(map[interface{}]interface{}, 100), - - "m = map({x=1,y=2})\n return m['x']": float64(1), - "m = map({x=1,y=2})\n m['x'] = 5\n return m": map[interface{}]interface{}{"x": float64(5), "y": float64(2)}, - - "m = map()\n return map.size(m)": float64(0), - "m = map.create(100)\n return map.size(m)": float64(0), - "m = map({x=1,y=2})\n return map.size(m)": float64(2), - - "m = map{x=1,y=2,z=3}\n cnt = 0\nfor k, v in map.pairs(m) do\n\t cnt = cnt + v\n end\n return cnt": float64(6), - - "m = map{x=1,y=2,z=3}\n str = ''\nfor k in map.keys(m) do\n\t str = str .. k\n end\n return string.len(str)": float64(3), - "m = map{x=1,y=2,z=3}\n cnt = 0\nfor v in map.values(m) do\n\t cnt = cnt + v\n end\n return cnt": float64(6), - - "m = map{x=1,y=2}\n map.remove(m, 'x')\n return m": map[interface{}]interface{}{"y": float64(2)}, - "m = map{x=1,y=2}\n map.remove(m, 'y')\n return m": map[interface{}]interface{}{"x": float64(1)}, - "m = map{x=1,y=2}\n map.remove(m, 'x')\nmap.remove(m, 'y')\n return m": map[interface{}]interface{}{}, - "m = map{x=1,y=2}\n map.remove(m, 'z')\nmap.remove(m, 't')\n return m": map[interface{}]interface{}{"x": float64(1), "y": float64(2)}, - - "m1 = map({x=1,y=2})\n m2 = map.clone(m1)\n return map.size(m2)": float64(2), - - "m1 = map{x=1,y=2}\n m2 = map{a=3,b=4}\n return map.merge(m1, m2)": map[interface{}]interface{}{"x": float64(1), "y": float64(2), "a": float64(3), "b": float64(4)}, - "m1 = map{x=1,y=2}\n m2 = map{x=3,y=4}\n return map.merge(m1, m2, function(v1, v2)\n return v1 + v2\n end)": map[interface{}]interface{}{"x": float64(4), "y": float64(6)}, - } - - gg.It("must run all code blocks", func() { - instance := ilua.LuaPool.Get().(*lua.LState) - defer instance.Close() - for source, expected := range testMatrix { - - err := instance.DoString(source) - gm.Expect(err).NotTo(gm.HaveOccurred()) - - gg.By(source) - gm.Expect(ilua.LValueToInterface(instance.CheckAny(-1))).To(gm.Equal(expected)) - instance.Pop(1) // remove received value - } - - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go deleted file mode 100644 index 7a21c747..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_stream.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua - -import ( - "fmt" - - lua "github.com/yuin/gopher-lua" -) - -// Stream is the data type used as a stream by the lua instances -type Stream struct { - s chan interface{} -} - -const luaLuaStreamTypeName = "LuaStream" - -// Registers my luaStream type to given L. -func registerLuaStreamType(L *lua.LState) { - mt := L.NewTypeMetatable(luaLuaStreamTypeName) - - L.SetGlobal("stream", mt) - - // static attributes - L.SetField(mt, "__call", L.NewFunction(newStream)) - L.SetField(mt, "read", L.NewFunction(luaStreamRead)) - L.SetField(mt, "write", L.NewFunction(luaStreamWrite)) - L.SetField(mt, "readable", L.NewFunction(luaStreamReadable)) - L.SetField(mt, "writeable", L.NewFunction(luaStreamWriteable)) - - // methods - L.SetFuncs(mt, map[string]lua.LGFunction{ - "__tostring": luaStreamToString, - }) - - L.SetMetatable(mt, mt) -} - -// NewStream creates a LuaStream -func NewStream(L *lua.LState, stream chan interface{}) *lua.LUserData { - luaStream := &Stream{s: stream} - ud := L.NewUserData() - ud.Value = luaStream - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaStreamTypeName)) - return ud -} - -func newStream(L *lua.LState) int { - luaStream := &Stream{s: make(chan interface{}, 64)} - ud := L.NewUserData() - ud.Value = luaStream - L.SetMetatable(ud, L.GetTypeMetatable(luaLuaStreamTypeName)) - L.Push(ud) - return 1 -} - -// Checks whether the first lua argument is a *LUserData with *LuaStream and returns this *LuaStream. -func checkLuaStream(L *lua.LState) *Stream { - ud := L.CheckUserData(1) - if v, ok := ud.Value.(*Stream); ok { - return v - } - L.ArgError(1, "luaSteam expected") - return nil -} - -func luaStreamToString(L *lua.LState) int { - p := checkLuaStream(L) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for tostring method") - return 0 - } - L.Push(lua.LString(fmt.Sprintf("%v", p.s))) - return 1 -} - -func luaStreamRead(L *lua.LState) int { - p := checkLuaStream(L) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for stream:read method") - return 0 - } - - L.Push(NewValue(L, <-p.s)) - return 1 -} - -func luaStreamWrite(L *lua.LState) int { - p := checkLuaStream(L) - if L.GetTop() != 2 { - L.ArgError(1, "Only one argument expected for stream:write method") - return 0 - } - - p.s <- LValueToInterface(L.CheckAny(2)) - return 1 -} - -func luaStreamReadable(L *lua.LState) int { - checkLuaStream(L) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for readable method") - return 0 - } - L.Push(lua.LBool(true)) - return 1 -} - -func luaStreamWriteable(L *lua.LState) int { - checkLuaStream(L) - if L.GetTop() != 1 { - L.ArgError(1, "No arguments expected for writeable method") - return 0 - } - L.Push(lua.LBool(true)) - return 1 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go deleted file mode 100644 index 26db9346..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/lua_suite_test.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lua_test - -import ( - "testing" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func TestLua(t *testing.T) { - gm.RegisterFailHandler(gg.Fail) - gg.RunSpecs(t, "Lua Libs Test") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go deleted file mode 100644 index 0440db57..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/aerospike.go +++ /dev/null @@ -1,205 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -package luaLib - -// LibAerospike is the source code for the Aerospike library in the lua instance -const LibAerospike = ` - --- The Lua Interface to Aerospike --- --- ====================================================================== --- Copyright [2014] Aerospike, Inc.. Portions may be licensed --- to Aerospike, Inc. under one or more contributor license agreements. --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- ====================================================================== - --- A table to track whether we had sandboxed a function -sandboxed = {} - -ldebug = debug; - --- ############################################################################ --- --- LOG FUNCTIONS --- --- ############################################################################ - -function trace(m, ...) - return aerospike:log(4, string.format(m, ...)) -end - -function debug(m, ...) - return aerospike:log(3, string.format(m, ...)) -end - -function info(m, ...) - return aerospike:log(2, string.format(m, ...)) -end - -function warn(m, ...) - return aerospike:log(1, string.format(m, ...)) -end - --- ############################################################################ --- --- APPLY FUNCTIONS --- --- ############################################################################ - --- --- Creates a new environment for use in apply_record functions --- -function env_record() - return { - - -- aerospike types - ["record"] = record, - ["iterator"] = iterator, - ["list"] = list, - ["map"] = map, - ["bytes"] = bytes, - ["aerospike"] = aerospike, - - ["putX"] = putX, - - -- logging functions - ["trace"] = trace, - ["debug"] = debug, - ["info"] = info, - ["warn"] = warn, - - -- standard lua functions - ["collectgarbage"] = collectgarbage, - ["error"] = error, - ["getmetatable"] = getmetatable, - ["ipairs"] = ipairs, - ["load"] = loadstring, - ["module"] = module, - ["next"] = next, - ["pairs"] = pairs, - ["print"] = print, - ["pcall"] = pcall, - ["rawequal"] = rawequal, - ["rawget"] = rawget, - ["rawset"] = rawset, - ["require"] = require, - ["require"] = require, - ["select"] = select, - ["setmetatable"] = setmetatable, - ["setfenv"] = setfenv, - ["tonumber"] = tonumber, - ["tostring"] = tostring, - ["type"] = type, - ["unpack"] = unpack, - ["xpcall"] = xpcall, - - -- standard lua objects - ["math"] = math, - ["io"] = io, - ["os"] = { - ['clock'] = os.clock, - ['date'] = os.date, - ['difftime'] = os.difftime, - ['getenv'] = os.getenv, - ['setlocale'] = os.setlocale, - ['time'] = os.time, - ['tmpname'] = os.tmpname - }, - ["package"] = package, - ["string"] = string, - ["table"] = table, - - -- standard lua variables - ["_G"] = {} - } -end - --- --- Apply function to a record and arguments. --- --- @param f the fully-qualified name of the function. --- @param r the record to be applied to the function. --- @param ... additional arguments to be applied to the function. --- @return result of the called function or nil. --- -function apply_record(f, r, ...) - - if f == nil then - error("function not found", 2) - end - - if not sandboxed[f] then - setfenv(f,env_record()) - sandboxed[f] = true - end - - success, result = pcall(f, r, ...) - if success then - return result - else - error(result, 2) - return nil - end -end - --- --- Apply function to an iterator and arguments. --- --- @param f the fully-qualified name of the function. --- @param s the iterator to be applied to the function. --- @param ... additional arguments to be applied to the function. --- @return 0 on success, otherwise failure. --- -function apply_stream(f, scope, istream, ostream, ...) - - if f == nil then - error("function not found", 2) - return 2 - end - - --require("stream_ops") - - if not sandboxed[f] then - setfenv(f,env_record()) - sandboxed[f] = true - end - - local stream_ops = StreamOps_create(); - success, result = pcall(f, stream_ops, ...) - - -- info("apply_stream: success=%s, result=%s", tostring(success), tostring(result)) - - if success then - local ops = StreamOps_select(result.ops, scope); - - -- Apply server operations to the stream - -- result => a stream_ops object - local values = StreamOps_apply(stream_iterator(istream), ops); - - -- Iterate the stream of values from the computation - -- then pipe it to the ostream - for value in values do - -- info("value = %s", tostring(value)) - stream.write(ostream, value) - end - - -- 0 is success - return 0 - else - error(result, 2) - return 2 - end -end -` diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go b/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go deleted file mode 100644 index c7d447a3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/lua/resources/stream_ops.go +++ /dev/null @@ -1,362 +0,0 @@ -//go:build !app_engine -// +build !app_engine - -package luaLib - -// LibStreamOps is the source code for the stream library in the lua instance -const LibStreamOps = ` --- Lua Interface for Aerospike Record Stream Support --- --- ====================================================================== --- Copyright [2014] Aerospike, Inc.. Portions may be licensed --- to Aerospike, Inc. under one or more contributor license agreements. --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- ====================================================================== - -local function check_limit(v) - return type(v) == 'number' and v >= 1000 -end - --- --- clone a table. creates a shallow copy of the table. --- -local function clone_table(t) - local out = {} - for k,v in pairs(t) do - out[k] = v - end - return out -end - --- --- Clone a value. --- -local function clone(v) - - local t = type(v) - - if t == 'number' then - return v - elseif t == 'string' then - return v - elseif t == 'boolean' then - return v - elseif t == 'table' then - return clone_table(v) - elseif t == 'userdata' then - if v.__index == Map then - return map.clone(v) - elseif v.__index == List then - return list.clone(v) - end - return nil - end - - return v -end - --- --- Filter values --- @param next - a generator that produces the next value from a stream --- @param f - the function to transform each value --- -function filter( next, p ) - -- done indicates if we exhausted the 'next' stream - local done = false - - -- return a closure which the caller can use to get the next value - return function() - - -- we bail if we already exhausted the stream - if done then return nil end - - -- find the first value which satisfies the predicate - for a in next do - if p(a) then - return a - end - end - - done = true - - return nil - end -end - --- --- Transform values --- @param next - a generator that produces the next value from a stream --- @param f - the tranfomation operation --- -function transform( next, f ) - -- done indicates if we exhausted the 'next' stream - local done = false - - -- return a closure which the caller can use to get the next value - return function() - - -- we bail if we already exhausted the stream - if done then return nil end - - -- get the first value - local a = next() - - -- apply the transformation - if a ~= nil then - return f(a) - end - - done = true; - - return nil - end -end - --- --- Combines two values from an istream into a single value. --- @param next - a generator that produces the next value from a stream --- @param f - the reduction operation --- -function reduce( next, f ) - -- done indicates if we exhausted the 'next' stream - local done = false - - -- return a closure which the caller can use to get the next value - return function() - - - -- we bail if we already exhausted the stream - if done then return nil end - - -- get the first value - local a = next() - - if a ~= nil then - -- get each subsequent value and reduce them - for b in next do - a = f(a,b) - end - end - - -- we are done! - done = true - - return a - end -end - --- --- Aggregate values into a single value. --- @param next - a generator that produces the next value from a stream --- @param f - the aggregation operation --- -function aggregate( next, init, f ) - -- done indicates if we exhausted the 'next' stream - local done = false - - -- return a closure which the caller can use to get the next value - return function() - - -- we bail if we already exhausted the stream - if done then return nil end - - -- get the initial value - local a = clone(init) - - -- get each subsequent value and aggregate them - for b in next do - a = f(a,b) - - -- check the size limit, if it is exceeded, - -- then return the value - if check_limit(a) then - return a - end - end - - -- we are done! - done = true - - return a - end -end - --- --- as_stream iterator --- -function stream_iterator(s) - local done = false - return function() - if done then return nil end - local v = stream.read(s) - if v == nil then - done = true - end - return v; - end -end - - - --- ###################################################################################### --- --- StreamOps --- Builds a sequence of operations to be applied to a stream of values. --- --- ###################################################################################### - -StreamOps = {} -StreamOps_mt = { __index = StreamOps } - --- Op only executes on server -local SCOPE_SERVER = 1 - --- Op only executes on client -local SCOPE_CLIENT = 2 - --- Op can execute on either client or server -local SCOPE_EITHER = 3 - --- Op executes on both client and server -local SCOPE_BOTH = 4 - --- --- Creates a new StreamOps using an array of ops --- --- @param ops an array of operations --- -function StreamOps_create() - local self = {} - setmetatable(self, StreamOps_mt) - self.ops = {} - return self -end - -function StreamOps_apply(stream, ops, i, n) - - -- if nil, then use default values - i = i or 1 - n = n or #ops - - -- if index in list > size of list, then return the stream - if i > n then return stream end - - -- get the current operation - local op = ops[i] - - -- apply the operation and get a stream or use provided stream - local s = op.func(stream, unpack(op.args)) or stream - - -- move to the next operation - return StreamOps_apply(s, ops, i + 1, n) -end - - --- --- This selects the operations appropriate for a given scope. --- For the SERVER scope, it will select the first n ops until one of the ops --- is a CLIENT scope op. --- For the CLIENT scope, it will skip the first n ops that are SERVER scope --- ops, then it will take the remaining ops, including SERVER scoped ops. --- -function StreamOps_select(stream_ops, scope) - local server_ops = {} - local client_ops = {} - - local phase = SCOPE_SERVER - for i,op in ipairs(stream_ops) do - if phase == SCOPE_SERVER then - if op.scope == SCOPE_SERVER then - table.insert(server_ops, op) - elseif op.scope == SCOPE_EITHER then - table.insert(server_ops, op) - elseif op.scope == SCOPE_BOTH then - table.insert(server_ops, op) - table.insert(client_ops, op) - phase = SCOPE_CLIENT - end - elseif phase == SCOPE_CLIENT then - table.insert(client_ops, op) - end - end - - if scope == SCOPE_CLIENT then - return client_ops - else - return server_ops - end -end - - - --- --- OPS: [ OP, ... ] --- OP: {scope=SCOPE, name=NAME, func=FUNC, args=ARGS} --- SCOPE: ANY(0) | SERVER(1) | CLIENT(2) | --- NAME: FUNCTION NAME --- FUNC: FUNCTION POINTER --- ARGS: ARRAY OF ARGUMENTS --- - - -function StreamOps:aggregate(...) - table.insert(self.ops, { scope = SCOPE_SERVER, name = "aggregate", func = aggregate, args = {...}}) - return self -end - -function StreamOps:reduce(...) - table.insert(self.ops, { scope = SCOPE_BOTH, name = "reduce", func = reduce, args = {...}}) - return self -end - -function StreamOps:map(...) - table.insert(self.ops, { scope = SCOPE_EITHER, name = "map", func = transform, args = {...}}) - return self -end - -function StreamOps:filter(...) - table.insert(self.ops, { scope = SCOPE_EITHER, name = "filter", func = filter, args = {...}}) - return self -end - --- stream : group(f) --- --- Group By will return a Map of keys to a list of values. The key is determined by applying the --- function 'f' to each element in the stream. --- -function StreamOps:groupby(f) - - local function _aggregate(m, v) - local k = f and f(v) or nil; - local l = m[k] or list() - list.append(l, v) - m[k] = l; - return m; - end - - local function _merge(l1, l2) - local l = list.clone(l1) - for v in list.iterator(l2) do - list.append(l, v) - end - return l - end - - function _reduce(m1, m2) - return map.merge(m1, m2, _merge) - end - - return self : aggregate(map(), _aggregate) : reduce(_reduce) -end -` diff --git a/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go b/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go deleted file mode 100644 index a04100e4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/internal/seq/seq.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package seq - -import ( - "errors" - "sync" -) - -var Break = errors.New("Break") - -func Do[T any](seq []T, f func(T) error) { - for i := range seq { - if err := f(seq[i]); err == Break { - break - } - } -} - -func ParDo[T any](seq []T, f func(T)) { - if len(seq) == 0 { - return - } - - wg := new(sync.WaitGroup) - wg.Add(len(seq)) - for i := range seq { - go func(t T) { - defer wg.Done() - f(t) - }(seq[i]) - } - wg.Wait() -} - -func Any[T any](seq []T, f func(T) bool) bool { - for i := range seq { - if f(seq[i]) { - return true - } - } - return false -} - -func All[T any](seq []T, f func(T) bool) bool { - if len(seq) == 0 { - return false - } - - for i := range seq { - if !f(seq[i]) { - return false - } - } - return true -} - -func Clone[T any](seq []T) []T { - if seq == nil { - return nil - } - - if len(seq) == 0 { - return []T{} - } - - res := make([]T, len(seq)) - copy(res, seq) - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/key.go b/aerospike-tls/vendor-aerospike-client-go/key.go deleted file mode 100644 index 3b62bf0d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/key.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// Key is the unique record identifier. Records can be identified using a specified namespace, -// an optional set name, and a user defined key which must be unique within a set. -// Records can also be identified by namespace/digest which is the combination used -// on the server. -type Key struct { - // namespace. Equivalent to database name. - namespace string - - // Optional set name. Equivalent to database table. - setName string - - // Unique server hash value generated from set name and user key. - digest [20]byte - - // Original user key. This key is immediately converted to a hash digest. - // This key is not used or returned by the server by default. If the user key needs - // to persist on the server, use one of the following methods: - // - // Set "WritePolicy.sendKey" to true. In this case, the key will be sent to the server for storage on writes - // and retrieved on multi-record scans and queries. - // Explicitly store and retrieve the key in a bin. - userKey Value - - keyWriter keyWriter -} - -// Namespace returns key's namespace. -func (ky *Key) Namespace() string { - return ky.namespace -} - -// SetName returns key's set name. -func (ky *Key) SetName() string { - return ky.setName -} - -// Value returns key's value. -func (ky *Key) Value() Value { - return ky.userKey -} - -// SetValue sets the Key's value and recompute's its digest without allocating new memory. -// This allows the keys to be reusable. -func (ky *Key) SetValue(val Value) Error { - ky.userKey = val - return ky.computeDigest() -} - -// Digest returns key digest. -func (ky *Key) Digest() []byte { - return ky.digest[:] -} - -// Equals uses key digests to compare key equality. -func (ky *Key) Equals(other *Key) bool { - return bytes.Equal(ky.digest[:], other.digest[:]) -} - -// String implements Stringer interface and returns string representation of key. -func (ky *Key) String() string { - if ky == nil { - return "" - } - - if ky.userKey != nil { - return fmt.Sprintf("%s:%s:%s:%v", ky.namespace, ky.setName, ky.userKey.String(), fmt.Sprintf("% 02x", ky.digest[:])) - } - return fmt.Sprintf("%s:%s::%v", ky.namespace, ky.setName, fmt.Sprintf("% 02x", ky.digest[:])) -} - -// NewKey initializes a key from namespace, optional set name and user key. -// The set name and user defined key are converted to a digest before sending to the server. -// The server handles record identifiers by digest only. -func NewKey(namespace string, setName string, key interface{}) (*Key, Error) { - newKey := &Key{ - namespace: namespace, - setName: setName, - userKey: NewValue(key), - } - - if err := newKey.computeDigest(); err != nil { - return nil, err - } - - return newKey, nil -} - -// NewKeyWithDigest initializes a key from namespace, optional set name and user key. -// The server handles record identifiers by digest only. -func NewKeyWithDigest(namespace string, setName string, key interface{}, digest []byte) (*Key, Error) { - newKey := &Key{ - namespace: namespace, - setName: setName, - userKey: NewValue(key), - } - - if err := newKey.SetDigest(digest); err != nil { - return nil, err - } - return newKey, nil -} - -// SetDigest sets a custom hash -func (ky *Key) SetDigest(digest []byte) Error { - if len(digest) != 20 { - return newError(types.PARAMETER_ERROR, "Invalid digest: Digest is required to be exactly 20 bytes.") - } - copy(ky.digest[:], digest) - return nil -} - -// Generate unique server hash value from set name, key type and user defined key. -// The hash function is RIPEMD-160 (a 160 bit hash). -func (ky *Key) computeDigest() Error { - // With custom changes to the ripemd160 package, - // now the following line does not allocate on the heap anymore/. - ky.keyWriter.hash.Reset() - - if _, err := ky.keyWriter.Write([]byte(ky.setName)); err != nil { - return err - } - - if _, err := ky.keyWriter.Write([]byte{byte(ky.userKey.GetType())}); err != nil { - return err - } - - if err := ky.keyWriter.writeKey(ky.userKey); err != nil { - return err - } - - // With custom changes to the ripemd160 package, - // the following line does not allocate on he heap anymore. - ky.keyWriter.hash.Sum(ky.digest[:]) - return nil -} - -// PartitionId returns the partition that the key belongs to. -func (ky *Key) PartitionId() int { - // CAN'T USE MOD directly - mod will give negative numbers. - // First AND makes positive and negative correctly, then mod. - return int(Buffer.LittleBytesToInt32(ky.digest[:], 0)&0xFFFF) & (_PARTITIONS - 1) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go b/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go deleted file mode 100644 index 5c9b183b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/key_bench_test.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - "strings" - "testing" - - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" -) - -var res = make([]byte, 20) - -func doTheHash(buf []byte, b *testing.B) { - hash := ripemd160.New() - for i := 0; i < b.N; i++ { - hash.Reset() - hash.Write(buf) - hash.Sum(res) - } -} - -func Benchmark_Key_Hash_S_______1(b *testing.B) { - buffer := []byte(strings.Repeat("s", 1)) - doTheHash(buffer, b) -} - -func Benchmark_Key_Hash_S______10(b *testing.B) { - buffer := []byte(strings.Repeat("s", 10)) - doTheHash(buffer, b) -} - -func Benchmark_Key_Hash_S_____100(b *testing.B) { - buffer := []byte(strings.Repeat("s", 100)) - doTheHash(buffer, b) -} - -func Benchmark_Key_Hash_S____1000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 1000)) - doTheHash(buffer, b) -} - -func Benchmark_Key_Hash_S__10_000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 10000)) - doTheHash(buffer, b) -} - -func Benchmark_Key_Hash_S_100_000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 100000)) - doTheHash(buffer, b) -} - -var _key *Key - -func makeKeys(val interface{}, b *testing.B) { - var err error - for i := 0; i < b.N; i++ { - _key, err = NewKey("ns", "set", val) - if err != nil { - panic(err) - } - } -} - -func Benchmark_NewKey_String______1(b *testing.B) { - buffer := strings.Repeat("s", 1) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_String_____10(b *testing.B) { - buffer := strings.Repeat("s", 10) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_String____100(b *testing.B) { - buffer := strings.Repeat("s", 100) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_String___1000(b *testing.B) { - buffer := strings.Repeat("s", 1000) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_String__10000(b *testing.B) { - buffer := strings.Repeat("s", 10000) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_String_100000(b *testing.B) { - buffer := strings.Repeat("s", 100000) - makeKeys(buffer, b) -} -func Benchmark_NewKey_Byte______1(b *testing.B) { - buffer := []byte(strings.Repeat("s", 1)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_Byte_____10(b *testing.B) { - buffer := []byte(strings.Repeat("s", 10)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_Byte____100(b *testing.B) { - buffer := []byte(strings.Repeat("s", 100)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_Byte___1000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 1000)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_Byte__10000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 10000)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_Byte_100000(b *testing.B) { - buffer := []byte(strings.Repeat("s", 100000)) - makeKeys(buffer, b) -} - -func Benchmark_NewKey_________Int(b *testing.B) { - makeKeys(rand.Int63(), b) -} - -func Benchmark_NewKey_____Float64(b *testing.B) { - makeKeys(rand.Float64(), b) -} - -func Benchmark_NewKey_List_No_Reflect(b *testing.B) { - list := []interface{}{ - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - } - makeKeys(list, b) -} - -func Benchmark_NewKey_List_With_Reflect(b *testing.B) { - list := []string{ - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - strings.Repeat("s", 1e3), - } - makeKeys(list, b) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_helper.go b/aerospike-tls/vendor-aerospike-client-go/key_helper.go deleted file mode 100644 index f237fc89..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/key_helper.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "encoding/binary" - "math" - - "github.com/aerospike/aerospike-client-go/v7/pkg/ripemd160" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type keyWriter struct { - buffer [8]byte - hash ripemd160.Digest -} - -// WriteInt64 writes a int64 to the key -func (vb *keyWriter) WriteInt64(num int64) int { - return vb.WriteUint64(uint64(num)) -} - -// WriteUint64 writes a uint64 to the key -func (vb *keyWriter) WriteUint64(num uint64) int { - binary.BigEndian.PutUint64(vb.buffer[:8], num) - vb.hash.Write(vb.buffer[:8]) - return 8 -} - -// WriteInt32 writes a int32 to the key -func (vb *keyWriter) WriteInt32(num int32) int { - return vb.WriteUint32(uint32(num)) -} - -// WriteUint32 writes a uint32 to the key -func (vb *keyWriter) WriteUint32(num uint32) int { - binary.BigEndian.PutUint32(vb.buffer[:4], num) - vb.hash.Write(vb.buffer[:4]) - return 4 -} - -// WriteInt16 writes a int16 to the key -func (vb *keyWriter) WriteInt16(num int16) int { - return vb.WriteUint16(uint16(num)) -} - -// WriteUint16 writes a uint16 to the key -func (vb *keyWriter) WriteUint16(num uint16) int { - binary.BigEndian.PutUint16(vb.buffer[:2], num) - vb.hash.Write(vb.buffer[:2]) - return 2 -} - -// WriteFloat32 writes a float32 to the key -func (vb *keyWriter) WriteFloat32(float float32) int { - bits := math.Float32bits(float) - binary.BigEndian.PutUint32(vb.buffer[:4], bits) - vb.hash.Write(vb.buffer[:4]) - return 4 -} - -// WriteFloat64 writes a float64 to the key -func (vb *keyWriter) WriteFloat64(float float64) int { - bits := math.Float64bits(float) - binary.BigEndian.PutUint64(vb.buffer[:8], bits) - vb.hash.Write(vb.buffer[:8]) - return 8 -} - -// WriteBool writes a bool to the key -func (vb *keyWriter) WriteBool(b bool) int { - if b { - vb.hash.Write([]byte{1}) - } else { - vb.hash.Write([]byte{0}) - } - return 1 -} - -// WriteByte writes a byte to the key -func (vb *keyWriter) WriteByte(b byte) { - vb.hash.Write([]byte{b}) -} - -// WriteString writes a string to the key -func (vb *keyWriter) WriteString(s string) (int, Error) { - // To avoid allocating memory, write the strings in small chunks - l := len(s) - const size = 128 - b := [size]byte{} - cnt := 0 - sz := 0 - for i := 0; i < l; i++ { - b[cnt] = s[i] - cnt++ - - if cnt == size { - n, err := vb.Write(b[:]) - if err != nil { - return sz + n, err - } - sz += n - cnt = 0 - } - } - - if cnt > 0 { - n, err := vb.Write(b[:cnt]) - if err != nil { - return sz + n, err - } - } - - return len(s), nil -} - -func (vb *keyWriter) Write(b []byte) (int, Error) { - n, err := vb.hash.Write(b) - if err != nil { - return n, newCommonError(err) - } - return n, nil -} - -func (vb *keyWriter) writeKey(val Value) Error { - switch v := val.(type) { - case IntegerValue: - vb.WriteInt64(int64(v)) - return nil - case LongValue: - vb.WriteInt64(int64(v)) - return nil - case StringValue: - vb.WriteString(string(v)) - return nil - case BytesValue: - vb.Write(v) - return nil - } - - // TODO: Replace the error message with fmt.Sprintf("Key Generation Error. Value type not supported: %T", val) - return newError(types.PARAMETER_ERROR, "Key Generation Error. Value not supported: "+val.String()) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go deleted file mode 100644 index 87e0d40f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/key_reflect_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - gg "github.com/onsi/ginkgo/v2" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Key Test Reflection", func() { - - // gg.Context("Digests should be the same", func() { - - // gg.It("for Arrays", func() { - - // // The following two cases should be in exact order - // key, _ := as.NewKey("namespace", "set", []int{1, 2, 3}) - // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("a8b63a8208ebebb49d027d51899121fd0d03d2f7")) - - // keyInterfaceArrayOfTheSameValues, _ := as.NewKey("namespace", "set", []interface{}{1, 2, 3}) - // gm.Expect(hex.EncodeToString(keyInterfaceArrayOfTheSameValues.Digest())).To(gm.Equal(hex.EncodeToString(key.Digest()))) - - // }) - - // }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/key_test.go b/aerospike-tls/vendor-aerospike-client-go/key_test.go deleted file mode 100644 index 541e80e5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/key_test.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "encoding/hex" - "math" - "strings" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Key Test", func() { - - gg.Context("Digests should be the same", func() { - - gg.It("for Integers", func() { - - key, _ := as.NewKey("namespace", "set", math.MinInt64) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("7185c2a47fb02c996daed26b4e01b83240aee9d4")) - - key, _ = as.NewKey("namespace", "set", math.MaxInt64) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("1698328974afa62c8e069860c1516f780d63dbb8")) - - key, _ = as.NewKey("namespace", "set", math.MinInt32) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("d635a867b755f8f54cdc6275e6fb437df82a728c")) - - key, _ = as.NewKey("namespace", "set", math.MaxInt32) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("fa8c47b8b898af1bbcb20af0d729ca68359a2645")) - - key, _ = as.NewKey("namespace", "set", math.MinInt16) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("7f41e9dd1f3fe3694be0430e04c8bfc7d51ec2af")) - - key, _ = as.NewKey("namespace", "set", math.MaxInt16) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("309fc9c2619c4f65ff7f4cd82085c3ee7a31fc7c")) - - key, _ = as.NewKey("namespace", "set", math.MinInt8) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("93191e549f8f3548d7e2cfc958ddc8c65bcbe4c6")) - - key, _ = as.NewKey("namespace", "set", math.MaxInt8) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("a58f7d98bf60e10fe369c82030b1c9dee053def9")) - - key, _ = as.NewKey("namespace", "set", -1) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("22116d253745e29fc63fdf760b6e26f7e197e01d")) - - key, _ = as.NewKey("namespace", "set", 0) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("93d943aae37b017ad7e011b0c1d2e2143c2fb37d")) - - }) - - gg.It("for Strings", func() { - - key, _ := as.NewKey("namespace", "set", "") - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2819b1ff6e346a43b4f5f6b77a88bc3eaac22a83")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("s", 1)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("607cddba7cd111745ef0a3d783d57f0e83c8f311")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("a", 10)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("5979fb32a80da070ff356f7695455592272e36c2")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("m", 100)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("f00ad7dbcb4bd8122d9681bca49b8c2ffd4beeed")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("t", 1000)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("07ac412d4c33b8628ab147b8db244ce44ae527f8")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("-", 10000)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("b42e64afbfccb05912a609179228d9249ea1c1a0")) - - key, _ = as.NewKey("namespace", "set", strings.Repeat("+", 100000)) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("0a3e888c20bb8958537ddd4ba835e4070bd51740")) - - }) - - gg.It("for []byte", func() { - - key, _ := as.NewKey("namespace", "set", []byte{}) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("327e2877b8815c7aeede0d5a8620d4ef8df4a4b4")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("s", 1))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("ca2d96dc9a184d15a7fa2927565e844e9254e001")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("a", 10))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("d10982327b2b04c7360579f252e164a75f83cd99")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("m", 100))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("475786aa4ee664532a7d1ea69cb02e4695fcdeed")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("t", 1000))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("5a32b507518a49bf47fdaa3deca53803f5b2e8c3")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("-", 10000))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("ed65c63f7a1f8c6697eb3894b6409a95461fd982")) - - key, _ = as.NewKey("namespace", "set", []byte(strings.Repeat("+", 100000))) - gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("fe19770c371774ba1a1532438d4851b8a773a9e6")) - - }) - - // gg.It("for Arrays", func() { - - // key, _ := as.NewKey("namespace", "set", []interface{}{}) - // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2af0111192df4ca297232d1641ff52c2ce51ce2d")) - - // key, _ = as.NewKey("namespace", "set", []interface{}{1, []byte{1, 17}, "str"}) - // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("8f5129e079cf66333a8372192d93072a4c661be2")) - - // }) - - gg.It("for custom digest", func() { - // key, _ := as.NewKey("namespace", "set", []interface{}{}) - // gm.Expect(hex.EncodeToString(key.Digest())).To(gm.Equal("2af0111192df4ca297232d1641ff52c2ce51ce2d")) - key, _ := as.NewKey("namespace", "set", 1) - err := key.SetDigest([]byte("01234567890123456789")) - gm.Expect(err, nil) - gm.Expect(key.Digest()).To(gm.Equal([]byte("01234567890123456789"))) - - key, _ = as.NewKeyWithDigest("namespace", "set", []interface{}{}, []byte("01234567890123456789")) - gm.Expect(key.Digest()).To(gm.Equal([]byte("01234567890123456789"))) - }) - - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/language.go b/aerospike-tls/vendor-aerospike-client-go/language.go deleted file mode 100644 index b1bbfaa7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/language.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// Language specifies User defined function languages. -type Language string - -const ( - - // LUA embedded programming language. - LUA Language = "LUA" -) diff --git a/aerospike-tls/vendor-aerospike-client-go/load_test.go b/aerospike-tls/vendor-aerospike-client-go/load_test.go deleted file mode 100644 index a79b126e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/load_test.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math/rand" - "runtime" - "sync" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func init() { - // load test require actual parallelism - runtime.GOMAXPROCS(runtime.NumCPU()) -} - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike load tests", func() { - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - gg.Describe("Single long random string test", func() { - var ns = *namespace - var set = "load" - var wpolicy = as.NewWritePolicy(0, 0) - var rpolicy = as.NewPolicy() - rpolicy.TotalTimeout = 200 * time.Millisecond - if *useReplicas { - rpolicy.ReplicaPolicy = as.MASTER_PROLES - } - - bname1 := randString(14) - bname2 := randString(14) - - gg.Context("Concurrent Load", func() { - - gg.It("must save and then retrieve an INT and STRING bin with random key", func() { - const Concurrency = 10 - const IterationPerWorker = 10 - - var wg sync.WaitGroup - wg.Add(Concurrency) - - for j := 0; j < Concurrency; j++ { - go func() { - defer gg.GinkgoRecover() - defer wg.Done() - for i := 0; i < IterationPerWorker; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin1 := as.NewBin(bname1, randString(10)) - bin2 := as.NewBin(bname2, rand.Int()) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - rec, err := client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - } - }() - } - - // wait until everything is written - wg.Wait() - }) // it - - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/logger/logger.go b/aerospike-tls/vendor-aerospike-client-go/logger/logger.go deleted file mode 100644 index 028fe5e6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/logger/logger.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package logger - -import ( - "fmt" - "log" - "os" -) - -// LogPriority specifies the logging level for the client -type LogPriority int - -const ( - // DEBUG log level - DEBUG LogPriority = iota - 1 - // INFO log level - INFO - // WARNING log level - WARNING - // ERR log level - ERR - // OFF log level - OFF LogPriority = 999 -) - -type genericLogger interface { - Printf(format string, v ...interface{}) -} - -type logger struct { - Logger genericLogger - - level LogPriority -} - -// Logger is the default logger instance -var Logger = newLogger() - -func newLogger() *logger { - // TODO: Replace with slog - return &logger{ - Logger: log.New(os.Stdout, "", log.LstdFlags), - level: OFF, - } -} - -// SetLogger sets the *log.Logger object where log messages should be sent to. -// This method is not goroutine-safe, and is not designed to be accessed -// from multiple goroutines. -func (lgr *logger) SetLogger(l genericLogger) { - lgr.Logger = l -} - -// SetLevel sets logging level. Default is ERR. -// This method is not goroutine-safe, and is not designed to be accessed -// from multiple goroutines. -func (lgr *logger) SetLevel(level LogPriority) { - lgr.level = level -} - -// LogAtLevel will logs a message at the level requested. -func (lgr *logger) LogAtLevel(level LogPriority, format string, v ...interface{}) { - switch level { - case DEBUG: - lgr.Debug(format, v...) - case INFO: - lgr.Info(format, v...) - case WARNING: - lgr.Warn(format, v...) - case ERR: - lgr.Error(format, v...) - case OFF: - } -} - -// Debug logs a message if log level allows to do so. -func (lgr *logger) Debug(format string, v ...interface{}) { - if lgr.level <= DEBUG { - if l, ok := lgr.Logger.(*log.Logger); ok { - l.Output(2, fmt.Sprintf(format, v...)) - } else { - lgr.Logger.Printf(format, v...) - } - } -} - -// Info logs a message if log level allows to do so. -func (lgr *logger) Info(format string, v ...interface{}) { - if lgr.level <= INFO { - if l, ok := lgr.Logger.(*log.Logger); ok { - l.Output(2, fmt.Sprintf(format, v...)) - } else { - lgr.Logger.Printf(format, v...) - } - } -} - -// Warn logs a message if log level allows to do so. -func (lgr *logger) Warn(format string, v ...interface{}) { - if lgr.level <= WARNING { - if l, ok := lgr.Logger.(*log.Logger); ok { - l.Output(2, fmt.Sprintf(format, v...)) - } else { - lgr.Logger.Printf(format, v...) - } - } -} - -// Error logs a message if log level allows to do so. -func (lgr *logger) Error(format string, v ...interface{}) { - if lgr.level <= ERR { - if l, ok := lgr.Logger.(*log.Logger); ok { - l.Output(2, fmt.Sprintf(format, v...)) - } else { - lgr.Logger.Printf(format, v...) - } - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/login_command.go b/aerospike-tls/vendor-aerospike-client-go/login_command.go deleted file mode 100644 index 159cb9d2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/login_command.go +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use acmd file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type sessionInfo struct { - token []byte - expiration time.Time -} - -func (si *sessionInfo) isValid() bool { - if si == nil || si.token == nil || si.expiration.IsZero() || time.Now().After(si.expiration) { - return false - } - - return true -} - -// Login command authenticates to the server. -// If the authentication is external, Session Information will be returned. -type loginCommand struct { - AdminCommand - - // SessionToken for the current session on the external authentication server. - SessionToken []byte - - // SessionExpiration for the current session on the external authentication server. - SessionExpiration time.Time -} - -func newLoginCommand(buf []byte) *loginCommand { - return &loginCommand{ - AdminCommand: *NewAdminCommand(buf), - } -} - -func (lcmd *loginCommand) sessionInfo() *sessionInfo { - if lcmd.SessionToken != nil { - return &sessionInfo{token: lcmd.SessionToken, expiration: lcmd.SessionExpiration} - } - return &sessionInfo{} -} - -// Login tries to authenticate to the aerospike server. Depending on the server configuration and ClientPolicy, -// the session information will be returned. -func (lcmd *loginCommand) Login(policy *ClientPolicy, conn *Connection) Error { - hashedPass, err := hashPassword(policy.Password) - if err != nil { - return err - } - - return lcmd.login(policy, conn, hashedPass) -} - -// Login tries to authenticate to the aerospike server. Depending on the server configuration and ClientPolicy, -// the session information will be returned. -func (lcmd *loginCommand) login(policy *ClientPolicy, conn *Connection, hashedPass []byte) Error { - switch policy.AuthMode { - case AuthModeExternal: - lcmd.writeHeader(_LOGIN, 3) - lcmd.writeFieldStr(_USER, policy.User) - lcmd.writeFieldBytes(_CREDENTIAL, hashedPass) - lcmd.writeFieldStr(_CLEAR_PASSWORD, policy.Password) - case AuthModeInternal: - lcmd.writeHeader(_LOGIN, 2) - lcmd.writeFieldStr(_USER, policy.User) - lcmd.writeFieldBytes(_CREDENTIAL, hashedPass) - case AuthModePKI: - lcmd.writeHeader(_LOGIN, 0) - default: - return newError(types.ResultCode(types.INVALID_COMMAND), "Invalid ClientPolicy.AuthMode.") - } - - lcmd.writeSize() - - var deadline time.Time - if policy.LoginTimeout > 0 { - deadline = time.Now().Add(policy.Timeout) - } - conn.SetTimeout(deadline, policy.LoginTimeout) - - if _, err := conn.Write(lcmd.dataBuffer[:lcmd.dataOffset]); err != nil { - return err - } - - if _, err := conn.Read(lcmd.dataBuffer, _HEADER_SIZE); err != nil { - return err - } - - result := lcmd.dataBuffer[_RESULT_CODE] & 0xFF - if result != 0 { - if int(result) == int(types.SECURITY_NOT_ENABLED) { - // Server does not require login. - return nil - } - - return newError(types.ResultCode(result)) - } - - // Read session token. - sz := Buffer.BytesToInt64(lcmd.dataBuffer, 0) - receiveSize := int((sz & 0xFFFFFFFFFFFF) - int64(_HEADER_REMAINING)) - fieldCount := int(lcmd.dataBuffer[11] & 0xFF) - - if receiveSize <= 0 || receiveSize > len(lcmd.dataBuffer) || fieldCount <= 0 { - return newError(types.ResultCode(result), "Node failed to retrieve session token") - } - - if len(lcmd.dataBuffer) < receiveSize { - lcmd.dataBuffer = make([]byte, receiveSize) - } - - _, err := conn.Read(lcmd.dataBuffer, receiveSize) - if err != nil { - logger.Logger.Debug("Error reading data from connection for login command: %s", err.Error()) - return err - } - - lcmd.dataOffset = 0 - for i := 0; i < fieldCount; i++ { - mlen := int(Buffer.BytesToUint32(lcmd.dataBuffer, lcmd.dataOffset)) - lcmd.dataOffset += 4 - id := lcmd.dataBuffer[lcmd.dataOffset] - lcmd.dataOffset++ - mlen-- - - switch id { - case _SESSION_TOKEN: - // copy the contents of the buffer into a new byte slice - lcmd.SessionToken = make([]byte, mlen) - copy(lcmd.SessionToken, lcmd.dataBuffer[lcmd.dataOffset:lcmd.dataOffset+mlen]) - case _SESSION_TTL: - // Subtract 60 seconds from TTL so client session expires before server session. - seconds := int(Buffer.BytesToUint32(lcmd.dataBuffer, lcmd.dataOffset) - 60) - - if seconds > 0 { - lcmd.SessionExpiration = time.Now().Add(time.Duration(seconds) * time.Second) - } else { - logger.Logger.Warn("Invalid session TTL: %d", seconds) - } - } - - lcmd.dataOffset += mlen - } - - if lcmd.SessionToken == nil { - return newError(types.ResultCode(result), "Node failed to retrieve session token") - } - return nil -} - -func (lcmd *loginCommand) authenticateViaToken(policy *ClientPolicy, conn *Connection, sessionToken []byte) Error { - lcmd.setAuthenticate(policy, sessionToken) - - if _, err := conn.Write(lcmd.dataBuffer[:lcmd.dataOffset]); err != nil { - return err - } - - if _, err := conn.Read(lcmd.dataBuffer, _HEADER_SIZE); err != nil { - return err - } - - result := lcmd.dataBuffer[_RESULT_CODE] & 0xFF - if result != 0 && int(result) != int(types.SECURITY_NOT_ENABLED) { - return newError(types.ResultCode(result), "Authentication failed") - } - - return nil -} - -func (lcmd *loginCommand) setAuthenticate(policy *ClientPolicy, sessionToken []byte) Error { - if policy.AuthMode != AuthModePKI { - lcmd.writeHeader(_AUTHENTICATE, 2) - lcmd.writeFieldStr(_USER, policy.User) - } else { - lcmd.writeHeader(_AUTHENTICATE, 1) - } - - if sessionToken != nil { - // New authentication. - lcmd.writeFieldBytes(_SESSION_TOKEN, sessionToken) - } - - lcmd.writeSize() - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/marshal.go b/aerospike-tls/vendor-aerospike-client-go/marshal.go deleted file mode 100644 index e7f23d11..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/marshal.go +++ /dev/null @@ -1,362 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "reflect" - "strings" - "sync" - "time" -) - -// UseNativeBoolTypeInReflection determines if Boolean values should be directly translated to native Boolean type in reflection API -// introduced in server version 5.6+. By default it keeps the old behavior, but can be set to true to opt in. -// -// Deprecated: Will be removed in the next major version. -var UseNativeBoolTypeInReflection = false - -var aerospikeTag = "as" - -const ( - aerospikeMetaTag = "asm" - aerospikeMetaTagGen = "gen" - aerospikeMetaTagTTL = "ttl" -) - -// This method is copied verbatim from https://golang.org/src/encoding/json/encode.go -// to ensure compatibility with the json package. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return false -} - -// SetAerospikeTag sets the bin tag to the specified tag. -// This will be useful for when a user wants to use the same tag name for two different concerns. -// For example, one will be able to use the same tag name for both json and aerospike bin name. -func SetAerospikeTag(tag string) { - aerospikeTag = tag -} - -func valueToInterface(f reflect.Value) interface{} { - // get to the core value - for f.Kind() == reflect.Ptr { - if f.IsNil() { - return nil - } - f = reflect.Indirect(f) - } - - switch f.Kind() { - case reflect.Int, reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8: - return IntegerValue(f.Int()) - case reflect.Uint64, reflect.Uint, reflect.Uint8, reflect.Uint32, reflect.Uint16: - return int64(f.Uint()) - case reflect.Float64, reflect.Float32: - return FloatValue(f.Float()) - - case reflect.Struct: - if f.Type().PkgPath() == "time" && f.Type().Name() == "Time" { - return f.Interface().(time.Time).UTC().UnixNano() - } - return structToMap(f) - case reflect.Bool: - if UseNativeBoolTypeInReflection { - return BoolValue(f.Bool()) - } - - if f.Bool() { - return IntegerValue(1) - } - return IntegerValue(0) - case reflect.Map: - if f.IsNil() { - return nil - } - - newMap := make(map[interface{}]interface{}, f.Len()) - for _, mk := range f.MapKeys() { - newMap[valueToInterface(mk)] = valueToInterface(f.MapIndex(mk)) - } - - return newMap - case reflect.Slice, reflect.Array: - if f.Kind() == reflect.Slice && f.IsNil() { - return nil - } - if f.Kind() == reflect.Slice && reflect.TypeOf(f.Interface()).Elem().Kind() == reflect.Uint8 { - // handle blobs - return f.Bytes() - } - // convert to primitives recursively - newSlice := make([]interface{}, f.Len(), f.Cap()) - for i := 0; i < len(newSlice); i++ { - newSlice[i] = valueToInterface(f.Index(i)) - } - return newSlice - case reflect.Interface: - if f.IsNil() { - return nullValue - } - return f.Interface() - default: - return f.Interface() - } -} - -func fieldIsMetadata(f reflect.StructField) bool { - meta := f.Tag.Get(aerospikeMetaTag) - return strings.Trim(meta, " ") != "" -} - -func fieldIsOmitOnEmpty(f reflect.StructField) bool { - tag := f.Tag.Get(aerospikeTag) - return strings.Contains(tag, ",omitempty") -} - -func stripOptions(tag string) string { - i := strings.Index(tag, ",") - if i < 0 { - return tag - } - return string(tag[:i]) -} - -func fieldAlias(f reflect.StructField) string { - alias := strings.Trim(stripOptions(f.Tag.Get(aerospikeTag)), " ") - if alias != "" { - // if tag is -, the field should not be persisted - if alias == "-" { - return "" - } - return alias - } - return f.Name -} - -func setBinMap(s reflect.Value, typeOfT reflect.Type, binMap BinMap, index []int) { - numFields := typeOfT.NumField() - var fld reflect.StructField - for i := 0; i < numFields; i++ { - fld = typeOfT.Field(i) - - fldIndex := append(index, fld.Index...) - - if fld.Anonymous && fld.Type.Kind() == reflect.Struct { - setBinMap(s, fld.Type, binMap, fldIndex) - continue - } - - // skip unexported fields - if fld.PkgPath != "" && !fld.Anonymous { - continue - } - - if fieldIsMetadata(fld) { - continue - } - - // skip transient fields tagged `-` - alias := fieldAlias(fld) - if alias == "" { - continue - } - - value := s.FieldByIndex(fldIndex) - if fieldIsOmitOnEmpty(fld) && isEmptyValue(value) { - continue - } - - binValue := valueToInterface(value) - - if _, ok := binMap[alias]; ok { - panic(fmt.Sprintf("ambiguous fields with the same name or alias: %s", alias)) - } - binMap[alias] = binValue - } -} - -func structToMap(s reflect.Value) BinMap { - if !s.IsValid() { - return nil - } - - binMap := make(BinMap, s.NumField()) - - setBinMap(s, s.Type(), binMap, nil) - - return binMap -} - -func marshal(v interface{}) BinMap { - s := indirect(reflect.ValueOf(v)) - return structToMap(s) -} - -type syncMap struct { - objectMappings map[reflect.Type]map[string][]int - objectFields map[reflect.Type][]string - objectTTLs map[reflect.Type][][]int - objectGen map[reflect.Type][][]int - mutex sync.RWMutex -} - -func (sm *syncMap) setMapping(objType reflect.Type, mapping map[string][]int, fields []string, ttl, gen [][]int) { - sm.mutex.Lock() - sm.objectMappings[objType] = mapping - sm.objectFields[objType] = fields - sm.objectTTLs[objType] = ttl - sm.objectGen[objType] = gen - sm.mutex.Unlock() -} - -func indirect(obj reflect.Value) reflect.Value { - for obj.Kind() == reflect.Ptr { - if obj.IsNil() { - return obj - } - obj = obj.Elem() - } - return obj -} - -func indirectT(objType reflect.Type) reflect.Type { - for objType.Kind() == reflect.Ptr { - objType = objType.Elem() - } - return objType -} - -func (sm *syncMap) mappingExists(objType reflect.Type) (map[string][]int, bool) { - sm.mutex.RLock() - mapping, exists := sm.objectMappings[objType] - sm.mutex.RUnlock() - return mapping, exists -} - -func (sm *syncMap) getMapping(objType reflect.Type) map[string][]int { - objType = indirectT(objType) - mapping, exists := sm.mappingExists(objType) - if !exists { - cacheObjectTags(objType) - mapping, _ = sm.mappingExists(objType) - } - - return mapping -} - -func (sm *syncMap) getMetaMappings(objType reflect.Type) (ttl, gen [][]int) { - objType = indirectT(objType) - if _, exists := sm.mappingExists(objType); !exists { - cacheObjectTags(objType) - } - - sm.mutex.RLock() - ttl = sm.objectTTLs[objType] - gen = sm.objectGen[objType] - sm.mutex.RUnlock() - return ttl, gen -} - -func (sm *syncMap) fieldsExists(objType reflect.Type) ([]string, bool) { - sm.mutex.RLock() - mapping, exists := sm.objectFields[objType] - sm.mutex.RUnlock() - return mapping, exists -} - -func (sm *syncMap) getFields(objType reflect.Type) []string { - objType = indirectT(objType) - fields, exists := sm.fieldsExists(objType) - if !exists { - cacheObjectTags(objType) - fields, _ = sm.fieldsExists(objType) - } - - return fields -} - -var objectMappings = &syncMap{ - objectMappings: map[reflect.Type]map[string][]int{}, - objectFields: map[reflect.Type][]string{}, - objectTTLs: map[reflect.Type][][]int{}, - objectGen: map[reflect.Type][][]int{}, -} - -func fillMapping(objType reflect.Type, mapping map[string][]int, fields []string, ttl, gen [][]int, index []int) ([]string, [][]int, [][]int) { - numFields := objType.NumField() - for i := 0; i < numFields; i++ { - f := objType.Field(i) - fIndex := append(index, f.Index...) - if f.Anonymous && f.Type.Kind() == reflect.Struct { - fields, ttl, gen = fillMapping(f.Type, mapping, fields, ttl, gen, fIndex) - continue - } - - // skip unexported fields - if f.PkgPath != "" && !f.Anonymous { - continue - } - - tag := strings.Trim(stripOptions(f.Tag.Get(aerospikeTag)), " ") - tagM := strings.Trim(f.Tag.Get(aerospikeMetaTag), " ") - - if tag != "" && tagM != "" { - panic(fmt.Sprintf("Cannot accept both data and metadata tags on the same attribute on struct: %s.%s", objType.Name(), f.Name)) - } - - if tag != "-" && tagM == "" { - if tag == "" { - tag = f.Name - } - if _, ok := mapping[tag]; ok { - panic(fmt.Sprintf("ambiguous fields with the same name or alias: %s", tag)) - } - mapping[tag] = fIndex - fields = append(fields, tag) - } - - if tagM == aerospikeMetaTagTTL { - ttl = append(ttl, fIndex) - } else if tagM == aerospikeMetaTagGen { - gen = append(gen, fIndex) - } else if tagM != "" { - panic(fmt.Sprintf("Invalid metadata tag `%s` on struct attribute: %s.%s", tagM, objType.Name(), f.Name)) - } - } - return fields, ttl, gen -} - -func cacheObjectTags(objType reflect.Type) { - mapping := map[string][]int{} - fields, ttl, gen := fillMapping(objType, mapping, []string{}, nil, nil, nil) - objectMappings.setMapping(objType, mapping, fields, ttl, gen) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go b/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go deleted file mode 100644 index f53165f2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/metrics_policy.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types/histogram" -) - -// MetricsPolicy specifies client periodic metrics configuration. -type MetricsPolicy struct { - // Histogram type specifies if the histogram should be [histogram.Linear] or [histogram.Logarithmic]. - // - // Default: [histogram.Logarithmic] - HistogramType histogram.Type - - // LatencyColumns defines the number of elapsed time range buckets in latency histograms. - // - // Default: 24 - LatencyColumns int //= 24; - - // Depending on the type of histogram: - // - // For logarithmic histograms, the buckets are: =base^(columns-1) - // - // // LatencyColumns=5 latencyBase=8 - // <8µs <64µs <512µs <4096µs >=4096 - // - // // LatencyColumns=7 LatencyBase=4 - // <4µs <16µs <64µs <256µs <1024µs <4096 >=4096µs - // - // For linear histograms, the buckets are: =base*(column-1) - // - // // LatencyColumns=5 latencyBase=15 - // <15µs <30µs <45µs <60µs >=60µs - // - // // LatencyColumns=7 LatencyBase=5 - // <5µs <10µs <15µs <20µs <25µs <30µs >=30µs - // - // Default: 2 - LatencyBase int //= 2; -} - -func DefaultMetricsPolicy() *MetricsPolicy { - return &MetricsPolicy{ - HistogramType: histogram.Logarithmic, - LatencyColumns: 24, - LatencyBase: 2, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/multi_command.go b/aerospike-tls/vendor-aerospike-client-go/multi_command.go deleted file mode 100644 index ae23b137..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/multi_command.go +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "math/rand" - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type baseMultiCommand struct { - baseCommand - - rawCDT bool - - namespace string - recordset *Recordset - - isOperation bool - - // Used in correct Scans/Queries - tracker *partitionTracker - nodePartitions *nodePartitions - - terminationErrorType types.ResultCode - - resObjType reflect.Type - resObjMappings map[string][]int - selectCases []reflect.SelectCase - - bc bufferedConn - grpcEOS bool -} - -var multiObjectParser func( - cmd *baseMultiCommand, - obj reflect.Value, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error - -var prepareReflectionData func(cmd *baseMultiCommand) - -func newMultiCommand(node *Node, recordset *Recordset, isOperation bool) *baseMultiCommand { - cmd := &baseMultiCommand{ - baseCommand: baseCommand{ - node: node, - }, - recordset: recordset, - isOperation: isOperation, - } - - if prepareReflectionData != nil { - prepareReflectionData(cmd) - } - return cmd -} - -func newStreamingMultiCommand(node *Node, recordset *Recordset, namespace string, isOperation bool) *baseMultiCommand { - cmd := &baseMultiCommand{ - baseCommand: baseCommand{ - node: node, - oneShot: true, - }, - namespace: namespace, - recordset: recordset, - isOperation: isOperation, - } - - if prepareReflectionData != nil { - prepareReflectionData(cmd) - } - return cmd -} - -func newCorrectStreamingMultiCommand(recordset *Recordset, namespace string) *baseMultiCommand { - cmd := &baseMultiCommand{ - baseCommand: baseCommand{ - oneShot: true, - }, - namespace: namespace, - recordset: recordset, - } - - if prepareReflectionData != nil { - prepareReflectionData(cmd) - } - return cmd -} - -func (cmd *baseMultiCommand) getNode(ifc command) (*Node, Error) { - return cmd.node, nil -} - -func (cmd *baseMultiCommand) prepareRetry(ifc command, isTimeout bool) bool { - return false -} - -func (cmd *baseMultiCommand) getConnection(policy Policy) (*Connection, Error) { - return cmd.node.getConnectionWithHint(policy.GetBasePolicy().deadline(), policy.GetBasePolicy().socketTimeout(), byte(rand.Int63()&0xff)) -} - -func (cmd *baseMultiCommand) putConnection(conn *Connection) { - cmd.node.putConnectionWithHint(conn, byte(rand.Int63()&0xff)) -} - -func (cmd *baseMultiCommand) parseResult(ifc command, conn *Connection) Error { - // Read socket into receive buffer one record at a time. Do not read entire receive size - // because the receive buffer would be too big. - status := true - - var err Error - - cmd.bc = newBufferedConn(conn, 0) - for status { - if err = cmd.conn.initInflater(false, 0); err != nil { - return newError(types.PARSE_ERROR, "Error setting up zlib inflater:", err.Error()).setNode(cmd.node) - } - cmd.bc.reset(8) - - // Read header. - if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { - return err - } - - proto := Buffer.BytesToInt64(cmd.dataBuffer, 0) - receiveSize := int(proto & 0xFFFFFFFFFFFF) - if receiveSize <= 0 { - continue - } - - if compressedSize := cmd.compressedSize(); compressedSize > 0 { - cmd.bc.reset(8) - // Read header. - if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { - return err - } - - receiveSize = int(Buffer.BytesToInt64(cmd.dataBuffer, 0)) - 8 - if err = cmd.conn.initInflater(true, compressedSize-8); err != nil { - return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize-8, err.Error())).setNode(cmd.node) - } - - // read the first 8 bytes - cmd.bc.reset(8) - if cmd.dataBuffer, err = cmd.bc.read(8); err != nil { - return err - } - } - - // Validate header to make sure we are at the beginning of a message - proto = Buffer.BytesToInt64(cmd.dataBuffer, 0) - if err = cmd.validateHeader(proto); err != nil { - return err - } - - if receiveSize > 0 { - cmd.bc.reset(receiveSize) - - status, err = ifc.parseRecordResults(ifc, receiveSize) - if err != nil { - cmd.bc.drainConn() - return err - } - } else { - status = false - } - } - - // if the buffer has been resized, put it back so that it will be reassigned to the connection. - cmd.dataBuffer = cmd.bc.buf() - - return nil -} - -func (cmd *baseMultiCommand) parseKey(fieldCount int, bval *int64) (*Key, Error) { - var digest [20]byte - var namespace, setName string - var userKey Value - var err Error - - for i := 0; i < fieldCount; i++ { - if err = cmd.readBytes(4); err != nil { - return nil, err - } - - fieldlen := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - if err = cmd.readBytes(fieldlen); err != nil { - return nil, err - } - - fieldtype := FieldType(cmd.dataBuffer[0]) - size := fieldlen - 1 - - switch fieldtype { - case DIGEST_RIPE: - copy(digest[:], cmd.dataBuffer[1:size+1]) - case NAMESPACE: - namespace = string(cmd.dataBuffer[1 : size+1]) - case TABLE: - setName = string(cmd.dataBuffer[1 : size+1]) - case KEY: - if userKey, err = bytesToKeyValue(int(cmd.dataBuffer[1]), cmd.dataBuffer, 2, size-1); err != nil { - return nil, err.setNode(cmd.node) - } - case BVAL_ARRAY: - if bval != nil { - v := Buffer.LittleBytesToInt64(cmd.dataBuffer, 1) - *bval = v - } - } - } - - return &Key{namespace: namespace, setName: setName, digest: digest, userKey: userKey}, nil -} - -func (cmd *baseMultiCommand) skipKey(fieldCount int) (err Error) { - for i := 0; i < fieldCount; i++ { - if err = cmd.readBytes(4); err != nil { - return err - } - - fieldlen := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - if err = cmd.readBytes(fieldlen); err != nil { - return err - } - } - - return nil -} - -func (cmd *baseMultiCommand) readBytes(length int) (err Error) { - // Corrupted data streams can result in a huge length. - // Do a sanity check here. - if length > MaxBufferSize || length < 0 { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid readBytes length: %d", length)).setNode(cmd.node) - } - - cmd.dataBuffer, err = cmd.bc.read(length) - if err != nil { - return err - } - cmd.dataOffset += length - - return nil -} - -func (cmd *baseMultiCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - // Read/parse remaining message bytes one record at a time. - cmd.dataOffset = 0 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - err = newNodeError(cmd.node, err) - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - if resultCode != 0 && resultCode != types.PARTITION_UNAVAILABLE { - if resultCode == types.KEY_NOT_FOUND_ERROR || resultCode == types.FILTERED_OUT { - return false, nil - } - err := newError(resultCode) - err = newNodeError(cmd.node, err) - return false, err - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - - var bval int64 - key, err := cmd.parseKey(fieldCount, &bval) - if err != nil { - err = newNodeError(cmd.node, err) - return false, err - } - - // Partition is done, don't go further - if (info3 & _INFO3_PARTITION_DONE) != 0 { - // When an error code is received, mark partition as unavailable - // for the current round. Unavailable partitions will be retried - // in the next round. Generation is overloaded as partitionId. - if resultCode != 0 && cmd.tracker != nil { - cmd.tracker.partitionUnavailable(cmd.nodePartitions, int(generation)) - } - continue - } - - // if there is a recordset, process the record traditionally - // otherwise, it is supposed to be a record channel - if cmd.selectCases == nil { - // Parse bins. - var bins BinMap - - for i := 0; i < opCount; i++ { - if err = cmd.readBytes(8); err != nil { - return false, newNodeError(cmd.node, err) - } - - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err = cmd.readBytes(nameSize); err != nil { - return false, newNodeError(cmd.node, err) - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err = cmd.readBytes(particleBytesSize); err != nil { - return false, newNodeError(cmd.node, err) - } - value, err := bytesToParticleRaw(particleType, cmd.dataBuffer, 0, particleBytesSize, cmd.rawCDT) - if err != nil { - return false, newNodeError(cmd.node, err) - } - - if bins == nil { - bins = make(BinMap, opCount) - } - - if cmd.isOperation { - if prev, ok := bins[name]; ok { - if prev2, ok := prev.(OpResults); ok { - bins[name] = append(prev2, value) - } else { - bins[name] = OpResults{prev, value} - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - if cmd.grpcEOS || !cmd.tracker.allowRecord(cmd.nodePartitions) { - continue - } - - // If the channel is full and it blocks, we don't want this command to - // block forever, or panic in case the channel is closed in the meantime. - select { - // send back the result on the async channel - case cmd.recordset.records <- &Result{Record: newRecord(cmd.node, key, bins, generation, expiration), Err: nil, BVal: &bval}: - case <-cmd.recordset.cancelled: - switch cmd.terminationErrorType { - case types.SCAN_TERMINATED: - return false, ErrScanTerminated.err().setNode(cmd.node) - case types.QUERY_TERMINATED: - return false, ErrQueryTerminated.err().setNode(cmd.node) - default: - return false, newError(cmd.terminationErrorType).setNode(cmd.node) - } - } - } else if multiObjectParser != nil { - obj := reflect.New(cmd.resObjType) - if err := multiObjectParser(cmd, obj, opCount, fieldCount, generation, expiration); err != nil { - err = newNodeError(cmd.node, err) - return false, err - } - - if cmd.grpcEOS || !cmd.tracker.allowRecord(cmd.nodePartitions) { - continue - } - - // set the object to send - cmd.selectCases[0].Send = obj - - chosen, _, _ := reflect.Select(cmd.selectCases) - switch chosen { - case 0: // object sent - case 1: // cancel channel is closed - return false, newError(cmd.terminationErrorType).setNode(cmd.node) - } - } - - if fieldCount > 0 && cmd.tracker != nil { - // only if there is key returned. Commands like QueryAggregate do not return keys - if cmd.terminationErrorType == types.SCAN_TERMINATED { - cmd.tracker.setDigest(cmd.nodePartitions, key) - } else { - cmd.tracker.setLast(cmd.nodePartitions, key, &bval) - } - } - } - - return true, nil -} - -func (cmd *baseMultiCommand) canPutConnBack() bool { - return false -} - -func (cmd *baseMultiCommand) execute(ifc command) Error { - - /*************************************************************************** - IMPORTANT: No need to send the error here to the recordset.Error channel. - It is being sent from the downstream command from the result - returned from the function. - ****************************************************************************/ - - return cmd.baseCommand.execute(ifc) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/multi_policy.go b/aerospike-tls/vendor-aerospike-client-go/multi_policy.go deleted file mode 100644 index 35d86ffa..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/multi_policy.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "time" - -// MultiPolicy contains parameters for policy attributes used in -// query and scan operations. -type MultiPolicy struct { - BasePolicy - - // Maximum number of concurrent requests to server nodes at any point in time. - // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries - // will be made to 8 nodes in parallel. When a query completes, a new query will - // be issued until all 16 nodes have been queried. - // Default (0) is to issue requests to all server nodes in parallel. - // 1 will to issue requests to server nodes one by one avoiding parallel queries. - MaxConcurrentNodes int - - // MaxRecords approximates the number of records to return to the client. This number is divided by the - // number of nodes involved in the query. The actual number of records returned - // may be less than MaxRecords if node record counts are small and unbalanced across - // nodes. - // - // This field is supported on server versions >= 4.9. - // - // Default: 0 (do not limit record count) - MaxRecords int64 - - // RecordsPerSecond limits returned records per second (rps) rate for each server. - // Will not apply rps limit if recordsPerSecond is zero (default). - // Currently only applicable to a query without a defined filter. - RecordsPerSecond int - - // Number of records to place in queue before blocking. - // Records received from multiple server nodes will be placed in a queue. - // A separate goroutine consumes these records in parallel. - // If the queue is full, the producer goroutines will block until records are consumed. - RecordQueueSize int //= 50 - - // Indicates if bin data is retrieved. If false, only record digests are retrieved. - IncludeBinData bool //= true; - - // RawCDT specifies that the value of the CDT fields (Maps and Lists) should not be unpacked/decoded. - // This is only used internally by Aerospike for Backup purposes and should not be used by 3rd parties. - RawCDT bool -} - -// NewMultiPolicy initializes a MultiPolicy instance with default values. -// It disables TotalTimeout and sets MaxRetries. -// Set MaxRetries for non-aggregation queries with a nil filter on -// server versions >= 4.9. All other queries are not retried. -// -// The latest servers support retries on individual data partitions. -// This feature is useful when a cluster is migrating and partition(s) -// are missed or incomplete on the first query attempt. -// -// If the first query attempt misses 2 of 4096 partitions, then only -// those 2 partitions are retried in the next query attempt from the -// last key digest received for each respective partition. A higher -// default MaxRetries is used because it's wasteful to invalidate -// all query results because a single partition was missed. -func NewMultiPolicy() *MultiPolicy { - bp := *NewPolicy() - bp.TotalTimeout = 0 * time.Second - bp.SocketTimeout = 30 * time.Second - bp.MaxRetries = 5 - - return &MultiPolicy{ - BasePolicy: bp, - MaxConcurrentNodes: 0, - RecordsPerSecond: 0, - RecordQueueSize: 50, - IncludeBinData: true, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/node.go b/aerospike-tls/vendor-aerospike-client-go/node.go deleted file mode 100644 index 6dc85ddc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/node.go +++ /dev/null @@ -1,963 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bufio" - "errors" - "io" - "strconv" - "strings" - "time" - - "golang.org/x/sync/errgroup" - - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const ( - _PARTITIONS = 4096 -) - -const ( - _SUPPORTS_PARTITION_SCAN = 1 << iota - _SUPPORTS_QUERY_SHOW - _SUPPORTS_BATCH_ANY - _SUPPORTS_PARTITION_QUERY -) - -// Node represents an Aerospike Database Server Node -type Node struct { - cluster *Cluster - name string - host *Host - aliases iatomic.TypedVal[[]*Host] - stats nodeStats - sessionInfo iatomic.TypedVal[*sessionInfo] - - racks iatomic.TypedVal[map[string]int] - - // tendConn reserves a connection for tend so that it won't have to - // wait in queue for connections, since that will cause starvation - // and the node being dropped under load. - tendConn iatomic.Guard[Connection] - - peersGeneration iatomic.Int - peersCount iatomic.Int - - connections connectionHeap - connectionCount iatomic.Int - - partitionGeneration iatomic.Int - referenceCount iatomic.Int - failures iatomic.Int - partitionChanged iatomic.Bool - errorCount iatomic.Int - rebalanceGeneration iatomic.Int - - features int - - active iatomic.Bool -} - -// NewNode initializes a server node with connection parameters. -func newNode(cluster *Cluster, nv *nodeValidator) *Node { - newNode := &Node{ - cluster: cluster, - name: nv.name, - host: nv.primaryHost, - - features: nv.features, - - stats: *newNodeStats(cluster.MetricsPolicy()), - - // Assign host to first IP alias because the server identifies nodes - // by IP address (not hostname). - connections: *newConnectionHeap(cluster.clientPolicy.MinConnectionsPerNode, cluster.clientPolicy.ConnectionQueueSize), - connectionCount: *iatomic.NewInt(0), - peersGeneration: *iatomic.NewInt(-1), - partitionGeneration: *iatomic.NewInt(-2), - referenceCount: *iatomic.NewInt(0), - failures: *iatomic.NewInt(0), - active: *iatomic.NewBool(true), - partitionChanged: *iatomic.NewBool(false), - errorCount: *iatomic.NewInt(0), - rebalanceGeneration: *iatomic.NewInt(-1), - } - - newNode.aliases.Set(nv.aliases) - newNode.sessionInfo.Set(nv.sessionInfo) - newNode.racks.Set(make(map[string]int)) - - // this will reset to zero on first aggregation on the cluster, - // therefore will only be counted once. - newNode.stats.NodeAdded.IncrementAndGet() - - return newNode -} - -// SupportsBatchAny returns true if the node supports the feature. -func (nd *Node) SupportsBatchAny() bool { - return (nd.features & _SUPPORTS_BATCH_ANY) != 0 -} - -// SupportsQueryShow returns true if the node supports the feature. -func (nd *Node) SupportsQueryShow() bool { - return (nd.features & _SUPPORTS_QUERY_SHOW) != 0 -} - -// SupportsPartitionQuery returns true if the node supports the feature. -func (nd *Node) SupportsPartitionQuery() bool { - return (nd.features & _SUPPORTS_PARTITION_QUERY) != 0 -} - -// Refresh requests current status from server node, and updates node with the result. -func (nd *Node) Refresh(peers *peers) Error { - if !nd.active.Get() { - return nil - } - - nd.stats.TendsTotal.IncrementAndGet() - - // Close idleConnections - defer nd.dropIdleConnections() - - // Clear node reference counts. - nd.referenceCount.Set(0) - nd.partitionChanged.Set(false) - - var infoMap map[string]string - commands := []string{"node", "peers-generation", "partition-generation"} - if nd.cluster.clientPolicy.RackAware { - commands = append(commands, "racks:") - } - - infoMap, err := nd.RequestInfo(&nd.cluster.infoPolicy, commands...) - if err != nil { - nd.refreshFailed(err) - return err - } - - if err = nd.verifyNodeName(infoMap); err != nil { - nd.refreshFailed(err) - return err - } - - if err = nd.verifyPeersGeneration(infoMap, peers); err != nil { - nd.refreshFailed(err) - return err - } - - if err = nd.verifyPartitionGeneration(infoMap); err != nil { - nd.refreshFailed(err) - return err - } - - if err = nd.updateRackInfo(infoMap); err != nil { - // Update rack info should fail if the feature is not supported on the server - if err.Matches(types.UNSUPPORTED_FEATURE) { - nd.refreshFailed(err) - return err - } - // Should not fail in other cases - logger.Logger.Warn("Updating node rack info failed with error: %s (racks: `%s`)", err, infoMap["racks:"]) - } - - nd.failures.Set(0) - peers.refreshCount.IncrementAndGet() - nd.referenceCount.IncrementAndGet() - nd.stats.TendsSuccessful.IncrementAndGet() - - if err = nd.refreshSessionToken(); err != nil { - logger.Logger.Error("Error refreshing session token: %s", err.Error()) - } - - if _, err = nd.fillMinConns(); err != nil { - logger.Logger.Error("Error filling up the connection queue to the minimum required") - } - - return nil -} - -// refreshSessionToken refreshes the session token if it has been expired -func (nd *Node) refreshSessionToken() (err Error) { - // no session token to refresh - if !nd.cluster.clientPolicy.RequiresAuthentication() { - return nil - } - - st := nd.sessionInfo.Get() - - // Consider when the next tend will be in this calculation. If the next tend will be too late, - // refresh the sessionInfo now. - if st.expiration.IsZero() || time.Now().Before(st.expiration.Add(-nd.cluster.clientPolicy.TendInterval)) { - return nil - } - - nd.usingTendConn(nd.cluster.clientPolicy.LoginTimeout, func(conn *Connection) { - command := newLoginCommand(conn.dataBuffer) - if err = command.login(&nd.cluster.clientPolicy, conn, nd.cluster.Password()); err != nil { - // force new connections to use default creds until a new valid session token is acquired - nd.resetSessionInfo() - // Socket not authenticated. Do not put back into pool. - conn.Close() - } else { - nd.sessionInfo.Set(command.sessionInfo()) - } - }) - - return err -} - -func (nd *Node) updateRackInfo(infoMap map[string]string) Error { - if !nd.cluster.clientPolicy.RackAware { - return nil - } - - // Do not raise an error if the server does not support rackaware - if strings.HasPrefix(strings.ToUpper(infoMap["racks:"]), "ERROR") { - return newError(types.UNSUPPORTED_FEATURE, "You have set the ClientPolicy.RackAware = true, but the server does not support this feature.") - } - - ss := strings.Split(infoMap["racks:"], ";") - racks := map[string]int{} - for _, s := range ss { - in := bufio.NewReader(strings.NewReader(s)) - _, err := in.ReadString('=') - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - ns, err := in.ReadString(':') - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - for { - _, err = in.ReadString('_') - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - rackStr, err := in.ReadString('=') - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - rack, err := strconv.Atoi(rackStr[:len(rackStr)-1]) - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - nodesList, err := in.ReadString(':') - if err != nil && err != io.EOF { - return newErrorAndWrap(err, types.PARSE_ERROR) - } - - nodes := strings.Split(strings.Trim(nodesList, ":"), ",") - for i := range nodes { - if nodes[i] == nd.name { - racks[ns[:len(ns)-1]] = rack - } - } - - if err == io.EOF { - break - } - } - } - - nd.racks.Set(racks) - - return nil -} - -func (nd *Node) verifyNodeName(infoMap map[string]string) Error { - infoName, exists := infoMap["node"] - - if !exists || len(infoName) == 0 { - return newError(types.INVALID_NODE_ERROR, "Node name is empty") - } - - if !(nd.name == infoName) { - // Set node to inactive immediately. - nd.active.Set(false) - return newError(types.INVALID_NODE_ERROR, "Node name has changed. Old="+nd.name+" New="+infoName) - } - return nil -} - -func (nd *Node) verifyPeersGeneration(infoMap map[string]string, peers *peers) Error { - genString := infoMap["peers-generation"] - if len(genString) == 0 { - return newError(types.PARSE_ERROR, "peers-generation is empty") - } - - gen, err := strconv.Atoi(genString) - if err != nil { - return newError(types.PARSE_ERROR, "peers-generation is not a number: "+genString) - } - - peers.genChanged.Or(nd.peersGeneration.Get() != gen) - return nil -} - -func (nd *Node) verifyPartitionGeneration(infoMap map[string]string) Error { - genString := infoMap["partition-generation"] - - if len(genString) == 0 { - return newError(types.PARSE_ERROR, "partition-generation is empty") - } - - gen, err := strconv.Atoi(genString) - if err != nil { - return newError(types.PARSE_ERROR, "partition-generation is not a number:"+genString) - } - - if nd.partitionGeneration.Get() != gen { - nd.partitionChanged.Set(true) - } - return nil -} - -func (nd *Node) refreshPeers(peers *peers) { - // Do not refresh peers when node connection has already failed during this cluster tend iteration. - if nd.failures.Get() > 0 || !nd.active.Get() { - return - } - - peerParser, err := parsePeers(nd.cluster, nd) - if err != nil { - logger.Logger.Debug("Parsing peers failed: %s", err) - nd.refreshFailed(err) - return - } - - peers.appendPeers(peerParser.peers) - nd.peersGeneration.Set(int(peerParser.generation())) - nd.peersCount.Set(len(peers.peers())) - peers.refreshCount.IncrementAndGet() -} - -func (nd *Node) refreshPartitions(peers *peers, partitions partitionMap, freshlyAdded bool) { - // Do not refresh peers when node connection has already failed during this cluster tend iteration. - // Also, avoid "split cluster" case where this node thinks it's a 1-node cluster. - // Unchecked, such a node can dominate the partition map and cause all other - // nodes to be dropped. - if !freshlyAdded { - if nd.failures.Get() > 0 || !nd.active.Get() || (nd.peersCount.Get() == 0 && peers.refreshCount.Get() > 1) { - return - } - } - - parser, err := newPartitionParser(nd, partitions, _PARTITIONS) - if err != nil { - nd.refreshFailed(err) - return - } - - if parser.generation != nd.partitionGeneration.Get() { - logger.Logger.Info("Node %s partition generation changed from %d to %d", nd.host.String(), nd.partitionGeneration.Get(), parser.getGeneration()) - nd.partitionChanged.Set(true) - nd.partitionGeneration.Set(parser.getGeneration()) - nd.stats.PartitionMapUpdates.IncrementAndGet() - } -} - -func (nd *Node) refreshFailed(e Error) { - nd.peersGeneration.Set(-1) - nd.partitionGeneration.Set(-1) - - if nd.cluster.clientPolicy.RackAware { - nd.rebalanceGeneration.Set(-1) - } - - nd.failures.IncrementAndGet() - nd.stats.TendsFailed.IncrementAndGet() - - // Only log message if cluster is still active. - if nd.cluster.IsConnected() { - logger.Logger.Warn("Node `%s` refresh failed: `%s`", nd, e) - } -} - -// dropIdleConnections picks a connection from the head of the connection pool queue -// if that connection is idle, it drops it and takes the next one until it picks -// a fresh connection or exhaust the queue. -func (nd *Node) dropIdleConnections() { - nd.connections.DropIdle() -} - -// GetConnection gets a connection to the node. -// If no pooled connection is available, a new connection will be created, unless -// ClientPolicy.MaxQueueSize number of connections are already created. -// This method will retry to retrieve a connection in case the connection pool -// is empty, until timeout is reached. -func (nd *Node) GetConnection(timeout time.Duration) (conn *Connection, err Error) { - if timeout <= 0 { - timeout = _DEFAULT_TIMEOUT - } - deadline := time.Now().Add(timeout) - - for time.Now().Before(deadline) { - conn, err = nd.getConnection(deadline, timeout) - if err == nil && conn != nil { - return conn, nil - } - - if errors.Is(err, ErrServerNotAvailable) { - return nil, err - } - - time.Sleep(5 * time.Millisecond) - } - - // in case the block didn't run at all - if err == nil { - err = ErrConnectionPoolEmpty.err() - } - - return nil, err -} - -// getConnection gets a connection to the node. -// If no pooled connection is available, a new connection will be created. -func (nd *Node) getConnection(deadline time.Time, timeout time.Duration) (conn *Connection, err Error) { - return nd.getConnectionWithHint(deadline, timeout, 0) -} - -// newConnectionAllowed will tentatively check if the client is allowed to make a new connection -// based on the ClientPolicy passed to it. -// This is more or less a copy of the logic in the beginning of newConnection function. -func (nd *Node) newConnectionAllowed() Error { - if !nd.active.Get() { - return ErrServerNotAvailable.err() - } - - // if connection count is limited and enough connections are already created, don't create a new one - cc := nd.connectionCount.IncrementAndGet() - defer nd.connectionCount.DecrementAndGet() - if nd.cluster.clientPolicy.LimitConnectionsToQueueSize && cc > nd.cluster.clientPolicy.ConnectionQueueSize { - return ErrTooManyConnectionsForNode.err() - } - - // Check for opening connection threshold - if nd.cluster.clientPolicy.OpeningConnectionThreshold > 0 { - ct := nd.cluster.connectionThreshold.IncrementAndGet() - defer nd.cluster.connectionThreshold.DecrementAndGet() - if ct > nd.cluster.clientPolicy.OpeningConnectionThreshold { - return ErrTooManyOpeningConnections.err() - } - } - - return nil -} - -// newConnection will make a new connection for the node. -func (nd *Node) newConnection(overrideThreshold bool) (*Connection, Error) { - if !nd.active.Get() { - return nil, ErrServerNotAvailable.err() - } - - // if connection count is limited and enough connections are already created, don't create a new one - cc := nd.connectionCount.IncrementAndGet() - if nd.cluster.clientPolicy.LimitConnectionsToQueueSize && cc > nd.cluster.clientPolicy.ConnectionQueueSize { - nd.connectionCount.DecrementAndGet() - nd.stats.ConnectionsPoolEmpty.IncrementAndGet() - - return nil, ErrTooManyConnectionsForNode.err() - } - - // Check for opening connection threshold - if !overrideThreshold && nd.cluster.clientPolicy.OpeningConnectionThreshold > 0 { - ct := nd.cluster.connectionThreshold.IncrementAndGet() - if ct > nd.cluster.clientPolicy.OpeningConnectionThreshold { - nd.cluster.connectionThreshold.DecrementAndGet() - nd.connectionCount.DecrementAndGet() - - return nil, ErrTooManyOpeningConnections.err() - } - - defer nd.cluster.connectionThreshold.DecrementAndGet() - } - - nd.stats.ConnectionsAttempts.IncrementAndGet() - conn, err := NewConnection(&nd.cluster.clientPolicy, nd.host) - if err != nil { - nd.incrErrorCount() - nd.connectionCount.DecrementAndGet() - nd.stats.ConnectionsFailed.IncrementAndGet() - return nil, err - } - conn.node = nd - - sessionInfo := nd.sessionInfo.Get() - // need to authenticate - if err = conn.login(&nd.cluster.clientPolicy, nd.cluster.Password(), sessionInfo); err != nil { - // increment node errors if authentication hit a network error - if networkError(err) { - nd.incrErrorCount() - } - nd.stats.ConnectionsFailed.IncrementAndGet() - - // Socket not authenticated. Do not put back into pool. - conn.Close() - return nil, err - } - - nd.stats.ConnectionsSuccessful.IncrementAndGet() - conn.setIdleTimeout(nd.cluster.clientPolicy.IdleTimeout) - - return conn, nil -} - -// makeConnectionForPool will try to open a connection until deadline. -// if no deadline is defined, it will only try for _DEFAULT_TIMEOUT. -func (nd *Node) makeConnectionForPool(hint byte) { - conn, err := nd.newConnection(false) - if err != nil { - logger.Logger.Debug("Error trying to make a connection to the node %s: %s", nd.String(), err.Error()) - return - } - - nd.putConnectionWithHint(conn, hint) -} - -// getConnectionWithHint gets a connection to the node. -// If no pooled connection is available, a new connection will be created. -func (nd *Node) getConnectionWithHint(deadline time.Time, timeout time.Duration, hint byte) (conn *Connection, err Error) { - if !nd.active.Get() { - return nil, ErrServerNotAvailable.err() - } - - // try to get a valid connection from the connection pool - for conn = nd.connections.Poll(hint); conn != nil; conn = nd.connections.Poll(hint) { - if conn.IsConnected() { - break - } - conn.Close() - conn = nil - } - - if conn == nil { - // tentatively check if a connection is allowed to avoid launching too many goroutines. - err = nd.newConnectionAllowed() - if err == nil { - go nd.makeConnectionForPool(hint) - } else if errors.Is(err, ErrTooManyConnectionsForNode) { - return nil, ErrConnectionPoolExhausted.err() - } - return nil, ErrConnectionPoolEmpty.err() - } - - if err = conn.SetTimeout(deadline, timeout); err != nil { - nd.stats.ConnectionsFailed.IncrementAndGet() - - // Do not put back into pool. - conn.Close() - return nil, err - } - - conn.refresh() - - return conn, nil -} - -// PutConnection puts back a connection to the pool. -// If connection pool is full, the connection will be -// closed and discarded. -func (nd *Node) putConnectionWithHint(conn *Connection, hint byte) bool { - conn.refresh() - if !nd.active.Get() || !nd.connections.Offer(conn, hint) { - nd.stats.ConnectionsPoolOverflow.IncrementAndGet() - conn.Close() - return false - } - return true -} - -// PutConnection puts back a connection to the pool. -// If connection pool is full, the connection will be -// closed and discarded. -func (nd *Node) PutConnection(conn *Connection) { - nd.putConnectionWithHint(conn, 0) -} - -// InvalidateConnection closes and discards a connection from the pool. -func (nd *Node) InvalidateConnection(conn *Connection) { - conn.Close() -} - -// GetHost retrieves host for the node. -func (nd *Node) GetHost() *Host { - return nd.host -} - -// IsActive Checks if the node is active. -func (nd *Node) IsActive() bool { - return nd != nil && nd.active.Get() && nd.partitionGeneration.Get() >= -1 -} - -// GetName returns node name. -func (nd *Node) GetName() string { - return nd.name -} - -// GetAliases returns node aliases. -func (nd *Node) GetAliases() []*Host { - return nd.aliases.Get() -} - -// Sets node aliases -func (nd *Node) setAliases(aliases []*Host) { - nd.aliases.Set(aliases) -} - -// AddAlias adds an alias for the node -func (nd *Node) addAlias(aliasToAdd *Host) { - // Aliases are only referenced in the cluster tend goroutine, - // so synchronization is not necessary. - aliases := nd.GetAliases() - if aliases == nil { - aliases = []*Host{} - } - - aliases = append(aliases, aliasToAdd) - nd.setAliases(aliases) -} - -// Close marks node as inactive and closes all of its pooled connections. -func (nd *Node) Close() { - if nd.active.Get() { - nd.active.Set(false) - nd.stats.NodeRemoved.IncrementAndGet() - } - nd.closeConnections() - nd.connections.cleanup() -} - -// String implements stringer interface -func (nd *Node) String() string { - if nd != nil { - return nd.name + " " + nd.host.String() - } - return "" -} - -func (nd *Node) closeConnections() { - for conn := nd.connections.Poll(0); conn != nil; conn = nd.connections.Poll(0) { - conn.Close() - } - - // close the tend connection - nd.tendConn.Do(func(conn *Connection) { - if conn != nil { - conn.Close() - } - }) -} - -// Equals compares equality of two nodes based on their names. -func (nd *Node) Equals(other *Node) bool { - return nd != nil && other != nil && (nd == other || nd.name == other.name) -} - -// MigrationInProgress determines if the node is participating in a data migration -func (nd *Node) MigrationInProgress() (bool, Error) { - values, err := nd.RequestStats(&nd.cluster.infoPolicy) - if err != nil { - return false, err - } - - // if the migrate_partitions_remaining exists and is not `0`, then migration is in progress - if migration, exists := values["migrate_partitions_remaining"]; exists && migration != "0" { - return true, nil - } - - // migration not in progress - return false, nil -} - -// WaitUntillMigrationIsFinished will block until migration operations are finished. -func (nd *Node) WaitUntillMigrationIsFinished(timeout time.Duration) Error { - if timeout <= 0 { - timeout = _NO_TIMEOUT - } - done := make(chan Error) - - go func() { - // this function is guaranteed to return after timeout - // no go routines will be leaked - for { - if res, err := nd.MigrationInProgress(); err != nil || !res { - done <- err - return - } - } - }() - - dealine := time.After(timeout) - select { - case <-dealine: - return newError(types.TIMEOUT) - case err := <-done: - return err - } -} - -// usingTendConn allows the tend connection to be used in a monitor without race conditions. -// If the connection is not valid, it establishes a valid connection first. -func (nd *Node) usingTendConn(timeout time.Duration, f func(conn *Connection)) (err Error) { - nd.tendConn.Update(func(conn **Connection) { - if timeout <= 0 { - timeout = _DEFAULT_TIMEOUT - } - deadline := time.Now().Add(timeout) - - // if the tend connection is invalid, establish a new connection first - if *conn == nil || !(*conn).IsConnected() { - if nd.connectionCount.Get() == 0 { - // if there are no connections in the pool, create a new connection synchronously. - // this will make sure the initial tend will get a connection without multiple retries. - *conn, err = nd.newConnection(true) - } else { - *conn, err = nd.GetConnection(timeout) - } - - // if no connection could be established, exit fast - if err != nil { - return - } - } - - // Set timeout for tend conn - if err = (*conn).SetTimeout(deadline, timeout); err != nil { - return - } - - // if all went well, call the closure - f(*conn) - }) - return err -} - -// requestInfoWithRetry gets info values by name from the specified database server node. -// It will try at least N times before returning an error. -func (nd *Node) requestInfoWithRetry(policy *InfoPolicy, n int, name ...string) (res map[string]string, err Error) { - for i := 0; i < n; i++ { - if res, err = nd.requestInfo(policy.Timeout, name...); err == nil { - return res, nil - } - - logger.Logger.Error("Error occurred while fetching info from the server node %s: %s", nd.host.String(), err.Error()) - time.Sleep(100 * time.Millisecond) - } - - // return the last error - return nil, err -} - -// RequestInfo gets info values by name from the specified database server node. -func (nd *Node) RequestInfo(policy *InfoPolicy, name ...string) (map[string]string, Error) { - return nd.requestInfo(policy.Timeout, name...) -} - -// RequestInfo gets info values by name from the specified database server node. -func (nd *Node) requestInfo(timeout time.Duration, name ...string) (response map[string]string, err Error) { - nd.usingTendConn(timeout, func(conn *Connection) { - response, err = conn.RequestInfo(name...) - if err != nil { - conn.Close() - } - }) - - return response, err -} - -// requestRawInfo gets info values by name from the specified database server node. -// It won't parse the results. -func (nd *Node) requestRawInfo(policy *InfoPolicy, name ...string) (response *info, err Error) { - nd.usingTendConn(policy.Timeout, func(conn *Connection) { - response, err = newInfo(conn, name...) - if err != nil { - conn.Close() - } - }) - return response, nil -} - -// RequestStats returns statistics for the specified node as a map -func (nd *Node) RequestStats(policy *InfoPolicy) (map[string]string, Error) { - infoMap, err := nd.RequestInfo(policy, "statistics") - if err != nil { - return nil, err - } - - res := map[string]string{} - - v, exists := infoMap["statistics"] - if !exists { - return res, nil - } - - values := strings.Split(v, ";") - for i := range values { - kv := strings.Split(values[i], "=") - if len(kv) > 1 { - res[kv[0]] = kv[1] - } - } - - return res, nil -} - -// resetSessionInfo resets the sessionInfo after an -// unsuccessful authentication with token -func (nd *Node) resetSessionInfo() { - si := &sessionInfo{} - nd.sessionInfo.Set(si) -} - -// sessionToken returns the session token for the node. -// It will return nil if the session has expired. -func (nd *Node) sessionToken() []byte { - si := nd.sessionInfo.Get() - if !si.isValid() { - return nil - } - - return si.token -} - -// Rack returns the rack number for the namespace. -func (nd *Node) Rack(namespace string) (int, Error) { - racks := nd.racks.Get() - v, exists := racks[namespace] - - if exists { - return v, nil - } - - return -1, newCustomNodeError(nd, types.RACK_NOT_DEFINED) -} - -// Rack returns the rack number for the namespace. -func (nd *Node) hasRack(namespace string, rack int) bool { - racks := nd.racks.Get() - v, exists := racks[namespace] - - if !exists { - return false - } - - return v == rack -} - -// WarmUp fills the node's connection pool with connections. -// This is necessary on startup for high traffic programs. -// If the count is <= 0, the connection queue will be filled. -// If the count is more than the size of the pool, the pool will be filled. -// Note: One connection per node is reserved for tend operations and is not used for transactions. -func (nd *Node) WarmUp(count int) (int, Error) { - var g errgroup.Group - cnt := iatomic.NewInt(0) - - toAlloc := nd.connections.Cap() - nd.connectionCount.Get() - if count < toAlloc && count > 0 { - toAlloc = count - } - - for i := 0; i < toAlloc; i++ { - g.Go(func() error { - conn, err := nd.newConnection(true) - if err != nil { - if errors.Is(err, ErrTooManyConnectionsForNode) { - return nil - } - return err - } - - if nd.putConnectionWithHint(conn, 0) { - cnt.IncrementAndGet() - } else { - conn.Close() - } - - return nil - }) - } - - err := g.Wait() - if err != nil { - return cnt.Get(), err.(Error) - } - return cnt.Get(), nil -} - -// fillMinCounts will fill the connection pool to the minimum required -// by the ClientPolicy.MinConnectionsPerNode -func (nd *Node) fillMinConns() (int, Error) { - if nd.cluster.clientPolicy.MinConnectionsPerNode > 0 { - toFill := nd.cluster.clientPolicy.MinConnectionsPerNode - nd.connectionCount.Get() - if toFill > 0 { - return nd.WarmUp(toFill) - } - } - return 0, nil -} - -// Increments error count for the node. If errorCount goes above the threshold, -// the node will not accept any more requests until the next window. -func (nd *Node) incrErrorCount() { - if nd.cluster.clientPolicy.MaxErrorRate > 0 { - nd.errorCount.GetAndIncrement() - } -} - -// Resets the error count -func (nd *Node) resetErrorCount() { - nd.errorCount.Set(0) -} - -// checks if the errorCount is within set limits -func (nd *Node) errorCountWithinLimit() bool { - return nd.cluster.clientPolicy.MaxErrorRate <= 0 || nd.errorCount.Get() <= nd.cluster.clientPolicy.MaxErrorRate -} - -// returns error if errorCount has gone above the threshold set in the policy -func (nd *Node) validateErrorCount() Error { - if !nd.errorCountWithinLimit() { - nd.stats.CircuitBreakerHits.IncrementAndGet() - return newError(types.MAX_ERROR_RATE) - } - return nil -} - -// PeersGeneration returns node's Peers Generation -func (nd *Node) PeersGeneration() int { - return nd.peersGeneration.Get() -} - -// PartitionGeneration returns node's Partition Generation -func (nd *Node) PartitionGeneration() int { - return nd.partitionGeneration.Get() -} - -// RebalanceGeneration returns node's Rebalance Generation -func (nd *Node) RebalanceGeneration() int { - return nd.rebalanceGeneration.Get() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/node_stats.go b/aerospike-tls/vendor-aerospike-client-go/node_stats.go deleted file mode 100644 index a4218c93..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/node_stats.go +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "encoding/json" - "sync" - - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - hist "github.com/aerospike/aerospike-client-go/v7/types/histogram" -) - -// nodeStats keeps track of client's internal node statistics -// These statistics are aggregated once per tend in the cluster object -// and then are served to the end-user. -type nodeStats struct { - m sync.Mutex - // Attempts to open a connection (failed + successful) - ConnectionsAttempts iatomic.Int `json:"connections-attempts"` - // Successful attempts to open a connection - ConnectionsSuccessful iatomic.Int `json:"connections-successful"` - // Failed attempts to use a connection (includes all errors) - ConnectionsFailed iatomic.Int `json:"connections-failed"` - // Connection Timeout errors - ConnectionsTimeoutErrors iatomic.Int `json:"connections-error-timeout"` - // Connection errors other than timeouts - ConnectionsOtherErrors iatomic.Int `json:"connections-error-other"` - // Number of times circuit breaker was hit - CircuitBreakerHits iatomic.Int `json:"circuit-breaker-hits"` - // The command polled the connection pool, but no connections were in the pool - ConnectionsPoolEmpty iatomic.Int `json:"connections-pool-empty"` - // The command offered the connection to the pool, but the pool was full and the connection was closed - ConnectionsPoolOverflow iatomic.Int `json:"connections-pool-overflow"` - // The connection was idle and was dropped - ConnectionsIdleDropped iatomic.Int `json:"connections-idle-dropped"` - // Number of open connections at a given time - ConnectionsOpen iatomic.Int `json:"open-connections"` - // Number of connections that were closed, for any reason (idled out, errored out, etc) - ConnectionsClosed iatomic.Int `json:"closed-connections"` - // Total number of attempted tends (failed + success) - TendsTotal iatomic.Int `json:"tends-total"` - // Total number of successful tends - TendsSuccessful iatomic.Int `json:"tends-successful"` - // Total number of failed tends - TendsFailed iatomic.Int `json:"tends-failed"` - // Total number of partition map updates - PartitionMapUpdates iatomic.Int `json:"partition-map-updates"` - // Total number of times nodes were added to the client (not the same as actual nodes added. Network disruptions between client and server may cause a node being dropped and re-added client-side) - NodeAdded iatomic.Int `json:"node-added-count"` - // Total number of times nodes were removed from the client (not the same as actual nodes removed. Network disruptions between client and server may cause a node being dropped client-side) - NodeRemoved iatomic.Int `json:"node-removed-count"` - - // Total number of transaction retries - TransactionRetryCount iatomic.Int `json:"transaction-retry-count"` - // Total number of transaction errors - TransactionErrorCount iatomic.Int `json:"transaction-error-count"` - - // Metrics for Get commands - GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` - // Metrics for GetHeader commands - GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` - // Metrics for Exists commands - ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` - // Metrics for Put commands - PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` - // Metrics for Delete commands - DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` - // Metrics for Operate commands - OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` - // Metrics for Query commands - QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` - // Metrics for Scan commands - ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` - // Metrics for UDFMetrics commands - UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` - // Metrics for Read only Batch commands - BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` - // Metrics for Batch commands containing writes - BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` -} - -func newNodeStats(policy *MetricsPolicy) *nodeStats { - if policy == nil { - policy = DefaultMetricsPolicy() - } - - return &nodeStats{ - GetMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - GetHeaderMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - ExistsMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - PutMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - DeleteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - OperateMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - QueryMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - ScanMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - UDFMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - BatchReadMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - BatchWriteMetrics: *hist.NewSync[uint64](policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns), - } -} - -// latest returns the latest values to be used in aggregation and then resets the values -func (ns *nodeStats) getAndReset() *nodeStats { - ns.m.Lock() - - res := &nodeStats{ - ConnectionsAttempts: ns.ConnectionsAttempts.CloneAndSet(0), - ConnectionsSuccessful: ns.ConnectionsSuccessful.CloneAndSet(0), - ConnectionsFailed: ns.ConnectionsFailed.CloneAndSet(0), - ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.CloneAndSet(0), - ConnectionsOtherErrors: ns.ConnectionsOtherErrors.CloneAndSet(0), - CircuitBreakerHits: ns.CircuitBreakerHits.CloneAndSet(0), - ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.CloneAndSet(0), - ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.CloneAndSet(0), - ConnectionsIdleDropped: ns.ConnectionsIdleDropped.CloneAndSet(0), - ConnectionsOpen: ns.ConnectionsOpen.CloneAndSet(0), - ConnectionsClosed: ns.ConnectionsClosed.CloneAndSet(0), - TendsTotal: ns.TendsTotal.CloneAndSet(0), - TendsSuccessful: ns.TendsSuccessful.CloneAndSet(0), - TendsFailed: ns.TendsFailed.CloneAndSet(0), - PartitionMapUpdates: ns.PartitionMapUpdates.CloneAndSet(0), - NodeAdded: ns.NodeAdded.CloneAndSet(0), - NodeRemoved: ns.NodeRemoved.CloneAndSet(0), - - TransactionRetryCount: ns.TransactionRetryCount.CloneAndSet(0), - TransactionErrorCount: ns.TransactionErrorCount.CloneAndSet(0), - - GetMetrics: *ns.GetMetrics.CloneAndReset(), - GetHeaderMetrics: *ns.GetHeaderMetrics.CloneAndReset(), - ExistsMetrics: *ns.ExistsMetrics.CloneAndReset(), - PutMetrics: *ns.PutMetrics.CloneAndReset(), - DeleteMetrics: *ns.DeleteMetrics.CloneAndReset(), - OperateMetrics: *ns.OperateMetrics.CloneAndReset(), - QueryMetrics: *ns.QueryMetrics.CloneAndReset(), - ScanMetrics: *ns.ScanMetrics.CloneAndReset(), - UDFMetrics: *ns.UDFMetrics.CloneAndReset(), - BatchReadMetrics: *ns.BatchReadMetrics.CloneAndReset(), - BatchWriteMetrics: *ns.BatchWriteMetrics.CloneAndReset(), - } - - ns.m.Unlock() - return res -} - -func (ns *nodeStats) clone() nodeStats { - ns.m.Lock() - - res := nodeStats{ - ConnectionsAttempts: ns.ConnectionsAttempts.Clone(), - ConnectionsSuccessful: ns.ConnectionsSuccessful.Clone(), - ConnectionsFailed: ns.ConnectionsFailed.Clone(), - ConnectionsTimeoutErrors: ns.ConnectionsTimeoutErrors.Clone(), - ConnectionsOtherErrors: ns.ConnectionsOtherErrors.Clone(), - CircuitBreakerHits: ns.CircuitBreakerHits.Clone(), - ConnectionsPoolEmpty: ns.ConnectionsPoolEmpty.Clone(), - ConnectionsPoolOverflow: ns.ConnectionsPoolOverflow.Clone(), - ConnectionsIdleDropped: ns.ConnectionsIdleDropped.Clone(), - ConnectionsOpen: ns.ConnectionsOpen.Clone(), - ConnectionsClosed: ns.ConnectionsClosed.Clone(), - TendsTotal: ns.TendsTotal.Clone(), - TendsSuccessful: ns.TendsSuccessful.Clone(), - TendsFailed: ns.TendsFailed.Clone(), - PartitionMapUpdates: ns.PartitionMapUpdates.Clone(), - NodeAdded: ns.NodeAdded.Clone(), - NodeRemoved: ns.NodeRemoved.Clone(), - - TransactionRetryCount: ns.TransactionRetryCount.Clone(), - TransactionErrorCount: ns.TransactionErrorCount.Clone(), - - GetMetrics: *ns.GetMetrics.Clone(), - GetHeaderMetrics: *ns.GetHeaderMetrics.Clone(), - ExistsMetrics: *ns.ExistsMetrics.Clone(), - PutMetrics: *ns.PutMetrics.Clone(), - DeleteMetrics: *ns.DeleteMetrics.Clone(), - OperateMetrics: *ns.OperateMetrics.Clone(), - QueryMetrics: *ns.QueryMetrics.Clone(), - ScanMetrics: *ns.ScanMetrics.Clone(), - UDFMetrics: *ns.UDFMetrics.Clone(), - BatchReadMetrics: *ns.BatchReadMetrics.Clone(), - BatchWriteMetrics: *ns.BatchWriteMetrics.Clone(), - } - - ns.m.Unlock() - return res -} - -func (ns *nodeStats) reshape(policy *MetricsPolicy) { - ns.m.Lock() - ns.GetMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.GetHeaderMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.ExistsMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.PutMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.DeleteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.OperateMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.QueryMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.ScanMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.UDFMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.BatchReadMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.BatchWriteMetrics.Reshape(policy.HistogramType, uint64(policy.LatencyBase), policy.LatencyColumns) - ns.m.Unlock() -} - -func (ns *nodeStats) aggregate(newStats *nodeStats) { - ns.m.Lock() - newStats.m.Lock() - - ns.ConnectionsAttempts.AddAndGet(newStats.ConnectionsAttempts.Get()) - ns.ConnectionsSuccessful.AddAndGet(newStats.ConnectionsSuccessful.Get()) - ns.ConnectionsFailed.AddAndGet(newStats.ConnectionsFailed.Get()) - ns.ConnectionsTimeoutErrors.AddAndGet(newStats.ConnectionsTimeoutErrors.Get()) - ns.ConnectionsOtherErrors.AddAndGet(newStats.ConnectionsOtherErrors.Get()) - ns.CircuitBreakerHits.AddAndGet(newStats.CircuitBreakerHits.Get()) - ns.ConnectionsPoolEmpty.AddAndGet(newStats.ConnectionsPoolEmpty.Get()) - ns.ConnectionsPoolOverflow.AddAndGet(newStats.ConnectionsPoolOverflow.Get()) - ns.ConnectionsIdleDropped.AddAndGet(newStats.ConnectionsIdleDropped.Get()) - ns.ConnectionsOpen.AddAndGet(newStats.ConnectionsOpen.Get()) - ns.ConnectionsClosed.AddAndGet(newStats.ConnectionsClosed.Get()) - ns.TendsTotal.AddAndGet(newStats.TendsTotal.Get()) - ns.TendsSuccessful.AddAndGet(newStats.TendsSuccessful.Get()) - ns.TendsFailed.AddAndGet(newStats.TendsFailed.Get()) - ns.PartitionMapUpdates.AddAndGet(newStats.PartitionMapUpdates.Get()) - ns.NodeAdded.AddAndGet(newStats.NodeAdded.Get()) - ns.NodeRemoved.AddAndGet(newStats.NodeRemoved.Get()) - - ns.TransactionRetryCount.AddAndGet(newStats.TransactionRetryCount.Get()) - ns.TransactionErrorCount.AddAndGet(newStats.TransactionErrorCount.Get()) - - ns.GetMetrics.Merge(&newStats.GetMetrics) - ns.GetHeaderMetrics.Merge(&newStats.GetHeaderMetrics) - ns.ExistsMetrics.Merge(&newStats.ExistsMetrics) - ns.PutMetrics.Merge(&newStats.PutMetrics) - ns.DeleteMetrics.Merge(&newStats.DeleteMetrics) - ns.OperateMetrics.Merge(&newStats.OperateMetrics) - ns.QueryMetrics.Merge(&newStats.QueryMetrics) - ns.ScanMetrics.Merge(&newStats.ScanMetrics) - ns.UDFMetrics.Merge(&newStats.UDFMetrics) - ns.BatchReadMetrics.Merge(&newStats.BatchReadMetrics) - ns.BatchWriteMetrics.Merge(&newStats.BatchWriteMetrics) - - newStats.m.Unlock() - ns.m.Unlock() -} - -func (ns nodeStats) MarshalJSON() ([]byte, error) { - return json.Marshal(&struct { - ConnectionsAttempts int `json:"connections-attempts"` - ConnectionsSuccessful int `json:"connections-successful"` - ConnectionsFailed int `json:"connections-failed"` - ConnectionsTimeoutErrors int `json:"connections-error-timeout"` - ConnectionsOtherErrors int `json:"connections-error-other"` - CircuitBreakerHits int `json:"circuit-breaker-hits"` - ConnectionsPoolEmpty int `json:"connections-pool-empty"` - ConnectionsPoolOverflow int `json:"connections-pool-overflow"` - ConnectionsIdleDropped int `json:"connections-idle-dropped"` - ConnectionsOpen int `json:"open-connections"` - ConnectionsClosed int `json:"closed-connections"` - TendsTotal int `json:"tends-total"` - TendsSuccessful int `json:"tends-successful"` - TendsFailed int `json:"tends-failed"` - PartitionMapUpdates int `json:"partition-map-updates"` - NodeAdded int `json:"node-added-count"` - NodeRemoved int `json:"node-removed-count"` - - RetryCount int `json:"transaction-retry-count"` - ErrorCount int `json:"transaction-error-count"` - - GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` - GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` - ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` - PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` - DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` - OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` - QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` - ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` - UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` - BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` - BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` - }{ - ns.ConnectionsAttempts.Get(), - ns.ConnectionsSuccessful.Get(), - ns.ConnectionsFailed.Get(), - ns.ConnectionsTimeoutErrors.Get(), - ns.ConnectionsOtherErrors.Get(), - ns.CircuitBreakerHits.Get(), - ns.ConnectionsPoolEmpty.Get(), - ns.ConnectionsPoolOverflow.Get(), - ns.ConnectionsIdleDropped.Get(), - ns.ConnectionsOpen.Get(), - ns.ConnectionsClosed.Get(), - ns.TendsTotal.Get(), - ns.TendsSuccessful.Get(), - ns.TendsFailed.Get(), - ns.PartitionMapUpdates.Get(), - ns.NodeAdded.Get(), - ns.NodeRemoved.Get(), - - ns.TransactionRetryCount.Get(), - ns.TransactionErrorCount.Get(), - - ns.GetMetrics, - ns.GetHeaderMetrics, - ns.ExistsMetrics, - ns.PutMetrics, - ns.DeleteMetrics, - ns.OperateMetrics, - ns.QueryMetrics, - ns.ScanMetrics, - ns.UDFMetrics, - ns.BatchReadMetrics, - ns.BatchWriteMetrics, - }) -} - -func (ns *nodeStats) UnmarshalJSON(data []byte) error { - aux := struct { - ConnectionsAttempts int `json:"connections-attempts"` - ConnectionsSuccessful int `json:"connections-successful"` - ConnectionsFailed int `json:"connections-failed"` - ConnectionsTimeoutErrors int `json:"connections-error-timeout"` - ConnectionsOtherErrors int `json:"connections-error-other"` - CircuitBreakerHits int `json:"circuit-breaker-hits"` - ConnectionsPoolEmpty int `json:"connections-pool-empty"` - ConnectionsPoolOverflow int `json:"connections-pool-overflow"` - ConnectionsIdleDropped int `json:"connections-idle-dropped"` - ConnectionsOpen int `json:"open-connections"` - ConnectionsClosed int `json:"closed-connections"` - TendsTotal int `json:"tends-total"` - TendsSuccessful int `json:"tends-successful"` - TendsFailed int `json:"tends-failed"` - PartitionMapUpdates int `json:"partition-map-updates"` - NodeAdded int `json:"node-added-count"` - NodeRemoved int `json:"node-removed-count"` - - RetryCount int `json:"transaction-retry-count"` - ErrorCount int `json:"transaction-error-count"` - - GetMetrics hist.SyncHistogram[uint64] `json:"get-metrics"` - GetHeaderMetrics hist.SyncHistogram[uint64] `json:"get-header-metrics"` - ExistsMetrics hist.SyncHistogram[uint64] `json:"exists-metrics"` - PutMetrics hist.SyncHistogram[uint64] `json:"put-metrics"` - DeleteMetrics hist.SyncHistogram[uint64] `json:"delete-metrics"` - OperateMetrics hist.SyncHistogram[uint64] `json:"operate-metrics"` - QueryMetrics hist.SyncHistogram[uint64] `json:"query-metrics"` - ScanMetrics hist.SyncHistogram[uint64] `json:"scan-metrics"` - UDFMetrics hist.SyncHistogram[uint64] `json:"udf-metrics"` - BatchReadMetrics hist.SyncHistogram[uint64] `json:"batch-read-metrics"` - BatchWriteMetrics hist.SyncHistogram[uint64] `json:"batch-write-metrics"` - }{} - - if err := json.Unmarshal(data, &aux); err != nil { - return err - } - - ns.ConnectionsAttempts.Set(aux.ConnectionsAttempts) - ns.ConnectionsSuccessful.Set(aux.ConnectionsSuccessful) - ns.ConnectionsFailed.Set(aux.ConnectionsFailed) - ns.ConnectionsTimeoutErrors.Set(aux.ConnectionsTimeoutErrors) - ns.ConnectionsOtherErrors.Set(aux.ConnectionsOtherErrors) - ns.CircuitBreakerHits.Set(aux.CircuitBreakerHits) - ns.ConnectionsPoolEmpty.Set(aux.ConnectionsPoolEmpty) - ns.ConnectionsPoolOverflow.Set(aux.ConnectionsPoolOverflow) - ns.ConnectionsIdleDropped.Set(aux.ConnectionsIdleDropped) - ns.ConnectionsOpen.Set(aux.ConnectionsOpen) - ns.ConnectionsClosed.Set(aux.ConnectionsClosed) - ns.TendsTotal.Set(aux.TendsTotal) - ns.TendsSuccessful.Set(aux.TendsSuccessful) - ns.TendsFailed.Set(aux.TendsFailed) - ns.PartitionMapUpdates.Set(aux.PartitionMapUpdates) - ns.NodeAdded.Set(aux.NodeAdded) - ns.NodeRemoved.Set(aux.NodeRemoved) - - ns.TransactionRetryCount.Set(aux.RetryCount) - ns.TransactionErrorCount.Set(aux.ErrorCount) - - ns.GetMetrics = aux.GetMetrics - ns.GetHeaderMetrics = aux.GetHeaderMetrics - ns.ExistsMetrics = aux.ExistsMetrics - ns.PutMetrics = aux.PutMetrics - ns.DeleteMetrics = aux.DeleteMetrics - ns.OperateMetrics = aux.OperateMetrics - ns.QueryMetrics = aux.QueryMetrics - ns.ScanMetrics = aux.ScanMetrics - ns.UDFMetrics = aux.UDFMetrics - ns.BatchReadMetrics = aux.BatchReadMetrics - ns.BatchWriteMetrics = aux.BatchWriteMetrics - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/node_test.go b/aerospike-tls/vendor-aerospike-client-go/node_test.go deleted file mode 100644 index 1b2067dc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/node_test.go +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "errors" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike Node Tests", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - }) - - gg.Describe("Node Connection Pool", func() { - // connection data - var err error - var client *as.Client - - dbHost := as.NewHost(*host, *port) - dbHost.TLSName = *nodeTLSName - - gg.BeforeEach(func() { - // use the same client for all - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.Context("When Authentication is Used", func() { - - if *user != "" { - - gg.It("must return error if it fails to authenticate", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.User = "non_existent_user" - clientPolicy.Password = "non_existent_user" - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).To(gm.HaveOccurred()) - }) - - } - - }) - - gg.Context("When No Connection Count Limit Is Set", func() { - - gg.It("must return a new connection on every poll", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.LimitConnectionsToQueueSize = false - clientPolicy.ConnectionQueueSize = 4 - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - for _, node := range client.GetNodes() { - for i := 0; i < 20; i++ { - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - - node.InvalidateConnection(c) - } - } - - }) - - }) - - gg.Context("When A Connection Count Limit Is Set", func() { - - gg.Context("When ExitFastOnExhaustedConnectionPool is set", func() { - - gg.It("must return appropriate error when pool is exhausted", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.LimitConnectionsToQueueSize = true - clientPolicy.ConnectionQueueSize = 4 - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - for _, node := range client.GetNodes() { - for i := 0; i < clientPolicy.ConnectionQueueSize-1; i++ { - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - - defer node.InvalidateConnection(c) - } - - // pool exhausted - c, err := node.GetConnection(0) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(errors.Is(err, as.ErrConnectionPoolExhausted)).To(gm.BeTrue()) - gm.Expect(c).To(gm.BeNil()) - } - - // same error on a command - p := as.NewPolicy() - p.ExitFastOnExhaustedConnectionPool = true - p.MaxRetries = 5 - - key, _ := as.NewKey(*namespace, randString(50), 5) - _, err := client.Get(p, key) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(errors.Is(err, as.ErrConnectionPoolExhausted)).To(gm.BeTrue()) - - ae := new(as.AerospikeError) - res := errors.As(err, &ae) - gm.Expect(res).To(gm.BeTrue()) - gm.Expect(ae.Iteration).To(gm.Equal(0)) - gm.Expect(ae.Node).ToNot(gm.BeNil()) - }) - - }) - - gg.It("must return an error when maximum number of connections are polled", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.LimitConnectionsToQueueSize = true - clientPolicy.ConnectionQueueSize = 4 - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - node := client.GetNodes()[0] - - cList := []*as.Connection{} - - // 4-1 is because we reserve a connection for tend - for i := 0; i < 4-1; i++ { - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - - // don't call invalidate here; we are testing node's connection queue behaviour - // if there are connections which are not invalidated. - // Don't call close as well, since it automatically reduces the total conn count. - // c.Close() - // append the connections to the list to prevent the invalidator closing them - cList = append(cList, c) - } - - // 4-1 is because we reserve a connection for tend - for i := 0; i < 4-1; i++ { - _, err := node.GetConnection(0) - gm.Expect(err).To(gm.HaveOccurred()) - } - - // prevent the optimizer optimizing the cList and it's contents out, since that would trigger the connection finzalizer - for _, c := range cList { - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - } - }) - - }) - - gg.Context("When Idle Timeout Is Used", func() { - - gg.It("must reuse connections before they become idle", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.IdleTimeout = 1000 * time.Millisecond - // clientPolicy.TendInterval = time.Hour - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - node := client.GetNodes()[0] - - // get a few connections at once - var conns []*as.Connection - for i := 0; i < 4; i++ { - // gg.By(fmt.Sprintf("Retrieving conns i=%d", i)) - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - - conns = append(conns, c) - } - - // return them to the pool - for _, c := range conns { - node.PutConnection(c) - } - - start := time.Now() - estimatedDeadline := start.Add(clientPolicy.IdleTimeout) - deadlineThreshold := clientPolicy.IdleTimeout / 10 - - // make sure the same connections are all retrieved again - checkCount := 0 - for time.Until(estimatedDeadline) > deadlineThreshold { - checkCount++ - // gg.By(fmt.Sprintf("Retrieving conns2 checkCount=%d", checkCount)) - var conns2 []*as.Connection - for i := 0; i < len(conns); i++ { - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - gm.Expect(conns).To(gm.ContainElement(c)) - gm.Expect(conns2).NotTo(gm.ContainElement(c)) - - conns2 = append(conns2, c) - } - - // just put them in the pool - for _, c := range conns2 { - node.PutConnection(c) - } - - time.Sleep(time.Millisecond) - } - - // we should be called lots of times - gm.Expect(checkCount).To(gm.BeNumerically(">", 500)) - - // sleep again until all connections are all idle - <-time.After(2 * clientPolicy.IdleTimeout) - - // get connections again, making sure they are all new - var conns3 []*as.Connection - for i := 0; i < len(conns); i++ { - // gg.By(fmt.Sprintf("Retrieving conns3 i=%d", i)) - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - - gm.Expect(conns).NotTo(gm.ContainElement(c)) - gm.Expect(conns3).NotTo(gm.ContainElement(c)) - - conns3 = append(conns3, c) - } - - // refresh and return them to the pool - for _, c := range conns { - gm.Expect(c.IsConnected()).To(gm.BeFalse()) - } - - // don't forget to close connections - for _, c := range conns3 { - c.Close() - } - }) - - gg.It("must maintain a minimum number of connections per client policy even if idle", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.IdleTimeout = 2000 * time.Millisecond - clientPolicy.MinConnectionsPerNode = 5 - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - client.WarmUp(10) - - node := client.GetNodes()[0] - - gm.Expect(node.ConnsCount()).To(gm.BeNumerically(">=", 10)) - - // sleep again until all connections are all idle - <-time.After(2 * clientPolicy.IdleTimeout) - gm.Expect(node.ConnsCount()).To(gm.Equal(clientPolicy.MinConnectionsPerNode + 1)) // min + 1 reserved for tend - }) - - gg.It("must delay the connection from becoming idle if it is put back in the queue", func() { - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.IdleTimeout = 1000 * time.Millisecond - clientPolicy.User = *user - clientPolicy.Password = *password - - client, err = as.NewClientWithPolicyAndHost(clientPolicy, dbHost) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer client.Close() - - node := client.GetNodes()[0] - - deadlineThreshold := clientPolicy.IdleTimeout / 10 - - // gg.By("Retrieving c") - c, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c).NotTo(gm.BeNil()) - gm.Expect(c.IsConnected()).To(gm.BeTrue()) - node.PutConnection(c) - - // continuously refresh the connection just before it goes idle - for i := 0; i < 5; i++ { - time.Sleep(clientPolicy.IdleTimeout - deadlineThreshold) - // gg.By(fmt.Sprintf("Retrieving c2 i=%d", i)) - - c2, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c2).NotTo(gm.BeNil()) - gm.Expect(c2).To(gm.Equal(c)) - gm.Expect(c2.IsConnected()).To(gm.BeTrue()) - - node.PutConnection(c2) - } - - // wait about the required time to become idle - <-time.After(2 * clientPolicy.IdleTimeout) - - // we should get a new connection - c3, err := node.GetConnection(0) - gm.Expect(err).NotTo(gm.HaveOccurred()) - gm.Expect(c3).NotTo(gm.BeNil()) - defer node.InvalidateConnection(c3) - gm.Expect(c3).ToNot(gm.Equal(c)) - gm.Expect(c3.IsConnected()).To(gm.BeTrue()) - - // the original connection should be closed - gm.Expect(c.IsConnected()).To(gm.BeFalse()) - }) - - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/node_validator.go b/aerospike-tls/vendor-aerospike-client-go/node_validator.go deleted file mode 100644 index 03874211..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/node_validator.go +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "fmt" - "net" - "strconv" - "strings" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type nodesToAddT map[string]*Node - -func (nta nodesToAddT) addNodeIfNotExists(ndv *nodeValidator, cluster *Cluster) bool { - _, exists := nta[ndv.name] - if !exists { - // found a new node - node := cluster.createNode(ndv) - nta[ndv.name] = node - } - return exists -} - -// Validates a Database server node -type nodeValidator struct { - name string - aliases []*Host - primaryHost *Host - - seedOnlyCluster bool - detectLoadBalancer bool - - sessionInfo *sessionInfo - - features int -} - -func (ndv *nodeValidator) seedNodes(cluster *Cluster, host *Host, nodesToAdd nodesToAddT) Error { - if err := ndv.setAliases(host); err != nil { - return err - } - - found := false - var resultErr Error - for _, alias := range ndv.aliases { - if resultErr = ndv.validateAlias(cluster, alias); resultErr != nil { - logger.Logger.Debug("Alias %s failed: %s", alias, resultErr) - continue - } - - found = true - nodesToAdd.addNodeIfNotExists(ndv, cluster) - } - - if !found { - return resultErr - } - return nil -} - -func (ndv *nodeValidator) validateNode(cluster *Cluster, host *Host) Error { - if clusterNodes := cluster.GetNodes(); cluster.clientPolicy.IgnoreOtherSubnetAliases && len(clusterNodes) > 0 { - masterHostname := clusterNodes[0].host.Name - ip, ipnet, err := net.ParseCIDR(masterHostname + "/24") - if err != nil { - logger.Logger.Error(err.Error()) - return newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Failed parsing hostname...") - } - - stop := ip.Mask(ipnet.Mask) - stop[3] += 255 - if bytes.Compare(net.ParseIP(host.Name).To4(), ip.Mask(ipnet.Mask).To4()) >= 0 && bytes.Compare(net.ParseIP(host.Name).To4(), stop.To4()) >= 0 { - return newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, "Ignored hostname from other subnet...") - } - } - - if err := ndv.setAliases(host); err != nil { - return err - } - - var resultErr Error - for _, alias := range ndv.aliases { - if err := ndv.validateAlias(cluster, alias); err != nil { - resultErr = chainErrors(err, resultErr) - logger.Logger.Debug("Aliases %s failed: %s", alias, err) - continue - } - return nil - } - - return resultErr -} - -func (ndv *nodeValidator) setAliases(host *Host) Error { - ndv.detectLoadBalancer = !ndv.seedOnlyCluster - - // IP addresses do not need a lookup - ip := net.ParseIP(host.Name) - if ip != nil { - // avoid detecting load balancer on localhost - ndv.detectLoadBalancer = ndv.detectLoadBalancer && !ip.IsLoopback() - - aliases := make([]*Host, 1) - aliases[0] = NewHost(host.Name, host.Port) - aliases[0].TLSName = host.TLSName - ndv.aliases = aliases - } else { - addresses, err := net.LookupHost(host.Name) - if err != nil { - logger.Logger.Error("Host lookup failed with error: %s", err.Error()) - return errToAerospikeErr(nil, err) - } - aliases := make([]*Host, len(addresses)) - for idx, addr := range addresses { - aliases[idx] = NewHost(addr, host.Port) - aliases[idx].TLSName = host.TLSName - - // avoid detecting load balancer on localhost - if ip := net.ParseIP(host.Name); ip != nil && ip.IsLoopback() { - ndv.detectLoadBalancer = false - } - } - ndv.aliases = aliases - } - logger.Logger.Debug("Node Validator has %d nodes and they are: %v", len(ndv.aliases), ndv.aliases) - return nil -} - -func (ndv *nodeValidator) validateAlias(cluster *Cluster, alias *Host) Error { - clientPolicy := cluster.clientPolicy - clientPolicy.Timeout /= 2 - - conn, err := NewConnection(&clientPolicy, alias) - if err != nil { - return err - } - defer conn.Close() - - if clientPolicy.RequiresAuthentication() { - // need to authenticate - acmd := newLoginCommand(conn.dataBuffer) - err = acmd.login(&clientPolicy, conn, cluster.Password()) - if err != nil { - return err - } - - ndv.sessionInfo = acmd.sessionInfo() - } - - // check to make sure we have actually connected - info, err := conn.RequestInfo("build") - if err != nil { - return err - } - - if _, exists := info["ERROR:80:not authenticated"]; exists { - return ErrNotAuthenticated.err() - } - - hasClusterName := len(clientPolicy.ClusterName) > 0 - - infoKeys := []string{"node", "partition-generation", "features"} - if hasClusterName { - infoKeys = append(infoKeys, "cluster-name") - } - - addressCommand := clientPolicy.serviceString() - if ndv.detectLoadBalancer && !ndv.seedOnlyCluster { - infoKeys = append(infoKeys, addressCommand) - } - - infoMap, err := conn.RequestInfo(infoKeys...) - if err != nil { - return err - } - - nodeName, exists := infoMap["node"] - if !exists { - return newError(types.INVALID_NODE_ERROR, "Invalid node alias:"+alias.String()) - } - - genStr, exists := infoMap["partition-generation"] - if !exists { - return newError(types.INVALID_NODE_ERROR, "Invalid partition-generation for node:"+alias.String()) - } - - gen, nerr := strconv.Atoi(genStr) - if nerr != nil { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid partition-generation for Node %s (%s), value: %s", nodeName, alias.String(), genStr)) - } - - if gen == -1 { - return newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Node %s (%s) is not yet fully initialized", nodeName, alias.String())) - } - - if hasClusterName { - id := infoMap["cluster-name"] - - if len(id) == 0 || id != clientPolicy.ClusterName { - return newError(types.CLUSTER_NAME_MISMATCH_ERROR, fmt.Sprintf("Node %s (%s) expected cluster name `%s` but received `%s`", nodeName, alias.String(), clientPolicy.ClusterName, id)) - } - } - - // set features - if features, exists := infoMap["features"]; exists { - ndv.setFeatures(features) - } - - // This client requires partition scan support. Partition scans were first - // supported in server version 4.9. Do not allow any server node into the - // cluster that is running server version < 4.9. - if (ndv.features & _SUPPORTS_PARTITION_SCAN) == 0 { - return newError(types.INVALID_NODE_ERROR, fmt.Sprintf("Node %s (%s) is version < 4.9. This client supports server versions >= 4.9", nodeName, alias.String())) - } - - // check if the host is a load-balancer - if peersStr, exists := infoMap[addressCommand]; exists { - var hostAddress []*Host - peerParser := peerListParser{buf: []byte("[" + peersStr + "]")} - if hostAddress, err = peerParser.readHosts(alias.TLSName); err != nil { - logger.Logger.Error("Failed to parse `%s` results... err: %s", alias.String(), err.Error()) - } - - if len(hostAddress) > 0 { - isLoadBalancer := true - LOAD_BALANCER: - for _, h := range hostAddress { - for _, a := range ndv.aliases { - if h.equals(a) { - // one of the aliases were the same as an advertised service - // no need to replace the seed host with the alias - isLoadBalancer = false - break LOAD_BALANCER - } - } - } - - if isLoadBalancer && ndv.detectLoadBalancer { - aliasFound := false - - // take the seed out of the aliases if it is load balancer - logger.Logger.Info("Host `%s` seems to be a load balancer. It is going to be replace by `%v`", alias.String(), hostAddress[0]) - // try to connect to the aliases, and coose the first one that connects - for _, h := range hostAddress { - hconn, err := NewConnection(&clientPolicy, h) - if err != nil { - continue - } - defer hconn.Close() - - if clientPolicy.RequiresAuthentication() { - // need to authenticate - acmd := newLoginCommand(hconn.dataBuffer) - err = acmd.login(&clientPolicy, hconn, cluster.Password()) - if err != nil { - continue - } - - ndv.sessionInfo = acmd.sessionInfo() - } - - alias = h - ndv.aliases = hostAddress - aliasFound = true - - // found one, no need to try the rest - break - } - - // Failed to find a valid address to connect. IP Address is probably internal on the cloud - // because the server access-address is not configured. Log warning and continue - // with original seed. - if !aliasFound { - logger.Logger.Info("Inaccessible address `%s` as cluster seed. access-address is probably not configured on server.", alias.String()) - } - } - } - } - - ndv.name = nodeName - ndv.primaryHost = alias - - return nil -} - -func (ndv *nodeValidator) setFeatures(features string) { - featureList := strings.Split(features, ";") - for i := range featureList { - switch featureList[i] { - case "pscans": - ndv.features |= _SUPPORTS_PARTITION_SCAN - case "query-show": - ndv.features |= _SUPPORTS_QUERY_SHOW - case "batch-any": - ndv.features |= _SUPPORTS_BATCH_ANY - case "pquery": - ndv.features |= _SUPPORTS_PARTITION_QUERY - } - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/operate_args.go b/aerospike-tls/vendor-aerospike-client-go/operate_args.go deleted file mode 100644 index 2afe5365..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/operate_args.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type operateArgs struct { - writePolicy *WritePolicy - operations []*Operation - partition *Partition - readAttr int - writeAttr int - hasWrite bool -} - -func newOperateArgs( - cluster *Cluster, - policy *WritePolicy, - key *Key, - operations []*Operation, -) (res operateArgs, err Error) { - res = operateArgs{ - operations: operations, - writePolicy: policy, - } - - rattr := 0 - wattr := 0 - write := false - readBin := false - readHeader := false - respondAllOps := false - - for _, operation := range operations { - switch operation.opType { - case _BIT_READ, _EXP_READ, _HLL_READ, _MAP_READ: - // Map operations require respondAllOps to be true. - respondAllOps = true - // Fall through to read. - fallthrough - case _CDT_READ, _READ: - rattr |= _INFO1_READ - - // Read all bins if no bin is specified. - if len(operation.binName) == 0 { - rattr |= _INFO1_GET_ALL - } - readBin = true - case _READ_HEADER: - rattr |= _INFO1_READ - readHeader = true - case _BIT_MODIFY, _EXP_MODIFY, _HLL_MODIFY, _MAP_MODIFY: - // Map operations require respondAllOps to be true. - respondAllOps = true - // Fall through to write. - fallthrough - default: - wattr = _INFO2_WRITE - write = true - } - - } - res.hasWrite = write - - if readHeader && !readBin { - rattr |= _INFO1_NOBINDATA - } - res.readAttr = rattr - - // When GET_ALL is specified, RESPOND_ALL_OPS must be disabled. - if (respondAllOps || res.writePolicy.RespondPerEachOp) && (rattr&_INFO1_GET_ALL) == 0 { - wattr |= _INFO2_RESPOND_ALL_OPS - } - res.writeAttr = wattr - - if cluster != nil { - if write { - res.partition, err = PartitionForWrite(cluster, &res.writePolicy.BasePolicy, key) - if err != nil { - return operateArgs{}, err - } - } else { - res.partition, err = PartitionForRead(cluster, &res.writePolicy.BasePolicy, key) - if err != nil { - return operateArgs{}, err - } - } - } - return res, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/operate_command.go b/aerospike-tls/vendor-aerospike-client-go/operate_command.go deleted file mode 100644 index d29f9a3b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/operate_command.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type operateCommand struct { - readCommand - - policy *WritePolicy - args operateArgs - useOpResults bool -} - -func newOperateCommand(cluster *Cluster, policy *WritePolicy, key *Key, args operateArgs, useOpResults bool) (operateCommand, Error) { - rdCommand, err := newReadCommand(cluster, &policy.BasePolicy, key, nil, args.partition) - if err != nil { - return operateCommand{}, err - } - - return operateCommand{ - readCommand: rdCommand, - policy: policy, - args: args, - useOpResults: useOpResults, - }, nil -} - -func (cmd *operateCommand) writeBuffer(ifc command) (err Error) { - return cmd.setOperate(cmd.policy, cmd.key, &cmd.args) -} - -func (cmd *operateCommand) getNode(ifc command) (*Node, Error) { - if cmd.args.hasWrite { - return cmd.partition.GetNodeWrite(cmd.cluster) - } - - // this may be affected by Rackaware - return cmd.partition.GetNodeRead(cmd.cluster) -} - -func (cmd *operateCommand) prepareRetry(ifc command, isTimeout bool) bool { - if cmd.args.hasWrite { - cmd.partition.PrepareRetryWrite(isTimeout) - } else { - cmd.partition.PrepareRetryRead(isTimeout) - } - return true -} - -func (cmd *operateCommand) isRead() bool { - return !cmd.args.hasWrite -} - -func (cmd *operateCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *operateCommand) transactionType() transactionType { - return ttOperate -} diff --git a/aerospike-tls/vendor-aerospike-client-go/operation.go b/aerospike-tls/vendor-aerospike-client-go/operation.go deleted file mode 100644 index fc0221ed..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/operation.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// OperationType determines operation type -type OperationType struct { - op byte - isWrite bool - enumDist byte // make the values like enum to distinguish them from each other -} - -type operationSubType *int - -// Valid OperationType values that can be used to create custom Operations. -// The names are self-explanatory. -var ( - _READ = OperationType{1, false, 0} - _READ_HEADER = OperationType{1, false, 1} - _WRITE = OperationType{2, true, 2} - _CDT_READ = OperationType{3, false, 3} - _CDT_MODIFY = OperationType{4, true, 4} - _MAP_READ = OperationType{3, false, 5} - _MAP_MODIFY = OperationType{4, true, 6} - _ADD = OperationType{5, true, 7} - _EXP_READ = OperationType{7, false, 8} - _EXP_MODIFY = OperationType{8, true, 9} - _APPEND = OperationType{9, true, 10} - _PREPEND = OperationType{10, true, 11} - _TOUCH = OperationType{11, true, 12} - _BIT_READ = OperationType{12, false, 13} - _BIT_MODIFY = OperationType{13, true, 14} - _DELETE = OperationType{14, true, 15} - _HLL_READ = OperationType{15, false, 16} - _HLL_MODIFY = OperationType{16, true, 17} -) - -// Operation contains operation definition. -// This struct is used in client's operate() method. -type Operation struct { - - // OpType determines type of operation. - opType OperationType - // used in CDT commands - opSubType operationSubType - // CDT context for nested types - ctx []*CDTContext - - encoder func(*Operation, BufferEx) (int, Error) - - // binName (Optional) determines the name of bin used in operation. - binName string - - // binValue (Optional) determines bin value used in operation. - binValue Value -} - -// size returns the size of the operation on the wire protocol. -func (op *Operation) size() (int, Error) { - size := len(op.binName) - - // Simple case - if op.encoder == nil { - valueLength, err := op.binValue.EstimateSize() - if err != nil { - return -1, err - } - - size += valueLength + 8 - return size, nil - } - - // Complex case, for CDTs - valueLength, err := op.encoder(op, nil) - if err != nil { - return -1, err - } - - size += valueLength + 8 - return size, nil -} - -// GetBinOp creates read bin database operation. -func GetBinOp(binName string) *Operation { - return &Operation{opType: _READ, binName: binName, binValue: NewNullValue()} -} - -// GetOp creates read all record bins database operation. -func GetOp() *Operation { - return &Operation{opType: _READ, binValue: NewNullValue()} -} - -// GetHeaderOp creates read record header database operation. -func GetHeaderOp() *Operation { - return &Operation{opType: _READ_HEADER, binValue: NewNullValue()} -} - -// PutOp creates set database operation. -func PutOp(bin *Bin) *Operation { - return &Operation{opType: _WRITE, binName: bin.Name, binValue: bin.Value} -} - -// AppendOp creates string append database operation. -func AppendOp(bin *Bin) *Operation { - return &Operation{opType: _APPEND, binName: bin.Name, binValue: bin.Value} -} - -// PrependOp creates string prepend database operation. -func PrependOp(bin *Bin) *Operation { - return &Operation{opType: _PREPEND, binName: bin.Name, binValue: bin.Value} -} - -// AddOp creates integer add database operation. -func AddOp(bin *Bin) *Operation { - return &Operation{opType: _ADD, binName: bin.Name, binValue: bin.Value} -} - -// TouchOp creates touch record database operation. -func TouchOp() *Operation { - return &Operation{opType: _TOUCH, binValue: NewNullValue()} -} - -// DeleteOp creates delete record database operation. -func DeleteOp() *Operation { - return &Operation{opType: _DELETE, binValue: NewNullValue()} -} diff --git a/aerospike-tls/vendor-aerospike-client-go/packer.go b/aerospike-tls/vendor-aerospike-client-go/packer.go deleted file mode 100644 index 4f588c01..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/packer.go +++ /dev/null @@ -1,681 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "encoding/binary" - "fmt" - "math" - "reflect" - "time" - - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -var packObjectReflect func(BufferEx, interface{}, bool) (int, Error) - -func packIfcList(cmd BufferEx, list []interface{}) (int, Error) { - size := 0 - n, err := packArrayBegin(cmd, len(list)) - if err != nil { - return n, err - } - size += n - - for i := range list { - n, err = packObject(cmd, list[i], false) - if err != nil { - return 0, err - } - size += n - } - - return size, err -} - -// PackList packs any slice that implement the ListIter interface -func PackList(cmd BufferEx, list ListIter) (int, Error) { - return packList(cmd, list) -} - -func packList(cmd BufferEx, list ListIter) (int, Error) { - size := 0 - n, err := packArrayBegin(cmd, list.Len()) - if err != nil { - return n, err - } - size += n - - n, nerr := list.PackList(cmd) - if nerr != nil { - return size + n, newErrorAndWrap(nerr, types.SERIALIZE_ERROR) - } - return size + n, nil -} - -func packValueArray(cmd BufferEx, list ValueArray) (int, Error) { - size := 0 - n, err := packArrayBegin(cmd, len(list)) - if err != nil { - return n, err - } - size += n - - for i := range list { - n, err = list[i].pack(cmd) - if err != nil { - return 0, err - } - size += n - } - - return size, err -} - -func packArrayBegin(cmd BufferEx, size int) (int, Error) { - if size < 16 { - return packAByte(cmd, 0x90|byte(size)) - } else if size <= math.MaxUint16 { - return packShort(cmd, 0xdc, int16(size)) - } else { - return packInt(cmd, 0xdd, int32(size)) - } -} - -func packIfcMap(cmd BufferEx, theMap map[interface{}]interface{}) (int, Error) { - size := 0 - n, err := packMapBegin(cmd, len(theMap)) - if err != nil { - return n, err - } - size += n - - for k, v := range theMap { - n, err = packObject(cmd, k, true) - if err != nil { - return 0, err - } - size += n - n, err = packObject(cmd, v, false) - if err != nil { - return 0, err - } - size += n - } - - return size, err -} - -// PackJson packs json data -func PackJson(cmd BufferEx, theMap map[string]interface{}) (int, Error) { - return packJsonMap(cmd, theMap) -} - -func packJsonMap(cmd BufferEx, theMap map[string]interface{}) (int, Error) { - size := 0 - n, err := packMapBegin(cmd, len(theMap)) - if err != nil { - return n, err - } - size += n - - for k, v := range theMap { - n, err = packString(cmd, k) - if err != nil { - return 0, err - } - size += n - n, err = packObject(cmd, v, false) - if err != nil { - return 0, err - } - size += n - } - - return size, err -} - -// PackMap packs any map that implements the MapIter interface -func PackMap(cmd BufferEx, theMap MapIter) (int, Error) { - return packMap(cmd, theMap) -} - -func packMap(cmd BufferEx, theMap MapIter) (int, Error) { - size := 0 - n, err := packMapBegin(cmd, theMap.Len()) - if err != nil { - return n, err - } - size += n - - n, nerr := theMap.PackMap(cmd) - if nerr != nil { - return size + n, newErrorAndWrap(nerr, types.SERIALIZE_ERROR) - } - return size + n, nil -} - -func packMapBegin(cmd BufferEx, size int) (int, Error) { - if size < 16 { - return packAByte(cmd, 0x80|byte(size)) - } else if size <= math.MaxUint16 { - return packShort(cmd, 0xde, int16(size)) - } else { - return packInt(cmd, 0xdf, int32(size)) - } -} - -// PackBytes backs a byte array -func PackBytes(cmd BufferEx, b []byte) (int, Error) { - return packBytes(cmd, b) -} - -func packBytes(cmd BufferEx, b []byte) (int, Error) { - size := 0 - n, err := packByteArrayBegin(cmd, len(b)+1) - if err != nil { - return n, err - } - size += n - - n, err = packAByte(cmd, ParticleType.BLOB) - if err != nil { - return size + n, err - } - size += n - - n, err = packByteArray(cmd, b) - if err != nil { - return size + n, err - } - size += n - - return size, nil -} - -func packByteArrayBegin(cmd BufferEx, length int) (int, Error) { - // Use string header codes for byte arrays. - return packStringBegin(cmd, length) -} - -func packObject(cmd BufferEx, obj interface{}, mapKey bool) (int, Error) { - switch v := obj.(type) { - case Value: - return v.pack(cmd) - case []Value: - return ValueArray(v).pack(cmd) - case string: - return packString(cmd, v) - case []byte: - return packBytes(cmd, obj.([]byte)) - case int8: - return packAInt(cmd, int(v)) - case uint8: - return packAInt(cmd, int(v)) - case int16: - return packAInt(cmd, int(v)) - case uint16: - return packAInt(cmd, int(v)) - case int32: - return packAInt(cmd, int(v)) - case uint32: - return packAInt(cmd, int(v)) - case int: - if Buffer.Arch32Bits { - return packAInt(cmd, v) - } - return packAInt64(cmd, int64(v)) - case uint: - if Buffer.Arch32Bits { - return packAInt(cmd, int(v)) - } - return packAUInt64(cmd, uint64(v)) - case int64: - return packAInt64(cmd, v) - case uint64: - return packAUInt64(cmd, v) - case time.Time: - return packAInt64(cmd, v.UnixNano()) - case nil: - return packNil(cmd) - case bool: - return packBool(cmd, v) - case float32: - return packFloat32(cmd, v) - case float64: - return packFloat64(cmd, v) - case struct{}: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) - } - return packIfcMap(cmd, map[interface{}]interface{}{}) - case []interface{}: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) - } - return packIfcList(cmd, v) - case map[interface{}]interface{}: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) - } - return packIfcMap(cmd, v) - case ListIter: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) - } - return packList(cmd, obj.(ListIter)) - case MapIter: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", v)) - } - return packMap(cmd, obj.(MapIter)) - } - - // try to see if the object is convertible to a concrete value. - // This will be faster and much more memory efficient than reflection. - if v := tryConcreteValue(obj); v != nil { - return v.pack(cmd) - } - - if packObjectReflect != nil { - return packObjectReflect(cmd, obj, mapKey) - } - - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Type `%v (%s)` not supported to pack. ", obj, reflect.TypeOf(obj).String())) -} - -func packAUInt64(cmd BufferEx, val uint64) (int, Error) { - return packUInt64(cmd, val) -} - -func packAInt64(cmd BufferEx, val int64) (int, Error) { - if val >= 0 { - if val < 128 { - return packAByte(cmd, byte(val)) - } - - if val <= math.MaxUint8 { - return packByte(cmd, 0xcc, byte(val)) - } - - if val <= math.MaxUint16 { - return packShort(cmd, 0xcd, int16(val)) - } - - if val <= math.MaxUint32 { - return packInt(cmd, 0xce, int32(val)) - } - return packInt64(cmd, 0xd3, val) - } - - if val >= -32 { - return packAByte(cmd, 0xe0|(byte(val)+32)) - } - - if val >= math.MinInt8 { - return packByte(cmd, 0xd0, byte(val)) - } - - if val >= math.MinInt16 { - return packShort(cmd, 0xd1, int16(val)) - } - - if val >= math.MinInt32 { - return packInt(cmd, 0xd2, int32(val)) - } - return packInt64(cmd, 0xd3, val) -} - -// PackInt64 packs an int64 -func PackInt64(cmd BufferEx, val int64) (int, Error) { - return packAInt64(cmd, val) -} - -func packAInt(cmd BufferEx, val int) (int, Error) { - return packAInt64(cmd, int64(val)) -} - -// PackString packs a string -func PackString(cmd BufferEx, val string) (int, Error) { - return packString(cmd, val) -} - -func packStringBegin(cmd BufferEx, size int) (int, Error) { - if size < 32 { - return packAByte(cmd, 0xa0|byte(size)) - } else if size < 256 { - return packByte(cmd, 0xd9, byte(size)) - } else if size < 65536 { - return packShort(cmd, 0xda, int16(size)) - } - return packInt(cmd, 0xdb, int32(size)) -} - -func packString(cmd BufferEx, val string) (int, Error) { - size := 0 - slen := len(val) + 1 - n, err := packStringBegin(cmd, slen) - if err != nil { - return n, err - } - size += n - - if cmd != nil { - cmd.WriteByte(byte(ParticleType.STRING)) - size++ - - n, err = cmd.WriteString(val) - if err != nil { - return size + n, err - } - size += n - } else { - size += 1 + len(val) - } - - return size, nil -} - -func packRawString(cmd BufferEx, val string) (int, Error) { - size := 0 - slen := len(val) - n, err := packStringBegin(cmd, slen) - if err != nil { - return n, err - } - size += n - - if cmd != nil { - n, err = cmd.WriteString(val) - if err != nil { - return size + n, err - } - size += n - } else { - size += len(val) - } - - return size, nil -} - -func packGeoJson(cmd BufferEx, val string) (int, Error) { - size := 0 - slen := len(val) + 1 - n, err := packByteArrayBegin(cmd, slen) - if err != nil { - return n, err - } - size += n - - if cmd != nil { - cmd.WriteByte(byte(ParticleType.GEOJSON)) - size++ - - n, err = cmd.WriteString(val) - if err != nil { - return size + n, err - } - size += n - } else { - size += 1 + len(val) - } - - return size, nil -} - -func packByteArray(cmd BufferEx, src []byte) (int, Error) { - if cmd != nil { - return cmd.Write(src) - } - return len(src), nil -} - -func packInt64(cmd BufferEx, valType int, val int64) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(valType)) - cmd.WriteInt64(val) - } - return 1 + 8, nil -} - -// PackUInt64 packs a uint64 -func PackUInt64(cmd BufferEx, val uint64) (int, Error) { - return packUInt64(cmd, val) -} - -func packUInt64(cmd BufferEx, val uint64) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(0xcf)) - cmd.WriteInt64(int64(val)) - } - return 1 + 8, nil -} - -func packInt(cmd BufferEx, valType int, val int32) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(valType)) - cmd.WriteInt32(val) - } - return 1 + 4, nil -} - -func packShort(cmd BufferEx, valType int, val int16) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(valType)) - cmd.WriteInt16(val) - } - return 1 + 2, nil -} - -// This method is not compatible with MsgPack specs and is only used by aerospike client<->server -// for wire transfer only -func packShortRaw(cmd BufferEx, val int16) (int, Error) { - if cmd != nil { - cmd.WriteInt16(val) - } - return 2, nil -} - -func packInfinity(cmd BufferEx) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(0xd4)) - cmd.WriteByte(0xff) - cmd.WriteByte(0x01) - } - return 3, nil -} - -func packWildCard(cmd BufferEx) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(0xd4)) - cmd.WriteByte(0xff) - cmd.WriteByte(0x00) - } - return 3, nil -} - -func packByte(cmd BufferEx, valType int, val byte) (int, Error) { - if cmd != nil { - cmd.WriteByte(byte(valType)) - cmd.WriteByte(val) - } - return 1 + 1, nil -} - -// PackNil packs a nil value -func PackNil(cmd BufferEx) (int, Error) { - return packNil(cmd) -} - -func packNil(cmd BufferEx) (int, Error) { - if cmd != nil { - cmd.WriteByte(0xc0) - } - return 1, nil -} - -// PackBool packs a bool value -func PackBool(cmd BufferEx, val bool) (int, Error) { - return packBool(cmd, val) -} - -func packBool(cmd BufferEx, val bool) (int, Error) { - if cmd != nil { - if val { - cmd.WriteByte(0xc3) - } else { - cmd.WriteByte(0xc2) - } - } - return 1, nil -} - -// PackFloat32 packs float32 value -func PackFloat32(cmd BufferEx, val float32) (int, Error) { - return packFloat32(cmd, val) -} - -func packFloat32(cmd BufferEx, val float32) (int, Error) { - if cmd != nil { - cmd.WriteByte(0xca) - cmd.WriteFloat32(val) - } - return 1 + 4, nil -} - -// PackFloat64 packs float64 value -func PackFloat64(cmd BufferEx, val float64) (int, Error) { - return packFloat64(cmd, val) -} - -func packFloat64(cmd BufferEx, val float64) (int, Error) { - if cmd != nil { - cmd.WriteByte(0xcb) - cmd.WriteFloat64(val) - } - return 1 + 8, nil -} - -func packAByte(cmd BufferEx, val byte) (int, Error) { - if cmd != nil { - cmd.WriteByte(val) - } - return 1, nil -} - -/*************************************************************************** - - packer - -***************************************************************************/ - -// packer implements a buffered packer -type packer struct { - bytes.Buffer - tempBuffer [8]byte -} - -func newPacker() *packer { - return &packer{} -} - -// WriteInt64 writes an int64 to the buffer -func (vb *packer) WriteInt64(num int64) int { - return vb.WriteUint64(uint64(num)) -} - -// WriteUint64 writes an uint64 to the buffer -func (vb *packer) WriteUint64(num uint64) int { - binary.BigEndian.PutUint64(vb.tempBuffer[:8], num) - n, _ := vb.Write(vb.tempBuffer[:8]) - return n -} - -// WriteInt32 writes an int32 to the buffer -func (vb *packer) WriteInt32(num int32) int { - return vb.WriteUint32(uint32(num)) -} - -// WriteUint32 writes an uint32 to the buffer -func (vb *packer) WriteUint32(num uint32) int { - binary.BigEndian.PutUint32(vb.tempBuffer[:4], num) - n, _ := vb.Write(vb.tempBuffer[:4]) - return n -} - -// WriteInt16 writes an int16 to the buffer -func (vb *packer) WriteInt16(num int16) int { - return vb.WriteUint16(uint16(num)) -} - -// WriteUint16 writes an uint16 to the buffer -func (vb *packer) WriteUint16(num uint16) int { - binary.BigEndian.PutUint16(vb.tempBuffer[:2], num) - n, _ := vb.Write(vb.tempBuffer[:2]) - return n -} - -// WriteFloat32 writes an float32 to the buffer -func (vb *packer) WriteFloat32(float float32) int { - bits := math.Float32bits(float) - binary.BigEndian.PutUint32(vb.tempBuffer[:4], bits) - n, _ := vb.Write(vb.tempBuffer[:4]) - return n -} - -// WriteFloat64 writes an float64 to the buffer -func (vb *packer) WriteFloat64(float float64) int { - bits := math.Float64bits(float) - binary.BigEndian.PutUint64(vb.tempBuffer[:8], bits) - n, _ := vb.Write(vb.tempBuffer[:8]) - return n -} - -// WriteBool writes a bool to the buffer -func (vb *packer) WriteBool(b bool) int { - if b { - vb.WriteByte(1) - } else { - vb.WriteByte(0) - } - return 1 -} - -// WriteBytes writes a byte to the buffer -func (vb *packer) WriteByte(b byte) { - vb.Write([]byte{b}) -} - -// Write writes a byte slice to the buffer -func (vb *packer) Write(b []byte) (int, Error) { - n, err := vb.Buffer.Write(b) - if err != nil { - return n, newCommonError(err) - } - return n, nil -} - -// WriteString writes a string to the buffer -func (vb *packer) WriteString(s string) (int, Error) { - n, err := vb.Buffer.WriteString(s) - if err != nil { - return n, newCommonError(err) - } - return n, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go b/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go deleted file mode 100644 index 5898cad4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/packer_reflect.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -func init() { - packObjectReflect = concretePackObjectReflect -} - -func concretePackObjectReflect(cmd BufferEx, obj interface{}, mapKey bool) (int, Error) { - // check for array and map - rv := reflect.ValueOf(obj) - switch reflect.TypeOf(obj).Kind() { - case reflect.Array, reflect.Slice: - if mapKey && reflect.TypeOf(obj).Kind() == reflect.Slice { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", obj)) - } - // pack bounded array of bytes differently - if reflect.TypeOf(obj).Kind() == reflect.Array && reflect.TypeOf(obj).Elem().Kind() == reflect.Uint8 { - l := rv.Len() - arr := make([]byte, l) - for i := 0; i < l; i++ { - arr[i] = rv.Index(i).Interface().(uint8) - } - return packBytes(cmd, arr) - } - - l := rv.Len() - arr := make([]interface{}, l) - for i := 0; i < l; i++ { - arr[i] = rv.Index(i).Interface() - } - return packIfcList(cmd, arr) - case reflect.Map: - if mapKey { - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Maps, Slices, and bounded arrays other than Bounded Byte Arrays are not supported as Map keys. Value: %#v", obj)) - } - l := rv.Len() - amap := make(map[interface{}]interface{}, l) - for _, i := range rv.MapKeys() { - amap[i.Interface()] = rv.MapIndex(i).Interface() - } - return packIfcMap(cmd, amap) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return packObject(cmd, rv.Int(), false) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return packObject(cmd, rv.Uint(), false) - case reflect.Bool: - return packObject(cmd, rv.Bool(), false) - case reflect.String: - return packObject(cmd, rv.String(), false) - case reflect.Float32, reflect.Float64: - return packObject(cmd, rv.Float(), false) - } - - return 0, newError(types.SERIALIZE_ERROR, fmt.Sprintf("Type `%#v` not supported to pack.", obj)) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/packing_test.go b/aerospike-tls/vendor-aerospike-client-go/packing_test.go deleted file mode 100644 index fd485d7c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/packing_test.go +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// import ( -// "math" -// "strings" - -// gg "github.com/onsi/ginkgo/v2" -// gm "github.com/onsi/gomega" -// ) - -// func testPackingFor(v interface{}) interface{} { -// packer := newPacker() - -// err := packer.PackObject(v) -// gm.Expect(err).ToNot(gm.HaveOccurred()) - -// unpacker := newUnpacker(packer.buffer.Bytes(), 0, len(packer.buffer.Bytes())) -// unpackedValue, err := unpacker.unpackObject(false) -// gm.Expect(err).ToNot(gm.HaveOccurred()) - -// return unpackedValue -// } - -// var _ = gg.Describe("Packing Test", func() { - -// gg.Context("Simple Value Types", func() { - -// gg.It("should pack and unpack nil values", func() { -// gm.Expect(testPackingFor(nil)).To(gm.BeNil()) -// }) - -// gg.It("should pack and unpack -32 < int8 < 32 values", func() { -// v := int8(31) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) - -// v = int8(-32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack int8 values", func() { -// v := int8(math.MaxInt8) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) - -// v = int8(math.MinInt8) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack uint8 values", func() { -// v := uint8(math.MaxUint8) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack int16 values", func() { -// v := int16(math.MaxInt16) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) - -// v = int16(math.MinInt16) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack uint16 values", func() { -// v := uint16(math.MaxUint16) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack int32 values", func() { -// v := int32(math.MaxInt32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) - -// v = int32(math.MinInt32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack uint32 values", func() { -// v := uint32(math.MaxUint32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack int64 values", func() { -// v := int64(math.MaxInt64) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) - -// v = int64(math.MinInt64) -// gm.Expect(testPackingFor(v)).To(gm.Equal(int(v))) -// }) - -// gg.It("should pack and unpack uint64 values", func() { -// v := uint64(math.MaxUint64) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack string values", func() { -// v := "string123456789\n" -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack string values of size 32911 for sign bit check", func() { -// v := strings.Repeat("s", 32911) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack boolean: true values", func() { -// v := true -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack boolean: false values", func() { -// v := false -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack float32 values", func() { -// v := float32(math.MaxFloat32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) - -// v = float32(-math.MaxFloat32) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) - -// gg.It("should pack and unpack float64 values", func() { -// v := float64(math.MaxFloat64) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) - -// v = float64(-math.MaxFloat64) -// gm.Expect(testPackingFor(v)).To(gm.Equal(v)) -// }) -// }) - -// gg.Context("Array Value Types", func() { - -// gg.It("should pack and unpack empty array of int8", func() { -// v := []int8{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of int8", func() { -// v := []int8{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of uint8", func() { -// // Note: An array of uint8 ends up as being a ByteArrayValue -// v := []uint8{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]byte{})) -// }) - -// gg.It("should pack and unpack an array of uint8", func() { -// // Note: An array of uint8 ends up as being a ByteArrayValue -// v := []uint8{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]byte{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of int16", func() { -// v := []int16{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of int16", func() { -// v := []int16{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of uint16", func() { -// v := []uint16{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of uint16", func() { -// v := []uint16{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of int32", func() { -// v := []int32{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of int32", func() { -// v := []int32{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of uint32", func() { -// v := []uint32{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of uint32", func() { -// v := []uint32{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of int64", func() { -// v := []int64{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of int64", func() { -// v := []int64{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{1, 2, 3})) -// }) - -// gg.It("should pack and unpack empty array of uint64", func() { -// v := []uint64{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of uint64", func() { -// v := []uint64{1, 2, 3} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{uint64(1), uint64(2), uint64(3)})) -// }) - -// gg.It("should pack and unpack empty array of string", func() { -// v := []string{} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{})) -// }) - -// gg.It("should pack and unpack an array of string", func() { -// v := []string{"this", "is", "an", "array", "of", "strings", strings.Repeat("s", 32911)} -// gm.Expect(testPackingFor(v)).To(gm.Equal([]interface{}{"this", "is", "an", "array", "of", "strings", strings.Repeat("s", 32911)})) -// }) - -// }) - -// gg.Context("Map Value Types", func() { - -// gg.It("should pack and unpack empty map", func() { -// v := map[interface{}]interface{}{} -// gm.Expect(testPackingFor(v)).To(gm.Equal(map[interface{}]interface{}{})) -// }) - -// gg.It("should pack and unpack a complex map", func() { -// v := map[interface{}]interface{}{ -// "uint8": uint8(math.MaxUint8), -// "int8": int8(math.MaxInt8), -// "mint8": int8(math.MinInt8), -// "uint16": uint16(math.MaxUint16), -// "int16": int16(math.MaxInt16), -// "mint16": int16(math.MinInt16), -// "uint32": uint32(math.MaxUint32), -// "int32": int32(math.MaxInt32), -// "mint32": int32(math.MinInt32), -// "uint": uint64(math.MaxUint64), -// "int": int64(math.MaxInt64), -// "mint": int64(math.MinInt64), -// "uint64": uint64(math.MaxUint64), -// "int64": int64(math.MaxInt64), -// "mint64": int64(math.MinInt64), -// "maxFloat32": float32(math.MaxFloat32), -// "minFloat32": float32(-math.MaxFloat32), -// "maxFloat64": float64(math.MaxFloat64), -// "minFloat64": float64(-math.MaxFloat64), -// "str": "this is a string", -// "strbitsign": strings.Repeat("s", 32911), -// "nil": nil, -// "true": true, -// "false": false, -// } - -// vRes := map[interface{}]interface{}{ -// "uint8": int(math.MaxUint8), -// "int8": int(math.MaxInt8), -// "mint8": int(math.MinInt8), -// "uint16": int(math.MaxUint16), -// "int16": int(math.MaxInt16), -// "mint16": int(math.MinInt16), -// "uint32": int(math.MaxUint32), -// "int32": int(math.MaxInt32), -// "mint32": int(math.MinInt32), -// "uint": uint64(math.MaxUint64), -// "int": int(math.MaxInt64), -// "mint": int(math.MinInt64), -// "uint64": uint64(math.MaxUint64), -// "int64": int(math.MaxInt64), -// "mint64": int(math.MinInt64), -// "maxFloat32": float32(math.MaxFloat32), -// "minFloat32": float32(-math.MaxFloat32), -// "maxFloat64": float64(math.MaxFloat64), -// "minFloat64": float64(-math.MaxFloat64), -// "str": "this is a string", -// "strbitsign": strings.Repeat("s", 32911), -// "nil": nil, -// "true": true, -// "false": false, -// } - -// gm.Expect(testPackingFor(v)).To(gm.Equal(vRes)) -// }) - -// gg.It("should pack and unpack map with varying key types", func() { -// // Test Values -// vUint8 := map[uint8]interface{}{ -// uint8(math.MaxUint8): "v", -// } - -// vInt8 := map[int8]interface{}{ -// int8(math.MaxInt8): "v", -// } - -// vUint16 := map[uint16]interface{}{ -// uint16(math.MaxUint16): "v", -// } - -// vInt16 := map[int16]interface{}{ -// int16(math.MaxInt16): "v", -// } - -// vUint32 := map[uint32]interface{}{ -// uint32(math.MaxUint32): "v", -// } - -// vInt32 := map[int32]interface{}{ -// int32(math.MaxInt32): "v", -// } - -// vUint64 := map[uint64]interface{}{ -// uint64(math.MaxUint64): "v", -// } - -// vInt64 := map[int64]interface{}{ -// int64(math.MaxInt64): "v", -// } - -// vFloat32 := map[float32]interface{}{ -// float32(math.MaxFloat32): "v", -// } - -// vFloat64 := map[float64]interface{}{ -// float64(math.MaxFloat64): "v", -// } - -// vStr := map[string]interface{}{ -// "string key": "v", -// } - -// // gm.Expected Values -// retUint8 := map[interface{}]interface{}{ -// int(math.MaxUint8): "v", -// } - -// retInt8 := map[interface{}]interface{}{ -// int(math.MaxInt8): "v", -// } - -// retUint16 := map[interface{}]interface{}{ -// int(math.MaxUint16): "v", -// } - -// retInt16 := map[interface{}]interface{}{ -// int(math.MaxInt16): "v", -// } - -// retUint32 := map[interface{}]interface{}{ -// int(math.MaxUint32): "v", -// } - -// retInt32 := map[interface{}]interface{}{ -// int(math.MaxInt32): "v", -// } - -// retUint64 := map[interface{}]interface{}{ -// uint64(math.MaxUint64): "v", -// } - -// retInt64 := map[interface{}]interface{}{ -// int(math.MaxInt64): "v", -// } - -// retFloat32 := map[interface{}]interface{}{ -// float32(math.MaxFloat32): "v", -// } - -// retFloat64 := map[interface{}]interface{}{ -// float64(math.MaxFloat64): "v", -// } - -// retStr := map[interface{}]interface{}{ -// "string key": "v", -// } - -// gm.Expect(testPackingFor(vUint8)).To(gm.Equal(retUint8)) -// gm.Expect(testPackingFor(vInt8)).To(gm.Equal(retInt8)) -// gm.Expect(testPackingFor(vUint16)).To(gm.Equal(retUint16)) -// gm.Expect(testPackingFor(vInt16)).To(gm.Equal(retInt16)) -// gm.Expect(testPackingFor(vUint32)).To(gm.Equal(retUint32)) -// gm.Expect(testPackingFor(vInt32)).To(gm.Equal(retInt32)) -// gm.Expect(testPackingFor(vUint64)).To(gm.Equal(retUint64)) -// gm.Expect(testPackingFor(vInt64)).To(gm.Equal(retInt64)) -// gm.Expect(testPackingFor(vFloat32)).To(gm.Equal(retFloat32)) -// gm.Expect(testPackingFor(vFloat64)).To(gm.Equal(retFloat64)) -// gm.Expect(testPackingFor(vStr)).To(gm.Equal(retStr)) -// }) -// }) -// }) diff --git a/aerospike-tls/vendor-aerospike-client-go/partition.go b/aerospike-tls/vendor-aerospike-client-go/partition.go deleted file mode 100644 index 38b63633..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partition.go +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Partition encapsulates partition information. -type Partition struct { - // Namespace of the partition - Namespace string - // PartitionId of the partition - PartitionId int - partitions *Partitions - replica ReplicaPolicy - prevNode *Node - sequence int - linearize bool -} - -// NewPartition returns a partition representation -func NewPartition(partitions *Partitions, key *Key, replica ReplicaPolicy, prevNode *Node, linearize bool) *Partition { - return &Partition{ - partitions: partitions, - Namespace: key.Namespace(), - replica: replica, - prevNode: prevNode, - linearize: linearize, - PartitionId: key.PartitionId(), - } -} - -// NewPartitionForReplicaPolicy returns a partition for the stated replica policy -func NewPartitionForReplicaPolicy(namespace string, replica ReplicaPolicy) *Partition { - return &Partition{ - Namespace: namespace, - replica: replica, - linearize: false, - } -} - -// PartitionForWrite returns a partition for write purposes -func PartitionForWrite(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, Error) { - // Must copy hashmap reference for copy on write semantics to work. - pmap := cluster.getPartitions() - partitions := pmap[key.namespace] - - if partitions == nil { - return nil, newInvalidNamespaceError(key.namespace, len(pmap)) - } - - return NewPartition(partitions, key, policy.ReplicaPolicy, nil, false), nil -} - -// PartitionForRead returns a partition for read purposes -func PartitionForRead(cluster *Cluster, policy *BasePolicy, key *Key) (*Partition, Error) { - // Must copy hashmap reference for copy on write semantics to work. - pmap := cluster.getPartitions() - partitions := pmap[key.namespace] - - if partitions == nil { - return nil, newInvalidNamespaceError(key.namespace, len(pmap)) - } - - var replica ReplicaPolicy - var linearize bool - - if partitions.SCMode { - switch policy.ReadModeSC { - case ReadModeSCSession: - replica = MASTER - linearize = false - - case ReadModeSCLinearize: - replica = policy.ReplicaPolicy - if policy.ReplicaPolicy == PREFER_RACK { - replica = SEQUENCE - } - linearize = true - - default: - replica = policy.ReplicaPolicy - linearize = false - } - } else { - replica = policy.ReplicaPolicy - linearize = false - } - return NewPartition(partitions, key, replica, nil, linearize), nil -} - -// GetReplicaPolicySC returns a ReplicaPolicy based on different variables in SC mode -func GetReplicaPolicySC(policy *BasePolicy) ReplicaPolicy { - switch policy.ReadModeSC { - case ReadModeSCSession: - return MASTER - - case ReadModeSCLinearize: - if policy.ReplicaPolicy == PREFER_RACK { - return SEQUENCE - } - return policy.ReplicaPolicy - - default: - return policy.ReplicaPolicy - } -} - -// GetNodeBatchRead returns a node for batch reads -func GetNodeBatchRead(cluster *Cluster, key *Key, replica ReplicaPolicy, replicaSC ReplicaPolicy, prevNode *Node, sequence int, sequenceSC int) (*Node, Error) { - // Must copy hashmap reference for copy on write semantics to work. - pmap := cluster.getPartitions() - partitions := pmap[key.namespace] - - if partitions == nil { - return nil, newInvalidNamespaceError(key.namespace, len(pmap)) - } - - if partitions.SCMode { - replica = replicaSC - sequence = sequenceSC - } - - p := NewPartition(partitions, key, replica, prevNode, false) - p.sequence = sequence - return p.GetNodeRead(cluster) -} - -// GetNodeBatchWrite returns a node for batch Writes -func GetNodeBatchWrite(cluster *Cluster, key *Key, replica ReplicaPolicy, prevNode *Node, sequence int) (*Node, Error) { - // Must copy hashmap reference for copy on write semantics to work. - pmap := cluster.getPartitions() - partitions := pmap[key.namespace] - - if partitions == nil { - return nil, newInvalidNamespaceError(key.namespace, len(pmap)) - } - - p := NewPartition(partitions, key, replica, prevNode, false) - p.prevNode = prevNode - p.sequence = sequence - return p.GetNodeWrite(cluster) -} - -// GetNodeRead returns a node for read operations -func (ptn *Partition) GetNodeRead(cluster *Cluster) (*Node, Error) { - switch ptn.replica { - default: - fallthrough - case SEQUENCE: - return ptn.getSequenceNode(cluster) - - case PREFER_RACK: - return ptn.getRackNode(cluster) - - case MASTER: - return ptn.getMasterNode(cluster) - - case MASTER_PROLES: - return ptn.getMasterProlesNode(cluster) - - case RANDOM: - return cluster.GetRandomNode() - } -} - -// GetNodeWrite returns a node for write operations -func (ptn *Partition) GetNodeWrite(cluster *Cluster) (*Node, Error) { - switch ptn.replica { - default: - fallthrough - case SEQUENCE: - fallthrough - case PREFER_RACK: - return ptn.getSequenceNode(cluster) - - case MASTER: - fallthrough - case MASTER_PROLES: - fallthrough - case RANDOM: - return ptn.getMasterNode(cluster) - } -} - -func (ptn *Partition) GetNodeQuery(cluster *Cluster, partitions *Partitions, ps *PartitionStatus) (*Node, Error) { - ptn.partitions = partitions - ptn.PartitionId = ps.Id - ptn.sequence = ps.sequence - ptn.prevNode = ps.node - - node, err := ptn.GetNodeRead(cluster) - if err != nil { - return nil, err - } - - ps.node = node - ps.sequence = ptn.sequence - ps.Retry = false - - return node, nil -} - -// PrepareRetryRead increases sequence number before read retries -func (ptn *Partition) PrepareRetryRead(isClientTimeout bool) { - if !isClientTimeout || !ptn.linearize { - ptn.sequence++ - } -} - -// PrepareRetryWrite increases sequence number before write retries -func (ptn *Partition) PrepareRetryWrite(isClientTimeout bool) { - if !isClientTimeout { - ptn.sequence++ - } -} - -func (ptn *Partition) getSequenceNode(cluster *Cluster) (*Node, Error) { - replicas := ptn.partitions.Replicas - - for range replicas { - index := ptn.sequence % len(replicas) - node := replicas[index][ptn.PartitionId] - - if node != nil && node.IsActive() { - return node, nil - } - ptn.sequence++ - } - nodeArray := cluster.GetNodes() - return nil, newInvalidNodeError(len(nodeArray), ptn) -} - -func (ptn *Partition) getRackNode(cluster *Cluster) (*Node, Error) { - replicas := ptn.partitions.Replicas - - // Try to find a node on the same rack first: - for _, rackId := range cluster.clientPolicy.RackIds { - seq := ptn.sequence - for range replicas { - index := seq % len(replicas) - node := replicas[index][ptn.PartitionId] - - if node != nil && node != ptn.prevNode && node.hasRack(ptn.Namespace, rackId) && node.IsActive() { - ptn.prevNode = node - ptn.sequence = seq + 1 // start from the next node and save a comparison - return node, nil - } - seq++ - } - } - - // A node on the same Rack was not found, so try other options. - // Same node as the previous will be the last option, - // since it is the least desirable. - for range replicas { - index := ptn.sequence % len(replicas) - node := replicas[index][ptn.PartitionId] - - if node != nil && node.IsActive() { - ptn.prevNode = node - return node, nil - } - ptn.sequence++ - } - - nodeArray := cluster.GetNodes() - return nil, newInvalidNodeError(len(nodeArray), ptn) -} - -func (ptn *Partition) getMasterNode(cluster *Cluster) (*Node, Error) { - node := ptn.partitions.Replicas[0][ptn.PartitionId] - - if node != nil && node.IsActive() { - return node, nil - } - nodeArray := cluster.GetNodes() - return nil, newInvalidNodeError(len(nodeArray), ptn) -} - -func (ptn *Partition) getMasterProlesNode(cluster *Cluster) (*Node, Error) { - replicas := ptn.partitions.Replicas - - for range replicas { - index := cluster.replicaIndex.IncrementAndGet() % len(replicas) - node := replicas[index][ptn.PartitionId] - - if node != nil && node.IsActive() { - return node, nil - } - } - nodeArray := cluster.GetNodes() - return nil, newInvalidNodeError(len(nodeArray), ptn) -} - -// String implements the Stringer interface. -func (ptn *Partition) String() string { - return fmt.Sprintf("%s:%d", ptn.Namespace, ptn.PartitionId) -} - -// Equals checks equality of two partitions. -func (ptn *Partition) Equals(other *Partition) bool { - return ptn.PartitionId == other.PartitionId && ptn.Namespace == other.Namespace -} - -// newnewInvalidNamespaceError creates an AerospikeError with Resultcode INVALID_NAMESPACE -// and a corresponding message. -func newInvalidNamespaceError(ns string, mapSize int) Error { - s := "Partition map empty" - if mapSize != 0 { - s = "Namespace not found in partition map: " + ns - } - return newError(types.INVALID_NAMESPACE, s) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_filter.go b/aerospike-tls/vendor-aerospike-client-go/partition_filter.go deleted file mode 100644 index 5dd37755..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partition_filter.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import ( - "bytes" - "encoding/gob" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// PartitionFilter is used in scan/queries. This filter is also used as a cursor. -// -// If a previous scan/query returned all records specified by a PartitionFilter instance, a -// future scan/query using the same PartitionFilter instance will only return new records added -// after the last record read (in digest order) in each partition in the previous scan/query. -type PartitionFilter struct { - Begin int - Count int - Digest []byte - // Partitions encapsulates the cursor for the progress of the scan/query to be used for pagination. - Partitions []*PartitionStatus - Done bool - Retry bool -} - -// NewPartitionFilterAll creates a partition filter that -// reads all the partitions. -func NewPartitionFilterAll() *PartitionFilter { - return newPartitionFilter(0, _PARTITIONS) -} - -// NewPartitionFilterById creates a partition filter by partition id. -// Partition id is between 0 - 4095 -func NewPartitionFilterById(partitionId int) *PartitionFilter { - return newPartitionFilter(partitionId, 1) -} - -// NewPartitionFilterByRange creates a partition filter by partition range. -// begin partition id is between 0 - 4095 -// count is the number of partitions, in the range of 1 - 4096 inclusive. -func NewPartitionFilterByRange(begin, count int) *PartitionFilter { - return newPartitionFilter(begin, count) -} - -// NewPartitionFilterByKey returns records after the key's digest in the partition containing the digest. -// Records in all other partitions are not included. The digest is used to determine -// order and this is not the same as userKey order. -// -// This method only works for scan or query with nil filter (primary index query). -// This method does not work for a secondary index query because the digest alone -// is not sufficient to determine a cursor in a secondary index query. -func NewPartitionFilterByKey(key *Key) *PartitionFilter { - return &PartitionFilter{Begin: key.PartitionId(), Count: 1, Digest: key.Digest()} -} - -func newPartitionFilter(begin, count int) *PartitionFilter { - return &PartitionFilter{Begin: begin, Count: count} -} - -// IsDone returns - if using ScanPolicy.MaxRecords or QueryPolicy,MaxRecords - -// if the previous paginated scans with this partition filter instance return all records? -// This method is not synchronized and is not meant to be called while the Scan/Query is -// ongoing. It should be called after all the records are received from the recordset. -func (pf *PartitionFilter) IsDone() bool { - return pf.Done -} - -// EncodeCursor encodes and returns the cursor for the partition filter. -// This cursor can be persisted and reused later for pagination via PartitionFilter.DecodeCursor. -func (pf *PartitionFilter) EncodeCursor() ([]byte, Error) { - var buf bytes.Buffer - enc := gob.NewEncoder(&buf) - err := enc.Encode(pf.Partitions) - if err != nil { - return nil, newError(types.PARAMETER_ERROR, err.Error()) - } - - return buf.Bytes(), nil -} - -// Decodes and sets the cursor for the partition filter using the output of PartitionFilter.EncodeCursor. -func (pf *PartitionFilter) DecodeCursor(b []byte) Error { - buf := bytes.NewBuffer(b) - dec := gob.NewDecoder(buf) - - var parts []*PartitionStatus - if err := dec.Decode(&parts); err != nil { - return newError(types.PARSE_ERROR, err.Error()) - } - - pf.Partitions = parts - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_parser.go b/aerospike-tls/vendor-aerospike-client-go/partition_parser.go deleted file mode 100644 index 7d769ffc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partition_parser.go +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -import ( - "encoding/base64" - "fmt" - "strconv" - "sync" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const ( - _PartitionGeneration = "partition-generation" - _Replicas = "replicas" -) - -var partitionMapLock sync.Mutex - -// Parse node's master (and optionally prole) partitions. -type partitionParser struct { - pmap partitionMap - buffer []byte - partitionCount int - generation int - length int - offset int - - regimeError bool -} - -func newPartitionParser(node *Node, partitions partitionMap, partitionCount int) (*partitionParser, Error) { - newPartitionParser := &partitionParser{ - partitionCount: partitionCount, - } - - // Send format 1: partition-generation\nreplicas\n - // Send format 2: partition-generation\nreplicas-all\n - command := _Replicas - - info, err := node.requestRawInfo(&node.cluster.infoPolicy, _PartitionGeneration, command) - if err != nil { - return nil, err - } - - newPartitionParser.buffer = info.msg.Data - newPartitionParser.length = len(info.msg.Data) - if newPartitionParser.length == 0 { - return nil, newError(types.PARSE_ERROR, "Partition info is empty") - } - - newPartitionParser.generation, err = newPartitionParser.parseGeneration() - if err != nil { - return nil, err - } - - newPartitionParser.pmap = partitions - - partitionMapLock.Lock() - defer partitionMapLock.Unlock() - - err = newPartitionParser.parseReplicasAll(node, command) - if err != nil { - return nil, err - } - - return newPartitionParser, nil -} - -func (pp *partitionParser) getGeneration() int { - return pp.generation -} - -func (pp *partitionParser) parseGeneration() (int, Error) { - if err := pp.expectName(_PartitionGeneration); err != nil { - return -1, err - } - - begin := pp.offset - for pp.offset < pp.length { - if pp.buffer[pp.offset] == '\n' { - s := string(pp.buffer[begin:pp.offset]) - pp.offset++ - v, err := strconv.Atoi(s) - if err != nil { - return -1, newError(types.PARSE_ERROR, "Failed to find partition-generation value") - } - return v, nil - } - pp.offset++ - } - return -1, newError(types.PARSE_ERROR, "Failed to find partition-generation value") -} - -func (pp *partitionParser) parseReplicasAll(node *Node, command string) Error { - // Use low-level info methods and parse byte array directly for maximum performance. - // Receive format: replicas-all\t - // :[regime],,,...; - // :[regime],,,...;\n - if err := pp.expectName(command); err != nil { - return err - } - - begin := pp.offset - regime := 0 - - for pp.offset < pp.length { - if pp.buffer[pp.offset] == ':' { - // Parse namespace. - namespace := string(pp.buffer[begin:pp.offset]) - - if len(namespace) <= 0 || len(namespace) >= 32 { - response := pp.getTruncatedResponse() - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid partition namespace `%s` response: `%s`", namespace, response)) - } - pp.offset++ - begin = pp.offset - - // Parse regime. - if command == _Replicas { - for pp.offset < pp.length { - b := pp.buffer[pp.offset] - - if b == ',' { - break - } - pp.offset++ - } - - var err error - regime, err = strconv.Atoi(string(pp.buffer[begin:pp.offset])) - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to parse regime value") - } - - pp.offset++ - begin = pp.offset - } - - // Parse replica count. - for pp.offset < pp.length { - b := pp.buffer[pp.offset] - - if b == ',' { - break - } - pp.offset++ - } - - replicaCount, err := strconv.Atoi(string(pp.buffer[begin:pp.offset])) - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to find replica count value") - } - - partitions := pp.pmap[namespace] - if partitions == nil { - // Create new replica array. - partitions = newPartitions(pp.partitionCount, replicaCount, regime != 0) - pp.pmap[namespace] = partitions - } else if len(partitions.Replicas) != replicaCount { - // Ensure replicaArray is correct size. - logger.Logger.Info("Namespace `%s` replication factor changed from `%d` to `%d` ", namespace, len(partitions.Replicas), replicaCount) - - partitions.setReplicaCount(replicaCount) //= clonePartitions(partitions, replicaCount) - pp.pmap[namespace] = partitions - } - - // Parse partition bitmaps. - for i := 0; i < replicaCount; i++ { - pp.offset++ - begin = pp.offset - - // Find bitmap endpoint - for pp.offset < pp.length { - b := pp.buffer[pp.offset] - - if b == ',' || b == ';' { - break - } - pp.offset++ - } - - if pp.offset == begin { - response := pp.getTruncatedResponse() - return newError(types.PARSE_ERROR, fmt.Sprintf("Empty partition id for namespace `%s` response: `%s`", namespace, response)) - } - - if err := pp.decodeBitmap(node, partitions, i, regime, begin); err != nil { - return err - } - } - pp.offset++ - begin = pp.offset - } else { - pp.offset++ - } - } - - return nil -} - -func (pp *partitionParser) decodeBitmap(node *Node, partitions *Partitions, replica int, regime int, begin int) Error { - restoreBuffer, err := base64.StdEncoding.DecodeString(string(pp.buffer[begin:pp.offset])) - if err != nil { - return newErrorAndWrap(err, types.PARSE_ERROR, "Failed to decode partition bitmap value") - } - - for partition := 0; partition < pp.partitionCount; partition++ { - nodeOld := partitions.Replicas[replica][partition] - - if (restoreBuffer[partition>>3] & (0x80 >> uint(partition&7))) != 0 { - // Node owns this partition. - regimeOld := partitions.regimes[partition] - - if regime == 0 || regime >= regimeOld { - if regime > regimeOld { - partitions.regimes[partition] = regime - } - - if nodeOld != nil && nodeOld != node { - // Force previously mapped node to refresh it's partition map on next cluster tend. - nodeOld.partitionGeneration.Set(-1) - } - - partitions.Replicas[replica][partition] = node - } else { - if !pp.regimeError { - logger.Logger.Info("%s regime(%d) < old regime(%d)", node.String(), regime, regimeOld) - pp.regimeError = true - } - } - } - } - - return nil -} - -func (pp *partitionParser) expectName(name string) Error { - begin := pp.offset - - for pp.offset < pp.length { - if pp.buffer[pp.offset] == '\t' { - s := string(pp.buffer[begin:pp.offset]) - if name == s { - pp.offset++ - return nil - } - break - } - pp.offset++ - } - - return newError(types.PARSE_ERROR, fmt.Sprintf("Failed to find `%s`", name)) -} - -func (pp *partitionParser) getTruncatedResponse() string { - max := pp.length - if max > 200 { - max = 200 - } - return string(pp.buffer[0:max]) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_status.go b/aerospike-tls/vendor-aerospike-client-go/partition_status.go deleted file mode 100644 index 7f541aa8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partition_status.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import ( - "fmt" -) - -// PartitionStatus encapsulates the pagination status in partitions. -type PartitionStatus struct { - // BVal - BVal int64 - // Id shows the partition Id. - Id int - // Retry signifies if the partition requires a retry. - Retry bool - // Digest records the digest of the last key digest received from the server - // for this partition. - Digest []byte - - // the following fields are transient - node *Node - sequence int -} - -func newPartitionStatus(id int) *PartitionStatus { - return &PartitionStatus{Id: id, Retry: true} -} - -func (ps *PartitionStatus) String() string { - r := 'F' - if ps.Retry { - r = 'T' - } - return fmt.Sprintf("%04d:%c", ps.Id, r) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go b/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go deleted file mode 100644 index 8e6f80c4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partition_tracker.go +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements WHICH ARE COMPATIBLE WITH THE APACHE LICENSE, VERSION 2.0. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import ( - "fmt" - "strings" - "time" - - atmc "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type partitionTracker struct { - partitions []*PartitionStatus - partitionsCapacity int - partitionBegin int - nodeCapacity int - nodeFilter *Node - partitionFilter *PartitionFilter - replica ReplicaPolicy - nodePartitionsList []*nodePartitions - recordCount *atmc.Int - maxRecords int64 - sleepBetweenRetries time.Duration - socketTimeout time.Duration - totalTimeout time.Duration - iteration int //= 1 - deadline time.Time -} - -func newPartitionTrackerForNodes(policy *MultiPolicy, nodes []*Node) *partitionTracker { - // Create initial partition capacity for each node as average + 25%. - ppn := _PARTITIONS / len(nodes) - ppn += ppn / 4 - - pt := partitionTracker{ - partitionBegin: 0, - nodeCapacity: len(nodes), - nodeFilter: nil, - replica: policy.ReplicaPolicy, - partitionsCapacity: ppn, - maxRecords: policy.MaxRecords, - iteration: 1, - } - - pt.partitions = pt.initPartitions(policy, _PARTITIONS, nil) - pt.init(policy) - return &pt -} - -func newPartitionTrackerForNode(policy *MultiPolicy, nodeFilter *Node) *partitionTracker { - pt := partitionTracker{ - partitionBegin: 0, - nodeCapacity: 1, - nodeFilter: nodeFilter, - replica: policy.ReplicaPolicy, - partitionsCapacity: _PARTITIONS, - maxRecords: policy.MaxRecords, - iteration: 1, - } - - pt.partitions = pt.initPartitions(policy, _PARTITIONS, nil) - pt.init(policy) - return &pt -} - -func newPartitionTracker(policy *MultiPolicy, filter *PartitionFilter, nodes []*Node) *partitionTracker { - // Validate here instead of initial PartitionFilter constructor because total number of - // cluster partitions may change on the server and PartitionFilter will never have access - // to Cluster instance. Use fixed number of partitions for now. - if !(filter.Begin >= 0 && filter.Begin < _PARTITIONS) { - panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition begin %d . Valid range: 0-%d", filter.Begin, - (_PARTITIONS-1)))) - } - - if filter.Count <= 0 { - panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition count %d", filter.Count))) - } - - if filter.Begin+filter.Count > _PARTITIONS { - panic(newError(types.PARAMETER_ERROR, fmt.Sprintf("Invalid partition range (%d,%d)", filter.Begin, filter.Begin+filter.Count))) - } - - // This is required for proxy server since there are no nodes represented there - nodeCapacity := len(nodes) - if nodeCapacity <= 0 { - nodeCapacity = 1 - } - - pt := &partitionTracker{ - partitionBegin: filter.Begin, - nodeCapacity: nodeCapacity, - nodeFilter: nil, - replica: policy.ReplicaPolicy, - partitionsCapacity: filter.Count, - maxRecords: policy.MaxRecords, - iteration: 1, - } - - if len(filter.Partitions) == 0 { - filter.Partitions = pt.initPartitions(policy, filter.Count, filter.Digest) - filter.Retry = true - } else { - // Retry all partitions when maxRecords not specified. - if policy.MaxRecords <= 0 { - filter.Retry = true - } - - // Reset replica sequence and last node used. - for _, part := range filter.Partitions { - part.sequence = 0 - part.node = nil - } - } - - pt.partitions = filter.Partitions - pt.partitionFilter = filter - pt.init(policy) - return pt -} - -func (pt *partitionTracker) init(policy *MultiPolicy) { - pt.sleepBetweenRetries = policy.SleepBetweenRetries - pt.socketTimeout = policy.SocketTimeout - pt.totalTimeout = policy.TotalTimeout - - if pt.totalTimeout > 0 { - pt.deadline = time.Now().Add(pt.totalTimeout) - if pt.socketTimeout == 0 || pt.socketTimeout > pt.totalTimeout { - pt.socketTimeout = pt.totalTimeout - } - } - - if pt.replica == RANDOM { - panic(newError(types.PARAMETER_ERROR, "Invalid replica: RANDOM")) - } -} - -func (pt *partitionTracker) initPartitions(policy *MultiPolicy, partitionCount int, digest []byte) []*PartitionStatus { - partsAll := make([]*PartitionStatus, partitionCount) - - for i := 0; i < partitionCount; i++ { - partsAll[i] = newPartitionStatus(pt.partitionBegin + i) - } - - if digest != nil { - partsAll[0].Digest = digest - } - - return partsAll -} - -func (pt *partitionTracker) SetSleepBetweenRetries(sleepBetweenRetries time.Duration) { - pt.sleepBetweenRetries = sleepBetweenRetries -} - -func (pt *partitionTracker) assignPartitionsToNodes(cluster *Cluster, namespace string) ([]*nodePartitions, Error) { - list := make([]*nodePartitions, 0, pt.nodeCapacity) - - pMap := cluster.getPartitions() - parts := pMap[namespace] - - if parts == nil { - return nil, newError(types.INVALID_NAMESPACE, fmt.Sprintf("Invalid Partition Map for namespace `%s` in Partition Scan", namespace)) - } - - p := NewPartitionForReplicaPolicy(namespace, pt.replica) - retry := (pt.partitionFilter == nil || pt.partitionFilter.Retry) && (pt.iteration == 1) - - for _, part := range pt.partitions { - if retry || part.Retry { - node, err := p.GetNodeQuery(cluster, parts, part) - if err != nil { - return nil, err - } - - // Use node name to check for single node equality because - // partition map may be in transitional state between - // the old and new node with the same name. - if pt.nodeFilter != nil && pt.nodeFilter.GetName() != node.GetName() { - continue - } - - np := pt.findNode(list, node) - - if np == nil { - // If the partition map is in a transitional state, multiple - // nodePartitions instances (each with different partitions) - // may be created for a single node. - np = newNodePartitions(node, pt.partitionsCapacity) - list = append(list, np) - } - np.addPartition(part) - } - } - - nodeSize := len(list) - if nodeSize <= 0 { - return nil, newError(types.INVALID_NODE_ERROR, "No nodes were assigned") - } - - // Set global retry to true because scan/query may terminate early and all partitions - // will need to be retried if the PartitionFilter instance is reused in a new scan/query. - // Global retry will be set to false if the scan/query completes normally and maxRecords - // is specified. - if pt.partitionFilter != nil { - pt.partitionFilter.Retry = true - } - - pt.recordCount = nil - - if pt.maxRecords > 0 { - if pt.maxRecords >= int64(nodeSize) { - // Distribute maxRecords across nodes. - max := pt.maxRecords / int64(nodeSize) - rem := pt.maxRecords - (max * int64(nodeSize)) - - for i, np := range list { - if int64(i) < rem { - np.recordMax = max + 1 - } else { - np.recordMax = max - } - } - } else { - // If maxRecords < nodeSize, the retry = true, ensure each node receives at least one max record - // allocation and filter out excess records when receiving records from the server. - for _, np := range list { - np.recordMax = 1 - } - - // Track records returned for this iteration. - pt.recordCount = atmc.NewInt(0) - } - } - - pt.nodePartitionsList = list - return list, nil -} - -func (pt *partitionTracker) findNode(list []*nodePartitions, node *Node) *nodePartitions { - for _, nodePartition := range list { - // Use pointer equality for performance. - if nodePartition.node == node { - return nodePartition - } - } - return nil -} - -func (pt *partitionTracker) partitionUnavailable(nodePartitions *nodePartitions, partitionId int) { - ps := pt.partitions[partitionId-pt.partitionBegin] - ps.Retry = true - ps.sequence++ - nodePartitions.partsUnavailable++ -} - -func (pt *partitionTracker) setDigest(nodePartitions *nodePartitions, key *Key) { - partitionId := key.PartitionId() - pt.partitions[partitionId-pt.partitionBegin].Digest = key.Digest() - - // nodePartitions is nil in Proxy client - if nodePartitions != nil { - nodePartitions.recordCount++ - } -} - -func (pt *partitionTracker) setLast(nodePartitions *nodePartitions, key *Key, bval *int64) { - partitionId := key.PartitionId() - if partitionId-pt.partitionBegin < 0 { - panic(fmt.Sprintf("Partition mismatch: key.partitionId: %d, partitionBegin: %d", partitionId, pt.partitionBegin)) - } - ps := pt.partitions[partitionId-pt.partitionBegin] - ps.Digest = key.digest[:] - if bval != nil { - ps.BVal = *bval - } - - // nodePartitions is nil in Proxy client - if nodePartitions != nil { - nodePartitions.recordCount++ - } -} - -func (pt *partitionTracker) allowRecord(np *nodePartitions) bool { - if pt.recordCount == nil || int64(pt.recordCount.AddAndGet(1)) <= pt.maxRecords { - return true - } - - // Record was returned, but would exceed maxRecords. - // Discard record and increment disallowedCount. - np.disallowedCount++ - return false -} - -func (pt *partitionTracker) isClusterComplete(cluster *Cluster, policy *BasePolicy) (bool, Error) { - return pt.isComplete(cluster.supportsPartitionQuery.Get(), policy, pt.nodePartitionsList) -} - -func (pt *partitionTracker) isComplete(hasPartitionQuery bool, policy *BasePolicy, nodePartitionsList []*nodePartitions) (bool, Error) { - recordCount := int64(0) - partsUnavailable := 0 - - for _, np := range nodePartitionsList { - recordCount += np.recordCount - partsUnavailable += np.partsUnavailable - } - - if partsUnavailable == 0 { - if pt.maxRecords <= 0 { - if pt.partitionFilter != nil { - pt.partitionFilter.Retry = false - pt.partitionFilter.Done = true - } - } else if pt.iteration > 1 { - if pt.partitionFilter != nil { - // If errors occurred on a node, only that node's partitions are retried in the - // next iteration. If that node finally succeeds, the other original nodes still - // need to be retried if partition state is reused in the next scan/query command. - // Force retry on all node partitions. - pt.partitionFilter.Retry = true - pt.partitionFilter.Done = false - } - } else { - // Cluster will be nil for the Proxy client - if hasPartitionQuery { - // Server version >= 6.0 will return all records for each node up to - // that node's max. If node's record count reached max, there still - // may be records available for that node. - done := true - - for _, np := range nodePartitionsList { - if np.recordCount+np.disallowedCount >= np.recordMax { - pt.markRetry(np) - done = false - } - } - - if pt.partitionFilter != nil { - pt.partitionFilter.Retry = false - pt.partitionFilter.Done = done - } - } else { - // Servers version < 6.0 can return less records than max and still - // have more records for each node, so the node is only done if no - // records were retrieved for that node. - for _, np := range nodePartitionsList { - if np.recordCount+np.disallowedCount > 0 { - pt.markRetry(np) - } - } - - if pt.partitionFilter != nil { - pt.partitionFilter.Retry = false - pt.partitionFilter.Done = (recordCount == 0) - } - } - } - return true, nil - } - - if pt.maxRecords > 0 && recordCount >= pt.maxRecords { - return true, nil - } - - // Check if limits have been reached. - if pt.iteration > policy.MaxRetries { - return false, newError(types.MAX_RETRIES_EXCEEDED, fmt.Sprintf("Max retries exceeded: %d", policy.MaxRetries)) - } - - if policy.TotalTimeout > 0 { - // Check for total timeout. - remaining := time.Until(pt.deadline) - pt.sleepBetweenRetries - - if remaining <= 0 { - return false, ErrTimeout.err() - } - - if remaining < pt.totalTimeout { - pt.totalTimeout = remaining - - if pt.socketTimeout > pt.totalTimeout { - pt.socketTimeout = pt.totalTimeout - } - } - } - - // Prepare for next iteration. - if pt.maxRecords > 0 { - pt.maxRecords -= recordCount - } - - pt.iteration++ - return false, nil -} - -func (pt *partitionTracker) shouldRetry(nodePartitions *nodePartitions, e Error) bool { - res := e.Matches( - types.TIMEOUT, - types.NETWORK_ERROR, - types.SERVER_NOT_AVAILABLE, - types.INDEX_NOTFOUND, - types.INDEX_NOTREADABLE, - ) - if res { - pt.markRetrySequence(nodePartitions) - nodePartitions.partsUnavailable = len(nodePartitions.partsFull) + len(nodePartitions.partsPartial) - } - return res -} - -func (pt *partitionTracker) markRetrySequence(nodePartitions *nodePartitions) { - // Mark retry for next replica. - for _, ps := range nodePartitions.partsFull { - ps.Retry = true - ps.sequence++ - } - - for _, ps := range nodePartitions.partsPartial { - ps.Retry = true - ps.sequence++ - } -} - -func (pt *partitionTracker) markRetry(nodePartitions *nodePartitions) { - // Mark retry for same replica. - for _, ps := range nodePartitions.partsFull { - ps.Retry = true - } - - for _, ps := range nodePartitions.partsPartial { - ps.Retry = true - } -} - -func (pt *partitionTracker) partitionError() { - // Mark all partitions for retry on fatal errors. - if pt.partitionFilter != nil { - pt.partitionFilter.Retry = true - } -} - -func (pt *partitionTracker) String() string { - var sb strings.Builder - for i, ps := range pt.partitions { - sb.WriteString(ps.String()) - if (i+1)%16 == 0 { - sb.WriteString("\n") - } else { - sb.WriteString("\t") - } - } - return sb.String() -} - -type nodePartitions struct { - node *Node - partsFull []*PartitionStatus - partsPartial []*PartitionStatus - recordCount int64 - recordMax int64 - disallowedCount int64 - partsUnavailable int -} - -func newNodePartitions(node *Node, capacity int) *nodePartitions { - return &nodePartitions{ - node: node, - partsFull: make([]*PartitionStatus, 0, capacity), - partsPartial: make([]*PartitionStatus, 0, capacity), - } -} - -func (np *nodePartitions) String() string { - return fmt.Sprintf("Node %s: full: %d, partial: %d", np.node.String(), len(np.partsFull), len(np.partsPartial)) -} - -func (np *nodePartitions) addPartition(part *PartitionStatus) { - if part.Digest == nil { - np.partsFull = append(np.partsFull, part) - } else { - np.partsPartial = append(np.partsPartial, part) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/partitions.go b/aerospike-tls/vendor-aerospike-client-go/partitions.go deleted file mode 100644 index 18d8b3f5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/partitions.go +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "bytes" - "fmt" - "strconv" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Partitions represents a list of partitions -type Partitions struct { - Replicas [][]*Node - SCMode bool - regimes []int -} - -func newPartitions(partitionCount int, replicaCount int, cpMode bool) *Partitions { - replicas := make([][]*Node, replicaCount) - for i := range replicas { - replicas[i] = make([]*Node, partitionCount) - } - - return &Partitions{ - Replicas: replicas, - SCMode: cpMode, - regimes: make([]int, partitionCount), - } -} - -func (p *Partitions) setReplicaCount(replicaCount int) { - if len(p.Replicas) < replicaCount { - i := len(p.Replicas) - - // Extend the size - for ; i < replicaCount; i++ { - p.Replicas = append(p.Replicas, make([]*Node, _PARTITIONS)) - } - } else { - // Reduce the size - p.Replicas = p.Replicas[:replicaCount] - } -} - -// Copy partition map while reserving space for a new replica count. -func (p *Partitions) clone() *Partitions { - replicas := make([][]*Node, len(p.Replicas)) - - for i := range p.Replicas { - r := make([]*Node, len(p.Replicas[i])) - copy(r, p.Replicas[i]) - replicas[i] = r - } - - regimes := make([]int, len(p.regimes)) - copy(regimes, p.regimes) - - return &Partitions{ - Replicas: replicas, - SCMode: p.SCMode, - regimes: regimes, - } -} - -/* - - partitionMap - -*/ - -type partitionMap map[string]*Partitions - -// cleanup removes all the references stored in the lists -// to help the GC identify the unused pointers. -func (pm partitionMap) cleanup() { - for ns, partitions := range pm { - for i := range partitions.Replicas { - for j := range partitions.Replicas[i] { - partitions.Replicas[i][j] = nil - } - partitions.Replicas[i] = nil - } - - partitions.Replicas = nil - partitions.regimes = nil - - delete(pm, ns) - } -} - -// String implements stringer interface for partitionMap -func (pm partitionMap) clone() partitionMap { - // Make deep copy of map. - pmap := make(partitionMap, len(pm)) - for ns := range pm { - pmap[ns] = pm[ns].clone() - } - return pmap -} - -// String implements stringer interface for partitionMap -func (pm partitionMap) String() string { - res := bytes.Buffer{} - for ns, partitions := range pm { - res.WriteString("-----------------------------------------------------------------------\n") - res.WriteString("Namespace: " + ns + "\n") - res.WriteString(fmt.Sprintf("Regimes: %v\n", partitions.regimes)) - res.WriteString(fmt.Sprintf("SCMode: %v\n", partitions.SCMode)) - replicaArray := partitions.Replicas - for i, nodeArray := range replicaArray { - if i == 0 { - res.WriteString("\nMASTER:") - } else { - res.WriteString(fmt.Sprintf("\nReplica %d: ", i)) - } - for partitionID, node := range nodeArray { - res.WriteString(strconv.Itoa(partitionID) + "/") - if node != nil { - res.WriteString(node.host.String()) - res.WriteString(", ") - } else { - res.WriteString("nil, ") - } - } - res.WriteString("\n") - } - } - res.WriteString("\n") - return res.String() -} - -// naively validates the partition map -func (pm partitionMap) validate() Error { - masterNodePartitionNotDefined := map[string][]int{} - replicaNodePartitionNotDefined := map[string][]int{} - var errs Error - - for nsName, partition := range pm { - if len(partition.regimes) != _PARTITIONS { - errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Wrong number of regimes for namespace `%s`. Must be %d, but found %d.", nsName, _PARTITIONS, len(partition.regimes))), errs) - } - - for replica, partitionNodes := range partition.Replicas { - if len(partitionNodes) != _PARTITIONS { - errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Wrong number of partitions for namespace `%s`, replica `%d`. Must be %d, but found %d.", nsName, replica, _PARTITIONS, len(partitionNodes))), errs) - } - - for pIndex, node := range partitionNodes { - if node == nil { - if replica == 0 { - masterNodePartitionNotDefined[nsName] = append(masterNodePartitionNotDefined[nsName], pIndex) - } else { - replicaNodePartitionNotDefined[nsName] = append(replicaNodePartitionNotDefined[nsName], pIndex) - } - } - } - } - } - - if errs != nil || len(masterNodePartitionNotDefined) > 0 || len(replicaNodePartitionNotDefined) > 0 { - for nsName, partitionList := range masterNodePartitionNotDefined { - errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Master partition nodes not defined for namespace `%s`: %d out of %d", nsName, len(partitionList), _PARTITIONS)), errs) - } - - for nsName, partitionList := range replicaNodePartitionNotDefined { - errs = chainErrors(newError(types.COMMON_ERROR, fmt.Sprintf("Replica partition nodes not defined for namespace `%s`: %d", nsName, len(partitionList))), errs) - } - - errs = chainErrors(ErrInvalidPartitionMap.err(), errs) - return errs - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/peers.go b/aerospike-tls/vendor-aerospike-client-go/peers.go deleted file mode 100644 index 1dfae9bd..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/peers.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "sync" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" -) - -type peers struct { - _peers map[string]*peer - _hosts map[Host]struct{} - _nodes map[string]*Node - refreshCount atomic.Int - genChanged atomic.Bool - - mutex sync.RWMutex -} - -func newPeers(peerCapacity int, addCapacity int) *peers { - return &peers{ - _peers: make(map[string]*peer, peerCapacity), - _hosts: make(map[Host]struct{}, addCapacity), - _nodes: make(map[string]*Node, addCapacity), - genChanged: *atomic.NewBool(true), - } -} - -func (ps *peers) hostExists(host Host) bool { - ps.mutex.RLock() - defer ps.mutex.RUnlock() - _, exists := ps._hosts[host] - return exists -} - -func (ps *peers) addHost(host Host) { - ps.mutex.Lock() - defer ps.mutex.Unlock() - ps._hosts[host] = struct{}{} -} - -func (ps *peers) addNode(name string, node *Node) { - ps.mutex.Lock() - defer ps.mutex.Unlock() - ps._nodes[name] = node -} - -func (ps *peers) nodeByName(name string) *Node { - ps.mutex.RLock() - defer ps.mutex.RUnlock() - return ps._nodes[name] -} - -func (ps *peers) appendPeers(peers []*peer) { - ps.mutex.Lock() - defer ps.mutex.Unlock() - - for _, peer := range peers { - ps._peers[peer.nodeName] = peer - } - -} - -func (ps *peers) peers() []*peer { - ps.mutex.RLock() - defer ps.mutex.RUnlock() - - res := make([]*peer, 0, len(ps._peers)) - for _, peer := range ps._peers { - res = append(res, peer) - } - return res -} - -func (ps *peers) nodes() map[string]*Node { - ps.mutex.RLock() - defer ps.mutex.RUnlock() - return ps._nodes -} - -type peer struct { - nodeName string - tlsName string - hosts []*Host -} diff --git a/aerospike-tls/vendor-aerospike-client-go/peers_parser.go b/aerospike-tls/vendor-aerospike-client-go/peers_parser.go deleted file mode 100644 index 2ef89c5d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/peers_parser.go +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - // "github.com/aerospike/aerospike-client-go/v7/logger" - - "io" - "strconv" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -var aeroerr = newError(types.PARSE_ERROR, "Error parsing peers list.") - -func parsePeers(cluster *Cluster, node *Node) (*peerListParser, Error) { - cmd := cluster.clientPolicy.peersString() - - info, err := node.RequestInfo(&cluster.infoPolicy, cmd) - if err != nil { - return nil, err - } - - peersStr, exists := info[cmd] - if !exists { - return nil, newError(types.PARSE_ERROR, "Info Command response was empty.") - } - - p := peerListParser{buf: []byte(peersStr)} - if err := p.Parse(); err != nil { - return nil, err - } - - return &p, nil -} - -type peerListParser struct { - buf []byte - pos int - - defPort *int64 - gen *int64 - peers []*peer -} - -func (p *peerListParser) generation() int64 { - if p.gen != nil { - return *p.gen - } - return 0 -} - -func (p *peerListParser) Expect(ch byte) bool { - if p.pos == len(p.buf) { - return false - } - - if p.buf[p.pos] == ch { - p.pos++ - return true - } - return false -} - -func (p *peerListParser) readByte() *byte { - if p.pos == len(p.buf) { - return nil - } - - ch := p.buf[p.pos] - p.pos++ - return &ch -} - -func (p *peerListParser) PeekByte() *byte { - if p.pos == len(p.buf) { - return nil - } - - ch := p.buf[p.pos] - return &ch -} - -func (p *peerListParser) readInt64() (*int64, Error) { - if p.pos == len(p.buf) { - return nil, newErrorAndWrap(io.EOF, types.PARSE_ERROR, "Error Parsing the peers list") - } - - if p.buf[p.pos] == ',' { - return nil, nil - } - - begin := p.pos - for p.pos < len(p.buf) { - ch := p.buf[p.pos] - if ch == ',' { - break - } - p.pos++ - } - - num, err := strconv.ParseInt(string(p.buf[begin:p.pos]), 10, 64) - if err != nil { - return nil, newErrorAndWrap(err, types.PARSE_ERROR, "Error Parsing the peers list") - } - return &num, nil -} - -func (p *peerListParser) readString() (string, Error) { - if p.pos == len(p.buf) { - return "", newErrorAndWrap(io.EOF, types.PARSE_ERROR, "Error Parsing the peers list") - } - - if p.buf[p.pos] == ',' { - return "", nil - } - - begin := p.pos - bracket := p.buf[p.pos] == '[' - for p.pos < len(p.buf) { - ch := p.buf[p.pos] - if ch == ',' { - break - } - - if ch == ']' { - if !bracket { - break - } - bracket = false - } - p.pos++ - } - - return string(p.buf[begin:p.pos]), nil -} - -func (p *peerListParser) ParseHost(host string) (*Host, Error) { - ppos := -1 - bpos := -1 - for i := 0; i < len(host); i++ { - switch host[i] { - case ':': - ppos = i - case ']': - ppos = -1 - bpos = i - } - } - - port := 0 - if p.defPort != nil { - port = int(*p.defPort) - } - var err error - if ppos >= 0 { - portStr := host[ppos+1:] - port, err = strconv.Atoi(portStr) - if err != nil { - return nil, newErrorAndWrap(err, types.PARSE_ERROR, "Error Parsing the peers list") - } - } - - var addr string - if bpos >= 0 { - addr = host[1:bpos] - } else { - if ppos >= 0 { - addr = host[:ppos] - } else { - addr = host - } - } - - return NewHost(addr, port), nil -} - -func (p *peerListParser) readHosts(tlsName string) ([]*Host, Error) { - if !p.Expect('[') { - return nil, aeroerr - } - - hostList := []*Host{} - for { - hostStr, err := p.readString() - if err != nil { - return nil, err - } - - if hostStr == "" { - break - } - - host, err := p.ParseHost(hostStr) - if err != nil { - return nil, aeroerr - } - - host.TLSName = tlsName - hostList = append(hostList, host) - - if !p.Expect(',') { - break - } - } - - if !p.Expect(']') { - return nil, aeroerr - } - - return hostList, nil -} - -func (p *peerListParser) readPeer() (*peer, Error) { - if !p.Expect('[') { - return nil, nil - } - - nodeName, err := p.readString() - if err != nil { - return nil, err - } - - if !p.Expect(',') { - return nil, aeroerr - } - tlsName, err := p.readString() - if err != nil { - return nil, err - } - - if !p.Expect(',') { - return nil, aeroerr - } - - hostList, err := p.readHosts(tlsName) - if err != nil { - return nil, err - } - - if !p.Expect(']') { - return nil, aeroerr - } - - nodeData := &peer{nodeName: nodeName, tlsName: tlsName, hosts: hostList} - return nodeData, nil -} - -func (p *peerListParser) readNodeList() ([]*peer, Error) { - ch := p.readByte() - if ch == nil { - return nil, nil - } - - if *ch != '[' { - return nil, aeroerr - } - - nodeList := []*peer{} - for { - node, err := p.readPeer() - if err != nil { - return nil, err - } - - if node == nil { - break - } - - nodeList = append(nodeList, node) - - if !p.Expect(',') { - break - } - } - - if !p.Expect(']') { - return nil, aeroerr - } - - return nodeList, nil -} - -func (p *peerListParser) Parse() Error { - var err Error - p.gen, err = p.readInt64() - if err != nil { - return err - } - - if !p.Expect(',') { - return aeroerr - } - - p.defPort, err = p.readInt64() - if err != nil { - return err - } - - if !p.Expect(',') { - return aeroerr - } - - p.peers, err = p.readNodeList() - if err != nil { - return err - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore deleted file mode 100644 index c1e1c062..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -6.out -*.6 -_obj -_test -_testmain.go diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE deleted file mode 100644 index 555bb71c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2011 James Keane . All rights reserved. -Copyright (c) 2006 Damien Miller . -Copyright (c) 2011 ZooWar.com, All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of weekendlogic nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README deleted file mode 100644 index a4d638ab..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/README +++ /dev/null @@ -1,46 +0,0 @@ -Installation: - goinstall github.com/jameskeane/bcrypt - -Example use: - package main - - import ( - "fmt" - "github.com/jameskeane/bcrypt" - ) - - var password = "WyWihatdyd?frub1" - var bad_password = "just a wild guess" - - func main() { - // generate a random salt with default rounds of complexity - salt, _ := bcrypt.Salt() - - // generate a random salt with 10 rounds of complexity - salt, _ = bcrypt.Salt(10) - - // hash and verify a password with random salt - hash, _ := bcrypt.Hash(password) - if bcrypt.Match(password, hash) { - fmt.Println("They match") - } - - // hash and verify a password with a static salt - hash, _ = bcrypt.Hash(password, salt) - if bcrypt.Match(password, hash) { - fmt.Println("They match") - } - - // verify a random password fails to match the hashed password - if !bcrypt.Match(bad_password, hash) { - fmt.Println("They don't match") - } - } - -Todo: - grep 'TODO' * -r - -Notes: - * This library is derived from jBcrypt by Damien Miller - * bcrypt_test.go is from ZooWar.com - diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go deleted file mode 100644 index f544ecd3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/bcrypt.go +++ /dev/null @@ -1,190 +0,0 @@ -package bcrypt - -import ( - "bytes" - "crypto/rand" - "crypto/subtle" - "encoding/base64" - "errors" - "strconv" - "strings" -) - -var ( - InvalidRounds = errors.New("bcrypt: Invalid rounds parameter") - InvalidSalt = errors.New("bcrypt: Invalid salt supplied") -) - -const ( - MaxRounds = 31 - MinRounds = 4 - DefaultRounds = 12 - SaltLen = 16 - BlowfishRounds = 16 -) - -var enc = base64.NewEncoding("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") - -// Helper function to build the bcrypt hash string -// payload takes : -// - []byte -> which it base64 encodes it (trims padding "=") and writes it to the buffer -// - string -> which it writes straight to the buffer -func build_bcrypt_str(minor byte, rounds uint, payload ...interface{}) []byte { - rs := bytes.NewBuffer(make([]byte, 0, 61)) - rs.WriteString("$2") - if minor >= 'a' { - rs.WriteByte(minor) - } - - rs.WriteByte('$') - if rounds < 10 { - rs.WriteByte('0') - } - - rs.WriteString(strconv.FormatUint(uint64(rounds), 10)) - rs.WriteByte('$') - for _, p := range payload { - if pb, ok := p.([]byte); ok { - rs.WriteString(strings.TrimRight(enc.EncodeToString(pb), "=")) - } else if ps, ok := p.(string); ok { - rs.WriteString(ps) - } - } - return rs.Bytes() -} - -// Salt generation -func Salt(rounds ...int) (string, error) { - rb, err := SaltBytes(rounds...) - return string(rb), err -} - -func SaltBytes(rounds ...int) (salt []byte, err error) { - r := DefaultRounds - if len(rounds) > 0 { - r = rounds[0] - if r < MinRounds || r > MaxRounds { - return nil, InvalidRounds - } - } - - rnd := make([]byte, SaltLen) - read, err := rand.Read(rnd) - if read != SaltLen || err != nil { - return nil, err - } - - return build_bcrypt_str('a', uint(r), rnd), nil -} - -func consume(r *bytes.Buffer, b byte) bool { - got, err := r.ReadByte() - if err != nil { - return false - } - if got != b { - r.UnreadByte() - return false - } - - return true -} - -func Hash(password string, salt ...string) (ps string, err error) { - var s []byte - var pb []byte - - if len(salt) == 0 { - s, err = SaltBytes() - if err != nil { - return - } - } else if len(salt) > 0 { - s = []byte(salt[0]) - } - - pb, err = HashBytes([]byte(password), s) - return string(pb), err -} - -func HashBytes(password []byte, salt ...[]byte) (hash []byte, err error) { - var s []byte - - if len(salt) == 0 { - s, err = SaltBytes() - if err != nil { - return - } - } else if len(salt) > 0 { - s = salt[0] - } - - // TODO: use a regex? I hear go has bad regex performance a simple FSM seems faster - // "^\\$2([a-z]?)\\$([0-3][0-9])\\$([\\./A-Za-z0-9]{22}+)" - - // Ok, extract the required information - minor := byte(0) - sr := bytes.NewBuffer(s) - - if !consume(sr, '$') || !consume(sr, '2') { - return nil, InvalidSalt - } - - if !consume(sr, '$') { - minor, _ = sr.ReadByte() - if minor != 'a' || !consume(sr, '$') { - return nil, InvalidSalt - } - } - - rounds_bytes := make([]byte, 2) - read, err := sr.Read(rounds_bytes) - if err != nil || read != 2 { - return nil, InvalidSalt - } - - if !consume(sr, '$') { - return nil, InvalidSalt - } - - var rounds64 uint64 - rounds64, err = strconv.ParseUint(string(rounds_bytes), 10, 0) - if err != nil { - return nil, InvalidSalt - } - - rounds := uint(rounds64) - - // TODO: can't we use base64.NewDecoder(enc, sr) ? - salt_bytes := make([]byte, 22) - read, err = sr.Read(salt_bytes) - if err != nil || read != 22 { - return nil, InvalidSalt - } - - var saltb []byte - // encoding/base64 expects 4 byte blocks padded, since bcrypt uses only 22 bytes we need to go up - saltb, err = enc.DecodeString(string(salt_bytes) + "==") - if err != nil { - return nil, err - } - - // cipher expects null terminated input (go initializes everything with zero values so this works) - password_term := make([]byte, len(password)+1) - copy(password_term, password) - - hashed := crypt_raw(password_term, saltb[:SaltLen], rounds) - return build_bcrypt_str(minor, rounds, string(salt_bytes), hashed[:len(bf_crypt_ciphertext)*4-1]), nil -} - -func Match(password, hash string) bool { - return MatchBytes([]byte(password), []byte(hash)) -} - -func MatchBytes(password []byte, hash []byte) bool { - h, err := HashBytes(password, hash) - if err != nil { - return false - } - return subtle.ConstantTimeCompare(h, hash) == 1 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go b/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go deleted file mode 100644 index aff6d9df..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/bcrypt/cipher.go +++ /dev/null @@ -1,415 +0,0 @@ -package bcrypt - -var p_orig = [18]uint{ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, - 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, - 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, - 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, - 0x9216d5d9, 0x8979fb1b, -} - -var s_orig = [1024]uint{ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, - 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, - 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, - 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, - 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, - 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, - 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, - 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, - 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, - 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, - 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, - 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, - 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, - 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, - 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, - 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, - 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, - 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, - 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, - 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, - 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, - 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, - 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, - 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, - 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, - 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, - 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, - 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, - 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, - 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, - 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, - 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, - 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, - 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, - 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, - 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, - 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, - 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, - 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, - 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, - 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, - 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, - 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, - 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, - 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, - 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, - 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, - 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, - 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, - 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a, - 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, - 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, - 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, - 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, - 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, - 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, - 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, - 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, - 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, - 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, - 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, - 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, - 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, - 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, - 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, - 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, - 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, - 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, - 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, - 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, - 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, - 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, - 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, - 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, - 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, - 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, - 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, - 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, - 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, - 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, - 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, - 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, - 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, - 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, - 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, - 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, - 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, - 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, - 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, - 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, - 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, - 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, - 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, - 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, - 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, - 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, - 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, - 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, - 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7, - 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, - 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, - 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, - 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, - 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, - 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, - 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, - 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, - 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, - 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, - 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, - 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, - 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, - 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, - 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, - 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, - 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, - 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, - 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, - 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, - 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, - 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, - 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, - 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, - 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, - 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, - 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, - 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, - 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, - 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, - 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, - 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, - 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, - 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, - 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, - 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, - 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, - 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, - 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, - 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, - 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, - 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, - 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, - 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, - 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, - 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, - 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, - 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, - 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, - 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0, - 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, - 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, - 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, - 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, - 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, - 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, - 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, - 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, - 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, - 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, - 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, - 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, - 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, - 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, - 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, - 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, - 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, - 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, - 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, - 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, - 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, - 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, - 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, - 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, - 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, - 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, - 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, - 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, - 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, - 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, - 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, - 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, - 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, - 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, - 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, - 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, - 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, - 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, - 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, - 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, - 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, - 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, - 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, - 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, - 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, - 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, - 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, - 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, - 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, - 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, - 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, -} - -var bf_crypt_ciphertext = [6]uint{ - 0x4f727068, 0x65616e42, 0x65686f6c, - 0x64657253, 0x63727944, 0x6f756274, -} - -type cipher struct { - P [18]uint - S [1024]uint - data [6]uint -} - -func (c *cipher) encipher(lr []uint, off int) { - l := lr[off] ^ c.P[0] - r := lr[off+1] - - for i := 0; i <= BlowfishRounds-2; i += 2 { - // Feistel substitution on left and right word respectively - r ^= (((c.S[(l>>24)&0xff] + c.S[0x100|((l>>16)&0xff)]) ^ c.S[0x200|((l>>8)&0xff)]) + c.S[0x300|(l&0xff)]) ^ c.P[i+1] - l ^= (((c.S[(r>>24)&0xff] + c.S[0x100|((r>>16)&0xff)]) ^ c.S[0x200|((r>>8)&0xff)]) + c.S[0x300|(r&0xff)]) ^ c.P[i+2] - } - - lr[off] = r ^ c.P[BlowfishRounds+1] - lr[off+1] = l -} - -/** - * Cycically extract a word of key material - * @param data the string to extract the data from - * @param off the current offset into the data - * @return the next word of material from data and the next offset into the data - */ -func streamtoword(data []byte, off int) (uint, int) { - var word uint - for i := 0; i < 4; i++ { - word = (word << 8) | uint(data[off]&0xff) - off = (off + 1) % len(data) - } - - return word, off -} - -/** - * Key the Blowfish cipher - * @param key an array containing the key - */ -func (c *cipher) key(key []byte) { - var word uint - off := 0 - lr := []uint{0, 0} - plen := len(c.P) - slen := len(c.S) - - for i := 0; i < plen; i++ { - word, off = streamtoword(key, off) - c.P[i] = c.P[i] ^ word - } - - for i := 0; i < plen; i += 2 { - c.encipher(lr, 0) - c.P[i] = lr[0] - c.P[i+1] = lr[1] - } - - for i := 0; i < slen; i += 2 { - c.encipher(lr, 0) - c.S[i] = lr[0] - c.S[i+1] = lr[1] - } -} - -/** - * Perform the "enhanced key schedule" step described by - * Provos and Mazieres in "A Future-Adaptable Password Scheme" - * http://www.openbsd.org/papers/bcrypt-paper.ps - * @param data salt information - * @param key password information - */ -func (c *cipher) ekskey(data []byte, key []byte) { - var word uint - koff := 0 - doff := 0 - lr := []uint{0, 0} - plen := len(c.P) - slen := len(c.S) - - for i := 0; i < plen; i++ { - word, koff = streamtoword(key, koff) - c.P[i] = c.P[i] ^ word - } - - for i := 0; i < plen; i += 2 { - word, doff = streamtoword(data, doff) - lr[0] ^= word - word, doff = streamtoword(data, doff) - lr[1] ^= word - c.encipher(lr, 0) - c.P[i] = lr[0] - c.P[i+1] = lr[1] - } - - for i := 0; i < slen; i += 2 { - word, doff = streamtoword(data, doff) - lr[0] ^= word - word, doff = streamtoword(data, doff) - lr[1] ^= word - c.encipher(lr, 0) - c.S[i] = lr[0] - c.S[i+1] = lr[1] - } -} - -/** - * Perform the central password hashing step in the - * bcrypt scheme - * @param password the password to hash - * @param salt the binary salt to hash with the password - * @param log_rounds the binary logarithm of the number - * of rounds of hashing to apply - * @return an array containing the binary hashed password - */ -func crypt_raw(password []byte, salt []byte, log_rounds uint) []byte { - c := &cipher{P: p_orig, S: s_orig, data: bf_crypt_ciphertext} - - rounds := 1 << log_rounds - c.ekskey(salt, password) - for i := 0; i < rounds; i++ { - c.key(password) - c.key(salt) - } - - for i := 0; i < 64; i++ { - for j := 0; j < (6 >> 1); j++ { - c.encipher(c.data[:], j<<1) - } - } - - ret := make([]byte, 24) - for i := 0; i < 6; i++ { - k := i << 2 - ret[k] = (byte)((c.data[i] >> 24) & 0xff) - ret[k+1] = (byte)((c.data[i] >> 16) & 0xff) - ret[k+2] = (byte)((c.data[i] >> 8) & 0xff) - ret[k+3] = (byte)(c.data[i] & 0xff) - } - return ret -} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go deleted file mode 100644 index ccb09c62..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ripemd160 implements the RIPEMD-160 hash algorithm. -package ripemd160 - -import "hash" - -// RIPEMD-160 is designed by by Hans Dobbertin, Antoon Bosselaers, and Bart -// Preneel with specifications available at: -// http://homes.esat.kuleuven.be/~cosicart/pdf/AB-9601/AB-9601.pdf. - -// func init() { -// crypto.RegisterHash(crypto.RIPEMD160, New) -// } - -// The size of the checksum in bytes. -const Size = 20 - -// The block size of the hash algorithm in bytes. -const BlockSize = 64 - -const ( - _s0 = 0x67452301 - _s1 = 0xefcdab89 - _s2 = 0x98badcfe - _s3 = 0x10325476 - _s4 = 0xc3d2e1f0 -) - -// Digest represents the partial evaluation of a checksum. -type Digest struct { - s [5]uint32 // running context - x [BlockSize]byte // temporary buffer - nx int // index into x - tc uint64 // total count of bytes processed -} - -func (d *Digest) Reset() { - d.s[0], d.s[1], d.s[2], d.s[3], d.s[4] = _s0, _s1, _s2, _s3, _s4 - d.nx = 0 - d.tc = 0 -} - -// New returns a new hash.Hash computing the checksum. -func New() hash.Hash { - result := Digest{} - result.Reset() - return &result -} - -func (d *Digest) Size() int { return Size } - -func (d *Digest) BlockSize() int { return BlockSize } - -func (d *Digest) Write(p []byte) (nn int, err error) { - nn = len(p) - d.tc += uint64(nn) - if d.nx > 0 { - n := len(p) - if n > BlockSize-d.nx { - n = BlockSize - d.nx - } - for i := 0; i < n; i++ { - d.x[d.nx+i] = p[i] - } - d.nx += n - if d.nx == BlockSize { - _Block(d, d.x[0:]) - d.nx = 0 - } - p = p[n:] - } - n := _Block(d, p) - p = p[n:] - if len(p) > 0 { - d.nx = copy(d.x[:], p) - } - return -} - -func (d *Digest) Sum(res []byte) []byte { - // Make a copy of d0 so that caller can keep writing and summing. - // d := *d0 - - // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. - tc := d.tc - var tmp [64]byte - tmp[0] = 0x80 - if tc%64 < 56 { - d.Write(tmp[0 : 56-tc%64]) - } else { - d.Write(tmp[0 : 64+56-tc%64]) - } - - // Length in bits. - tc <<= 3 - for i := uint(0); i < 8; i++ { - tmp[i] = byte(tc >> (8 * i)) - } - d.Write(tmp[0:8]) - - if d.nx != 0 { - panic("d.nx != 0") - } - - var Digest [Size]byte - for i, s := range d.s { - Digest[i*4] = byte(s) - Digest[i*4+1] = byte(s >> 8) - Digest[i*4+2] = byte(s >> 16) - Digest[i*4+3] = byte(s >> 24) - } - - if res != nil { - copy(res, Digest[:]) - return nil - } - return append(res, Digest[:]...) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go deleted file mode 100644 index 42d27762..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160_test.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ripemd160 - -// Test vectors are from: -// http://homes.esat.kuleuven.be/~bosselae/ripemd160.html - -import ( - "fmt" - "io" - "testing" -) - -type mdTest struct { - out string - in string -} - -var vectors = [...]mdTest{ - {"9c1185a5c5e9fc54612808977ee8f548b2258d31", ""}, - {"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe", "a"}, - {"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", "abc"}, - {"5d0689ef49d2fae572b881b123a85ffa21595f36", "message digest"}, - {"f71c27109c692c1b56bbdceb5b9d2865b3708dbc", "abcdefghijklmnopqrstuvwxyz"}, - {"12a053384a9c0c88e405a06c27dcf49ada62eb2b", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}, - {"b0e20b6e3116640286ed3a87a5713079b21f5189", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"}, - {"9b752e45573d4b39f4dbd3323cab82bf63326bfb", "12345678901234567890123456789012345678901234567890123456789012345678901234567890"}, -} - -func TestVectors(t *testing.T) { - for i := 0; i < len(vectors); i++ { - tv := vectors[i] - md := New() - for j := 0; j < 3; j++ { - if j < 2 { - io.WriteString(md, tv.in) - } else { - io.WriteString(md, tv.in[0:len(tv.in)/2]) - // md.Sum(nil) // removed due to our changes in the code; we use only one Sum() and then reset - io.WriteString(md, tv.in[len(tv.in)/2:]) - } - s := fmt.Sprintf("%x", md.Sum(nil)) - if s != tv.out { - t.Fatalf("RIPEMD-160[%d](%s) = %s, expected %s", j, tv.in, s, tv.out) - } - md.Reset() - } - } -} - -func TestMillionA(t *testing.T) { - md := New() - for i := 0; i < 100000; i++ { - io.WriteString(md, "aaaaaaaaaa") - } - out := "52783243c1697bdbe16d37f97f68f08325dc1528" - s := fmt.Sprintf("%x", md.Sum(nil)) - if s != out { - t.Fatalf("RIPEMD-160 (1 million 'a') = %s, expected %s", s, out) - } - md.Reset() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go b/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go deleted file mode 100644 index bb7fe7d2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/pkg/ripemd160/ripemd160block.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// RIPEMD-160 block step. -// In its own file so that a faster assembly or C version -// can be substituted easily. - -package ripemd160 - -// work buffer indices and roll amounts for one line -var _n = [80]uint{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, - 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, - 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13, -} - -var _r = [80]uint{ - 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, - 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, - 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, - 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, - 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6, -} - -// same for the other parallel one -var n_ = [80]uint{ - 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, - 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, - 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, - 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, - 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11, -} - -var r_ = [80]uint{ - 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, - 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, - 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, - 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, - 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11, -} - -func _Block(md *Digest, p []byte) int { - n := 0 - var x [16]uint32 - var alpha, beta uint32 - for len(p) >= BlockSize { - a, b, c, d, e := md.s[0], md.s[1], md.s[2], md.s[3], md.s[4] - aa, bb, cc, dd, ee := a, b, c, d, e - j := 0 - for i := 0; i < 16; i++ { - x[i] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24 - j += 4 - } - - // round 1 - i := 0 - for i < 16 { - alpha = a + (b ^ c ^ d) + x[_n[i]] - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 - a, b, c, d, e = e, alpha, b, beta, d - - // parallel line - alpha = aa + (bb ^ (cc | ^dd)) + x[n_[i]] + 0x50a28be6 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 - aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd - - i++ - } - - // round 2 - for i < 32 { - alpha = a + (b&c | ^b&d) + x[_n[i]] + 0x5a827999 - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 - a, b, c, d, e = e, alpha, b, beta, d - - // parallel line - alpha = aa + (bb&dd | cc&^dd) + x[n_[i]] + 0x5c4dd124 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 - aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd - - i++ - } - - // round 3 - for i < 48 { - alpha = a + (b | ^c ^ d) + x[_n[i]] + 0x6ed9eba1 - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 - a, b, c, d, e = e, alpha, b, beta, d - - // parallel line - alpha = aa + (bb | ^cc ^ dd) + x[n_[i]] + 0x6d703ef3 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 - aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd - - i++ - } - - // round 4 - for i < 64 { - alpha = a + (b&d | c&^d) + x[_n[i]] + 0x8f1bbcdc - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 - a, b, c, d, e = e, alpha, b, beta, d - - // parallel line - alpha = aa + (bb&cc | ^bb&dd) + x[n_[i]] + 0x7a6d76e9 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 - aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd - - i++ - } - - // round 5 - for i < 80 { - alpha = a + (b ^ (c | ^d)) + x[_n[i]] + 0xa953fd4e - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 - a, b, c, d, e = e, alpha, b, beta, d - - // parallel line - alpha = aa + (bb ^ cc ^ dd) + x[n_[i]] - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 - aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd - - i++ - } - - // combine results - dd += c + md.s[1] - md.s[1] = md.s[2] + d + ee - md.s[2] = md.s[3] + e + aa - md.s[3] = md.s[4] + a + bb - md.s[4] = md.s[0] + b + cc - md.s[0] = dd - - p = p[BlockSize:] - n += BlockSize - } - return n -} diff --git a/aerospike-tls/vendor-aerospike-client-go/policy.go b/aerospike-tls/vendor-aerospike-client-go/policy.go deleted file mode 100644 index cbfd4ff4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/policy.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -// Policy Interface -type Policy interface { - // Retrieves BasePolicy - GetBasePolicy() *BasePolicy - - // determines if the command should be compressed - compress() bool -} - -// enforce the interface -var _ Policy = &BasePolicy{} - -// BasePolicy encapsulates parameters for transaction policy attributes -// used in all database operation calls. -type BasePolicy struct { - // FilterExpression is the optional Filter Expression. Supported on Server v5.2+ - FilterExpression *Expression - - // ReadModeAP indicates read policy for AP (availability) namespaces. - ReadModeAP ReadModeAP //= ONE - - // ReadModeSC indicates read policy for SC (strong consistency) namespaces. - ReadModeSC ReadModeSC //= SESSION; - - // TotalTimeout specifies total transaction timeout. - // - // The TotalTimeout is tracked on the client and also sent to the server along - // with the transaction in the wire protocol. The client will most likely - // timeout first, but the server has the capability to Timeout the transaction. - // - // If TotalTimeout is not zero and TotalTimeout is reached before the transaction - // completes, the transaction will abort with TotalTimeout error. - // - // If TotalTimeout is zero, there will be no time limit and the transaction will retry - // on network timeouts/errors until MaxRetries is exceeded. If MaxRetries is exceeded, the - // transaction also aborts with Timeout error. - // - // Default for scan/query: 0 (no time limit and rely on MaxRetries) - // - // Default for all other commands: 1000ms - TotalTimeout time.Duration - - // SocketTimeout determines network timeout for each attempt. - // - // If SocketTimeout is not zero and SocketTimeout is reached before an attempt completes, - // the Timeout above is checked. If Timeout is not exceeded, the transaction - // is retried. If both SocketTimeout and Timeout are non-zero, SocketTimeout must be less - // than or equal to Timeout, otherwise Timeout will also be used for SocketTimeout. - // - // Default: 30s - SocketTimeout time.Duration - - // MaxRetries determines the maximum number of retries before aborting the current transaction. - // The initial attempt is not counted as a retry. - // - // If MaxRetries is exceeded, the transaction will abort with an error. - // - // WARNING: Database writes that are not idempotent (such as AddOp) - // should not be retried because the write operation may be performed - // multiple times if the client timed out previous transaction attempts. - // It's important to use a distinct WritePolicy for non-idempotent - // writes which sets maxRetries = 0; - // - // Default for read: 2 (initial attempt + 2 retries = 3 attempts) - // - // Default for write: 0 (no retries) - // - // Default for partition scan or query with nil filter: 5 - // (6 attempts. See ScanPolicy comments.) - MaxRetries int //= 2; - - // ReadTouchTTLPercent determines how record TTL (time to live) is affected on reads. When enabled, the server can - // efficiently operate as a read-based LRU cache where the least recently used records are expired. - // The value is expressed as a percentage of the TTL sent on the most recent write such that a read - // within this interval of the record’s end of life will generate a touch. - // - // For example, if the most recent write had a TTL of 10 hours and read_touch_ttl_percent is set to - // 80, the next read within 8 hours of the record's end of life (equivalent to 2 hours after the most - // recent write) will result in a touch, resetting the TTL to another 10 hours. - // - // Values: - // - // 0 : Use server config default-read-touch-ttl-pct for the record's namespace/set. - // -1 : Do not reset record TTL on reads. - // 1 - 100 : Reset record TTL on reads when within this percentage of the most recent write TTL. - // Default: 0 - ReadTouchTTLPercent int32 - - // SleepBetweenRtries determines the duration to sleep between retries. Enter zero to skip sleep. - // This field is ignored when maxRetries is zero. - // This field is also ignored in async mode. - // - // The sleep only occurs on connection errors and server timeouts - // which suggest a node is down and the cluster is reforming. - // The sleep does not occur when the client's socketTimeout expires. - // - // Reads do not have to sleep when a node goes down because the cluster - // does not shut out reads during cluster reformation. The default for - // reads is zero. - // - // The default for writes is also zero because writes are not retried by default. - // Writes need to wait for the cluster to reform when a node goes down. - // Immediate write retries on node failure have been shown to consistently - // result in errors. If maxRetries is greater than zero on a write, then - // sleepBetweenRetries should be set high enough to allow the cluster to - // reform (>= 500ms). - SleepBetweenRetries time.Duration //= 1ms; - - // SleepMultiplier specifies the multiplying factor to be used for exponential backoff during retries. - // Default to (1.0); Only values greater than 1 are valid. - SleepMultiplier float64 //= 1.0; - - // ExitFastOnExhaustedConnectionPool determines if a command that tries to get a - // connection from the connection pool will wait and retry in case the pool is - // exhausted until a connection becomes available (or the TotalTimeout is reached). - // If set to true, an error will be return immediately. - // If set to false, getting a connection will be retried. - // This only applies if LimitConnectionsToQueueSize is set to true and the number of open connections to a node has reached ConnectionQueueSize. - // The default is false - ExitFastOnExhaustedConnectionPool bool // false - - // SendKey determines to whether send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - // - // If the key is sent on a read, the server will generate the hash digest from - // the key and validate that digest with the digest sent by the client. Unless - // this is the explicit intent of the developer, avoid sending the key on reads. - // The default is to not send the user defined key. - SendKey bool // = false - - // UseCompression uses zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - // - // Default: false - UseCompression bool // = false - - // ReplicaPolicy specifies the algorithm used to determine the target node for a partition derived from a key - // or requested in a scan/query. - // Write commands are not affected by this setting, because all writes are directed - // to the node containing the key's master partition. - // Default to sending read commands to the node containing the key's master partition. - ReplicaPolicy ReplicaPolicy -} - -// NewPolicy generates a new BasePolicy instance with default values. -func NewPolicy() *BasePolicy { - return &BasePolicy{ - ReadModeAP: ReadModeAPOne, - ReadModeSC: ReadModeSCSession, - TotalTimeout: 1000 * time.Millisecond, - SocketTimeout: 30 * time.Second, - MaxRetries: 2, - SleepBetweenRetries: 1 * time.Millisecond, - SleepMultiplier: 1.0, - ReplicaPolicy: SEQUENCE, - SendKey: false, - UseCompression: false, - } -} - -var _ Policy = &BasePolicy{} - -// GetBasePolicy returns embedded BasePolicy in all types that embed this struct. -func (p *BasePolicy) GetBasePolicy() *BasePolicy { return p } - -// socketTimeout validates and then calculates the timeout to be used for the socket -// based on Timeout and SocketTimeout values. -func (p *BasePolicy) socketTimeout() time.Duration { - if p.TotalTimeout == 0 && p.SocketTimeout == 0 { - return 0 - } else if p.TotalTimeout > 0 && p.SocketTimeout == 0 { - return p.TotalTimeout - } else if p.TotalTimeout == 0 && p.SocketTimeout > 0 { - return p.SocketTimeout - } else if p.TotalTimeout > 0 && p.SocketTimeout > 0 { - if p.SocketTimeout < p.TotalTimeout { - return p.SocketTimeout - } - } - return p.TotalTimeout -} - -func (p *BasePolicy) timeout() time.Duration { - if p.TotalTimeout == 0 && p.SocketTimeout == 0 { - return 0 - } else if p.TotalTimeout > 0 && p.SocketTimeout == 0 { - return p.TotalTimeout - } else if p.TotalTimeout == 0 && p.SocketTimeout > 0 { - return p.SocketTimeout - } else if p.TotalTimeout > 0 && p.SocketTimeout > 0 { - if p.SocketTimeout < p.TotalTimeout { - return p.SocketTimeout - } - } - return p.TotalTimeout -} - -func (p *BasePolicy) deadline() time.Time { - var deadline time.Time - if p != nil { - if p.TotalTimeout > 0 { - deadline = time.Now().Add(p.TotalTimeout) - } else if p.SocketTimeout > 0 { - if p.MaxRetries > 0 { - deadline = time.Now().Add(time.Duration(p.MaxRetries) * p.SocketTimeout) - } else { - deadline = time.Now().Add(p.SocketTimeout) - } - } - } - - return deadline -} - -func (p *BasePolicy) compress() bool { - return p.UseCompression -} diff --git a/aerospike-tls/vendor-aerospike-client-go/privilege.go b/aerospike-tls/vendor-aerospike-client-go/privilege.go deleted file mode 100644 index 8a99fb06..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/privilege.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -import "fmt" - -type privilegeCode string - -// Privilege determines user access granularity. -type Privilege struct { - // Role - Code privilegeCode - - // Namespace determines namespace scope. Apply permission to this namespace only. - // If namespace is zero value, the privilege applies to all namespaces. - Namespace string - - // Set name scope. Apply permission to this set within namespace only. - // If set is zero value, the privilege applies to all sets within namespace. - SetName string -} - -func (p *Privilege) code() int { - switch p.Code { - // User can edit/remove other users. Global scope only. - case UserAdmin: - return 0 - - // User can perform systems administration functions on a database that do not involve user - // administration. Examples include server configuration. - // Global scope only. - case SysAdmin: - return 1 - - // User can perform UDF and SINDEX administration actions. Global scope only. - case DataAdmin: - return 2 - - // User can perform user defined function(UDF) administration actions. - // Examples include create/drop UDF. Global scope only. - // Requires server version 6+ - case UDFAdmin: - return 3 - - // User can perform secondary index administration actions. - // Examples include create/drop index. Global scope only. - // Requires server version 6+ - case SIndexAdmin: - return 4 - - // User can read data only. - case Read: - return 10 - - // User can read and write data. - case ReadWrite: - return 11 - - // User can read and write data through user defined functions. - case ReadWriteUDF: - return 12 - - // User can read and write data through user defined functions. - case Write: - return 13 - - // User can truncate data only. - // Requires server version 6+ - case Truncate: - return 14 - } - - panic("invalid role: " + p.Code) -} - -func privilegeFrom(code uint8) privilegeCode { - switch code { - // User can edit/remove other users. Global scope only. - case 0: - return UserAdmin - - // User can perform systems administration functions on a database that do not involve user - // administration. Examples include server configuration. - // Global scope only. - case 1: - return SysAdmin - - // User can perform data administration functions on a database that do not involve user - // administration. Examples include index and user defined function management. - // Global scope only. - case 2: - return DataAdmin - - // User can perform user defined function(UDF) administration actions. - // Examples include create/drop UDF. Global scope only. - // Requires server version 6+ - case 3: - return UDFAdmin - - // User can perform secondary index administration actions. - // Examples include create/drop index. Global scope only. - // Requires server version 6+ - case 4: - return SIndexAdmin - - // User can read data. - case 10: - return Read - - // User can read and write data. - case 11: - return ReadWrite - - // User can read and write data through user defined functions. - case 12: - return ReadWriteUDF - - // User can only write data. - case 13: - return Write - - // User can truncate data only. - // Requires server version 6+ - case 14: - return Truncate - } - - panic(fmt.Sprintf("invalid privilege code: %v", code)) -} - -func (p *Privilege) canScope() bool { - return p.code() >= 10 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go deleted file mode 100644 index c472fc1c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.pb.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.32.0 -// protoc v5.27.1 -// source: aerospike_proxy_auth.proto - -package auth - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// An auth request to get an access token to perform operations on Aerospike -// database. -type AerospikeAuthRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *AerospikeAuthRequest) Reset() { - *x = AerospikeAuthRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_auth_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AerospikeAuthRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AerospikeAuthRequest) ProtoMessage() {} - -func (x *AerospikeAuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_auth_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AerospikeAuthRequest.ProtoReflect.Descriptor instead. -func (*AerospikeAuthRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_auth_proto_rawDescGZIP(), []int{0} -} - -func (x *AerospikeAuthRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AerospikeAuthRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// An auth token to perform operations on Aerospike database. -type AerospikeAuthResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *AerospikeAuthResponse) Reset() { - *x = AerospikeAuthResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_auth_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AerospikeAuthResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AerospikeAuthResponse) ProtoMessage() {} - -func (x *AerospikeAuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_auth_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AerospikeAuthResponse.ProtoReflect.Descriptor instead. -func (*AerospikeAuthResponse) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_auth_proto_rawDescGZIP(), []int{1} -} - -func (x *AerospikeAuthResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -var File_aerospike_proxy_auth_proto protoreflect.FileDescriptor - -var file_aerospike_proxy_auth_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x14, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2d, 0x0a, 0x15, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x45, 0x0a, 0x0b, 0x41, - 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, - 0x74, 0x12, 0x15, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x59, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, - 0x69, 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x65, 0x72, - 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, - 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x37, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_aerospike_proxy_auth_proto_rawDescOnce sync.Once - file_aerospike_proxy_auth_proto_rawDescData = file_aerospike_proxy_auth_proto_rawDesc -) - -func file_aerospike_proxy_auth_proto_rawDescGZIP() []byte { - file_aerospike_proxy_auth_proto_rawDescOnce.Do(func() { - file_aerospike_proxy_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_aerospike_proxy_auth_proto_rawDescData) - }) - return file_aerospike_proxy_auth_proto_rawDescData -} - -var file_aerospike_proxy_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_aerospike_proxy_auth_proto_goTypes = []interface{}{ - (*AerospikeAuthRequest)(nil), // 0: AerospikeAuthRequest - (*AerospikeAuthResponse)(nil), // 1: AerospikeAuthResponse -} -var file_aerospike_proxy_auth_proto_depIdxs = []int32{ - 0, // 0: AuthService.Get:input_type -> AerospikeAuthRequest - 1, // 1: AuthService.Get:output_type -> AerospikeAuthResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_aerospike_proxy_auth_proto_init() } -func file_aerospike_proxy_auth_proto_init() { - if File_aerospike_proxy_auth_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_aerospike_proxy_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AerospikeAuthRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AerospikeAuthResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_aerospike_proxy_auth_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_aerospike_proxy_auth_proto_goTypes, - DependencyIndexes: file_aerospike_proxy_auth_proto_depIdxs, - MessageInfos: file_aerospike_proxy_auth_proto_msgTypes, - }.Build() - File_aerospike_proxy_auth_proto = out.File - file_aerospike_proxy_auth_proto_rawDesc = nil - file_aerospike_proxy_auth_proto_goTypes = nil - file_aerospike_proxy_auth_proto_depIdxs = nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto deleted file mode 100644 index 4a56bf80..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/aerospike/aerospike-client-go/v7/proto/auth;auth"; -option java_package = "com.aerospike.proxy.client"; - -// Proxy auth service -service AuthService { - rpc Get(AerospikeAuthRequest) returns (AerospikeAuthResponse) {} -} - -// An auth request to get an access token to perform operations on Aerospike -// database. -message AerospikeAuthRequest { - string username = 1; - string password = 2; -} - -// An auth token to perform operations on Aerospike database. -message AerospikeAuthResponse { - string token = 1; -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go deleted file mode 100644 index 766bb0ba..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/auth/aerospike_proxy_auth_grpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.1 -// source: proto/auth/aerospike_proxy_auth.proto - -package auth - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - AuthService_Get_FullMethodName = "/AuthService/Get" -) - -// AuthServiceClient is the client API for AuthService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AuthServiceClient interface { - Get(ctx context.Context, in *AerospikeAuthRequest, opts ...grpc.CallOption) (*AerospikeAuthResponse, error) -} - -type authServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { - return &authServiceClient{cc} -} - -func (c *authServiceClient) Get(ctx context.Context, in *AerospikeAuthRequest, opts ...grpc.CallOption) (*AerospikeAuthResponse, error) { - out := new(AerospikeAuthResponse) - err := c.cc.Invoke(ctx, AuthService_Get_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServiceServer is the server API for AuthService service. -// All implementations must embed UnimplementedAuthServiceServer -// for forward compatibility -type AuthServiceServer interface { - Get(context.Context, *AerospikeAuthRequest) (*AerospikeAuthResponse, error) - mustEmbedUnimplementedAuthServiceServer() -} - -// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations. -type UnimplementedAuthServiceServer struct { -} - -func (UnimplementedAuthServiceServer) Get(context.Context, *AerospikeAuthRequest) (*AerospikeAuthResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} - -// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthServiceServer will -// result in compilation errors. -type UnsafeAuthServiceServer interface { - mustEmbedUnimplementedAuthServiceServer() -} - -func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { - s.RegisterService(&AuthService_ServiceDesc, srv) -} - -func _AuthService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeAuthRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Get_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Get(ctx, req.(*AerospikeAuthRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AuthService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "AuthService", - HandlerType: (*AuthServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _AuthService_Get_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto/auth/aerospike_proxy_auth.proto", -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go deleted file mode 100644 index 97b82117..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.pb.go +++ /dev/null @@ -1,3616 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.32.0 -// protoc v5.27.1 -// source: aerospike_proxy_kv.proto - -package kvs - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Read policy for AP (availability) namespaces. -// How duplicates should be consulted in a read operation. -// Only makes a difference during migrations and only applicable in AP mode. -type ReadModeAP int32 - -const ( - // Involve single node in the read operation. - ReadModeAP_ONE ReadModeAP = 0 - // Involve all duplicates in the read operation. - ReadModeAP_ALL ReadModeAP = 1 -) - -// Enum value maps for ReadModeAP. -var ( - ReadModeAP_name = map[int32]string{ - 0: "ONE", - 1: "ALL", - } - ReadModeAP_value = map[string]int32{ - "ONE": 0, - "ALL": 1, - } -) - -func (x ReadModeAP) Enum() *ReadModeAP { - p := new(ReadModeAP) - *p = x - return p -} - -func (x ReadModeAP) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ReadModeAP) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[0].Descriptor() -} - -func (ReadModeAP) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[0] -} - -func (x ReadModeAP) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ReadModeAP.Descriptor instead. -func (ReadModeAP) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{0} -} - -// Read policy for SC (strong consistency) namespaces. -// Determines SC read consistency options. -type ReadModeSC int32 - -const ( - // Ensures this client will only see an increasing sequence of record versions. - // Server only reads from master. This is the default. - ReadModeSC_SESSION ReadModeSC = 0 - // Ensures ALL clients will only see an increasing sequence of record versions. - // Server only reads from master. - ReadModeSC_LINEARIZE ReadModeSC = 1 - // Server may read from master or any full (non-migrating) replica. - // Increasing sequence of record versions is not guaranteed. - ReadModeSC_ALLOW_REPLICA ReadModeSC = 2 - // Server may read from master or any full (non-migrating) replica or from unavailable - // partitions. Increasing sequence of record versions is not guaranteed. - ReadModeSC_ALLOW_UNAVAILABLE ReadModeSC = 3 -) - -// Enum value maps for ReadModeSC. -var ( - ReadModeSC_name = map[int32]string{ - 0: "SESSION", - 1: "LINEARIZE", - 2: "ALLOW_REPLICA", - 3: "ALLOW_UNAVAILABLE", - } - ReadModeSC_value = map[string]int32{ - "SESSION": 0, - "LINEARIZE": 1, - "ALLOW_REPLICA": 2, - "ALLOW_UNAVAILABLE": 3, - } -) - -func (x ReadModeSC) Enum() *ReadModeSC { - p := new(ReadModeSC) - *p = x - return p -} - -func (x ReadModeSC) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ReadModeSC) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[1].Descriptor() -} - -func (ReadModeSC) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[1] -} - -func (x ReadModeSC) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ReadModeSC.Descriptor instead. -func (ReadModeSC) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{1} -} - -// Defines algorithm used to determine the target node for a command. -// Scan and query are not affected by replica algorithm. -// -// Note: The enum ordinals do not match the Aerospike Client ordinals because -// the default has to be ordinal zero in protobuf. -type Replica int32 - -const ( - // Try node containing master partition first. - // If connection fails, all commands try nodes containing replicated partitions. - // If socketTimeout is reached, reads also try nodes containing replicated partitions, - // but writes remain on master node. - Replica_SEQUENCE Replica = 0 - // Use node containing key's master partition. - Replica_MASTER Replica = 1 - // Distribute reads across nodes containing key's master and replicated partitions - // in round-robin fashion. Writes always use node containing key's master partition. - Replica_MASTER_PROLES Replica = 2 - // Try node on the same rack as the client first. If timeout or there are no nodes on the - // same rack, use SEQUENCE instead. - Replica_PREFER_RACK Replica = 3 - // Distribute reads across all nodes in cluster in round-robin fashion. - // Writes always use node containing key's master partition. - // This option is useful when the replication factor equals the number - // of nodes in the cluster and the overhead of requesting proles is not desired. - Replica_RANDOM Replica = 4 -) - -// Enum value maps for Replica. -var ( - Replica_name = map[int32]string{ - 0: "SEQUENCE", - 1: "MASTER", - 2: "MASTER_PROLES", - 3: "PREFER_RACK", - 4: "RANDOM", - } - Replica_value = map[string]int32{ - "SEQUENCE": 0, - "MASTER": 1, - "MASTER_PROLES": 2, - "PREFER_RACK": 3, - "RANDOM": 4, - } -) - -func (x Replica) Enum() *Replica { - p := new(Replica) - *p = x - return p -} - -func (x Replica) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Replica) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[2].Descriptor() -} - -func (Replica) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[2] -} - -func (x Replica) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Replica.Descriptor instead. -func (Replica) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{2} -} - -type QueryDuration int32 - -const ( - // The query is expected to return more than 100 records per node. The server optimizes for a large record set. - QueryDuration_LONG QueryDuration = 0 - // The query is expected to return less than 100 records per node. The server optimizes for a small record set. - QueryDuration_SHORT QueryDuration = 1 - // Treat query as a LONG query, but relax read consistency for AP namespaces. - // This value is treated exactly like LONG for server versions < 7.1. - QueryDuration_LONG_RELAX_AP QueryDuration = 2 -) - -// Enum value maps for QueryDuration. -var ( - QueryDuration_name = map[int32]string{ - 0: "LONG", - 1: "SHORT", - 2: "LONG_RELAX_AP", - } - QueryDuration_value = map[string]int32{ - "LONG": 0, - "SHORT": 1, - "LONG_RELAX_AP": 2, - } -) - -func (x QueryDuration) Enum() *QueryDuration { - p := new(QueryDuration) - *p = x - return p -} - -func (x QueryDuration) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (QueryDuration) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[3].Descriptor() -} - -func (QueryDuration) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[3] -} - -func (x QueryDuration) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use QueryDuration.Descriptor instead. -func (QueryDuration) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{3} -} - -// Secondary index collection type. -type IndexCollectionType int32 - -const ( - // Normal scalar index. - IndexCollectionType_DEFAULT IndexCollectionType = 0 - // Index list elements. - IndexCollectionType_LIST IndexCollectionType = 1 - // Index map keys. - IndexCollectionType_MAPKEYS IndexCollectionType = 2 - // Index map values. - IndexCollectionType_MAPVALUES IndexCollectionType = 3 -) - -// Enum value maps for IndexCollectionType. -var ( - IndexCollectionType_name = map[int32]string{ - 0: "DEFAULT", - 1: "LIST", - 2: "MAPKEYS", - 3: "MAPVALUES", - } - IndexCollectionType_value = map[string]int32{ - "DEFAULT": 0, - "LIST": 1, - "MAPKEYS": 2, - "MAPVALUES": 3, - } -) - -func (x IndexCollectionType) Enum() *IndexCollectionType { - p := new(IndexCollectionType) - *p = x - return p -} - -func (x IndexCollectionType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IndexCollectionType) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[4].Descriptor() -} - -func (IndexCollectionType) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[4] -} - -func (x IndexCollectionType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IndexCollectionType.Descriptor instead. -func (IndexCollectionType) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{4} -} - -type OperationType int32 - -const ( - OperationType_READ OperationType = 0 - OperationType_READ_HEADER OperationType = 1 - OperationType_WRITE OperationType = 2 - OperationType_CDT_READ OperationType = 3 - OperationType_CDT_MODIFY OperationType = 4 - OperationType_MAP_READ OperationType = 5 - OperationType_MAP_MODIFY OperationType = 6 - OperationType_ADD OperationType = 7 - OperationType_EXP_READ OperationType = 8 - OperationType_EXP_MODIFY OperationType = 9 - OperationType_APPEND OperationType = 10 - OperationType_PREPEND OperationType = 11 - OperationType_TOUCH OperationType = 12 - OperationType_BIT_READ OperationType = 13 - OperationType_BIT_MODIFY OperationType = 14 - OperationType_DELETE OperationType = 15 - OperationType_HLL_READ OperationType = 16 - OperationType_HLL_MODIFY OperationType = 17 -) - -// Enum value maps for OperationType. -var ( - OperationType_name = map[int32]string{ - 0: "READ", - 1: "READ_HEADER", - 2: "WRITE", - 3: "CDT_READ", - 4: "CDT_MODIFY", - 5: "MAP_READ", - 6: "MAP_MODIFY", - 7: "ADD", - 8: "EXP_READ", - 9: "EXP_MODIFY", - 10: "APPEND", - 11: "PREPEND", - 12: "TOUCH", - 13: "BIT_READ", - 14: "BIT_MODIFY", - 15: "DELETE", - 16: "HLL_READ", - 17: "HLL_MODIFY", - } - OperationType_value = map[string]int32{ - "READ": 0, - "READ_HEADER": 1, - "WRITE": 2, - "CDT_READ": 3, - "CDT_MODIFY": 4, - "MAP_READ": 5, - "MAP_MODIFY": 6, - "ADD": 7, - "EXP_READ": 8, - "EXP_MODIFY": 9, - "APPEND": 10, - "PREPEND": 11, - "TOUCH": 12, - "BIT_READ": 13, - "BIT_MODIFY": 14, - "DELETE": 15, - "HLL_READ": 16, - "HLL_MODIFY": 17, - } -) - -func (x OperationType) Enum() *OperationType { - p := new(OperationType) - *p = x - return p -} - -func (x OperationType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OperationType) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[5].Descriptor() -} - -func (OperationType) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[5] -} - -func (x OperationType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OperationType.Descriptor instead. -func (OperationType) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{5} -} - -type RecordExistsAction int32 - -const ( - // Create or update record. - // Merge write command bins with existing bins. - RecordExistsAction_UPDATE RecordExistsAction = 0 - // Update record only. Fail if record does not exist. - // Merge write command bins with existing bins. - RecordExistsAction_UPDATE_ONLY RecordExistsAction = 1 - // Create or replace record. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike server versions >= 3.1.6. - RecordExistsAction_REPLACE RecordExistsAction = 2 - // Replace record only. Fail if record does not exist. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike server versions >= 3.1.6. - RecordExistsAction_REPLACE_ONLY RecordExistsAction = 3 - // Create only. Fail if record exists. - RecordExistsAction_CREATE_ONLY RecordExistsAction = 4 -) - -// Enum value maps for RecordExistsAction. -var ( - RecordExistsAction_name = map[int32]string{ - 0: "UPDATE", - 1: "UPDATE_ONLY", - 2: "REPLACE", - 3: "REPLACE_ONLY", - 4: "CREATE_ONLY", - } - RecordExistsAction_value = map[string]int32{ - "UPDATE": 0, - "UPDATE_ONLY": 1, - "REPLACE": 2, - "REPLACE_ONLY": 3, - "CREATE_ONLY": 4, - } -) - -func (x RecordExistsAction) Enum() *RecordExistsAction { - p := new(RecordExistsAction) - *p = x - return p -} - -func (x RecordExistsAction) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RecordExistsAction) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[6].Descriptor() -} - -func (RecordExistsAction) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[6] -} - -func (x RecordExistsAction) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RecordExistsAction.Descriptor instead. -func (RecordExistsAction) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{6} -} - -type GenerationPolicy int32 - -const ( - // Do not use record generation to restrict writes. - GenerationPolicy_NONE GenerationPolicy = 0 - // Update/delete record if expected generation is equal to server generation. Otherwise, fail. - GenerationPolicy_EXPECT_GEN_EQUAL GenerationPolicy = 1 - // Update/delete record if expected generation greater than the server generation. Otherwise, fail. - // This is useful for restore after backup. - GenerationPolicy_EXPECT_GEN_GT GenerationPolicy = 2 -) - -// Enum value maps for GenerationPolicy. -var ( - GenerationPolicy_name = map[int32]string{ - 0: "NONE", - 1: "EXPECT_GEN_EQUAL", - 2: "EXPECT_GEN_GT", - } - GenerationPolicy_value = map[string]int32{ - "NONE": 0, - "EXPECT_GEN_EQUAL": 1, - "EXPECT_GEN_GT": 2, - } -) - -func (x GenerationPolicy) Enum() *GenerationPolicy { - p := new(GenerationPolicy) - *p = x - return p -} - -func (x GenerationPolicy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GenerationPolicy) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[7].Descriptor() -} - -func (GenerationPolicy) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[7] -} - -func (x GenerationPolicy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GenerationPolicy.Descriptor instead. -func (GenerationPolicy) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{7} -} - -type CommitLevel int32 - -const ( - // Server should wait until successfully committing master and all replicas. - CommitLevel_COMMIT_ALL CommitLevel = 0 - // Server should wait until successfully committing master only. - CommitLevel_COMMIT_MASTER CommitLevel = 1 -) - -// Enum value maps for CommitLevel. -var ( - CommitLevel_name = map[int32]string{ - 0: "COMMIT_ALL", - 1: "COMMIT_MASTER", - } - CommitLevel_value = map[string]int32{ - "COMMIT_ALL": 0, - "COMMIT_MASTER": 1, - } -) - -func (x CommitLevel) Enum() *CommitLevel { - p := new(CommitLevel) - *p = x - return p -} - -func (x CommitLevel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CommitLevel) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[8].Descriptor() -} - -func (CommitLevel) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[8] -} - -func (x CommitLevel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CommitLevel.Descriptor instead. -func (CommitLevel) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{8} -} - -type BackgroundTaskStatus int32 - -const ( - // Task not found. - BackgroundTaskStatus_NOT_FOUND BackgroundTaskStatus = 0 - // Task in progress. - BackgroundTaskStatus_IN_PROGRESS BackgroundTaskStatus = 1 - // Task completed. - BackgroundTaskStatus_COMPLETE BackgroundTaskStatus = 2 -) - -// Enum value maps for BackgroundTaskStatus. -var ( - BackgroundTaskStatus_name = map[int32]string{ - 0: "NOT_FOUND", - 1: "IN_PROGRESS", - 2: "COMPLETE", - } - BackgroundTaskStatus_value = map[string]int32{ - "NOT_FOUND": 0, - "IN_PROGRESS": 1, - "COMPLETE": 2, - } -) - -func (x BackgroundTaskStatus) Enum() *BackgroundTaskStatus { - p := new(BackgroundTaskStatus) - *p = x - return p -} - -func (x BackgroundTaskStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BackgroundTaskStatus) Descriptor() protoreflect.EnumDescriptor { - return file_aerospike_proxy_kv_proto_enumTypes[9].Descriptor() -} - -func (BackgroundTaskStatus) Type() protoreflect.EnumType { - return &file_aerospike_proxy_kv_proto_enumTypes[9] -} - -func (x BackgroundTaskStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BackgroundTaskStatus.Descriptor instead. -func (BackgroundTaskStatus) EnumDescriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{9} -} - -// The about request message. -type AboutRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AboutRequest) Reset() { - *x = AboutRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AboutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AboutRequest) ProtoMessage() {} - -func (x *AboutRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AboutRequest.ProtoReflect.Descriptor instead. -func (*AboutRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{0} -} - -// The about response message. -type AboutResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Proxy server version. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *AboutResponse) Reset() { - *x = AboutResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AboutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AboutResponse) ProtoMessage() {} - -func (x *AboutResponse) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AboutResponse.ProtoReflect.Descriptor instead. -func (*AboutResponse) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{1} -} - -func (x *AboutResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Read policy attributes used in read database commands that are not part of -// the wire protocol. -type ReadPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Read policy for AP (availability) namespaces. - Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` - // Read policy for SC (strong consistency) namespaces. - ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` -} - -func (x *ReadPolicy) Reset() { - *x = ReadPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadPolicy) ProtoMessage() {} - -func (x *ReadPolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReadPolicy.ProtoReflect.Descriptor instead. -func (*ReadPolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{2} -} - -func (x *ReadPolicy) GetReplica() Replica { - if x != nil { - return x.Replica - } - return Replica_SEQUENCE -} - -func (x *ReadPolicy) GetReadModeAP() ReadModeAP { - if x != nil { - return x.ReadModeAP - } - return ReadModeAP_ONE -} - -func (x *ReadPolicy) GetReadModeSC() ReadModeSC { - if x != nil { - return x.ReadModeSC - } - return ReadModeSC_SESSION -} - -// Write policy attributes used in write database commands that are not part of -// the wire protocol. -type WritePolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Read policy for AP (availability) namespaces. - Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` - // Read policy for SC (strong consistency) namespaces. - ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` -} - -func (x *WritePolicy) Reset() { - *x = WritePolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WritePolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WritePolicy) ProtoMessage() {} - -func (x *WritePolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WritePolicy.ProtoReflect.Descriptor instead. -func (*WritePolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{3} -} - -func (x *WritePolicy) GetReplica() Replica { - if x != nil { - return x.Replica - } - return Replica_SEQUENCE -} - -func (x *WritePolicy) GetReadModeAP() ReadModeAP { - if x != nil { - return x.ReadModeAP - } - return ReadModeAP_ONE -} - -func (x *WritePolicy) GetReadModeSC() ReadModeSC { - if x != nil { - return x.ReadModeSC - } - return ReadModeSC_SESSION -} - -// The request message containing the user's name. -type AerospikeRequestPayload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unique identifier of the request in the stream. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // Client iteration number starting at 1. On first attempt iteration should - // be 1. On first retry iteration should be 2, on second retry iteration - // should be 3, and so on. - Iteration uint32 `protobuf:"varint,2,opt,name=iteration,proto3" json:"iteration,omitempty"` - // Aerospike wire format request payload. - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // Read policy for read requests. - ReadPolicy *ReadPolicy `protobuf:"bytes,4,opt,name=readPolicy,proto3,oneof" json:"readPolicy,omitempty"` - // Write policy for write requests. - WritePolicy *WritePolicy `protobuf:"bytes,5,opt,name=writePolicy,proto3,oneof" json:"writePolicy,omitempty"` - // Scan request for scan. - ScanRequest *ScanRequest `protobuf:"bytes,6,opt,name=scanRequest,proto3,oneof" json:"scanRequest,omitempty"` - // Request for running a query. - QueryRequest *QueryRequest `protobuf:"bytes,7,opt,name=queryRequest,proto3,oneof" json:"queryRequest,omitempty"` - // Abort a scan/query on application error. - AbortRequest *AbortRequest `protobuf:"bytes,8,opt,name=abortRequest,proto3,oneof" json:"abortRequest,omitempty"` - // Request for executing operations background on matching records. - BackgroundExecuteRequest *BackgroundExecuteRequest `protobuf:"bytes,9,opt,name=backgroundExecuteRequest,proto3,oneof" json:"backgroundExecuteRequest,omitempty"` - // Request for getting background task status. - BackgroundTaskStatusRequest *BackgroundTaskStatusRequest `protobuf:"bytes,10,opt,name=backgroundTaskStatusRequest,proto3,oneof" json:"backgroundTaskStatusRequest,omitempty"` - // Info request - InfoRequest *InfoRequest `protobuf:"bytes,11,opt,name=infoRequest,proto3,oneof" json:"infoRequest,omitempty"` -} - -func (x *AerospikeRequestPayload) Reset() { - *x = AerospikeRequestPayload{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AerospikeRequestPayload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AerospikeRequestPayload) ProtoMessage() {} - -func (x *AerospikeRequestPayload) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AerospikeRequestPayload.ProtoReflect.Descriptor instead. -func (*AerospikeRequestPayload) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{4} -} - -func (x *AerospikeRequestPayload) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AerospikeRequestPayload) GetIteration() uint32 { - if x != nil { - return x.Iteration - } - return 0 -} - -func (x *AerospikeRequestPayload) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *AerospikeRequestPayload) GetReadPolicy() *ReadPolicy { - if x != nil { - return x.ReadPolicy - } - return nil -} - -func (x *AerospikeRequestPayload) GetWritePolicy() *WritePolicy { - if x != nil { - return x.WritePolicy - } - return nil -} - -func (x *AerospikeRequestPayload) GetScanRequest() *ScanRequest { - if x != nil { - return x.ScanRequest - } - return nil -} - -func (x *AerospikeRequestPayload) GetQueryRequest() *QueryRequest { - if x != nil { - return x.QueryRequest - } - return nil -} - -func (x *AerospikeRequestPayload) GetAbortRequest() *AbortRequest { - if x != nil { - return x.AbortRequest - } - return nil -} - -func (x *AerospikeRequestPayload) GetBackgroundExecuteRequest() *BackgroundExecuteRequest { - if x != nil { - return x.BackgroundExecuteRequest - } - return nil -} - -func (x *AerospikeRequestPayload) GetBackgroundTaskStatusRequest() *BackgroundTaskStatusRequest { - if x != nil { - return x.BackgroundTaskStatusRequest - } - return nil -} - -func (x *AerospikeRequestPayload) GetInfoRequest() *InfoRequest { - if x != nil { - return x.InfoRequest - } - return nil -} - -// The request message containing the user's name. -type AerospikeResponsePayload struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unique identifier of the corresponding request in the stream. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // Status of the corresponding request. - // - // if status equals 0 - // The proxy received a valid response from Aerospike. The payload's - // result code should be used as the client result code. - // else - // The request failed at the proxy. This status should be used - // as the client result code. - Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` - // This flag indicates that the write transaction may have completed, - // even though the client sees an error. - InDoubt bool `protobuf:"varint,3,opt,name=inDoubt,proto3" json:"inDoubt,omitempty"` - // Aerospike wire format request payload. - Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` - // For requests with multiple responses like batch and queries, - // hasNext flag indicates if there are more responses to follow this - // response or if this is the last response for this request. - HasNext bool `protobuf:"varint,5,opt,name=hasNext,proto3" json:"hasNext,omitempty"` - // Background task status, populated for background task request. - BackgroundTaskStatus *BackgroundTaskStatus `protobuf:"varint,6,opt,name=backgroundTaskStatus,proto3,enum=BackgroundTaskStatus,oneof" json:"backgroundTaskStatus,omitempty"` -} - -func (x *AerospikeResponsePayload) Reset() { - *x = AerospikeResponsePayload{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AerospikeResponsePayload) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AerospikeResponsePayload) ProtoMessage() {} - -func (x *AerospikeResponsePayload) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AerospikeResponsePayload.ProtoReflect.Descriptor instead. -func (*AerospikeResponsePayload) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{5} -} - -func (x *AerospikeResponsePayload) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AerospikeResponsePayload) GetStatus() int32 { - if x != nil { - return x.Status - } - return 0 -} - -func (x *AerospikeResponsePayload) GetInDoubt() bool { - if x != nil { - return x.InDoubt - } - return false -} - -func (x *AerospikeResponsePayload) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *AerospikeResponsePayload) GetHasNext() bool { - if x != nil { - return x.HasNext - } - return false -} - -func (x *AerospikeResponsePayload) GetBackgroundTaskStatus() BackgroundTaskStatus { - if x != nil && x.BackgroundTaskStatus != nil { - return *x.BackgroundTaskStatus - } - return BackgroundTaskStatus_NOT_FOUND -} - -// Scan policy attributes used by queries. -// Scan requests are send completely using proto buffers and hence include all policy attributes. -type ScanPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Read policy for AP (availability) namespaces. - Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` - // Read policy for SC (strong consistency) namespaces. - ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and scan are not affected by replica algorithms. - ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - Compress bool `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"` - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - Expression []byte `protobuf:"bytes,5,opt,name=expression,proto3,oneof" json:"expression,omitempty"` - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - TotalTimeout *uint32 `protobuf:"varint,6,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` - // Approximate number of records to return to client. This number is divided by the - // number of nodes involved in the scan. The actual number of records returned - // may be less than maxRecords if node record counts are small and unbalanced across - // nodes. - // Default: 0 (do not limit record count) - MaxRecords *uint64 `protobuf:"varint,7,opt,name=maxRecords,proto3,oneof" json:"maxRecords,omitempty"` - // Limit returned records per second (rps) rate for each server. - // Do not apply rps limit if recordsPerSecond is zero. - // Default: 0 - RecordsPerSecond *uint32 `protobuf:"varint,8,opt,name=recordsPerSecond,proto3,oneof" json:"recordsPerSecond,omitempty"` - // Should scan requests be issued in parallel. - // Default: true - ConcurrentNodes *bool `protobuf:"varint,9,opt,name=concurrentNodes,proto3,oneof" json:"concurrentNodes,omitempty"` - // Maximum number of concurrent requests to server nodes at any point in time. - // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries - // will be made to 8 nodes in parallel. When a scan completes, a new scan will - // be issued until all 16 nodes have been queried. - // Default: 0 (issue requests to all server nodes in parallel) - MaxConcurrentNodes *uint32 `protobuf:"varint,10,opt,name=maxConcurrentNodes,proto3,oneof" json:"maxConcurrentNodes,omitempty"` - // Should bin data be retrieved. If false, only record digests (and user keys - // if stored on the server) are retrieved. - // Default: true - IncludeBinData *bool `protobuf:"varint,11,opt,name=includeBinData,proto3,oneof" json:"includeBinData,omitempty"` -} - -func (x *ScanPolicy) Reset() { - *x = ScanPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ScanPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScanPolicy) ProtoMessage() {} - -func (x *ScanPolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ScanPolicy.ProtoReflect.Descriptor instead. -func (*ScanPolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{6} -} - -func (x *ScanPolicy) GetReplica() Replica { - if x != nil { - return x.Replica - } - return Replica_SEQUENCE -} - -func (x *ScanPolicy) GetReadModeAP() ReadModeAP { - if x != nil { - return x.ReadModeAP - } - return ReadModeAP_ONE -} - -func (x *ScanPolicy) GetReadModeSC() ReadModeSC { - if x != nil { - return x.ReadModeSC - } - return ReadModeSC_SESSION -} - -func (x *ScanPolicy) GetCompress() bool { - if x != nil { - return x.Compress - } - return false -} - -func (x *ScanPolicy) GetExpression() []byte { - if x != nil { - return x.Expression - } - return nil -} - -func (x *ScanPolicy) GetTotalTimeout() uint32 { - if x != nil && x.TotalTimeout != nil { - return *x.TotalTimeout - } - return 0 -} - -func (x *ScanPolicy) GetMaxRecords() uint64 { - if x != nil && x.MaxRecords != nil { - return *x.MaxRecords - } - return 0 -} - -func (x *ScanPolicy) GetRecordsPerSecond() uint32 { - if x != nil && x.RecordsPerSecond != nil { - return *x.RecordsPerSecond - } - return 0 -} - -func (x *ScanPolicy) GetConcurrentNodes() bool { - if x != nil && x.ConcurrentNodes != nil { - return *x.ConcurrentNodes - } - return false -} - -func (x *ScanPolicy) GetMaxConcurrentNodes() uint32 { - if x != nil && x.MaxConcurrentNodes != nil { - return *x.MaxConcurrentNodes - } - return 0 -} - -func (x *ScanPolicy) GetIncludeBinData() bool { - if x != nil && x.IncludeBinData != nil { - return *x.IncludeBinData - } - return false -} - -// Partition status used to perform partial scans on client side retries. -type PartitionStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The partition status. - Id *uint32 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` - // Begin value to start scanning / querying after. - BVal *int64 `protobuf:"varint,2,opt,name=bVal,proto3,oneof" json:"bVal,omitempty"` - // Digest to start scanning / querying after. - Digest []byte `protobuf:"bytes,3,opt,name=digest,proto3,oneof" json:"digest,omitempty"` - // Indicates this partition should be tried. - // Should be set to true for the first attempt as well. - Retry bool `protobuf:"varint,5,opt,name=retry,proto3" json:"retry,omitempty"` -} - -func (x *PartitionStatus) Reset() { - *x = PartitionStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PartitionStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PartitionStatus) ProtoMessage() {} - -func (x *PartitionStatus) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PartitionStatus.ProtoReflect.Descriptor instead. -func (*PartitionStatus) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{7} -} - -func (x *PartitionStatus) GetId() uint32 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *PartitionStatus) GetBVal() int64 { - if x != nil && x.BVal != nil { - return *x.BVal - } - return 0 -} - -func (x *PartitionStatus) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -func (x *PartitionStatus) GetRetry() bool { - if x != nil { - return x.Retry - } - return false -} - -// A partition filter for scans and queries. -type PartitionFilter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Start partition id. - // Not required if the digest to start scanning from is specified. - Begin *uint32 `protobuf:"varint,1,opt,name=begin,proto3,oneof" json:"begin,omitempty"` - // The number of records to scan. - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - // Optional digest to start scanning from. - Digest []byte `protobuf:"bytes,3,opt,name=digest,proto3,oneof" json:"digest,omitempty"` - // Optional partition statuses used on retries to restart - // from last known record for the partition. - PartitionStatuses []*PartitionStatus `protobuf:"bytes,4,rep,name=partitionStatuses,proto3" json:"partitionStatuses,omitempty"` - // Indicates if all partitions in this filter should - // be retried ignoring the partition status - Retry bool `protobuf:"varint,5,opt,name=retry,proto3" json:"retry,omitempty"` -} - -func (x *PartitionFilter) Reset() { - *x = PartitionFilter{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PartitionFilter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PartitionFilter) ProtoMessage() {} - -func (x *PartitionFilter) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PartitionFilter.ProtoReflect.Descriptor instead. -func (*PartitionFilter) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{8} -} - -func (x *PartitionFilter) GetBegin() uint32 { - if x != nil && x.Begin != nil { - return *x.Begin - } - return 0 -} - -func (x *PartitionFilter) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *PartitionFilter) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -func (x *PartitionFilter) GetPartitionStatuses() []*PartitionStatus { - if x != nil { - return x.PartitionStatuses - } - return nil -} - -func (x *PartitionFilter) GetRetry() bool { - if x != nil { - return x.Retry - } - return false -} - -// A scan request. -type ScanRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional scan policy. - ScanPolicy *ScanPolicy `protobuf:"bytes,1,opt,name=scanPolicy,proto3,oneof" json:"scanPolicy,omitempty"` - // The namespace to scan. - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - // Optional set name. - SetName *string `protobuf:"bytes,3,opt,name=setName,proto3,oneof" json:"setName,omitempty"` - // Optional bin to retrieve. All bins will be returned - // if not specified. - BinNames []string `protobuf:"bytes,4,rep,name=binNames,proto3" json:"binNames,omitempty"` - // Optional partition filter to selectively scan partitions. - PartitionFilter *PartitionFilter `protobuf:"bytes,5,opt,name=partitionFilter,proto3,oneof" json:"partitionFilter,omitempty"` -} - -func (x *ScanRequest) Reset() { - *x = ScanRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ScanRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ScanRequest) ProtoMessage() {} - -func (x *ScanRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ScanRequest.ProtoReflect.Descriptor instead. -func (*ScanRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{9} -} - -func (x *ScanRequest) GetScanPolicy() *ScanPolicy { - if x != nil { - return x.ScanPolicy - } - return nil -} - -func (x *ScanRequest) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *ScanRequest) GetSetName() string { - if x != nil && x.SetName != nil { - return *x.SetName - } - return "" -} - -func (x *ScanRequest) GetBinNames() []string { - if x != nil { - return x.BinNames - } - return nil -} - -func (x *ScanRequest) GetPartitionFilter() *PartitionFilter { - if x != nil { - return x.PartitionFilter - } - return nil -} - -// Query policy attributes used by queries. -// Query requests are send completely using proto buffers and hence include all policy attributes. -type QueryPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Read policy for AP (availability) namespaces. - Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` - // Read policy for SC (strong consistency) namespaces. - ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` - // Send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - // Default: false (do not send the user defined key) - SendKey *bool `protobuf:"varint,4,opt,name=sendKey,proto3,oneof" json:"sendKey,omitempty"` - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - Compress bool `protobuf:"varint,5,opt,name=compress,proto3" json:"compress,omitempty"` - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - Expression []byte `protobuf:"bytes,6,opt,name=expression,proto3,oneof" json:"expression,omitempty"` - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - TotalTimeout *uint32 `protobuf:"varint,7,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` - // Maximum number of concurrent requests to server nodes at any point in time. - // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries - // will be made to 8 nodes in parallel. When a query completes, a new query will - // be issued until all 16 nodes have been queried. - // Default: 0 (issue requests to all server nodes in parallel) - MaxConcurrentNodes *uint32 `protobuf:"varint,8,opt,name=maxConcurrentNodes,proto3,oneof" json:"maxConcurrentNodes,omitempty"` - // Number of records to place in queue before blocking. - // Records received from multiple server nodes will be placed in a queue. - // A separate thread consumes these records in parallel. - // If the queue is full, the producer threads will block until records are consumed. - // Default: 5000 - RecordQueueSize *uint32 `protobuf:"varint,9,opt,name=recordQueueSize,proto3,oneof" json:"recordQueueSize,omitempty"` - // Should bin data be retrieved. If false, only record digests (and user keys - // if stored on the server) are retrieved. - // Default: true - IncludeBinData *bool `protobuf:"varint,10,opt,name=includeBinData,proto3,oneof" json:"includeBinData,omitempty"` - // Terminate query if cluster is in migration state. If the server supports partition - // queries or the query filter is null (scan), this field is ignored. - // Default: false - FailOnClusterChange *bool `protobuf:"varint,11,opt,name=failOnClusterChange,proto3,oneof" json:"failOnClusterChange,omitempty"` - // Deprecated, use expectedDuration instead. - // Is query expected to return less than 100 records per node. - // If true, the server will optimize the query for a small record set. - // This field is ignored for aggregation queries, background queries - // and server versions < 6.0. - // Default: false - ShortQuery *bool `protobuf:"varint,12,opt,name=shortQuery,proto3,oneof" json:"shortQuery,omitempty"` - // Timeout in milliseconds for "cluster-stable" info command that is run when - // failOnClusterChange is true and server version is less than 6.0. - // - // Default: 1000 - InfoTimeout *uint32 `protobuf:"varint,13,opt,name=infoTimeout,proto3,oneof" json:"infoTimeout,omitempty"` - // Expected query duration. The server treats the query in different ways depending on the expected duration. - // This field is ignored for aggregation queries, background queries and server versions less than 6.0. - // Default: QueryDuration.LONG - ExpectedDuration *QueryDuration `protobuf:"varint,14,opt,name=expectedDuration,proto3,enum=QueryDuration,oneof" json:"expectedDuration,omitempty"` -} - -func (x *QueryPolicy) Reset() { - *x = QueryPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryPolicy) ProtoMessage() {} - -func (x *QueryPolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryPolicy.ProtoReflect.Descriptor instead. -func (*QueryPolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{10} -} - -func (x *QueryPolicy) GetReplica() Replica { - if x != nil { - return x.Replica - } - return Replica_SEQUENCE -} - -func (x *QueryPolicy) GetReadModeAP() ReadModeAP { - if x != nil { - return x.ReadModeAP - } - return ReadModeAP_ONE -} - -func (x *QueryPolicy) GetReadModeSC() ReadModeSC { - if x != nil { - return x.ReadModeSC - } - return ReadModeSC_SESSION -} - -func (x *QueryPolicy) GetSendKey() bool { - if x != nil && x.SendKey != nil { - return *x.SendKey - } - return false -} - -func (x *QueryPolicy) GetCompress() bool { - if x != nil { - return x.Compress - } - return false -} - -func (x *QueryPolicy) GetExpression() []byte { - if x != nil { - return x.Expression - } - return nil -} - -func (x *QueryPolicy) GetTotalTimeout() uint32 { - if x != nil && x.TotalTimeout != nil { - return *x.TotalTimeout - } - return 0 -} - -func (x *QueryPolicy) GetMaxConcurrentNodes() uint32 { - if x != nil && x.MaxConcurrentNodes != nil { - return *x.MaxConcurrentNodes - } - return 0 -} - -func (x *QueryPolicy) GetRecordQueueSize() uint32 { - if x != nil && x.RecordQueueSize != nil { - return *x.RecordQueueSize - } - return 0 -} - -func (x *QueryPolicy) GetIncludeBinData() bool { - if x != nil && x.IncludeBinData != nil { - return *x.IncludeBinData - } - return false -} - -func (x *QueryPolicy) GetFailOnClusterChange() bool { - if x != nil && x.FailOnClusterChange != nil { - return *x.FailOnClusterChange - } - return false -} - -func (x *QueryPolicy) GetShortQuery() bool { - if x != nil && x.ShortQuery != nil { - return *x.ShortQuery - } - return false -} - -func (x *QueryPolicy) GetInfoTimeout() uint32 { - if x != nil && x.InfoTimeout != nil { - return *x.InfoTimeout - } - return 0 -} - -func (x *QueryPolicy) GetExpectedDuration() QueryDuration { - if x != nil && x.ExpectedDuration != nil { - return *x.ExpectedDuration - } - return QueryDuration_LONG -} - -// Query statement filter -type Filter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the filter. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Secondary index collection type. - ColType IndexCollectionType `protobuf:"varint,2,opt,name=colType,proto3,enum=IndexCollectionType" json:"colType,omitempty"` - // Optional filter context packed in Aerospike format. - PackedCtx []byte `protobuf:"bytes,3,opt,name=packedCtx,proto3,oneof" json:"packedCtx,omitempty"` - // The queried column particle type. - ValType int32 `protobuf:"varint,4,opt,name=valType,proto3" json:"valType,omitempty"` - // The Aerospike encoded query start "Value" - Begin []byte `protobuf:"bytes,5,opt,name=begin,proto3,oneof" json:"begin,omitempty"` - // The Aerospike encoded query end "Value" - End []byte `protobuf:"bytes,6,opt,name=end,proto3,oneof" json:"end,omitempty"` -} - -func (x *Filter) Reset() { - *x = Filter{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Filter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Filter) ProtoMessage() {} - -func (x *Filter) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Filter.ProtoReflect.Descriptor instead. -func (*Filter) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{11} -} - -func (x *Filter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Filter) GetColType() IndexCollectionType { - if x != nil { - return x.ColType - } - return IndexCollectionType_DEFAULT -} - -func (x *Filter) GetPackedCtx() []byte { - if x != nil { - return x.PackedCtx - } - return nil -} - -func (x *Filter) GetValType() int32 { - if x != nil { - return x.ValType - } - return 0 -} - -func (x *Filter) GetBegin() []byte { - if x != nil { - return x.Begin - } - return nil -} - -func (x *Filter) GetEnd() []byte { - if x != nil { - return x.End - } - return nil -} - -// Single record operation. -type Operation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The operation type. - Type OperationType `protobuf:"varint,1,opt,name=type,proto3,enum=OperationType" json:"type,omitempty"` - // Optional bin name. - BinName *string `protobuf:"bytes,2,opt,name=binName,proto3,oneof" json:"binName,omitempty"` - // Optional bin value. - Value []byte `protobuf:"bytes,3,opt,name=value,proto3,oneof" json:"value,omitempty"` -} - -func (x *Operation) Reset() { - *x = Operation{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{12} -} - -func (x *Operation) GetType() OperationType { - if x != nil { - return x.Type - } - return OperationType_READ -} - -func (x *Operation) GetBinName() string { - if x != nil && x.BinName != nil { - return *x.BinName - } - return "" -} - -func (x *Operation) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -// Query statement. -type Statement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The namespace to query. - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - // Optional set name. - SetName *string `protobuf:"bytes,2,opt,name=setName,proto3,oneof" json:"setName,omitempty"` - // Optional index name. - IndexName *string `protobuf:"bytes,3,opt,name=indexName,proto3,oneof" json:"indexName,omitempty"` - // Optional bins names to return for each result record. - // If not specified all bins are returned. - BinNames []string `protobuf:"bytes,4,rep,name=binNames,proto3" json:"binNames,omitempty"` - // Optional Filter encoded in Aerospike wire format. - Filter *Filter `protobuf:"bytes,5,opt,name=filter,proto3,oneof" json:"filter,omitempty"` - // Aggregation file name. - PackageName string `protobuf:"bytes,6,opt,name=packageName,proto3" json:"packageName,omitempty"` - // Aggregation function name. - FunctionName string `protobuf:"bytes,7,opt,name=functionName,proto3" json:"functionName,omitempty"` - // Aggregation function arguments encoded as bytes using Aerospike wire format. - FunctionArgs [][]byte `protobuf:"bytes,8,rep,name=functionArgs,proto3" json:"functionArgs,omitempty"` - // Operations to be performed on query encoded as bytes using Aerospike wire format. - Operations []*Operation `protobuf:"bytes,9,rep,name=operations,proto3" json:"operations,omitempty"` - // Optional taskId. - TaskId *int64 `protobuf:"varint,10,opt,name=taskId,proto3,oneof" json:"taskId,omitempty"` - // Approximate number of records to return to client. This number is divided by the - // number of nodes involved in the scan. The actual number of records returned - // may be less than maxRecords if node record counts are small and unbalanced across - // nodes. - // Default: 0 (do not limit record count) - MaxRecords *uint64 `protobuf:"varint,11,opt,name=maxRecords,proto3,oneof" json:"maxRecords,omitempty"` - // Limit returned records per second (rps) rate for each server. - // Do not apply rps limit if recordsPerSecond is zero. - // Default: 0 - RecordsPerSecond *uint32 `protobuf:"varint,12,opt,name=recordsPerSecond,proto3,oneof" json:"recordsPerSecond,omitempty"` -} - -func (x *Statement) Reset() { - *x = Statement{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Statement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Statement) ProtoMessage() {} - -func (x *Statement) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Statement.ProtoReflect.Descriptor instead. -func (*Statement) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{13} -} - -func (x *Statement) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *Statement) GetSetName() string { - if x != nil && x.SetName != nil { - return *x.SetName - } - return "" -} - -func (x *Statement) GetIndexName() string { - if x != nil && x.IndexName != nil { - return *x.IndexName - } - return "" -} - -func (x *Statement) GetBinNames() []string { - if x != nil { - return x.BinNames - } - return nil -} - -func (x *Statement) GetFilter() *Filter { - if x != nil { - return x.Filter - } - return nil -} - -func (x *Statement) GetPackageName() string { - if x != nil { - return x.PackageName - } - return "" -} - -func (x *Statement) GetFunctionName() string { - if x != nil { - return x.FunctionName - } - return "" -} - -func (x *Statement) GetFunctionArgs() [][]byte { - if x != nil { - return x.FunctionArgs - } - return nil -} - -func (x *Statement) GetOperations() []*Operation { - if x != nil { - return x.Operations - } - return nil -} - -func (x *Statement) GetTaskId() int64 { - if x != nil && x.TaskId != nil { - return *x.TaskId - } - return 0 -} - -func (x *Statement) GetMaxRecords() uint64 { - if x != nil && x.MaxRecords != nil { - return *x.MaxRecords - } - return 0 -} - -func (x *Statement) GetRecordsPerSecond() uint32 { - if x != nil && x.RecordsPerSecond != nil { - return *x.RecordsPerSecond - } - return 0 -} - -// A query request. -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optional query policy. - QueryPolicy *QueryPolicy `protobuf:"bytes,1,opt,name=queryPolicy,proto3,oneof" json:"queryPolicy,omitempty"` - // The query statement. - Statement *Statement `protobuf:"bytes,2,opt,name=statement,proto3" json:"statement,omitempty"` - // Set to true for background queries. - Background bool `protobuf:"varint,3,opt,name=background,proto3" json:"background,omitempty"` - // Optional partition filter to selectively query partitions. - PartitionFilter *PartitionFilter `protobuf:"bytes,4,opt,name=partitionFilter,proto3,oneof" json:"partitionFilter,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{14} -} - -func (x *QueryRequest) GetQueryPolicy() *QueryPolicy { - if x != nil { - return x.QueryPolicy - } - return nil -} - -func (x *QueryRequest) GetStatement() *Statement { - if x != nil { - return x.Statement - } - return nil -} - -func (x *QueryRequest) GetBackground() bool { - if x != nil { - return x.Background - } - return false -} - -func (x *QueryRequest) GetPartitionFilter() *PartitionFilter { - if x != nil { - return x.PartitionFilter - } - return nil -} - -type BackgroundExecutePolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Read policy for AP (availability) namespaces. - Replica Replica `protobuf:"varint,1,opt,name=replica,proto3,enum=Replica" json:"replica,omitempty"` - // Read policy for SC (strong consistency) namespaces. - ReadModeAP ReadModeAP `protobuf:"varint,2,opt,name=readModeAP,proto3,enum=ReadModeAP" json:"readModeAP,omitempty"` - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and scan are not affected by replica algorithms. - ReadModeSC ReadModeSC `protobuf:"varint,3,opt,name=readModeSC,proto3,enum=ReadModeSC" json:"readModeSC,omitempty"` - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - Compress bool `protobuf:"varint,4,opt,name=compress,proto3" json:"compress,omitempty"` - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - Expression []byte `protobuf:"bytes,5,opt,name=expression,proto3,oneof" json:"expression,omitempty"` - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - TotalTimeout *uint32 `protobuf:"varint,6,opt,name=totalTimeout,proto3,oneof" json:"totalTimeout,omitempty"` - // Send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - //

- // Default: false (do not send the user defined key) - SendKey *bool `protobuf:"varint,7,opt,name=sendKey,proto3,oneof" json:"sendKey,omitempty"` - // Qualify how to handle writes where the record already exists. - // - // Default: RecordExistsAction.UPDATE - RecordExistsAction *RecordExistsAction `protobuf:"varint,8,opt,name=recordExistsAction,proto3,enum=RecordExistsAction,oneof" json:"recordExistsAction,omitempty"` - // Qualify how to handle record writes based on record generation. The default (NONE) - // indicates that the generation is not used to restrict writes. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: GenerationPolicy.NONE - GenerationPolicy *GenerationPolicy `protobuf:"varint,9,opt,name=generationPolicy,proto3,enum=GenerationPolicy,oneof" json:"generationPolicy,omitempty"` - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - // - // Default: CommitLevel.COMMIT_ALL - CommitLevel *CommitLevel `protobuf:"varint,10,opt,name=commitLevel,proto3,enum=CommitLevel,oneof" json:"commitLevel,omitempty"` - // Expected generation. Generation is the number of times a record has been modified - // (including creation) on the server. If a write operation is creating a record, - // the expected generation would be 0. This field is only relevant when - // generationPolicy is not NONE. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: 0 - Generation *uint32 `protobuf:"varint,11,opt,name=generation,proto3,oneof" json:"generation,omitempty"` - // Record expiration. Also known as ttl (time to live). - // Seconds record will live before being removed by the server. - // - // Expiration values: - // - // - -2: Do not change ttl when record is updated. - // - -1: Never expire. - // - 0: Default to namespace configuration variable "default-ttl" on the server. - // - > 0: Actual ttl in seconds.
- // - // Default: 0 - Expiration *uint32 `protobuf:"varint,12,opt,name=expiration,proto3,oneof" json:"expiration,omitempty"` - // For client operate(), return a result for every operation. - // - // Some operations do not return results by default (ListOperation.clear() for example). - // This can make it difficult to determine the desired result offset in the returned - // bin's result list. - // - // Setting respondAllOps to true makes it easier to identify the desired result offset - // (result offset equals bin's operate sequence). If there is a map operation in operate(), - // respondAllOps will be forced to true for that operate() call. - // - // Default: false - RespondAllOps *bool `protobuf:"varint,13,opt,name=respondAllOps,proto3,oneof" json:"respondAllOps,omitempty"` - // If the transaction results in a record deletion, leave a tombstone for the record. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition 3.10+ only. - // - // Default: false (do not tombstone deleted records). - DurableDelete *bool `protobuf:"varint,14,opt,name=durableDelete,proto3,oneof" json:"durableDelete,omitempty"` - // Operate in XDR mode. Some external connectors may need to emulate an XDR client. - // If enabled, an XDR bit is set for writes in the wire protocol. - // - // Default: false. - Xdr *bool `protobuf:"varint,15,opt,name=xdr,proto3,oneof" json:"xdr,omitempty"` -} - -func (x *BackgroundExecutePolicy) Reset() { - *x = BackgroundExecutePolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackgroundExecutePolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackgroundExecutePolicy) ProtoMessage() {} - -func (x *BackgroundExecutePolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackgroundExecutePolicy.ProtoReflect.Descriptor instead. -func (*BackgroundExecutePolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{15} -} - -func (x *BackgroundExecutePolicy) GetReplica() Replica { - if x != nil { - return x.Replica - } - return Replica_SEQUENCE -} - -func (x *BackgroundExecutePolicy) GetReadModeAP() ReadModeAP { - if x != nil { - return x.ReadModeAP - } - return ReadModeAP_ONE -} - -func (x *BackgroundExecutePolicy) GetReadModeSC() ReadModeSC { - if x != nil { - return x.ReadModeSC - } - return ReadModeSC_SESSION -} - -func (x *BackgroundExecutePolicy) GetCompress() bool { - if x != nil { - return x.Compress - } - return false -} - -func (x *BackgroundExecutePolicy) GetExpression() []byte { - if x != nil { - return x.Expression - } - return nil -} - -func (x *BackgroundExecutePolicy) GetTotalTimeout() uint32 { - if x != nil && x.TotalTimeout != nil { - return *x.TotalTimeout - } - return 0 -} - -func (x *BackgroundExecutePolicy) GetSendKey() bool { - if x != nil && x.SendKey != nil { - return *x.SendKey - } - return false -} - -func (x *BackgroundExecutePolicy) GetRecordExistsAction() RecordExistsAction { - if x != nil && x.RecordExistsAction != nil { - return *x.RecordExistsAction - } - return RecordExistsAction_UPDATE -} - -func (x *BackgroundExecutePolicy) GetGenerationPolicy() GenerationPolicy { - if x != nil && x.GenerationPolicy != nil { - return *x.GenerationPolicy - } - return GenerationPolicy_NONE -} - -func (x *BackgroundExecutePolicy) GetCommitLevel() CommitLevel { - if x != nil && x.CommitLevel != nil { - return *x.CommitLevel - } - return CommitLevel_COMMIT_ALL -} - -func (x *BackgroundExecutePolicy) GetGeneration() uint32 { - if x != nil && x.Generation != nil { - return *x.Generation - } - return 0 -} - -func (x *BackgroundExecutePolicy) GetExpiration() uint32 { - if x != nil && x.Expiration != nil { - return *x.Expiration - } - return 0 -} - -func (x *BackgroundExecutePolicy) GetRespondAllOps() bool { - if x != nil && x.RespondAllOps != nil { - return *x.RespondAllOps - } - return false -} - -func (x *BackgroundExecutePolicy) GetDurableDelete() bool { - if x != nil && x.DurableDelete != nil { - return *x.DurableDelete - } - return false -} - -func (x *BackgroundExecutePolicy) GetXdr() bool { - if x != nil && x.Xdr != nil { - return *x.Xdr - } - return false -} - -type BackgroundExecuteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Background write policy - WritePolicy *BackgroundExecutePolicy `protobuf:"bytes,1,opt,name=writePolicy,proto3,oneof" json:"writePolicy,omitempty"` - // The statement containing the UDF function reference - // or the operations to be performed on matching record - Statement *Statement `protobuf:"bytes,2,opt,name=statement,proto3" json:"statement,omitempty"` -} - -func (x *BackgroundExecuteRequest) Reset() { - *x = BackgroundExecuteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackgroundExecuteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackgroundExecuteRequest) ProtoMessage() {} - -func (x *BackgroundExecuteRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackgroundExecuteRequest.ProtoReflect.Descriptor instead. -func (*BackgroundExecuteRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{16} -} - -func (x *BackgroundExecuteRequest) GetWritePolicy() *BackgroundExecutePolicy { - if x != nil { - return x.WritePolicy - } - return nil -} - -func (x *BackgroundExecuteRequest) GetStatement() *Statement { - if x != nil { - return x.Statement - } - return nil -} - -type BackgroundTaskStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The id of the task. - TaskId int64 `protobuf:"varint,1,opt,name=taskId,proto3" json:"taskId,omitempty"` - // If true indicates the task is a scan task else task is a query - IsScan bool `protobuf:"varint,2,opt,name=isScan,proto3" json:"isScan,omitempty"` -} - -func (x *BackgroundTaskStatusRequest) Reset() { - *x = BackgroundTaskStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BackgroundTaskStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackgroundTaskStatusRequest) ProtoMessage() {} - -func (x *BackgroundTaskStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BackgroundTaskStatusRequest.ProtoReflect.Descriptor instead. -func (*BackgroundTaskStatusRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{17} -} - -func (x *BackgroundTaskStatusRequest) GetTaskId() int64 { - if x != nil { - return x.TaskId - } - return 0 -} - -func (x *BackgroundTaskStatusRequest) GetIsScan() bool { - if x != nil { - return x.IsScan - } - return false -} - -// Abort a request identified by id in the stream. -type AbortRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Unique identifier of the corresponding request in the stream to abort. - // Not to be confused with the AbortRequest's id in the stream. - AbortId uint32 `protobuf:"varint,1,opt,name=abortId,proto3" json:"abortId,omitempty"` -} - -func (x *AbortRequest) Reset() { - *x = AbortRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AbortRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AbortRequest) ProtoMessage() {} - -func (x *AbortRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AbortRequest.ProtoReflect.Descriptor instead. -func (*AbortRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{18} -} - -func (x *AbortRequest) GetAbortId() uint32 { - if x != nil { - return x.AbortId - } - return 0 -} - -// Info policy for info request -type InfoPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Info command socket timeout in milliseconds. - // - // Default: 1000 - Timeout *uint32 `protobuf:"varint,1,opt,name=timeout,proto3,oneof" json:"timeout,omitempty"` -} - -func (x *InfoPolicy) Reset() { - *x = InfoPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoPolicy) ProtoMessage() {} - -func (x *InfoPolicy) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InfoPolicy.ProtoReflect.Descriptor instead. -func (*InfoPolicy) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{19} -} - -func (x *InfoPolicy) GetTimeout() uint32 { - if x != nil && x.Timeout != nil { - return *x.Timeout - } - return 0 -} - -// Info request -type InfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InfoPolicy *InfoPolicy `protobuf:"bytes,1,opt,name=infoPolicy,proto3,oneof" json:"infoPolicy,omitempty"` - Commands []string `protobuf:"bytes,2,rep,name=commands,proto3" json:"commands,omitempty"` -} - -func (x *InfoRequest) Reset() { - *x = InfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_aerospike_proxy_kv_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InfoRequest) ProtoMessage() {} - -func (x *InfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_aerospike_proxy_kv_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead. -func (*InfoRequest) Descriptor() ([]byte, []int) { - return file_aerospike_proxy_kv_proto_rawDescGZIP(), []int{20} -} - -func (x *InfoRequest) GetInfoPolicy() *InfoPolicy { - if x != nil { - return x.InfoPolicy - } - return nil -} - -func (x *InfoRequest) GetCommands() []string { - if x != nil { - return x.Commands - } - return nil -} - -var File_aerospike_proxy_kv_proto protoreflect.FileDescriptor - -var file_aerospike_proxy_kv_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x5f, 0x6b, 0x76, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x41, 0x62, - 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x29, 0x0a, 0x0d, 0x41, 0x62, - 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, - 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, - 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, - 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, - 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, - 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, - 0x53, 0x43, 0x22, 0x8b, 0x01, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, - 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, - 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, - 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, - 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, - 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, - 0x22, 0x81, 0x06, 0x0a, 0x17, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x69, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x30, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x73, - 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x02, - 0x52, 0x0b, 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, - 0x12, 0x36, 0x0a, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x03, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x0c, 0x61, 0x62, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x04, 0x52, - 0x0c, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, - 0x12, 0x5a, 0x0a, 0x18, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x05, 0x52, - 0x18, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, 0x63, 0x0a, 0x1b, - 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, - 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x06, 0x52, 0x1b, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, - 0x01, 0x12, 0x33, 0x0a, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x48, 0x07, 0x52, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x63, 0x61, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x61, 0x62, 0x6f, 0x72, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x62, 0x61, 0x63, 0x6b, - 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, - 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0xf9, 0x01, 0x0a, 0x18, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x44, - 0x6f, 0x75, 0x62, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x6e, 0x44, 0x6f, - 0x75, 0x62, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x12, 0x4e, 0x0a, 0x14, 0x62, 0x61, 0x63, 0x6b, 0x67, - 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x14, - 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x62, 0x61, 0x63, 0x6b, - 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0xdd, 0x04, 0x0a, 0x0a, 0x53, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, - 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, - 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, - 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, - 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, - 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1a, 0x0a, - 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, - 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, - 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x48, 0x02, 0x52, 0x0a, 0x6d, - 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x10, - 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, - 0x0f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x12, - 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x05, 0x52, 0x12, 0x6d, 0x61, 0x78, 0x43, - 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x88, 0x01, - 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x06, 0x52, 0x0e, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x42, 0x0d, - 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, - 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0d, - 0x0a, 0x0b, 0x5f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x42, 0x13, 0x0a, - 0x11, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, 0x61, 0x78, 0x43, 0x6f, - 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x11, 0x0a, - 0x0f, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x22, 0x8d, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x56, 0x61, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x04, 0x62, 0x56, 0x61, 0x6c, 0x88, - 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x02, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x12, - 0x14, 0x0a, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x72, 0x65, 0x74, 0x72, 0x79, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, - 0x5f, 0x62, 0x56, 0x61, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x88, - 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x11, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x72, 0x65, 0x74, 0x72, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x65, 0x67, - 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x88, 0x02, - 0x0a, 0x0b, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, - 0x0a, 0x73, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x53, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, - 0x52, 0x0a, 0x73, 0x63, 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, - 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, - 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, - 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x63, - 0x61, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x9f, 0x06, 0x0a, 0x0b, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, - 0x72, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, - 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, - 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, - 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, - 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, - 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x02, 0x52, 0x0c, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, - 0x33, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x03, 0x52, 0x12, 0x6d, - 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x2d, 0x0a, 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x51, 0x75, - 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x04, 0x52, - 0x0f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x51, 0x75, 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, - 0x6e, 0x44, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0e, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, - 0x12, 0x35, 0x0a, 0x13, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x06, 0x52, - 0x13, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x48, 0x07, 0x52, 0x0a, 0x73, - 0x68, 0x6f, 0x72, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, - 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x0d, 0x48, 0x08, 0x52, 0x0b, 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x09, 0x52, - 0x10, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, - 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x51, 0x75, 0x65, 0x75, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x42, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x42, 0x16, - 0x0a, 0x14, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x4f, 0x6e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xdb, 0x01, 0x0a, 0x06, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6c, - 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x07, 0x63, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x61, 0x63, - 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x09, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x88, 0x01, 0x01, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, - 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x88, 0x01, - 0x01, 0x12, 0x15, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x02, - 0x52, 0x03, 0x65, 0x6e, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x61, 0x63, - 0x6b, 0x65, 0x64, 0x43, 0x74, 0x78, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x62, 0x65, 0x67, 0x69, 0x6e, - 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x65, 0x6e, 0x64, 0x22, 0x7f, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x62, 0x69, 0x6e, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x62, 0x69, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x62, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x42, - 0x08, 0x0a, 0x06, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8a, 0x04, 0x0a, 0x09, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x09, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x48, 0x02, 0x52, 0x06, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x66, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x22, 0x0a, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x72, 0x67, 0x73, 0x12, 0x2a, 0x0a, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x1b, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, - 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, - 0x48, 0x04, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x88, 0x01, - 0x01, 0x12, 0x2f, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x05, 0x52, 0x10, 0x72, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x88, - 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x0c, - 0x0a, 0x0a, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, - 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x73, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x50, 0x65, 0x72, - 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0xf2, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x09, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0a, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x61, 0x63, 0x6b, - 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3f, 0x0a, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x48, 0x01, 0x52, 0x0f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x61, 0x72, 0x74, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xcc, 0x06, 0x0a, 0x17, - 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x08, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, 0x2b, 0x0a, 0x0a, 0x72, - 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x0b, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x52, 0x0a, 0x72, 0x65, - 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x2b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, - 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x52, - 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4d, - 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x0c, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x12, - 0x1d, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x02, 0x52, 0x07, 0x73, 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x48, - 0x0a, 0x12, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x03, 0x52, 0x12, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x04, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x0b, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x48, - 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x88, 0x01, - 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x06, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x07, 0x52, 0x0a, 0x65, 0x78, - 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4f, 0x70, 0x73, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x08, 0x48, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, - 0x4f, 0x70, 0x73, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, - 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x48, 0x09, 0x52, - 0x0d, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x88, 0x01, - 0x01, 0x12, 0x15, 0x0a, 0x03, 0x78, 0x64, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x48, 0x0a, - 0x52, 0x03, 0x78, 0x64, 0x72, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, - 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x65, 0x6e, - 0x64, 0x4b, 0x65, 0x79, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x4f, 0x70, 0x73, - 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x78, 0x64, 0x72, 0x22, 0x95, 0x01, 0x0a, 0x18, 0x42, - 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x42, - 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x22, 0x4d, 0x0a, 0x1b, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, - 0x63, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x63, 0x61, - 0x6e, 0x22, 0x28, 0x0a, 0x0c, 0x41, 0x62, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x0a, 0x49, - 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x0a, 0x07, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x22, 0x6a, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x2a, 0x1e, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x41, 0x50, 0x12, 0x07, - 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x01, - 0x2a, 0x52, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x53, 0x43, 0x12, 0x0b, - 0x0a, 0x07, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, - 0x49, 0x4e, 0x45, 0x41, 0x52, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, - 0x4c, 0x4f, 0x57, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x10, 0x02, 0x12, 0x15, 0x0a, - 0x11, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, - 0x4c, 0x45, 0x10, 0x03, 0x2a, 0x53, 0x0a, 0x07, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x12, - 0x0c, 0x0a, 0x08, 0x53, 0x45, 0x51, 0x55, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, - 0x06, 0x4d, 0x41, 0x53, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x41, 0x53, - 0x54, 0x45, 0x52, 0x5f, 0x50, 0x52, 0x4f, 0x4c, 0x45, 0x53, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, - 0x50, 0x52, 0x45, 0x46, 0x45, 0x52, 0x5f, 0x52, 0x41, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x0a, 0x0a, - 0x06, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x10, 0x04, 0x2a, 0x37, 0x0a, 0x0d, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x4f, - 0x4e, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x48, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, - 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x4e, 0x47, 0x5f, 0x52, 0x45, 0x4c, 0x41, 0x58, 0x5f, 0x41, 0x50, - 0x10, 0x02, 0x2a, 0x48, 0x0a, 0x13, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, - 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x50, 0x4b, 0x45, 0x59, 0x53, 0x10, 0x02, 0x12, 0x0d, 0x0a, - 0x09, 0x4d, 0x41, 0x50, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x10, 0x03, 0x2a, 0x84, 0x02, 0x0a, - 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, - 0x0a, 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x41, 0x44, - 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x52, 0x49, - 0x54, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x44, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x44, - 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x44, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, - 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x05, - 0x12, 0x0e, 0x0a, 0x0a, 0x4d, 0x41, 0x50, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x06, - 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, - 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x5f, 0x4d, - 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x09, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x50, 0x50, 0x45, 0x4e, - 0x44, 0x10, 0x0a, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x45, 0x50, 0x45, 0x4e, 0x44, 0x10, 0x0b, - 0x12, 0x09, 0x0a, 0x05, 0x54, 0x4f, 0x55, 0x43, 0x48, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x42, - 0x49, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x0d, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x49, 0x54, - 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x59, 0x10, 0x0e, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, - 0x45, 0x54, 0x45, 0x10, 0x0f, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x4c, 0x4c, 0x5f, 0x52, 0x45, 0x41, - 0x44, 0x10, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x48, 0x4c, 0x4c, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, - 0x59, 0x10, 0x11, 0x2a, 0x61, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, - 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, - 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, - 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x5f, 0x4f, - 0x4e, 0x4c, 0x59, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, - 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x2a, 0x45, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, - 0x4e, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x58, 0x50, 0x45, 0x43, 0x54, 0x5f, 0x47, - 0x45, 0x4e, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x45, 0x58, - 0x50, 0x45, 0x43, 0x54, 0x5f, 0x47, 0x45, 0x4e, 0x5f, 0x47, 0x54, 0x10, 0x02, 0x2a, 0x30, 0x0a, - 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0e, 0x0a, 0x0a, - 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, - 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x5f, 0x4d, 0x41, 0x53, 0x54, 0x45, 0x52, 0x10, 0x01, 0x2a, - 0x44, 0x0a, 0x14, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, - 0x6b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, - 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x49, 0x4e, 0x5f, 0x50, 0x52, 0x4f, - 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, 0x50, 0x4c, - 0x45, 0x54, 0x45, 0x10, 0x02, 0x32, 0x2f, 0x0a, 0x05, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x12, 0x26, - 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x0d, 0x2e, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x41, 0x62, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x32, 0x9c, 0x0a, 0x0a, 0x03, 0x4b, 0x56, 0x53, 0x12, 0x3d, - 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4a, 0x0a, - 0x0d, 0x52, 0x65, 0x61, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, - 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4f, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3f, - 0x0a, 0x06, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, - 0x4c, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, - 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, - 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3e, 0x0a, - 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4b, 0x0a, - 0x0e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, - 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, - 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3f, 0x0a, 0x06, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, - 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0f, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, - 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x05, 0x54, 0x6f, 0x75, - 0x63, 0x68, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, - 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x54, 0x6f, 0x75, - 0x63, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, - 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x07, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, - 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x10, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, - 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, - 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x10, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, - 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x47, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, - 0x68, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, - 0x01, 0x12, 0x52, 0x0a, 0x15, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, - 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, - 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x93, 0x01, 0x0a, 0x04, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x3f, - 0x0a, 0x04, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, - 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, - 0x4a, 0x0a, 0x0d, 0x53, 0x63, 0x61, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, - 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0xea, 0x03, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x18, - 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, - 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x11, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, - 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, - 0x30, 0x01, 0x12, 0x57, 0x0a, 0x1a, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, - 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x14, 0x42, - 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5a, 0x0a, 0x1d, - 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, - 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, - 0x69, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x45, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x3d, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, - 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x1a, 0x19, 0x2e, 0x41, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x00, 0x42, - 0x57, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5a, 0x39, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, - 0x69, 0x6b, 0x65, 0x2f, 0x61, 0x65, 0x72, 0x6f, 0x73, 0x70, 0x69, 0x6b, 0x65, 0x2d, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x37, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x6b, 0x76, 0x73, 0x3b, 0x6b, 0x76, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_aerospike_proxy_kv_proto_rawDescOnce sync.Once - file_aerospike_proxy_kv_proto_rawDescData = file_aerospike_proxy_kv_proto_rawDesc -) - -func file_aerospike_proxy_kv_proto_rawDescGZIP() []byte { - file_aerospike_proxy_kv_proto_rawDescOnce.Do(func() { - file_aerospike_proxy_kv_proto_rawDescData = protoimpl.X.CompressGZIP(file_aerospike_proxy_kv_proto_rawDescData) - }) - return file_aerospike_proxy_kv_proto_rawDescData -} - -var file_aerospike_proxy_kv_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_aerospike_proxy_kv_proto_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_aerospike_proxy_kv_proto_goTypes = []interface{}{ - (ReadModeAP)(0), // 0: ReadModeAP - (ReadModeSC)(0), // 1: ReadModeSC - (Replica)(0), // 2: Replica - (QueryDuration)(0), // 3: QueryDuration - (IndexCollectionType)(0), // 4: IndexCollectionType - (OperationType)(0), // 5: OperationType - (RecordExistsAction)(0), // 6: RecordExistsAction - (GenerationPolicy)(0), // 7: GenerationPolicy - (CommitLevel)(0), // 8: CommitLevel - (BackgroundTaskStatus)(0), // 9: BackgroundTaskStatus - (*AboutRequest)(nil), // 10: AboutRequest - (*AboutResponse)(nil), // 11: AboutResponse - (*ReadPolicy)(nil), // 12: ReadPolicy - (*WritePolicy)(nil), // 13: WritePolicy - (*AerospikeRequestPayload)(nil), // 14: AerospikeRequestPayload - (*AerospikeResponsePayload)(nil), // 15: AerospikeResponsePayload - (*ScanPolicy)(nil), // 16: ScanPolicy - (*PartitionStatus)(nil), // 17: PartitionStatus - (*PartitionFilter)(nil), // 18: PartitionFilter - (*ScanRequest)(nil), // 19: ScanRequest - (*QueryPolicy)(nil), // 20: QueryPolicy - (*Filter)(nil), // 21: Filter - (*Operation)(nil), // 22: Operation - (*Statement)(nil), // 23: Statement - (*QueryRequest)(nil), // 24: QueryRequest - (*BackgroundExecutePolicy)(nil), // 25: BackgroundExecutePolicy - (*BackgroundExecuteRequest)(nil), // 26: BackgroundExecuteRequest - (*BackgroundTaskStatusRequest)(nil), // 27: BackgroundTaskStatusRequest - (*AbortRequest)(nil), // 28: AbortRequest - (*InfoPolicy)(nil), // 29: InfoPolicy - (*InfoRequest)(nil), // 30: InfoRequest -} -var file_aerospike_proxy_kv_proto_depIdxs = []int32{ - 2, // 0: ReadPolicy.replica:type_name -> Replica - 0, // 1: ReadPolicy.readModeAP:type_name -> ReadModeAP - 1, // 2: ReadPolicy.readModeSC:type_name -> ReadModeSC - 2, // 3: WritePolicy.replica:type_name -> Replica - 0, // 4: WritePolicy.readModeAP:type_name -> ReadModeAP - 1, // 5: WritePolicy.readModeSC:type_name -> ReadModeSC - 12, // 6: AerospikeRequestPayload.readPolicy:type_name -> ReadPolicy - 13, // 7: AerospikeRequestPayload.writePolicy:type_name -> WritePolicy - 19, // 8: AerospikeRequestPayload.scanRequest:type_name -> ScanRequest - 24, // 9: AerospikeRequestPayload.queryRequest:type_name -> QueryRequest - 28, // 10: AerospikeRequestPayload.abortRequest:type_name -> AbortRequest - 26, // 11: AerospikeRequestPayload.backgroundExecuteRequest:type_name -> BackgroundExecuteRequest - 27, // 12: AerospikeRequestPayload.backgroundTaskStatusRequest:type_name -> BackgroundTaskStatusRequest - 30, // 13: AerospikeRequestPayload.infoRequest:type_name -> InfoRequest - 9, // 14: AerospikeResponsePayload.backgroundTaskStatus:type_name -> BackgroundTaskStatus - 2, // 15: ScanPolicy.replica:type_name -> Replica - 0, // 16: ScanPolicy.readModeAP:type_name -> ReadModeAP - 1, // 17: ScanPolicy.readModeSC:type_name -> ReadModeSC - 17, // 18: PartitionFilter.partitionStatuses:type_name -> PartitionStatus - 16, // 19: ScanRequest.scanPolicy:type_name -> ScanPolicy - 18, // 20: ScanRequest.partitionFilter:type_name -> PartitionFilter - 2, // 21: QueryPolicy.replica:type_name -> Replica - 0, // 22: QueryPolicy.readModeAP:type_name -> ReadModeAP - 1, // 23: QueryPolicy.readModeSC:type_name -> ReadModeSC - 3, // 24: QueryPolicy.expectedDuration:type_name -> QueryDuration - 4, // 25: Filter.colType:type_name -> IndexCollectionType - 5, // 26: Operation.type:type_name -> OperationType - 21, // 27: Statement.filter:type_name -> Filter - 22, // 28: Statement.operations:type_name -> Operation - 20, // 29: QueryRequest.queryPolicy:type_name -> QueryPolicy - 23, // 30: QueryRequest.statement:type_name -> Statement - 18, // 31: QueryRequest.partitionFilter:type_name -> PartitionFilter - 2, // 32: BackgroundExecutePolicy.replica:type_name -> Replica - 0, // 33: BackgroundExecutePolicy.readModeAP:type_name -> ReadModeAP - 1, // 34: BackgroundExecutePolicy.readModeSC:type_name -> ReadModeSC - 6, // 35: BackgroundExecutePolicy.recordExistsAction:type_name -> RecordExistsAction - 7, // 36: BackgroundExecutePolicy.generationPolicy:type_name -> GenerationPolicy - 8, // 37: BackgroundExecutePolicy.commitLevel:type_name -> CommitLevel - 25, // 38: BackgroundExecuteRequest.writePolicy:type_name -> BackgroundExecutePolicy - 23, // 39: BackgroundExecuteRequest.statement:type_name -> Statement - 29, // 40: InfoRequest.infoPolicy:type_name -> InfoPolicy - 10, // 41: About.Get:input_type -> AboutRequest - 14, // 42: KVS.Read:input_type -> AerospikeRequestPayload - 14, // 43: KVS.ReadStreaming:input_type -> AerospikeRequestPayload - 14, // 44: KVS.GetHeader:input_type -> AerospikeRequestPayload - 14, // 45: KVS.GetHeaderStreaming:input_type -> AerospikeRequestPayload - 14, // 46: KVS.Exists:input_type -> AerospikeRequestPayload - 14, // 47: KVS.ExistsStreaming:input_type -> AerospikeRequestPayload - 14, // 48: KVS.Write:input_type -> AerospikeRequestPayload - 14, // 49: KVS.WriteStreaming:input_type -> AerospikeRequestPayload - 14, // 50: KVS.Delete:input_type -> AerospikeRequestPayload - 14, // 51: KVS.DeleteStreaming:input_type -> AerospikeRequestPayload - 14, // 52: KVS.Touch:input_type -> AerospikeRequestPayload - 14, // 53: KVS.TouchStreaming:input_type -> AerospikeRequestPayload - 14, // 54: KVS.Operate:input_type -> AerospikeRequestPayload - 14, // 55: KVS.OperateStreaming:input_type -> AerospikeRequestPayload - 14, // 56: KVS.Execute:input_type -> AerospikeRequestPayload - 14, // 57: KVS.ExecuteStreaming:input_type -> AerospikeRequestPayload - 14, // 58: KVS.BatchOperate:input_type -> AerospikeRequestPayload - 14, // 59: KVS.BatchOperateStreaming:input_type -> AerospikeRequestPayload - 14, // 60: Scan.Scan:input_type -> AerospikeRequestPayload - 14, // 61: Scan.ScanStreaming:input_type -> AerospikeRequestPayload - 14, // 62: Query.Query:input_type -> AerospikeRequestPayload - 14, // 63: Query.QueryStreaming:input_type -> AerospikeRequestPayload - 14, // 64: Query.BackgroundExecute:input_type -> AerospikeRequestPayload - 14, // 65: Query.BackgroundExecuteStreaming:input_type -> AerospikeRequestPayload - 14, // 66: Query.BackgroundTaskStatus:input_type -> AerospikeRequestPayload - 14, // 67: Query.BackgroundTaskStatusStreaming:input_type -> AerospikeRequestPayload - 14, // 68: Info.Info:input_type -> AerospikeRequestPayload - 11, // 69: About.Get:output_type -> AboutResponse - 15, // 70: KVS.Read:output_type -> AerospikeResponsePayload - 15, // 71: KVS.ReadStreaming:output_type -> AerospikeResponsePayload - 15, // 72: KVS.GetHeader:output_type -> AerospikeResponsePayload - 15, // 73: KVS.GetHeaderStreaming:output_type -> AerospikeResponsePayload - 15, // 74: KVS.Exists:output_type -> AerospikeResponsePayload - 15, // 75: KVS.ExistsStreaming:output_type -> AerospikeResponsePayload - 15, // 76: KVS.Write:output_type -> AerospikeResponsePayload - 15, // 77: KVS.WriteStreaming:output_type -> AerospikeResponsePayload - 15, // 78: KVS.Delete:output_type -> AerospikeResponsePayload - 15, // 79: KVS.DeleteStreaming:output_type -> AerospikeResponsePayload - 15, // 80: KVS.Touch:output_type -> AerospikeResponsePayload - 15, // 81: KVS.TouchStreaming:output_type -> AerospikeResponsePayload - 15, // 82: KVS.Operate:output_type -> AerospikeResponsePayload - 15, // 83: KVS.OperateStreaming:output_type -> AerospikeResponsePayload - 15, // 84: KVS.Execute:output_type -> AerospikeResponsePayload - 15, // 85: KVS.ExecuteStreaming:output_type -> AerospikeResponsePayload - 15, // 86: KVS.BatchOperate:output_type -> AerospikeResponsePayload - 15, // 87: KVS.BatchOperateStreaming:output_type -> AerospikeResponsePayload - 15, // 88: Scan.Scan:output_type -> AerospikeResponsePayload - 15, // 89: Scan.ScanStreaming:output_type -> AerospikeResponsePayload - 15, // 90: Query.Query:output_type -> AerospikeResponsePayload - 15, // 91: Query.QueryStreaming:output_type -> AerospikeResponsePayload - 15, // 92: Query.BackgroundExecute:output_type -> AerospikeResponsePayload - 15, // 93: Query.BackgroundExecuteStreaming:output_type -> AerospikeResponsePayload - 15, // 94: Query.BackgroundTaskStatus:output_type -> AerospikeResponsePayload - 15, // 95: Query.BackgroundTaskStatusStreaming:output_type -> AerospikeResponsePayload - 15, // 96: Info.Info:output_type -> AerospikeResponsePayload - 69, // [69:97] is the sub-list for method output_type - 41, // [41:69] is the sub-list for method input_type - 41, // [41:41] is the sub-list for extension type_name - 41, // [41:41] is the sub-list for extension extendee - 0, // [0:41] is the sub-list for field type_name -} - -func init() { file_aerospike_proxy_kv_proto_init() } -func file_aerospike_proxy_kv_proto_init() { - if File_aerospike_proxy_kv_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_aerospike_proxy_kv_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AboutRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AboutResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WritePolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AerospikeRequestPayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AerospikeResponsePayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScanPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PartitionStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PartitionFilter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScanRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Filter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Statement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackgroundExecutePolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackgroundExecuteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackgroundTaskStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AbortRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_aerospike_proxy_kv_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_aerospike_proxy_kv_proto_msgTypes[4].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[5].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[6].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[7].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[8].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[9].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[10].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[11].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[12].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[13].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[14].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[15].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[16].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[19].OneofWrappers = []interface{}{} - file_aerospike_proxy_kv_proto_msgTypes[20].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_aerospike_proxy_kv_proto_rawDesc, - NumEnums: 10, - NumMessages: 21, - NumExtensions: 0, - NumServices: 5, - }, - GoTypes: file_aerospike_proxy_kv_proto_goTypes, - DependencyIndexes: file_aerospike_proxy_kv_proto_depIdxs, - EnumInfos: file_aerospike_proxy_kv_proto_enumTypes, - MessageInfos: file_aerospike_proxy_kv_proto_msgTypes, - }.Build() - File_aerospike_proxy_kv_proto = out.File - file_aerospike_proxy_kv_proto_rawDesc = nil - file_aerospike_proxy_kv_proto_goTypes = nil - file_aerospike_proxy_kv_proto_depIdxs = nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto deleted file mode 100644 index be32978c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv.proto +++ /dev/null @@ -1,831 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/aerospike/aerospike-client-go/v7/proto/kvs;kvs"; -option java_package = "com.aerospike.proxy.client"; - - -// The about request message. -message AboutRequest { - // Empty for now. -} - -// The about response message. -message AboutResponse { - // Proxy server version. - string version = 1; -} - -// Read policy for AP (availability) namespaces. -// How duplicates should be consulted in a read operation. -// Only makes a difference during migrations and only applicable in AP mode. -enum ReadModeAP { - // Involve single node in the read operation. - ONE = 0; - - // Involve all duplicates in the read operation. - ALL = 1; -} - -// Read policy for SC (strong consistency) namespaces. -// Determines SC read consistency options. -enum ReadModeSC { - // Ensures this client will only see an increasing sequence of record versions. - // Server only reads from master. This is the default. - SESSION = 0; - - // Ensures ALL clients will only see an increasing sequence of record versions. - // Server only reads from master. - LINEARIZE = 1; - - // Server may read from master or any full (non-migrating) replica. - // Increasing sequence of record versions is not guaranteed. - ALLOW_REPLICA = 2; - - // Server may read from master or any full (non-migrating) replica or from unavailable - // partitions. Increasing sequence of record versions is not guaranteed. - ALLOW_UNAVAILABLE = 3; -} - -// Defines algorithm used to determine the target node for a command. -// Scan and query are not affected by replica algorithm. -// -// Note: The enum ordinals do not match the Aerospike Client ordinals because -// the default has to be ordinal zero in protobuf. -enum Replica { - // Try node containing master partition first. - // If connection fails, all commands try nodes containing replicated partitions. - // If socketTimeout is reached, reads also try nodes containing replicated partitions, - // but writes remain on master node. - SEQUENCE = 0; - - // Use node containing key's master partition. - MASTER = 1; - - // Distribute reads across nodes containing key's master and replicated partitions - // in round-robin fashion. Writes always use node containing key's master partition. - MASTER_PROLES = 2; - - // Try node on the same rack as the client first. If timeout or there are no nodes on the - // same rack, use SEQUENCE instead. - PREFER_RACK = 3; - - // Distribute reads across all nodes in cluster in round-robin fashion. - // Writes always use node containing key's master partition. - // This option is useful when the replication factor equals the number - // of nodes in the cluster and the overhead of requesting proles is not desired. - RANDOM = 4; -} - -enum QueryDuration { - // The query is expected to return more than 100 records per node. The server optimizes for a large record set. - LONG = 0; - - // The query is expected to return less than 100 records per node. The server optimizes for a small record set. - SHORT = 1; - - // Treat query as a LONG query, but relax read consistency for AP namespaces. - // This value is treated exactly like LONG for server versions < 7.1. - LONG_RELAX_AP = 2; -} - -// Read policy attributes used in read database commands that are not part of -// the wire protocol. -message ReadPolicy { - // Read policy for AP (availability) namespaces. - Replica replica = 1; - - // Read policy for SC (strong consistency) namespaces. - ReadModeAP readModeAP = 2; - - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC readModeSC = 3; -} - -// Write policy attributes used in write database commands that are not part of -// the wire protocol. -message WritePolicy { - // Read policy for AP (availability) namespaces. - Replica replica = 1; - - // Read policy for SC (strong consistency) namespaces. - ReadModeAP readModeAP = 2; - - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC readModeSC = 3; -} - - -// The request message containing the user's name. -message AerospikeRequestPayload { - // Unique identifier of the request in the stream. - uint32 id = 1; - - // Client iteration number starting at 1. On first attempt iteration should - // be 1. On first retry iteration should be 2, on second retry iteration - // should be 3, and so on. - uint32 iteration = 2; - - // Aerospike wire format request payload. - bytes payload = 3; - - // Read policy for read requests. - optional ReadPolicy readPolicy = 4; - - // Write policy for write requests. - optional WritePolicy writePolicy = 5; - - // Scan request for scan. - optional ScanRequest scanRequest = 6; - - // Request for running a query. - optional QueryRequest queryRequest = 7; - - // Abort a scan/query on application error. - optional AbortRequest abortRequest = 8; - - // Request for executing operations background on matching records. - optional BackgroundExecuteRequest backgroundExecuteRequest = 9; - - // Request for getting background task status. - optional BackgroundTaskStatusRequest backgroundTaskStatusRequest = 10; - - // Info request - optional InfoRequest infoRequest = 11; -} - -// The request message containing the user's name. -message AerospikeResponsePayload { - // Unique identifier of the corresponding request in the stream. - uint32 id = 1; - - // Status of the corresponding request. - // if status equals 0 - // The proxy received a valid response from Aerospike. The payload's - // result code should be used as the client result code. - // else - // The request failed at the proxy. This status should be used - // as the client result code. - int32 status = 2; - - // This flag indicates that the write transaction may have completed, - // even though the client sees an error. - bool inDoubt = 3; - - // Aerospike wire format request payload. - bytes payload = 4; - - // For requests with multiple responses like batch and queries, - // hasNext flag indicates if there are more responses to follow this - // response or if this is the last response for this request. - bool hasNext = 5; - - // Background task status, populated for background task request. - optional BackgroundTaskStatus backgroundTaskStatus = 6; -} - -// Information about the service. -service About { - rpc Get (AboutRequest) returns (AboutResponse) {} -} - -// Aerospike KVS operations service -service KVS { - // Read a single record - rpc Read (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process stream of single record read requests. - rpc ReadStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Get a single record header containing metadata like generation, expiration - rpc GetHeader (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process stream of single record get header requests. - rpc GetHeaderStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Check if a record exists. - rpc Exists (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process stream of single record exist requests. - rpc ExistsStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Write a single record - rpc Write (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process a stream of single record write requests. - rpc WriteStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Delete a single record. - rpc Delete (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process a stream of single record delete requests. - rpc DeleteStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Reset single record's time to expiration using the write policy's expiration. - rpc Touch (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process a stream of single record touch requests. - rpc TouchStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Perform multiple read/write operations on a single key in one batch call. - rpc Operate (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Perform a stream of operate requests. - rpc OperateStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Execute single key user defined function on server and return results. - rpc Execute (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} - - // Process a stream of single record execute requests. - rpc ExecuteStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Process batch requests. - rpc BatchOperate (AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Process a stream of batch requests. - rpc BatchOperateStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} -} - -// Scan policy attributes used by queries. -// Scan requests are send completely using proto buffers and hence include all policy attributes. -message ScanPolicy { - // Read policy for AP (availability) namespaces. - Replica replica = 1; - - // Read policy for SC (strong consistency) namespaces. - ReadModeAP readModeAP = 2; - - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and scan are not affected by replica algorithms. - ReadModeSC readModeSC = 3; - - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - bool compress = 4; - - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - optional bytes expression = 5; - - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - optional uint32 totalTimeout = 6; - - // Approximate number of records to return to client. This number is divided by the - // number of nodes involved in the scan. The actual number of records returned - // may be less than maxRecords if node record counts are small and unbalanced across - // nodes. - // Default: 0 (do not limit record count) - optional uint64 maxRecords = 7; - - // Limit returned records per second (rps) rate for each server. - // Do not apply rps limit if recordsPerSecond is zero. - // Default: 0 - optional uint32 recordsPerSecond = 8; - - // Should scan requests be issued in parallel. - // Default: true - optional bool concurrentNodes = 9; - - // Maximum number of concurrent requests to server nodes at any point in time. - // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries - // will be made to 8 nodes in parallel. When a scan completes, a new scan will - // be issued until all 16 nodes have been queried. - // Default: 0 (issue requests to all server nodes in parallel) - optional uint32 maxConcurrentNodes = 10; - - // Should bin data be retrieved. If false, only record digests (and user keys - // if stored on the server) are retrieved. - // Default: true - optional bool includeBinData = 11; -} - -// Partition status used to perform partial scans on client side retries. -message PartitionStatus { - // The partition status. - optional uint32 id = 1; - - // Begin value to start scanning / querying after. - optional int64 bVal = 2; - - // Digest to start scanning / querying after. - optional bytes digest = 3; - - // Indicates this partition should be tried. - // Should be set to true for the first attempt as well. - bool retry = 5; -} - -// A partition filter for scans and queries. -message PartitionFilter { - // Start partition id. - // Not required if the digest to start scanning from is specified. - optional uint32 begin = 1; - - // The number of records to scan. - uint32 count = 2; - - // Optional digest to start scanning from. - optional bytes digest = 3; - - // Optional partition statuses used on retries to restart - // from last known record for the partition. - repeated PartitionStatus partitionStatuses = 4; - - // Indicates if all partitions in this filter should - // be retried ignoring the partition status - bool retry = 5; -} - -// A scan request. -message ScanRequest { - // Optional scan policy. - optional ScanPolicy scanPolicy = 1; - - // The namespace to scan. - string namespace = 2; - - // Optional set name. - optional string setName = 3; - - // Optional bin to retrieve. All bins will be returned - // if not specified. - repeated string binNames = 4; - - // Optional partition filter to selectively scan partitions. - optional PartitionFilter partitionFilter = 5; -} - -// Aerospike scan -service Scan { - // Scan Aerospike - rpc Scan (AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Process a stream of scan requests - rpc ScanStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} -} - -// Query policy attributes used by queries. -// Query requests are send completely using proto buffers and hence include all policy attributes. -message QueryPolicy { - // Read policy for AP (availability) namespaces. - Replica replica = 1; - - // Read policy for SC (strong consistency) namespaces. - ReadModeAP readModeAP = 2; - - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and query are not affected by replica algorithms. - ReadModeSC readModeSC = 3; - - // Send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - // Default: false (do not send the user defined key) - optional bool sendKey = 4; - - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - bool compress = 5; - - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - optional bytes expression = 6; - - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - optional uint32 totalTimeout = 7; - - // Maximum number of concurrent requests to server nodes at any point in time. - // If there are 16 nodes in the cluster and maxConcurrentNodes is 8, then queries - // will be made to 8 nodes in parallel. When a query completes, a new query will - // be issued until all 16 nodes have been queried. - // Default: 0 (issue requests to all server nodes in parallel) - optional uint32 maxConcurrentNodes = 8; - - // Number of records to place in queue before blocking. - // Records received from multiple server nodes will be placed in a queue. - // A separate thread consumes these records in parallel. - // If the queue is full, the producer threads will block until records are consumed. - // Default: 5000 - optional uint32 recordQueueSize = 9; - - // Should bin data be retrieved. If false, only record digests (and user keys - // if stored on the server) are retrieved. - // Default: true - optional bool includeBinData = 10; - - // Terminate query if cluster is in migration state. If the server supports partition - // queries or the query filter is null (scan), this field is ignored. - // Default: false - optional bool failOnClusterChange = 11; - - // Deprecated, use expectedDuration instead. - // Is query expected to return less than 100 records per node. - // If true, the server will optimize the query for a small record set. - // This field is ignored for aggregation queries, background queries - // and server versions < 6.0. - // Default: false - optional bool shortQuery = 12; - - // Timeout in milliseconds for "cluster-stable" info command that is run when - // failOnClusterChange is true and server version is less than 6.0. - // Default: 1000 - optional uint32 infoTimeout = 13; - - // Expected query duration. The server treats the query in different ways depending on the expected duration. - // This field is ignored for aggregation queries, background queries and server versions less than 6.0. - // Default: QueryDuration.LONG - optional QueryDuration expectedDuration = 14; -} - - -// Secondary index collection type. -enum IndexCollectionType { - // Normal scalar index. - DEFAULT = 0; - - // Index list elements. - LIST = 1; - - // Index map keys. - MAPKEYS = 2; - - // Index map values. - MAPVALUES = 3; -} - -// Query statement filter -message Filter { - // Name of the filter. - string name = 1; - - // Secondary index collection type. - IndexCollectionType colType = 2; - - // Optional filter context packed in Aerospike format. - optional bytes packedCtx = 3; - - // The queried column particle type. - int32 valType = 4; - - // The Aerospike encoded query start "Value" - optional bytes begin = 5 ; - - // The Aerospike encoded query end "Value" - optional bytes end = 6; -} - -enum OperationType { - READ = 0; - READ_HEADER = 1; - WRITE = 2; - CDT_READ = 3; - CDT_MODIFY = 4; - MAP_READ = 5; - MAP_MODIFY = 6; - ADD = 7; - EXP_READ = 8; - EXP_MODIFY = 9; - APPEND = 10; - PREPEND = 11; - TOUCH = 12; - BIT_READ = 13; - BIT_MODIFY = 14; - DELETE = 15; - HLL_READ = 16; - HLL_MODIFY = 17; -} - -// Single record operation. -message Operation { - // The operation type. - OperationType type = 1; - - // Optional bin name. - optional string binName = 2; - - // Optional bin value. - optional bytes value = 3; -} - -// Query statement. -message Statement { - // The namespace to query. - string namespace = 1; - - // Optional set name. - optional string setName = 2; - - // Optional index name. - optional string indexName = 3; - - // Optional bins names to return for each result record. - // If not specified all bins are returned. - repeated string binNames = 4; - - // Optional Filter encoded in Aerospike wire format. - optional Filter filter = 5; - - // Aggregation file name. - string packageName = 6; - - // Aggregation function name. - string functionName = 7; - - // Aggregation function arguments encoded as bytes using Aerospike wire format. - repeated bytes functionArgs = 8; - - // Operations to be performed on query encoded as bytes using Aerospike wire format. - repeated Operation operations = 9; - - // Optional taskId. - optional int64 taskId = 10; - - // Approximate number of records to return to client. This number is divided by the - // number of nodes involved in the scan. The actual number of records returned - // may be less than maxRecords if node record counts are small and unbalanced across - // nodes. - // Default: 0 (do not limit record count) - optional uint64 maxRecords = 11; - - // Limit returned records per second (rps) rate for each server. - // Do not apply rps limit if recordsPerSecond is zero. - // Default: 0 - optional uint32 recordsPerSecond = 12; -} - -// A query request. -message QueryRequest { - // Optional query policy. - optional QueryPolicy queryPolicy = 1; - - // The query statement. - Statement statement = 2; - - // Set to true for background queries. - bool background = 3; - - // Optional partition filter to selectively query partitions. - optional PartitionFilter partitionFilter = 4; -} - -enum RecordExistsAction { - // Create or update record. - // Merge write command bins with existing bins. - UPDATE = 0; - - // Update record only. Fail if record does not exist. - // Merge write command bins with existing bins. - UPDATE_ONLY = 1; - - // Create or replace record. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike server versions >= 3.1.6. - REPLACE = 2; - - // Replace record only. Fail if record does not exist. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike server versions >= 3.1.6. - REPLACE_ONLY = 3; - - // Create only. Fail if record exists. - CREATE_ONLY = 4; -} - -enum GenerationPolicy { - // Do not use record generation to restrict writes. - NONE = 0; - - // Update/delete record if expected generation is equal to server generation. Otherwise, fail. - EXPECT_GEN_EQUAL = 1; - - // Update/delete record if expected generation greater than the server generation. Otherwise, fail. - // This is useful for restore after backup. - EXPECT_GEN_GT = 2; -} - -enum CommitLevel { - // Server should wait until successfully committing master and all replicas. - COMMIT_ALL = 0; - - // Server should wait until successfully committing master only. - COMMIT_MASTER = 1; -} - -message BackgroundExecutePolicy { - // Read policy for AP (availability) namespaces. - Replica replica = 1; - - // Read policy for SC (strong consistency) namespaces. - ReadModeAP readModeAP = 2; - - // Replica algorithm used to determine the target node - // for a single record command. - // Scan and scan are not affected by replica algorithms. - ReadModeSC readModeSC = 3; - - // Use zlib compression on command buffers sent to the server and responses received - // from the server when the buffer size is greater than 128 bytes. - // This option will increase cpu and memory usage (for extra compressed buffers),but - // decrease the size of data sent over the network. - bool compress = 4; - - // Optional expression filter. If filterExp exists and evaluates to false, the - // transaction is ignored. - optional bytes expression = 5; - - // Total transaction timeout in milliseconds. - // Default for all other commands: 1000ms - optional uint32 totalTimeout = 6; - - // Send user defined key in addition to hash digest on both reads and writes. - // If the key is sent on a write, the key will be stored with the record on - // the server. - //

- // Default: false (do not send the user defined key) - optional bool sendKey = 7; - - // Qualify how to handle writes where the record already exists. - // - // Default: RecordExistsAction.UPDATE - optional RecordExistsAction recordExistsAction = 8; - - // Qualify how to handle record writes based on record generation. The default (NONE) - // indicates that the generation is not used to restrict writes. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: GenerationPolicy.NONE - optional GenerationPolicy generationPolicy = 9; - - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - // - // Default: CommitLevel.COMMIT_ALL - optional CommitLevel commitLevel = 10; - - // Expected generation. Generation is the number of times a record has been modified - // (including creation) on the server. If a write operation is creating a record, - // the expected generation would be 0. This field is only relevant when - // generationPolicy is not NONE. - // - // The server does not support this field for UDF execute() calls. The read-modify-write - // usage model can still be enforced inside the UDF code itself. - // - // Default: 0 - optional uint32 generation = 11; - - // Record expiration. Also known as ttl (time to live). - // Seconds record will live before being removed by the server. - // - // Expiration values: - // - // - -2: Do not change ttl when record is updated. - // - -1: Never expire. - // - 0: Default to namespace configuration variable "default-ttl" on the server. - // - > 0: Actual ttl in seconds.
- // - // Default: 0 - optional uint32 expiration = 12; - - // For client operate(), return a result for every operation. - // - // Some operations do not return results by default (ListOperation.clear() for example). - // This can make it difficult to determine the desired result offset in the returned - // bin's result list. - // - // Setting respondAllOps to true makes it easier to identify the desired result offset - // (result offset equals bin's operate sequence). If there is a map operation in operate(), - // respondAllOps will be forced to true for that operate() call. - // - // Default: false - optional bool respondAllOps = 13; - - // If the transaction results in a record deletion, leave a tombstone for the record. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition 3.10+ only. - // - // Default: false (do not tombstone deleted records). - optional bool durableDelete = 14; - - // Operate in XDR mode. Some external connectors may need to emulate an XDR client. - // If enabled, an XDR bit is set for writes in the wire protocol. - // - // Default: false. - optional bool xdr = 15; -} - -message BackgroundExecuteRequest { - // Background write policy - optional BackgroundExecutePolicy writePolicy = 1; - - // The statement containing the UDF function reference - // or the operations to be performed on matching record - Statement statement = 2; -} - -enum BackgroundTaskStatus { - // Task not found. - NOT_FOUND = 0; - - // Task in progress. - IN_PROGRESS = 1; - - // Task completed. - COMPLETE = 2; -} - -message BackgroundTaskStatusRequest { - // The id of the task. - int64 taskId = 1; - - // If true indicates the task is a scan task else task is a query - bool isScan = 2; -} - -// Abort a request identified by id in the stream. -message AbortRequest { - // Unique identifier of the corresponding request in the stream to abort. - // Not to be confused with the AbortRequest's id in the stream. - uint32 abortId = 1; -} - -// Aerospike queries -service Query { - // Query Aerospike - rpc Query (AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Process a stream of query requests - rpc QueryStreaming (stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Execute background write on selected records. - rpc BackgroundExecute(AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Execute a stream of background write requests. - rpc BackgroundExecuteStreaming(stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Get status of a background task. - rpc BackgroundTaskStatus(AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} - - // Get status of a stream of background tasks. - rpc BackgroundTaskStatusStreaming(stream AerospikeRequestPayload) returns - (stream AerospikeResponsePayload) {} -} - -// Info policy for info request -message InfoPolicy { - // Info command socket timeout in milliseconds. - // - // Default: 1000 - optional uint32 timeout = 1; -} - -// Info request -message InfoRequest { - optional InfoPolicy infoPolicy = 1; - repeated string commands = 2; -} - -// Aerospike info requests -service Info { - // Send an info request - rpc Info (AerospikeRequestPayload) returns - (AerospikeResponsePayload) {} -} \ No newline at end of file diff --git a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go b/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go deleted file mode 100644 index 7ee945e9..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proto/kvs/aerospike_proxy_kv_grpc.pb.go +++ /dev/null @@ -1,1926 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.1 -// source: proto/kvs/aerospike_proxy_kv.proto - -package kvs - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - About_Get_FullMethodName = "/About/Get" -) - -// AboutClient is the client API for About service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AboutClient interface { - Get(ctx context.Context, in *AboutRequest, opts ...grpc.CallOption) (*AboutResponse, error) -} - -type aboutClient struct { - cc grpc.ClientConnInterface -} - -func NewAboutClient(cc grpc.ClientConnInterface) AboutClient { - return &aboutClient{cc} -} - -func (c *aboutClient) Get(ctx context.Context, in *AboutRequest, opts ...grpc.CallOption) (*AboutResponse, error) { - out := new(AboutResponse) - err := c.cc.Invoke(ctx, About_Get_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AboutServer is the server API for About service. -// All implementations must embed UnimplementedAboutServer -// for forward compatibility -type AboutServer interface { - Get(context.Context, *AboutRequest) (*AboutResponse, error) - mustEmbedUnimplementedAboutServer() -} - -// UnimplementedAboutServer must be embedded to have forward compatible implementations. -type UnimplementedAboutServer struct { -} - -func (UnimplementedAboutServer) Get(context.Context, *AboutRequest) (*AboutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedAboutServer) mustEmbedUnimplementedAboutServer() {} - -// UnsafeAboutServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AboutServer will -// result in compilation errors. -type UnsafeAboutServer interface { - mustEmbedUnimplementedAboutServer() -} - -func RegisterAboutServer(s grpc.ServiceRegistrar, srv AboutServer) { - s.RegisterService(&About_ServiceDesc, srv) -} - -func _About_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AboutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AboutServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: About_Get_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AboutServer).Get(ctx, req.(*AboutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// About_ServiceDesc is the grpc.ServiceDesc for About service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var About_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "About", - HandlerType: (*AboutServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Get", - Handler: _About_Get_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto/kvs/aerospike_proxy_kv.proto", -} - -const ( - KVS_Read_FullMethodName = "/KVS/Read" - KVS_ReadStreaming_FullMethodName = "/KVS/ReadStreaming" - KVS_GetHeader_FullMethodName = "/KVS/GetHeader" - KVS_GetHeaderStreaming_FullMethodName = "/KVS/GetHeaderStreaming" - KVS_Exists_FullMethodName = "/KVS/Exists" - KVS_ExistsStreaming_FullMethodName = "/KVS/ExistsStreaming" - KVS_Write_FullMethodName = "/KVS/Write" - KVS_WriteStreaming_FullMethodName = "/KVS/WriteStreaming" - KVS_Delete_FullMethodName = "/KVS/Delete" - KVS_DeleteStreaming_FullMethodName = "/KVS/DeleteStreaming" - KVS_Touch_FullMethodName = "/KVS/Touch" - KVS_TouchStreaming_FullMethodName = "/KVS/TouchStreaming" - KVS_Operate_FullMethodName = "/KVS/Operate" - KVS_OperateStreaming_FullMethodName = "/KVS/OperateStreaming" - KVS_Execute_FullMethodName = "/KVS/Execute" - KVS_ExecuteStreaming_FullMethodName = "/KVS/ExecuteStreaming" - KVS_BatchOperate_FullMethodName = "/KVS/BatchOperate" - KVS_BatchOperateStreaming_FullMethodName = "/KVS/BatchOperateStreaming" -) - -// KVSClient is the client API for KVS service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type KVSClient interface { - // Read a single record - Read(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process stream of single record read requests. - ReadStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ReadStreamingClient, error) - // Get a single record header containing metadata like generation, expiration - GetHeader(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process stream of single record get header requests. - GetHeaderStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_GetHeaderStreamingClient, error) - // Check if a record exists. - Exists(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process stream of single record exist requests. - ExistsStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExistsStreamingClient, error) - // Write a single record - Write(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process a stream of single record write requests. - WriteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_WriteStreamingClient, error) - // Delete a single record. - Delete(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process a stream of single record delete requests. - DeleteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_DeleteStreamingClient, error) - // Reset single record's time to expiration using the write policy's expiration. - Touch(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process a stream of single record touch requests. - TouchStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_TouchStreamingClient, error) - // Perform multiple read/write operations on a single key in one batch call. - Operate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Perform a stream of operate requests. - OperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_OperateStreamingClient, error) - // Execute single key user defined function on server and return results. - Execute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) - // Process a stream of single record execute requests. - ExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExecuteStreamingClient, error) - // Process batch requests. - BatchOperate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (KVS_BatchOperateClient, error) - // Process a stream of batch requests. - BatchOperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_BatchOperateStreamingClient, error) -} - -type kVSClient struct { - cc grpc.ClientConnInterface -} - -func NewKVSClient(cc grpc.ClientConnInterface) KVSClient { - return &kVSClient{cc} -} - -func (c *kVSClient) Read(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Read_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) ReadStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ReadStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[0], KVS_ReadStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSReadStreamingClient{stream} - return x, nil -} - -type KVS_ReadStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSReadStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSReadStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSReadStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) GetHeader(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_GetHeader_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) GetHeaderStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_GetHeaderStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[1], KVS_GetHeaderStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSGetHeaderStreamingClient{stream} - return x, nil -} - -type KVS_GetHeaderStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSGetHeaderStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSGetHeaderStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSGetHeaderStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Exists(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Exists_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) ExistsStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExistsStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[2], KVS_ExistsStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSExistsStreamingClient{stream} - return x, nil -} - -type KVS_ExistsStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSExistsStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSExistsStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSExistsStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Write(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Write_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) WriteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_WriteStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[3], KVS_WriteStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSWriteStreamingClient{stream} - return x, nil -} - -type KVS_WriteStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSWriteStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSWriteStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSWriteStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Delete(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Delete_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) DeleteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_DeleteStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[4], KVS_DeleteStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSDeleteStreamingClient{stream} - return x, nil -} - -type KVS_DeleteStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSDeleteStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSDeleteStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSDeleteStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Touch(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Touch_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) TouchStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_TouchStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[5], KVS_TouchStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSTouchStreamingClient{stream} - return x, nil -} - -type KVS_TouchStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSTouchStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSTouchStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSTouchStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Operate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Operate_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) OperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_OperateStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[6], KVS_OperateStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSOperateStreamingClient{stream} - return x, nil -} - -type KVS_OperateStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSOperateStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSOperateStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSOperateStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) Execute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, KVS_Execute_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *kVSClient) ExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_ExecuteStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[7], KVS_ExecuteStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSExecuteStreamingClient{stream} - return x, nil -} - -type KVS_ExecuteStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSExecuteStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSExecuteStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSExecuteStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) BatchOperate(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (KVS_BatchOperateClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[8], KVS_BatchOperate_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSBatchOperateClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type KVS_BatchOperateClient interface { - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSBatchOperateClient struct { - grpc.ClientStream -} - -func (x *kVSBatchOperateClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *kVSClient) BatchOperateStreaming(ctx context.Context, opts ...grpc.CallOption) (KVS_BatchOperateStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &KVS_ServiceDesc.Streams[9], KVS_BatchOperateStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &kVSBatchOperateStreamingClient{stream} - return x, nil -} - -type KVS_BatchOperateStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type kVSBatchOperateStreamingClient struct { - grpc.ClientStream -} - -func (x *kVSBatchOperateStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *kVSBatchOperateStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// KVSServer is the server API for KVS service. -// All implementations must embed UnimplementedKVSServer -// for forward compatibility -type KVSServer interface { - // Read a single record - Read(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process stream of single record read requests. - ReadStreaming(KVS_ReadStreamingServer) error - // Get a single record header containing metadata like generation, expiration - GetHeader(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process stream of single record get header requests. - GetHeaderStreaming(KVS_GetHeaderStreamingServer) error - // Check if a record exists. - Exists(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process stream of single record exist requests. - ExistsStreaming(KVS_ExistsStreamingServer) error - // Write a single record - Write(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process a stream of single record write requests. - WriteStreaming(KVS_WriteStreamingServer) error - // Delete a single record. - Delete(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process a stream of single record delete requests. - DeleteStreaming(KVS_DeleteStreamingServer) error - // Reset single record's time to expiration using the write policy's expiration. - Touch(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process a stream of single record touch requests. - TouchStreaming(KVS_TouchStreamingServer) error - // Perform multiple read/write operations on a single key in one batch call. - Operate(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Perform a stream of operate requests. - OperateStreaming(KVS_OperateStreamingServer) error - // Execute single key user defined function on server and return results. - Execute(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - // Process a stream of single record execute requests. - ExecuteStreaming(KVS_ExecuteStreamingServer) error - // Process batch requests. - BatchOperate(*AerospikeRequestPayload, KVS_BatchOperateServer) error - // Process a stream of batch requests. - BatchOperateStreaming(KVS_BatchOperateStreamingServer) error - mustEmbedUnimplementedKVSServer() -} - -// UnimplementedKVSServer must be embedded to have forward compatible implementations. -type UnimplementedKVSServer struct { -} - -func (UnimplementedKVSServer) Read(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") -} -func (UnimplementedKVSServer) ReadStreaming(KVS_ReadStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method ReadStreaming not implemented") -} -func (UnimplementedKVSServer) GetHeader(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetHeader not implemented") -} -func (UnimplementedKVSServer) GetHeaderStreaming(KVS_GetHeaderStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method GetHeaderStreaming not implemented") -} -func (UnimplementedKVSServer) Exists(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Exists not implemented") -} -func (UnimplementedKVSServer) ExistsStreaming(KVS_ExistsStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method ExistsStreaming not implemented") -} -func (UnimplementedKVSServer) Write(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") -} -func (UnimplementedKVSServer) WriteStreaming(KVS_WriteStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method WriteStreaming not implemented") -} -func (UnimplementedKVSServer) Delete(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedKVSServer) DeleteStreaming(KVS_DeleteStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method DeleteStreaming not implemented") -} -func (UnimplementedKVSServer) Touch(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Touch not implemented") -} -func (UnimplementedKVSServer) TouchStreaming(KVS_TouchStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method TouchStreaming not implemented") -} -func (UnimplementedKVSServer) Operate(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Operate not implemented") -} -func (UnimplementedKVSServer) OperateStreaming(KVS_OperateStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method OperateStreaming not implemented") -} -func (UnimplementedKVSServer) Execute(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Execute not implemented") -} -func (UnimplementedKVSServer) ExecuteStreaming(KVS_ExecuteStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method ExecuteStreaming not implemented") -} -func (UnimplementedKVSServer) BatchOperate(*AerospikeRequestPayload, KVS_BatchOperateServer) error { - return status.Errorf(codes.Unimplemented, "method BatchOperate not implemented") -} -func (UnimplementedKVSServer) BatchOperateStreaming(KVS_BatchOperateStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method BatchOperateStreaming not implemented") -} -func (UnimplementedKVSServer) mustEmbedUnimplementedKVSServer() {} - -// UnsafeKVSServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to KVSServer will -// result in compilation errors. -type UnsafeKVSServer interface { - mustEmbedUnimplementedKVSServer() -} - -func RegisterKVSServer(s grpc.ServiceRegistrar, srv KVSServer) { - s.RegisterService(&KVS_ServiceDesc, srv) -} - -func _KVS_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Read(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Read_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Read(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_ReadStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).ReadStreaming(&kVSReadStreamingServer{stream}) -} - -type KVS_ReadStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSReadStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSReadStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSReadStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_GetHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).GetHeader(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_GetHeader_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).GetHeader(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_GetHeaderStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).GetHeaderStreaming(&kVSGetHeaderStreamingServer{stream}) -} - -type KVS_GetHeaderStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSGetHeaderStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSGetHeaderStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSGetHeaderStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Exists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Exists(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Exists_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Exists(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_ExistsStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).ExistsStreaming(&kVSExistsStreamingServer{stream}) -} - -type KVS_ExistsStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSExistsStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSExistsStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSExistsStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Write(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Write_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Write(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_WriteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).WriteStreaming(&kVSWriteStreamingServer{stream}) -} - -type KVS_WriteStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSWriteStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSWriteStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSWriteStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Delete_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Delete(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_DeleteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).DeleteStreaming(&kVSDeleteStreamingServer{stream}) -} - -type KVS_DeleteStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSDeleteStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSDeleteStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSDeleteStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Touch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Touch(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Touch_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Touch(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_TouchStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).TouchStreaming(&kVSTouchStreamingServer{stream}) -} - -type KVS_TouchStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSTouchStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSTouchStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSTouchStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Operate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Operate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Operate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Operate(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_OperateStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).OperateStreaming(&kVSOperateStreamingServer{stream}) -} - -type KVS_OperateStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSOperateStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSOperateStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSOperateStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KVSServer).Execute(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KVS_Execute_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVSServer).Execute(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -func _KVS_ExecuteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).ExecuteStreaming(&kVSExecuteStreamingServer{stream}) -} - -type KVS_ExecuteStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSExecuteStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSExecuteStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSExecuteStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _KVS_BatchOperate_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AerospikeRequestPayload) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(KVSServer).BatchOperate(m, &kVSBatchOperateServer{stream}) -} - -type KVS_BatchOperateServer interface { - Send(*AerospikeResponsePayload) error - grpc.ServerStream -} - -type kVSBatchOperateServer struct { - grpc.ServerStream -} - -func (x *kVSBatchOperateServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func _KVS_BatchOperateStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KVSServer).BatchOperateStreaming(&kVSBatchOperateStreamingServer{stream}) -} - -type KVS_BatchOperateStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type kVSBatchOperateStreamingServer struct { - grpc.ServerStream -} - -func (x *kVSBatchOperateStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *kVSBatchOperateStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// KVS_ServiceDesc is the grpc.ServiceDesc for KVS service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var KVS_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "KVS", - HandlerType: (*KVSServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Read", - Handler: _KVS_Read_Handler, - }, - { - MethodName: "GetHeader", - Handler: _KVS_GetHeader_Handler, - }, - { - MethodName: "Exists", - Handler: _KVS_Exists_Handler, - }, - { - MethodName: "Write", - Handler: _KVS_Write_Handler, - }, - { - MethodName: "Delete", - Handler: _KVS_Delete_Handler, - }, - { - MethodName: "Touch", - Handler: _KVS_Touch_Handler, - }, - { - MethodName: "Operate", - Handler: _KVS_Operate_Handler, - }, - { - MethodName: "Execute", - Handler: _KVS_Execute_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ReadStreaming", - Handler: _KVS_ReadStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "GetHeaderStreaming", - Handler: _KVS_GetHeaderStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "ExistsStreaming", - Handler: _KVS_ExistsStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "WriteStreaming", - Handler: _KVS_WriteStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "DeleteStreaming", - Handler: _KVS_DeleteStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "TouchStreaming", - Handler: _KVS_TouchStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "OperateStreaming", - Handler: _KVS_OperateStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "ExecuteStreaming", - Handler: _KVS_ExecuteStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "BatchOperate", - Handler: _KVS_BatchOperate_Handler, - ServerStreams: true, - }, - { - StreamName: "BatchOperateStreaming", - Handler: _KVS_BatchOperateStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "proto/kvs/aerospike_proxy_kv.proto", -} - -const ( - Scan_Scan_FullMethodName = "/Scan/Scan" - Scan_ScanStreaming_FullMethodName = "/Scan/ScanStreaming" -) - -// ScanClient is the client API for Scan service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ScanClient interface { - // Scan Aerospike - Scan(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Scan_ScanClient, error) - // Process a stream of scan requests - ScanStreaming(ctx context.Context, opts ...grpc.CallOption) (Scan_ScanStreamingClient, error) -} - -type scanClient struct { - cc grpc.ClientConnInterface -} - -func NewScanClient(cc grpc.ClientConnInterface) ScanClient { - return &scanClient{cc} -} - -func (c *scanClient) Scan(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Scan_ScanClient, error) { - stream, err := c.cc.NewStream(ctx, &Scan_ServiceDesc.Streams[0], Scan_Scan_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &scanScanClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Scan_ScanClient interface { - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type scanScanClient struct { - grpc.ClientStream -} - -func (x *scanScanClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *scanClient) ScanStreaming(ctx context.Context, opts ...grpc.CallOption) (Scan_ScanStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &Scan_ServiceDesc.Streams[1], Scan_ScanStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &scanScanStreamingClient{stream} - return x, nil -} - -type Scan_ScanStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type scanScanStreamingClient struct { - grpc.ClientStream -} - -func (x *scanScanStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *scanScanStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ScanServer is the server API for Scan service. -// All implementations must embed UnimplementedScanServer -// for forward compatibility -type ScanServer interface { - // Scan Aerospike - Scan(*AerospikeRequestPayload, Scan_ScanServer) error - // Process a stream of scan requests - ScanStreaming(Scan_ScanStreamingServer) error - mustEmbedUnimplementedScanServer() -} - -// UnimplementedScanServer must be embedded to have forward compatible implementations. -type UnimplementedScanServer struct { -} - -func (UnimplementedScanServer) Scan(*AerospikeRequestPayload, Scan_ScanServer) error { - return status.Errorf(codes.Unimplemented, "method Scan not implemented") -} -func (UnimplementedScanServer) ScanStreaming(Scan_ScanStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method ScanStreaming not implemented") -} -func (UnimplementedScanServer) mustEmbedUnimplementedScanServer() {} - -// UnsafeScanServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ScanServer will -// result in compilation errors. -type UnsafeScanServer interface { - mustEmbedUnimplementedScanServer() -} - -func RegisterScanServer(s grpc.ServiceRegistrar, srv ScanServer) { - s.RegisterService(&Scan_ServiceDesc, srv) -} - -func _Scan_Scan_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AerospikeRequestPayload) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ScanServer).Scan(m, &scanScanServer{stream}) -} - -type Scan_ScanServer interface { - Send(*AerospikeResponsePayload) error - grpc.ServerStream -} - -type scanScanServer struct { - grpc.ServerStream -} - -func (x *scanScanServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func _Scan_ScanStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ScanServer).ScanStreaming(&scanScanStreamingServer{stream}) -} - -type Scan_ScanStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type scanScanStreamingServer struct { - grpc.ServerStream -} - -func (x *scanScanStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *scanScanStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Scan_ServiceDesc is the grpc.ServiceDesc for Scan service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Scan_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "Scan", - HandlerType: (*ScanServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Scan", - Handler: _Scan_Scan_Handler, - ServerStreams: true, - }, - { - StreamName: "ScanStreaming", - Handler: _Scan_ScanStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "proto/kvs/aerospike_proxy_kv.proto", -} - -const ( - Query_Query_FullMethodName = "/Query/Query" - Query_QueryStreaming_FullMethodName = "/Query/QueryStreaming" - Query_BackgroundExecute_FullMethodName = "/Query/BackgroundExecute" - Query_BackgroundExecuteStreaming_FullMethodName = "/Query/BackgroundExecuteStreaming" - Query_BackgroundTaskStatus_FullMethodName = "/Query/BackgroundTaskStatus" - Query_BackgroundTaskStatusStreaming_FullMethodName = "/Query/BackgroundTaskStatusStreaming" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type QueryClient interface { - // Query Aerospike - Query(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_QueryClient, error) - // Process a stream of query requests - QueryStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_QueryStreamingClient, error) - // Execute background write on selected records. - BackgroundExecute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundExecuteClient, error) - // Execute a stream of background write requests. - BackgroundExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundExecuteStreamingClient, error) - // Get status of a background task. - BackgroundTaskStatus(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundTaskStatusClient, error) - // Get status of a stream of background tasks. - BackgroundTaskStatusStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundTaskStatusStreamingClient, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Query(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_QueryClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[0], Query_Query_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryQueryClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Query_QueryClient interface { - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryQueryClient struct { - grpc.ClientStream -} - -func (x *queryQueryClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryClient) QueryStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_QueryStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[1], Query_QueryStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryQueryStreamingClient{stream} - return x, nil -} - -type Query_QueryStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryQueryStreamingClient struct { - grpc.ClientStream -} - -func (x *queryQueryStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *queryQueryStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryClient) BackgroundExecute(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundExecuteClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[2], Query_BackgroundExecute_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryBackgroundExecuteClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Query_BackgroundExecuteClient interface { - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryBackgroundExecuteClient struct { - grpc.ClientStream -} - -func (x *queryBackgroundExecuteClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryClient) BackgroundExecuteStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundExecuteStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[3], Query_BackgroundExecuteStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryBackgroundExecuteStreamingClient{stream} - return x, nil -} - -type Query_BackgroundExecuteStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryBackgroundExecuteStreamingClient struct { - grpc.ClientStream -} - -func (x *queryBackgroundExecuteStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *queryBackgroundExecuteStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryClient) BackgroundTaskStatus(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (Query_BackgroundTaskStatusClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[4], Query_BackgroundTaskStatus_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryBackgroundTaskStatusClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Query_BackgroundTaskStatusClient interface { - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryBackgroundTaskStatusClient struct { - grpc.ClientStream -} - -func (x *queryBackgroundTaskStatusClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryClient) BackgroundTaskStatusStreaming(ctx context.Context, opts ...grpc.CallOption) (Query_BackgroundTaskStatusStreamingClient, error) { - stream, err := c.cc.NewStream(ctx, &Query_ServiceDesc.Streams[5], Query_BackgroundTaskStatusStreaming_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &queryBackgroundTaskStatusStreamingClient{stream} - return x, nil -} - -type Query_BackgroundTaskStatusStreamingClient interface { - Send(*AerospikeRequestPayload) error - Recv() (*AerospikeResponsePayload, error) - grpc.ClientStream -} - -type queryBackgroundTaskStatusStreamingClient struct { - grpc.ClientStream -} - -func (x *queryBackgroundTaskStatusStreamingClient) Send(m *AerospikeRequestPayload) error { - return x.ClientStream.SendMsg(m) -} - -func (x *queryBackgroundTaskStatusStreamingClient) Recv() (*AerospikeResponsePayload, error) { - m := new(AerospikeResponsePayload) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -type QueryServer interface { - // Query Aerospike - Query(*AerospikeRequestPayload, Query_QueryServer) error - // Process a stream of query requests - QueryStreaming(Query_QueryStreamingServer) error - // Execute background write on selected records. - BackgroundExecute(*AerospikeRequestPayload, Query_BackgroundExecuteServer) error - // Execute a stream of background write requests. - BackgroundExecuteStreaming(Query_BackgroundExecuteStreamingServer) error - // Get status of a background task. - BackgroundTaskStatus(*AerospikeRequestPayload, Query_BackgroundTaskStatusServer) error - // Get status of a stream of background tasks. - BackgroundTaskStatusStreaming(Query_BackgroundTaskStatusStreamingServer) error - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Query(*AerospikeRequestPayload, Query_QueryServer) error { - return status.Errorf(codes.Unimplemented, "method Query not implemented") -} -func (UnimplementedQueryServer) QueryStreaming(Query_QueryStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method QueryStreaming not implemented") -} -func (UnimplementedQueryServer) BackgroundExecute(*AerospikeRequestPayload, Query_BackgroundExecuteServer) error { - return status.Errorf(codes.Unimplemented, "method BackgroundExecute not implemented") -} -func (UnimplementedQueryServer) BackgroundExecuteStreaming(Query_BackgroundExecuteStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method BackgroundExecuteStreaming not implemented") -} -func (UnimplementedQueryServer) BackgroundTaskStatus(*AerospikeRequestPayload, Query_BackgroundTaskStatusServer) error { - return status.Errorf(codes.Unimplemented, "method BackgroundTaskStatus not implemented") -} -func (UnimplementedQueryServer) BackgroundTaskStatusStreaming(Query_BackgroundTaskStatusStreamingServer) error { - return status.Errorf(codes.Unimplemented, "method BackgroundTaskStatusStreaming not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -func _Query_Query_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AerospikeRequestPayload) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServer).Query(m, &queryQueryServer{stream}) -} - -type Query_QueryServer interface { - Send(*AerospikeResponsePayload) error - grpc.ServerStream -} - -type queryQueryServer struct { - grpc.ServerStream -} - -func (x *queryQueryServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func _Query_QueryStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(QueryServer).QueryStreaming(&queryQueryStreamingServer{stream}) -} - -type Query_QueryStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type queryQueryStreamingServer struct { - grpc.ServerStream -} - -func (x *queryQueryStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *queryQueryStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Query_BackgroundExecute_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AerospikeRequestPayload) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServer).BackgroundExecute(m, &queryBackgroundExecuteServer{stream}) -} - -type Query_BackgroundExecuteServer interface { - Send(*AerospikeResponsePayload) error - grpc.ServerStream -} - -type queryBackgroundExecuteServer struct { - grpc.ServerStream -} - -func (x *queryBackgroundExecuteServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func _Query_BackgroundExecuteStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(QueryServer).BackgroundExecuteStreaming(&queryBackgroundExecuteStreamingServer{stream}) -} - -type Query_BackgroundExecuteStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type queryBackgroundExecuteStreamingServer struct { - grpc.ServerStream -} - -func (x *queryBackgroundExecuteStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *queryBackgroundExecuteStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Query_BackgroundTaskStatus_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(AerospikeRequestPayload) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServer).BackgroundTaskStatus(m, &queryBackgroundTaskStatusServer{stream}) -} - -type Query_BackgroundTaskStatusServer interface { - Send(*AerospikeResponsePayload) error - grpc.ServerStream -} - -type queryBackgroundTaskStatusServer struct { - grpc.ServerStream -} - -func (x *queryBackgroundTaskStatusServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func _Query_BackgroundTaskStatusStreaming_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(QueryServer).BackgroundTaskStatusStreaming(&queryBackgroundTaskStatusStreamingServer{stream}) -} - -type Query_BackgroundTaskStatusStreamingServer interface { - Send(*AerospikeResponsePayload) error - Recv() (*AerospikeRequestPayload, error) - grpc.ServerStream -} - -type queryBackgroundTaskStatusStreamingServer struct { - grpc.ServerStream -} - -func (x *queryBackgroundTaskStatusStreamingServer) Send(m *AerospikeResponsePayload) error { - return x.ServerStream.SendMsg(m) -} - -func (x *queryBackgroundTaskStatusStreamingServer) Recv() (*AerospikeRequestPayload, error) { - m := new(AerospikeRequestPayload) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Query", - Handler: _Query_Query_Handler, - ServerStreams: true, - }, - { - StreamName: "QueryStreaming", - Handler: _Query_QueryStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "BackgroundExecute", - Handler: _Query_BackgroundExecute_Handler, - ServerStreams: true, - }, - { - StreamName: "BackgroundExecuteStreaming", - Handler: _Query_BackgroundExecuteStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "BackgroundTaskStatus", - Handler: _Query_BackgroundTaskStatus_Handler, - ServerStreams: true, - }, - { - StreamName: "BackgroundTaskStatusStreaming", - Handler: _Query_BackgroundTaskStatusStreaming_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "proto/kvs/aerospike_proxy_kv.proto", -} - -const ( - Info_Info_FullMethodName = "/Info/Info" -) - -// InfoClient is the client API for Info service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type InfoClient interface { - // Send an info request - Info(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) -} - -type infoClient struct { - cc grpc.ClientConnInterface -} - -func NewInfoClient(cc grpc.ClientConnInterface) InfoClient { - return &infoClient{cc} -} - -func (c *infoClient) Info(ctx context.Context, in *AerospikeRequestPayload, opts ...grpc.CallOption) (*AerospikeResponsePayload, error) { - out := new(AerospikeResponsePayload) - err := c.cc.Invoke(ctx, Info_Info_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// InfoServer is the server API for Info service. -// All implementations must embed UnimplementedInfoServer -// for forward compatibility -type InfoServer interface { - // Send an info request - Info(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) - mustEmbedUnimplementedInfoServer() -} - -// UnimplementedInfoServer must be embedded to have forward compatible implementations. -type UnimplementedInfoServer struct { -} - -func (UnimplementedInfoServer) Info(context.Context, *AerospikeRequestPayload) (*AerospikeResponsePayload, error) { - return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") -} -func (UnimplementedInfoServer) mustEmbedUnimplementedInfoServer() {} - -// UnsafeInfoServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to InfoServer will -// result in compilation errors. -type UnsafeInfoServer interface { - mustEmbedUnimplementedInfoServer() -} - -func RegisterInfoServer(s grpc.ServiceRegistrar, srv InfoServer) { - s.RegisterService(&Info_ServiceDesc, srv) -} - -func _Info_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AerospikeRequestPayload) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InfoServer).Info(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Info_Info_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InfoServer).Info(ctx, req.(*AerospikeRequestPayload)) - } - return interceptor(ctx, in, info, handler) -} - -// Info_ServiceDesc is the grpc.ServiceDesc for Info service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Info_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "Info", - HandlerType: (*InfoServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Info", - Handler: _Info_Info_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "proto/kvs/aerospike_proxy_kv.proto", -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go b/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go deleted file mode 100644 index adbe4ee6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_auth_interceptor.go +++ /dev/null @@ -1,218 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "encoding/base64" - "encoding/json" - "runtime/debug" - "strings" - "time" - - grpc "google.golang.org/grpc" - "google.golang.org/grpc/metadata" - - "github.com/aerospike/aerospike-client-go/v7/logger" - auth "github.com/aerospike/aerospike-client-go/v7/proto/auth" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type authInterceptor struct { - clnt *ProxyClient - closer chan struct{} - - expiry time.Time - fullToken string // "Bearer " -} - -func newAuthInterceptor(clnt *ProxyClient) (*authInterceptor, Error) { - interceptor := &authInterceptor{ - clnt: clnt, - closer: make(chan struct{}), - } - - err := interceptor.scheduleRefreshToken() - if err != nil { - return nil, err - } - - return interceptor, nil -} - -func (interceptor *authInterceptor) close() { - if interceptor.active() { - close(interceptor.closer) - } -} - -func (interceptor *authInterceptor) active() bool { - active := true - select { - case _, active = <-interceptor.closer: - default: - } - return active -} - -func (interceptor *authInterceptor) scheduleRefreshToken() Error { - err := interceptor.refreshToken() - if err != nil { - return err - } - - // launch the refresher go routine - go interceptor.tokenRefresher() - - return nil -} - -func (interceptor *authInterceptor) tokenRefresher() { - // make sure the goroutine is restarted if something panics downstream - defer func() { - if r := recover(); r != nil { - logger.Logger.Error("Interceptor refresh goroutine crashed: %s", debug.Stack()) - go interceptor.tokenRefresher() - } - }() - - // provide 5 secs of buffer before expiry due to network latency - wait := interceptor.expiry.Sub(time.Now()) - 5*time.Second - ticker := time.NewTicker(wait) - defer ticker.Stop() - - for { - ticker.Reset(wait) - select { - case <-ticker.C: - err := interceptor.refreshToken() - if err != nil { - wait = time.Second - } else { - wait = interceptor.expiry.Sub(time.Now()) - 5*time.Second - } - - case <-interceptor.closer: - // channel closed; return from the goroutine - return - } - } -} - -func (interceptor *authInterceptor) refreshToken() Error { - err := interceptor.login() - if err != nil { - return err - } - - interceptor.clnt.setAuthToken(interceptor.fullToken) - - return nil -} - -func (interceptor *authInterceptor) RequireTransportSecurity() bool { - return true -} - -func (interceptor *authInterceptor) Unary() grpc.UnaryClientInterceptor { - return func( - ctx context.Context, - method string, - req, reply interface{}, - cc *grpc.ClientConn, - invoker grpc.UnaryInvoker, - opts ...grpc.CallOption, - ) error { - return invoker(interceptor.attachToken(ctx), method, req, reply, cc, opts...) - } -} - -func (interceptor *authInterceptor) Stream() grpc.StreamClientInterceptor { - return func( - ctx context.Context, - desc *grpc.StreamDesc, - cc *grpc.ClientConn, - method string, - streamer grpc.Streamer, - opts ...grpc.CallOption, - ) (grpc.ClientStream, error) { - return streamer(interceptor.attachToken(ctx), desc, cc, method, opts...) - } -} - -func (interceptor *authInterceptor) attachToken(ctx context.Context) context.Context { - token := interceptor.clnt.token() - return metadata.AppendToOutgoingContext(ctx, "Authorization", token) -} - -func (interceptor *authInterceptor) login() Error { - conn, err := interceptor.clnt.createGrpcConn(true) - if err != nil { - return err - } - defer conn.Close() - - req := auth.AerospikeAuthRequest{ - Username: interceptor.clnt.clientPolicy.User, - Password: interceptor.clnt.clientPolicy.Password, - } - - client := auth.NewAuthServiceClient(conn) - - ctx, cancel := context.WithTimeout(context.Background(), interceptor.clnt.clientPolicy.Timeout) - defer cancel() - - res, gerr := client.Get(ctx, &req) - if gerr != nil { - return newGrpcError(false, gerr, gerr.Error()) - } - - claims := strings.Split(res.GetToken(), ".") - decClaims, gerr := base64.RawURLEncoding.DecodeString(claims[1]) - if gerr != nil { - return newGrpcError(false, gerr, "Invalid token encoding. Expected base64.") - } - - tokenMap := make(map[string]interface{}, 8) - gerr = json.Unmarshal(decClaims, &tokenMap) - if gerr != nil { - return newError(types.PARSE_ERROR, "Invalid token encoding. Expected json.") - } - - expiryToken, ok := tokenMap["exp"].(float64) - if !ok { - return newError(types.PARSE_ERROR, "Invalid expiry value. Expected float64.") - } - - iat, ok := tokenMap["iat"].(float64) - if !ok { - return newError(types.PARSE_ERROR, "Invalid iat value. Expected float64.") - - } - - ttl := time.Duration(expiryToken-iat) * time.Second - if ttl <= 0 { - return newError(types.PARSE_ERROR, "Invalid token values. token 'iat' > 'exp'") - } - - // Set expiry based on local clock. - expiry := time.Now().Add(ttl) - interceptor.fullToken = "Bearer " + res.GetToken() - interceptor.expiry = expiry - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client.go deleted file mode 100644 index 15257ae5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_client.go +++ /dev/null @@ -1,1531 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "math/rand" - "runtime" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - - iatomic "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -const notSupportedInProxyClient = "NOT SUPPORTED IN THE PROXY CLIENT" - -// ProxyClient encapsulates an Aerospike cluster. -// All database operations are available against this object. -type ProxyClient struct { - // only for GRPC - clientPolicy ClientPolicy - grpcConnPool *grpcConnectionHeap - grpcHost *Host - dialOptions []grpc.DialOption - - authToken iatomic.TypedVal[string] - authInterceptor *authInterceptor - - active iatomic.Bool - - // DefaultPolicy is used for all read commands without a specific policy. - DefaultPolicy *BasePolicy - // DefaultBatchPolicy is the default parent policy used in batch read commands. Base policy fields - // include socketTimeout, totalTimeout, maxRetries, etc... - DefaultBatchPolicy *BatchPolicy - // DefaultBatchReadPolicy is the default read policy used in batch operate commands. - DefaultBatchReadPolicy *BatchReadPolicy - // DefaultBatchWritePolicy is the default write policy used in batch operate commands. - // Write policy fields include generation, expiration, durableDelete, etc... - DefaultBatchWritePolicy *BatchWritePolicy - // DefaultBatchDeletePolicy is the default delete policy used in batch delete commands. - DefaultBatchDeletePolicy *BatchDeletePolicy - // DefaultBatchUDFPolicy is the default user defined function policy used in batch UDF execute commands. - DefaultBatchUDFPolicy *BatchUDFPolicy - // DefaultWritePolicy is used for all write commands without a specific policy. - DefaultWritePolicy *WritePolicy - // DefaultScanPolicy is used for all scan commands without a specific policy. - DefaultScanPolicy *ScanPolicy - // DefaultQueryPolicy is used for all query commands without a specific policy. - DefaultQueryPolicy *QueryPolicy - // DefaultAdminPolicy is used for all security commands without a specific policy. - DefaultAdminPolicy *AdminPolicy - // DefaultInfoPolicy is used for all info commands without a specific policy. - DefaultInfoPolicy *InfoPolicy -} - -func grpcClientFinalizer(f *ProxyClient) { - f.Close() -} - -//------------------------------------------------------- -// Constructors -//------------------------------------------------------- - -// NewProxyClientWithPolicyAndHost generates a new ProxyClient with the specified ClientPolicy and -// sets up the cluster using the provided hosts. -// You must pass the tag 'as_proxy' to the compiler during build. -// If the policy is nil, the default relevant policy will be used. -// Pass "dns:///

:" (note the 3 slashes) for dns load balancing, -// automatically supported internally by grpc-go. -// The connection pool after connecting to the database is initially empty, -// and connections are established on a per need basis, which can be slow and -// time out some initial commands. -// It is recommended to call the client.WarmUp() method right after connecting to the database -// to fill up the connection pool to the required service level. -func NewProxyClientWithPolicyAndHost(policy *ClientPolicy, host *Host, dialOptions ...grpc.DialOption) (*ProxyClient, Error) { - if policy == nil { - policy = NewClientPolicy() - } - - grpcClient := &ProxyClient{ - clientPolicy: *policy, - grpcConnPool: newGrpcConnectionHeap(policy.ConnectionQueueSize), - grpcHost: host, - dialOptions: dialOptions, - - active: *iatomic.NewBool(true), - - DefaultPolicy: NewPolicy(), - DefaultBatchPolicy: NewBatchPolicy(), - DefaultBatchReadPolicy: NewBatchReadPolicy(), - DefaultBatchWritePolicy: NewBatchWritePolicy(), - DefaultBatchDeletePolicy: NewBatchDeletePolicy(), - DefaultBatchUDFPolicy: NewBatchUDFPolicy(), - DefaultWritePolicy: NewWritePolicy(0, 0), - DefaultScanPolicy: NewScanPolicy(), - DefaultQueryPolicy: NewQueryPolicy(), - DefaultAdminPolicy: NewAdminPolicy(), - DefaultInfoPolicy: NewInfoPolicy(), - } - - if policy.RequiresAuthentication() { - authInterceptor, err := newAuthInterceptor(grpcClient) - if err != nil { - return nil, err - } - - grpcClient.authInterceptor = authInterceptor - } - - // check the version to make sure we are connected to the server - infoPolicy := NewInfoPolicy() - infoPolicy.Timeout = policy.Timeout - _, err := grpcClient.ServerVersion(infoPolicy) - if err != nil { - return nil, err - } - - runtime.SetFinalizer(grpcClient, grpcClientFinalizer) - return grpcClient, nil -} - -//------------------------------------------------------- -// Policy methods -//------------------------------------------------------- - -// DefaultPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultPolicy() *BasePolicy { - return clnt.DefaultPolicy -} - -// DefaultBatchPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultBatchPolicy() *BatchPolicy { - return clnt.DefaultBatchPolicy -} - -// DefaultBatchWritePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultBatchWritePolicy() *BatchWritePolicy { - return clnt.DefaultBatchWritePolicy -} - -// DefaultBatchReadPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultBatchReadPolicy() *BatchReadPolicy { - return clnt.DefaultBatchReadPolicy -} - -// DefaultBatchDeletePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultBatchDeletePolicy() *BatchDeletePolicy { - return clnt.DefaultBatchDeletePolicy -} - -// DefaultBatchUDFPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultBatchUDFPolicy() *BatchUDFPolicy { - return clnt.DefaultBatchUDFPolicy -} - -// DefaultWritePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultWritePolicy() *WritePolicy { - return clnt.DefaultWritePolicy -} - -// DefaultScanPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultScanPolicy() *ScanPolicy { - return clnt.DefaultScanPolicy -} - -// DefaultQueryPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultQueryPolicy() *QueryPolicy { - return clnt.DefaultQueryPolicy -} - -// DefaultAdminPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultAdminPolicy() *AdminPolicy { - return clnt.DefaultAdminPolicy -} - -// DefaultInfoPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) GetDefaultInfoPolicy() *InfoPolicy { - return clnt.DefaultInfoPolicy -} - -// DefaultPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultPolicy(policy *BasePolicy) { - clnt.DefaultPolicy = policy -} - -// DefaultBatchPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultBatchPolicy(policy *BatchPolicy) { - clnt.DefaultBatchPolicy = policy -} - -// DefaultBatchReadPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultBatchReadPolicy(policy *BatchReadPolicy) { - clnt.DefaultBatchReadPolicy = policy -} - -// DefaultBatchWritePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultBatchWritePolicy(policy *BatchWritePolicy) { - clnt.DefaultBatchWritePolicy = policy -} - -// DefaultBatchDeletePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultBatchDeletePolicy(policy *BatchDeletePolicy) { - clnt.DefaultBatchDeletePolicy = policy -} - -// DefaultBatchUDFPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultBatchUDFPolicy(policy *BatchUDFPolicy) { - clnt.DefaultBatchUDFPolicy = policy -} - -// DefaultWritePolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultWritePolicy(policy *WritePolicy) { - clnt.DefaultWritePolicy = policy -} - -// DefaultScanPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultScanPolicy(policy *ScanPolicy) { - clnt.DefaultScanPolicy = policy -} - -// DefaultQueryPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultQueryPolicy(policy *QueryPolicy) { - clnt.DefaultQueryPolicy = policy -} - -// DefaultAdminPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultAdminPolicy(policy *AdminPolicy) { - clnt.DefaultAdminPolicy = policy -} - -// DefaultInfoPolicy returns corresponding default policy from the client -func (clnt *ProxyClient) SetDefaultInfoPolicy(policy *InfoPolicy) { - clnt.DefaultInfoPolicy = policy -} - -//------------------------------------------------------- -// Cluster Connection Management -//------------------------------------------------------- - -func (clnt *ProxyClient) token() string { - return clnt.authToken.Get() -} - -func (clnt *ProxyClient) setAuthToken(token string) { - clnt.authToken.Set(token) -} - -func (clnt *ProxyClient) grpcConn() (*grpc.ClientConn, Error) { - pconn := clnt.grpcConnPool.Get() - if pconn != nil { - return pconn, nil - } - - return clnt.createGrpcConn(!clnt.clientPolicy.RequiresAuthentication()) -} - -func (clnt *ProxyClient) returnGrpcConnToPool(conn *grpc.ClientConn) { - if conn != nil { - clnt.grpcConnPool.Put(conn) - } -} - -func (clnt *ProxyClient) createGrpcConn(noInterceptor bool) (*grpc.ClientConn, Error) { - // make a new connection - // Implement TLS and auth - dialOptions := []grpc.DialOption{grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(MaxBufferSize)), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxBufferSize))} - if clnt.clientPolicy.TlsConfig != nil { - dialOptions = append(dialOptions, grpc.WithTransportCredentials(credentials.NewTLS(clnt.clientPolicy.TlsConfig))) - } else { - dialOptions = append(dialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) - } - - ctx, cancel := context.WithTimeout(context.Background(), clnt.clientPolicy.Timeout) - defer cancel() - - allOptions := append(dialOptions, clnt.dialOptions...) - if !noInterceptor { - allOptions = append(dialOptions, - grpc.WithUnaryInterceptor(clnt.authInterceptor.Unary()), - grpc.WithStreamInterceptor(clnt.authInterceptor.Stream()), - ) - } - - conn, err := grpc.DialContext(ctx, clnt.grpcHost.String(), allOptions...) - if err != nil { - return nil, newError(types.NO_AVAILABLE_CONNECTIONS_TO_NODE, err.Error()) - } - - return conn, nil -} - -// Close closes all Grpcclient connections to database server nodes. -func (clnt *ProxyClient) Close() { - clnt.active.Set(false) - clnt.grpcConnPool.cleanup() - if clnt.authInterceptor != nil { - clnt.authInterceptor.close() - } -} - -// IsConnected determines if the Grpcclient is ready to talk to the database server cluster. -func (clnt *ProxyClient) IsConnected() bool { - return clnt.active.Get() -} - -// GetNodes returns an array of active server nodes in the cluster. -func (clnt *ProxyClient) GetNodes() []*Node { - panic(notSupportedInProxyClient) -} - -// GetNodeNames returns a list of active server node names in the cluster. -func (clnt *ProxyClient) GetNodeNames() []string { - panic(notSupportedInProxyClient) -} - -// ServerVersion will return the version of the proxy server. -func (clnt *ProxyClient) ServerVersion(policy *InfoPolicy) (string, Error) { - policy = clnt.getUsableInfoPolicy(policy) - - req := kvs.AboutRequest{} - - conn, err := clnt.grpcConn() - if err != nil { - return "", err - } - - client := kvs.NewAboutClient(conn) - - ctx, cancel := policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Get(ctx, &req) - if gerr != nil { - return "", newGrpcError(false, gerr, gerr.Error()) - } - - clnt.returnGrpcConnToPool(conn) - - return res.GetVersion(), nil -} - -//------------------------------------------------------- -// Write Record Operations -//------------------------------------------------------- - -// Put writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Put(policy *WritePolicy, key *Key, binMap BinMap) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(nil, policy, key, nil, binMap, _WRITE) - if err != nil { - return err - } - - return command.ExecuteGRPC(clnt) -} - -// PutBins writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This method avoids using the BinMap allocation and iteration and is lighter on GC. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) PutBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newWriteCommand(nil, policy, key, bins, nil, _WRITE) - if err != nil { - return err - } - - return command.ExecuteGRPC(clnt) -} - -//------------------------------------------------------- -// Operations string -//------------------------------------------------------- - -// Append appends bin value's string to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call only works for string and []byte values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Append(policy *WritePolicy, key *Key, binMap BinMap) Error { - ops := make([]*Operation, 0, len(binMap)) - for k, v := range binMap { - ops = append(ops, AppendOp(NewBin(k, v))) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -// AppendBins works the same as Append, but avoids BinMap allocation and iteration. -func (clnt *ProxyClient) AppendBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - ops := make([]*Operation, 0, len(bins)) - for _, bin := range bins { - ops = append(ops, AppendOp(bin)) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -// Prepend prepends bin value's string to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call works only for string and []byte values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Prepend(policy *WritePolicy, key *Key, binMap BinMap) Error { - ops := make([]*Operation, 0, len(binMap)) - for k, v := range binMap { - ops = append(ops, PrependOp(NewBin(k, v))) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -// PrependBins works the same as Prepend, but avoids BinMap allocation and iteration. -func (clnt *ProxyClient) PrependBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - ops := make([]*Operation, 0, len(bins)) - for _, bin := range bins { - ops = append(ops, PrependOp(bin)) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -//------------------------------------------------------- -// Arithmetic Operations -//------------------------------------------------------- - -// Add adds integer bin values to existing record bin values. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// This call only works for integer values. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Add(policy *WritePolicy, key *Key, binMap BinMap) Error { - ops := make([]*Operation, 0, len(binMap)) - for k, v := range binMap { - ops = append(ops, AddOp(NewBin(k, v))) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -// AddBins works the same as Add, but avoids BinMap allocation and iteration. -func (clnt *ProxyClient) AddBins(policy *WritePolicy, key *Key, bins ...*Bin) Error { - ops := make([]*Operation, 0, len(bins)) - for _, bin := range bins { - ops = append(ops, AddOp(bin)) - } - - _, err := clnt.Operate(policy, key, ops...) - return err -} - -//------------------------------------------------------- -// Delete Operations -//------------------------------------------------------- - -// Delete deletes a record for specified key. -// The policy specifies the transaction timeout. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Delete(policy *WritePolicy, key *Key) (bool, Error) { - policy = clnt.getUsableWritePolicy(policy) - command, err := newDeleteCommand(nil, policy, key) - if err != nil { - return false, err - } - - err = command.ExecuteGRPC(clnt) - return command.Existed(), err -} - -//------------------------------------------------------- -// Touch Operations -//------------------------------------------------------- - -// Touch updates a record's metadata. -// If the record exists, the record's TTL will be reset to the -// policy's expiration. -// If the record doesn't exist, it will return an error. -func (clnt *ProxyClient) Touch(policy *WritePolicy, key *Key) Error { - policy = clnt.getUsableWritePolicy(policy) - command, err := newTouchCommand(nil, policy, key) - if err != nil { - return err - } - - return command.ExecuteGRPC(clnt) -} - -//------------------------------------------------------- -// Existence-Check Operations -//------------------------------------------------------- - -// Exists determine if a record key exists. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Exists(policy *BasePolicy, key *Key) (bool, Error) { - policy = clnt.getUsablePolicy(policy) - command, err := newExistsCommand(nil, policy, key) - if err != nil { - return false, err - } - - err = command.ExecuteGRPC(clnt) - return command.Exists(), err -} - -// BatchExists determines if multiple record keys exist in one batch request. -// The returned boolean array is in positional order with the original key array order. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) BatchExists(policy *BatchPolicy, keys []*Key) ([]bool, Error) { - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - for _, key := range keys { - batchRecordsIfc = append(batchRecordsIfc, NewBatchReadHeader(nil, key)) - } - - err := clnt.BatchOperate(policy, batchRecordsIfc) - records := make([]bool, 0, len(keys)) - for i := range batchRecordsIfc { - records = append(records, batchRecordsIfc[i].BatchRec().Record != nil) - // if nerr := batchRecordsIfc[i].BatchRec().Err; nerr != nil { - // err = chainErrors(err, nerr) - // } - } - - return records, err -} - -//------------------------------------------------------- -// Read Record Operations -//------------------------------------------------------- - -// Get reads a record header and bins for specified key. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Get(policy *BasePolicy, key *Key, binNames ...string) (*Record, Error) { - policy = clnt.getUsablePolicy(policy) - - command, err := newReadCommand(nil, policy, key, binNames, nil) - if err != nil { - return nil, err - } - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -// GetHeader reads a record generation and expiration only for specified key. -// Bins are not read. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) GetHeader(policy *BasePolicy, key *Key) (*Record, Error) { - policy = clnt.getUsablePolicy(policy) - - command, err := newReadHeaderCommand(nil, policy, key) - if err != nil { - return nil, err - } - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -//------------------------------------------------------- -// Batch Read Operations -//------------------------------------------------------- - -// BatchGet reads multiple record headers and bins for specified keys in one batch request. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) BatchGet(policy *BatchPolicy, keys []*Key, binNames ...string) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - if len(keys) == 0 { - return []*Record{}, nil - } - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - batchRecords := make([]*BatchRecord, 0, len(keys)) - for _, key := range keys { - batchRead, batchRecord := newBatchRead(clnt.DefaultBatchReadPolicy, key, binNames) - batchRecordsIfc = append(batchRecordsIfc, batchRead) - batchRecords = append(batchRecords, batchRecord) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - records := make([]*Record, 0, len(keys)) - for i := range batchRecords { - records = append(records, batchRecords[i].Record) - } - - return records, err -} - -// BatchGetOperate reads multiple records for specified keys using read operations in one batch call. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// -// If a batch request to a node fails, the entire batch is cancelled. -func (clnt *ProxyClient) BatchGetOperate(policy *BatchPolicy, keys []*Key, ops ...*Operation) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - if len(keys) == 0 { - return []*Record{}, nil - } - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - batchRecords := make([]*BatchRecord, 0, len(keys)) - for _, key := range keys { - batchRead, batchRecord := newBatchReadOps(clnt.DefaultBatchReadPolicy, key, ops...) - batchRecordsIfc = append(batchRecordsIfc, batchRead) - batchRecords = append(batchRecords, batchRecord) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - records := make([]*Record, 0, len(keys)) - for i := range batchRecords { - records = append(records, batchRecords[i].Record) - } - - return records, err -} - -// BatchGetComplex reads multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins to be requested for each key in the batch. -// The returned records are located in the same list. -// If the BatchRead key field is not found, the corresponding record field will be nil. -// The policy can be used to specify timeouts and maximum concurrent goroutines. -// This method requires Aerospike Server version >= 3.6.0. -func (clnt *ProxyClient) BatchGetComplex(policy *BatchPolicy, records []*BatchRead) Error { - policy = clnt.getUsableBatchPolicy(policy) - batchRecordsIfc := make([]BatchRecordIfc, 0, len(records)) - for _, record := range records { - batchRecordsIfc = append(batchRecordsIfc, record) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return err -} - -// BatchGetHeader reads multiple record header data for specified keys in one batch request. -// The returned records are in positional order with the original key array order. -// If a key is not found, the positional record will be nil. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) BatchGetHeader(policy *BatchPolicy, keys []*Key) ([]*Record, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - if len(keys) == 0 { - return []*Record{}, nil - } - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - for _, key := range keys { - batchRecordsIfc = append(batchRecordsIfc, NewBatchReadHeader(clnt.DefaultBatchReadPolicy, key)) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - records := make([]*Record, 0, len(keys)) - for i := range batchRecordsIfc { - records = append(records, batchRecordsIfc[i].BatchRec().Record) - } - - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return records, err -} - -// BatchDelete deletes records for specified keys. If a key is not found, the corresponding result -// BatchRecord.ResultCode will be types.KEY_NOT_FOUND_ERROR. -// -// Requires server version 6.0+ -func (clnt *ProxyClient) BatchDelete(policy *BatchPolicy, deletePolicy *BatchDeletePolicy, keys []*Key) ([]*BatchRecord, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - if len(keys) == 0 { - return []*BatchRecord{}, nil - } - - deletePolicy = clnt.getUsableBatchDeletePolicy(deletePolicy) - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - batchRecords := make([]*BatchRecord, 0, len(keys)) - for _, key := range keys { - batchDelete, batchRecord := newBatchDelete(deletePolicy, key) - batchRecordsIfc = append(batchRecordsIfc, batchDelete) - batchRecords = append(batchRecords, batchRecord) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - return batchRecords, err -} - -func (clnt *ProxyClient) batchOperate(policy *BatchPolicy, records []BatchRecordIfc) (int, Error) { - policy = clnt.getUsableBatchPolicy(policy) - - batchNode, err := newGrpcBatchOperateListIfc(policy, records) - if err != nil && policy.RespondAllKeys { - return 0, err - } - - cmd := newBatchCommandOperate(clnt, batchNode, policy, records) - return cmd.filteredOutCnt, cmd.ExecuteGRPC(clnt) -} - -// BatchOperate will read/write multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins for each key in the batch. -// The returned records are located in the same list. -// -// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. -// -// Requires server version 6.0+ -func (clnt *ProxyClient) BatchOperate(policy *BatchPolicy, records []BatchRecordIfc) Error { - _, err := clnt.batchOperate(policy, records) - return err -} - -// BatchExecute will read/write multiple records for specified batch keys in one batch call. -// This method allows different namespaces/bins for each key in the batch. -// The returned records are located in the same list. -// -// BatchRecord can be *BatchRead, *BatchWrite, *BatchDelete or *BatchUDF. -// -// Requires server version 6.0+ -func (clnt *ProxyClient) BatchExecute(policy *BatchPolicy, udfPolicy *BatchUDFPolicy, keys []*Key, packageName string, functionName string, args ...Value) ([]*BatchRecord, Error) { - if len(keys) == 0 { - return []*BatchRecord{}, nil - } - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - batchRecords := make([]*BatchRecord, 0, len(keys)) - for _, key := range keys { - batchUDF, batchRecord := newBatchUDF(udfPolicy, key, packageName, functionName, args...) - batchRecordsIfc = append(batchRecordsIfc, batchUDF) - batchRecords = append(batchRecords, batchRecord) - } - - filteredOut, err := clnt.batchOperate(policy, batchRecordsIfc) - if filteredOut > 0 { - err = chainErrors(ErrFilteredOut.err(), err) - } - - return batchRecords, err -} - -//------------------------------------------------------- -// Generic Database Operations -//------------------------------------------------------- - -// Operate performs multiple read/write operations on a single key in one batch request. -// An example would be to add an integer value to an existing record and then -// read the result, all in one database call. -// -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Operate(policy *WritePolicy, key *Key, operations ...*Operation) (*Record, Error) { - return clnt.operate(policy, key, false, operations...) -} - -func (clnt *ProxyClient) operate(policy *WritePolicy, key *Key, useOpResults bool, operations ...*Operation) (*Record, Error) { - policy = clnt.getUsableWritePolicy(policy) - args, err := newOperateArgs(nil, policy, key, operations) - if err != nil { - return nil, err - } - - command, err := newOperateCommand(nil, policy, key, args, useOpResults) - if err != nil { - return nil, err - } - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - return command.GetRecord(), nil -} - -//------------------------------------------------------- -// Scan Operations -//------------------------------------------------------- - -// ScanPartitions Read records in specified namespace, set and partition filter. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If partitionFilter is nil, all partitions will be scanned. -// If the policy is nil, the default relevant policy will be used. -// This method is only supported by Aerospike 4.9+ servers. -func (clnt *ProxyClient) ScanPartitions(apolicy *ScanPolicy, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - - // result recordset - tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) - res := newRecordset(policy.RecordQueueSize, 1) - cmd := newGrpcScanPartitionCommand(&policy, tracker, partitionFilter, namespace, setName, binNames, res) - go cmd.ExecuteGRPC(clnt) - - return res, nil -} - -// ScanAll reads all records in specified namespace and set from all nodes. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ScanAll(apolicy *ScanPolicy, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.ScanPartitions(apolicy, NewPartitionFilterAll(), namespace, setName, binNames...) -} - -// scanNodePartitions reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) scanNodePartitions(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -// ScanNode reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ScanNode(apolicy *ScanPolicy, node *Node, namespace string, setName string, binNames ...string) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -//--------------------------------------------------------------- -// User defined functions (Supported by Aerospike 3+ servers only) -//--------------------------------------------------------------- - -// RegisterUDFFromFile reads a file from file system and registers -// the containing a package user defined functions with the server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RegisterTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) RegisterUDFFromFile(policy *WritePolicy, clientPath string, serverPath string, language Language) (*RegisterTask, Error) { - panic(notSupportedInProxyClient) -} - -// RegisterUDF registers a package containing user defined functions with server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RegisterTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) RegisterUDF(policy *WritePolicy, udfBody []byte, serverPath string, language Language) (*RegisterTask, Error) { - panic(notSupportedInProxyClient) -} - -// RemoveUDF removes a package containing user defined functions in the server. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// RemoveTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) RemoveUDF(policy *WritePolicy, udfName string) (*RemoveTask, Error) { - panic(notSupportedInProxyClient) -} - -// ListUDF lists all packages containing user defined functions in the server. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ListUDF(policy *BasePolicy) ([]*UDF, Error) { - panic(notSupportedInProxyClient) -} - -// Execute executes a user defined function on server and return results. -// The function operates on a single record. -// The package name is used to locate the udf file location: -// -// udf file = /.lua -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (interface{}, Error) { - policy = clnt.getUsableWritePolicy(policy) - - command, err := newExecuteCommand(nil, policy, key, packageName, functionName, NewValueArray(args)) - if err != nil { - return nil, err - } - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - - if rec := command.GetRecord(); rec != nil && rec.Bins != nil { - return rec.Bins["SUCCESS"], nil - } - - return nil, nil -} - -func (clnt *ProxyClient) execute(policy *WritePolicy, key *Key, packageName string, functionName string, args ...Value) (*Record, Error) { - return nil, newError(types.UNSUPPORTED_FEATURE) -} - -//---------------------------------------------------------- -// Query/Execute (Supported by Aerospike 3+ servers only) -//---------------------------------------------------------- - -// QueryExecute applies operations on records that match the statement filter. -// Records are not returned to the Grpcclient. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryExecute(policy *QueryPolicy, - writePolicy *WritePolicy, - statement *Statement, - ops ...*Operation, -) (*ExecuteTask, Error) { - policy = clnt.getUsableQueryPolicy(policy) - writePolicy = clnt.getUsableWritePolicy(writePolicy) - - command := newServerCommand(nil, policy, writePolicy, statement, statement.TaskId, ops) - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - - return newGRPCExecuteTask(clnt, statement), nil -} - -// ExecuteUDF applies user defined function on records that match the statement filter. -// Records are not returned to the Grpcclient. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ExecuteUDF(policy *QueryPolicy, - statement *Statement, - packageName string, - functionName string, - functionArgs ...Value, -) (*ExecuteTask, Error) { - policy = clnt.getUsableQueryPolicy(policy) - wpolicy := clnt.getUsableWritePolicy(nil) - - nstatement := *statement - nstatement.SetAggregateFunction(packageName, functionName, functionArgs, false) - command := newServerCommand(nil, policy, wpolicy, &nstatement, nstatement.TaskId, nil) - - if err := command.ExecuteGRPC(clnt); err != nil { - return nil, err - } - - return newGRPCExecuteTask(clnt, &nstatement), nil -} - -// ExecuteUDFNode applies user defined function on records that match the statement filter on the specified node. -// Records are not returned to the Grpcclient. -// This asynchronous server call will return before command is complete. -// The user can optionally wait for command completion by using the returned -// ExecuteTask instance. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ExecuteUDFNode(policy *QueryPolicy, - node *Node, - statement *Statement, - packageName string, - functionName string, - functionArgs ...Value, -) (*ExecuteTask, Error) { - panic(notSupportedInProxyClient) -} - -// SetXDRFilter sets XDR filter for given datacenter name and namespace. The expression filter indicates -// which records XDR should ship to the datacenter. -// Pass nil as filter to remove the currentl filter on the server. -func (clnt *ProxyClient) SetXDRFilter(policy *InfoPolicy, datacenter string, namespace string, filter *Expression) Error { - panic(notSupportedInProxyClient) -} - -//-------------------------------------------------------- -// Query functions (Supported by Aerospike 3+ servers only) -//-------------------------------------------------------- - -// QueryPartitions executes a query for specified partitions and returns a recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 4.9+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryPartitions(policy *QueryPolicy, statement *Statement, partitionFilter *PartitionFilter) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - // result recordset - tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) - res := newRecordset(policy.RecordQueueSize, 1) - cmd := newGrpcQueryPartitionCommand(policy, nil, statement, nil, tracker, partitionFilter, res) - go cmd.ExecuteGRPC(clnt) - - return res, nil -} - -// Query executes a query and returns a Recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) Query(policy *QueryPolicy, statement *Statement) (*Recordset, Error) { - return clnt.QueryPartitions(policy, statement, NewPartitionFilterAll()) -} - -// QueryNode executes a query on a specific node and returns a recordset. -// The caller can concurrently pop records off the channel through the -// record channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryNode(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -func (clnt *ProxyClient) queryNodePartitions(policy *QueryPolicy, node *Node, statement *Statement) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -//-------------------------------------------------------- -// Index functions (Supported by Aerospike 3+ servers only) -//-------------------------------------------------------- - -// CreateIndex creates a secondary index. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// IndexTask instance. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) CreateIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType IndexType, -) (*IndexTask, Error) { - panic(notSupportedInProxyClient) -} - -// CreateComplexIndex creates a secondary index, with the ability to put indexes -// on bin containing complex data types, e.g: Maps and Lists. -// This asynchronous server call will return before the command is complete. -// The user can optionally wait for command completion by using the returned -// IndexTask instance. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) CreateComplexIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, - binName string, - indexType IndexType, - indexCollectionType IndexCollectionType, - ctx ...*CDTContext, -) (*IndexTask, Error) { - panic(notSupportedInProxyClient) -} - -// DropIndex deletes a secondary index. It will block until index is dropped on all nodes. -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) DropIndex( - policy *WritePolicy, - namespace string, - setName string, - indexName string, -) Error { - panic(notSupportedInProxyClient) -} - -// Truncate removes records in specified namespace/set efficiently. This method is many orders of magnitude -// faster than deleting records one at a time. Works with Aerospike Server versions >= 3.12. -// This asynchronous server call may return before the truncation is complete. The user can still -// write new records after the server call returns because new records will have last update times -// greater than the truncate cutoff (set at the time of truncate call). -// For more information, See https://www.aerospike.com/docs/reference/info#truncate -func (clnt *ProxyClient) Truncate(policy *InfoPolicy, namespace, set string, beforeLastUpdate *time.Time) Error { - panic(notSupportedInProxyClient) -} - -//------------------------------------------------------- -// User administration -//------------------------------------------------------- - -// CreateUser creates a new user with password and roles. Clear-text password will be hashed using bcrypt -// before sending to server. -func (clnt *ProxyClient) CreateUser(policy *AdminPolicy, user string, password string, roles []string) Error { - panic(notSupportedInProxyClient) -} - -// DropUser removes a user from the cluster. -func (clnt *ProxyClient) DropUser(policy *AdminPolicy, user string) Error { - panic(notSupportedInProxyClient) -} - -// ChangePassword changes a user's password. Clear-text password will be hashed using bcrypt before sending to server. -func (clnt *ProxyClient) ChangePassword(policy *AdminPolicy, user string, password string) Error { - panic(notSupportedInProxyClient) -} - -// GrantRoles adds roles to user's list of roles. -func (clnt *ProxyClient) GrantRoles(policy *AdminPolicy, user string, roles []string) Error { - panic(notSupportedInProxyClient) -} - -// RevokeRoles removes roles from user's list of roles. -func (clnt *ProxyClient) RevokeRoles(policy *AdminPolicy, user string, roles []string) Error { - panic(notSupportedInProxyClient) -} - -// QueryUser retrieves roles for a given user. -func (clnt *ProxyClient) QueryUser(policy *AdminPolicy, user string) (*UserRoles, Error) { - panic(notSupportedInProxyClient) -} - -// QueryUsers retrieves all users and their roles. -func (clnt *ProxyClient) QueryUsers(policy *AdminPolicy) ([]*UserRoles, Error) { - panic(notSupportedInProxyClient) -} - -// QueryRole retrieves privileges for a given role. -func (clnt *ProxyClient) QueryRole(policy *AdminPolicy, role string) (*Role, Error) { - panic(notSupportedInProxyClient) -} - -// QueryRoles retrieves all roles and their privileges. -func (clnt *ProxyClient) QueryRoles(policy *AdminPolicy) ([]*Role, Error) { - panic(notSupportedInProxyClient) -} - -// CreateRole creates a user-defined role. -// Quotas require server security configuration "enable-quotas" to be set to true. -// Pass 0 for quota values for no limit. -func (clnt *ProxyClient) CreateRole(policy *AdminPolicy, roleName string, privileges []Privilege, whitelist []string, readQuota, writeQuota uint32) Error { - panic(notSupportedInProxyClient) -} - -// DropRole removes a user-defined role. -func (clnt *ProxyClient) DropRole(policy *AdminPolicy, roleName string) Error { - panic(notSupportedInProxyClient) -} - -// GrantPrivileges grant privileges to a user-defined role. -func (clnt *ProxyClient) GrantPrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { - panic(notSupportedInProxyClient) -} - -// RevokePrivileges revokes privileges from a user-defined role. -func (clnt *ProxyClient) RevokePrivileges(policy *AdminPolicy, roleName string, privileges []Privilege) Error { - panic(notSupportedInProxyClient) -} - -// SetWhitelist sets IP address whitelist for a role. If whitelist is nil or empty, it removes existing whitelist from role. -func (clnt *ProxyClient) SetWhitelist(policy *AdminPolicy, roleName string, whitelist []string) Error { - panic(notSupportedInProxyClient) -} - -// SetQuotas sets maximum reads/writes per second limits for a role. If a quota is zero, the limit is removed. -// Quotas require server security configuration "enable-quotas" to be set to true. -// Pass 0 for quota values for no limit. -func (clnt *ProxyClient) SetQuotas(policy *AdminPolicy, roleName string, readQuota, writeQuota uint32) Error { - panic(notSupportedInProxyClient) -} - -// RequestInfo sends an info command to the server. The proxy server should be configured to have allowed -// the commands to go through. -func (clnt *ProxyClient) RequestInfo(policy *InfoPolicy, commands ...string) (map[string]string, Error) { - policy = clnt.getUsableInfoPolicy(policy) - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - InfoRequest: &kvs.InfoRequest{ - InfoPolicy: policy.grpc(), - Commands: commands, - }, - } - - conn, err := clnt.grpcConn() - if err != nil { - return nil, err - } - - client := kvs.NewInfoClient(conn) - - ctx, cancel := policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Info(ctx, &req) - if gerr != nil { - return nil, newGrpcError(false, gerr, gerr.Error()) - } - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return nil, newGrpcStatusError(res) - } - - info := info{ - msg: &types.Message{ - Data: res.Payload, - }, - } - - return info.parseMultiResponse() -} - -//------------------------------------------------------- -// Access Methods -//------------------------------------------------------- - -// Cluster exposes the cluster object to the user -func (clnt *ProxyClient) Cluster() *Cluster { - panic(notSupportedInProxyClient) -} - -// String implements the Stringer interface for Grpcclient -func (clnt *ProxyClient) String() string { - return "" -} - -// Stats returns internal statistics regarding the inner state of the Grpcclient and the cluster. -func (clnt *ProxyClient) Stats() (map[string]interface{}, Error) { - panic(notSupportedInProxyClient) -} - -// WarmUp fills the connection pool with connections for all nodes. -// This is necessary on startup for high traffic programs. -// If the count is <= 0, the connection queue will be filled. -// If the count is more than the size of the pool, the pool will be filled. -// Note: One connection per node is reserved for tend operations and is not used for transactions. -func (clnt *ProxyClient) WarmUp(count int) (int, Error) { - if count <= 0 || count > clnt.clientPolicy.ConnectionQueueSize { - count = clnt.clientPolicy.ConnectionQueueSize - } - - for i := 0; i < count; i++ { - conn, err := clnt.createGrpcConn(!clnt.clientPolicy.RequiresAuthentication()) - if err != nil { - return i, err - } - clnt.returnGrpcConnToPool(conn) - } - - return count, nil -} - -//------------------------------------------------------- -// Internal Methods -//------------------------------------------------------- - -func (clnt *ProxyClient) grpcMode() bool { - return clnt.grpcConnPool != nil -} - -//------------------------------------------------------- -// Policy Methods -//------------------------------------------------------- - -func (clnt *ProxyClient) getUsablePolicy(policy *BasePolicy) *BasePolicy { - if policy == nil { - if clnt.DefaultPolicy != nil { - return clnt.DefaultPolicy - } - return NewPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBatchPolicy(policy *BatchPolicy) *BatchPolicy { - if policy == nil { - if clnt.DefaultBatchPolicy != nil { - return clnt.DefaultBatchPolicy - } - return NewBatchPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBaseBatchWritePolicy(policy *BatchPolicy) *BatchPolicy { - if policy == nil { - if clnt.DefaultBatchPolicy != nil { - return clnt.DefaultBatchPolicy - } - return NewBatchPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBatchReadPolicy(policy *BatchReadPolicy) *BatchReadPolicy { - if policy == nil { - if clnt.DefaultBatchReadPolicy != nil { - return clnt.DefaultBatchReadPolicy - } - return NewBatchReadPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBatchWritePolicy(policy *BatchWritePolicy) *BatchWritePolicy { - if policy == nil { - if clnt.DefaultBatchWritePolicy != nil { - return clnt.DefaultBatchWritePolicy - } - return NewBatchWritePolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBatchDeletePolicy(policy *BatchDeletePolicy) *BatchDeletePolicy { - if policy == nil { - if clnt.DefaultBatchDeletePolicy != nil { - return clnt.DefaultBatchDeletePolicy - } - return NewBatchDeletePolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableBatchUDFPolicy(policy *BatchUDFPolicy) *BatchUDFPolicy { - if policy == nil { - if clnt.DefaultBatchUDFPolicy != nil { - return clnt.DefaultBatchUDFPolicy - } - return NewBatchUDFPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableWritePolicy(policy *WritePolicy) *WritePolicy { - if policy == nil { - if clnt.DefaultWritePolicy != nil { - return clnt.DefaultWritePolicy - } - return NewWritePolicy(0, 0) - } - return policy -} - -func (clnt *ProxyClient) getUsableScanPolicy(policy *ScanPolicy) *ScanPolicy { - if policy == nil { - if clnt.DefaultScanPolicy != nil { - return clnt.DefaultScanPolicy - } - return NewScanPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableQueryPolicy(policy *QueryPolicy) *QueryPolicy { - if policy == nil { - if clnt.DefaultQueryPolicy != nil { - return clnt.DefaultQueryPolicy - } - return NewQueryPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableAdminPolicy(policy *AdminPolicy) *AdminPolicy { - if policy == nil { - if clnt.DefaultAdminPolicy != nil { - return clnt.DefaultAdminPolicy - } - return NewAdminPolicy() - } - return policy -} - -func (clnt *ProxyClient) getUsableInfoPolicy(policy *InfoPolicy) *InfoPolicy { - if policy == nil { - if clnt.DefaultInfoPolicy != nil { - return clnt.DefaultInfoPolicy - } - return NewInfoPolicy() - } - return policy -} - -//------------------------------------------------------- -// Utility Functions -//------------------------------------------------------- - -// grpcConnectionHeap is a non-blocking LIFO heap. -// If the heap is empty, nil is returned. -// if the heap is full, offer will return false -type grpcConnectionHeap struct { - head, tail uint32 - data []*grpc.ClientConn - size uint32 - full bool - mutex sync.Mutex -} - -// newGrpcConnectionHeap creates a new heap with initial size. -func newGrpcConnectionHeap(size int) *grpcConnectionHeap { - if size <= 0 { - panic("Heap size cannot be less than 1") - } - - return &grpcConnectionHeap{ - full: false, - data: make([]*grpc.ClientConn, uint32(size)), - size: uint32(size), - } -} - -func (h *grpcConnectionHeap) cleanup() { - h.mutex.Lock() - defer h.mutex.Unlock() - - for i := range h.data { - if h.data[i] != nil { - h.data[i].Close() - } - - h.data[i] = nil - } - - // make sure offer and poll both fail - h.data = nil - h.full = true - h.head = 0 - h.tail = 0 -} - -// Put adds an item to the heap unless the heap is full. -// In case the heap is full, the item will not be added to the heap -// and false will be returned -func (h *grpcConnectionHeap) Put(conn *grpc.ClientConn) bool { - h.mutex.Lock() - - // make sure heap is not full or cleaned up - if h.full || len(h.data) == 0 { - h.mutex.Unlock() - return false - } - - h.head = (h.head + 1) % h.size - h.full = (h.head == h.tail) - h.data[h.head] = conn - h.mutex.Unlock() - return true -} - -// Poll removes and returns an item from the heap. -// If the heap is empty, nil will be returned. -func (h *grpcConnectionHeap) Get() (res *grpc.ClientConn) { - h.mutex.Lock() - - // the heap has been cleaned up - if len(h.data) == 0 { - h.mutex.Unlock() - return nil - } - - // if heap is not empty - if (h.tail != h.head) || h.full { - res = h.data[h.head] - h.data[h.head] = nil - - h.full = false - if h.head == 0 { - h.head = h.size - 1 - } else { - h.head-- - } - } - - h.mutex.Unlock() - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go deleted file mode 100644 index f6484ef8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_client_app_engine_exclusions.go +++ /dev/null @@ -1,28 +0,0 @@ -//go:build !app_engine && as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// QueryAggregate executes a Map/Reduce query and returns the results. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryAggregate(policy *QueryPolicy, statement *Statement, packageName, functionName string, functionArgs ...Value) (*Recordset, Error) { - panic("NOT SUPPORTED") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go deleted file mode 100644 index 8c656ff8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_client_reflect.go +++ /dev/null @@ -1,231 +0,0 @@ -//go:build !as_performance && as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// PutObject writes record bin(s) to the server. -// The policy specifies the transaction timeout, record expiration and how the transaction is -// handled when the record already exists. -// If the policy is nil, the default relevant policy will be used. -// A struct can be tagged to influence the way the object is put in the database: -// -// type Person struct { -// TTL uint32 `asm:"ttl"` -// RecGen uint32 `asm:"gen"` -// Name string `as:"name"` -// Address string `as:"desc,omitempty"` -// Age uint8 `as:",omitempty"` -// Password string `as:"-"` -// } -// -// Tag `as:` denotes Aerospike fields. The first value will be the alias for the field. -// `,omitempty` (without any spaces between the comma and the word) will act like the -// json package, and will not send the value of the field to the database if the value is zero value. -// Tag `asm:` denotes Aerospike Meta fields, and includes ttl and generation values. -// If a tag is marked with `-`, it will not be sent to the database at all. -// Note: Tag `as` can be replaced with any other user-defined tag via the function `SetAerospikeTag`. -func (clnt *ProxyClient) PutObject(policy *WritePolicy, key *Key, obj interface{}) (err Error) { - policy = clnt.getUsableWritePolicy(policy) - - binMap := marshal(obj) - command, err := newWriteCommand(nil, policy, key, nil, binMap, _WRITE) - if err != nil { - return err - } - - res := command.ExecuteGRPC(clnt) - return res -} - -// GetObject reads a record for specified key and puts the result into the provided object. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) GetObject(policy *BasePolicy, key *Key, obj interface{}) Error { - policy = clnt.getUsablePolicy(policy) - - rval := reflect.ValueOf(obj) - binNames := objectMappings.getFields(rval.Type()) - - command, err := newReadCommand(nil, policy, key, binNames, nil) - if err != nil { - return err - } - - command.object = &rval - - return command.ExecuteGRPC(clnt) -} - -// BatchGetObjects reads multiple record headers and bins for specified keys in one batch request. -// The returned objects are in positional order with the original key array order. -// If a key is not found, the positional object will not change, and the positional found boolean will be false. -// The policy can be used to specify timeouts. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) BatchGetObjects(policy *BatchPolicy, keys []*Key, objects []interface{}) (found []bool, err Error) { - policy = clnt.getUsableBatchPolicy(policy) - - // check the size of key and objects - if len(keys) != len(objects) { - return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: number of keys and objects do not match") - } - - if len(keys) == 0 { - return nil, newError(types.PARAMETER_ERROR, "wrong number of arguments to BatchGetObjects: keys are empty") - } - - binSet := map[string]struct{}{} - objectsVal := make([]*reflect.Value, len(objects)) - for i := range objects { - rval := reflect.ValueOf(objects[i]) - objectsVal[i] = &rval - for _, bn := range objectMappings.getFields(rval.Type()) { - binSet[bn] = struct{}{} - } - } - - binNames := make([]string, 0, len(binSet)) - for binName := range binSet { - binNames = append(binNames, binName) - } - - batchRecordsIfc := make([]BatchRecordIfc, 0, len(keys)) - batchRecords := make([]*BatchRecord, 0, len(keys)) - for _, key := range keys { - batchRead, batchRecord := newBatchRead(nil, key, binNames) - batchRecordsIfc = append(batchRecordsIfc, batchRead) - batchRecords = append(batchRecords, batchRecord) - } - - batchNode, err := newGrpcBatchOperateListIfc(policy, batchRecordsIfc) - if err != nil && policy.RespondAllKeys { - return nil, err - } - - cmd := newBatchCommandOperate(clnt, batchNode, policy, batchRecordsIfc) - - objectsFound := make([]bool, len(keys)) - cmd.objects = objectsVal - cmd.objectsFound = objectsFound - - err = cmd.ExecuteGRPC(clnt) - // if filteredOut > 0 { - // err = chainErrors(ErrFilteredOut.err(), err) - // } - - return objectsFound, err -} - -// ScanPartitionObjects Reads records in specified namespace, set and partition filter. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If partitionFilter is nil, all partitions will be scanned. -// If the policy is nil, the default relevant policy will be used. -// This method is only supported by Aerospike 4.9+ servers. -func (clnt *ProxyClient) ScanPartitionObjects(apolicy *ScanPolicy, objChan interface{}, partitionFilter *PartitionFilter, namespace string, setName string, binNames ...string) (*Recordset, Error) { - policy := *clnt.getUsableScanPolicy(apolicy) - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) - cmd := newGrpcScanPartitionCommand(&policy, tracker, partitionFilter, namespace, setName, binNames, res) - go cmd.ExecuteGRPC(clnt) - - return res, nil - -} - -// ScanAllObjects reads all records in specified namespace and set from all nodes. -// If the policy's concurrentNodes is specified, each server node will be read in -// parallel. Otherwise, server nodes are read sequentially. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) ScanAllObjects(apolicy *ScanPolicy, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - return clnt.ScanPartitionObjects(apolicy, objChan, NewPartitionFilterAll(), namespace, setName, binNames...) -} - -// scanNodePartitions reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) scanNodePartitionsObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -// ScanNodeObjects reads all records in specified namespace and set for one node only, -// and marshalls the results into the objects of the provided channel in Recordset. -// If the policy is nil, the default relevant policy will be used. -// The resulting records will be marshalled into the objChan. -// objChan will be closed after all the records are read. -func (clnt *ProxyClient) ScanNodeObjects(apolicy *ScanPolicy, node *Node, objChan interface{}, namespace string, setName string, binNames ...string) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -// scanNodeObjects reads all records in specified namespace and set for one node only, -// and marshalls the results into the objects of the provided channel in Recordset. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) scanNodeObjects(policy *ScanPolicy, node *Node, recordset *Recordset, namespace string, setName string, binNames ...string) Error { - panic(notSupportedInProxyClient) -} - -// QueryPartitionObjects executes a query for specified partitions and returns a recordset. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop records off the channel through the -// Recordset.Records channel. -// -// This method is only supported by Aerospike 4.9+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryPartitionObjects(policy *QueryPolicy, statement *Statement, objChan interface{}, partitionFilter *PartitionFilter) (*Recordset, Error) { - policy = clnt.getUsableQueryPolicy(policy) - - // result recordset - res := &Recordset{ - objectset: *newObjectset(reflect.ValueOf(objChan), 1), - } - tracker := newPartitionTracker(&policy.MultiPolicy, partitionFilter, nil) - cmd := newGrpcQueryPartitionCommand(policy, nil, statement, nil, tracker, partitionFilter, res) - go cmd.ExecuteGRPC(clnt) - - return res, nil - -} - -// QueryObjects executes a query on all nodes in the cluster and marshals the records into the given channel. -// The query executor puts records on the channel from separate goroutines. -// The caller can concurrently pop objects. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryObjects(policy *QueryPolicy, statement *Statement, objChan interface{}) (*Recordset, Error) { - return clnt.QueryPartitionObjects(policy, statement, objChan, NewPartitionFilterAll()) -} - -func (clnt *ProxyClient) queryNodePartitionsObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} - -// QueryNodeObjects executes a query on a specific node and marshals the records into the given channel. -// The caller can concurrently pop records off the channel. -// -// This method is only supported by Aerospike 3+ servers. -// If the policy is nil, the default relevant policy will be used. -func (clnt *ProxyClient) QueryNodeObjects(policy *QueryPolicy, node *Node, statement *Statement, objChan interface{}) (*Recordset, Error) { - panic(notSupportedInProxyClient) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go b/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go deleted file mode 100644 index 9a50ebff..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike Proxy Client", func() { - - gg.Describe("Info operations on proxy client", func() { - gg.BeforeEach(func() { - if !*proxy { - gg.Skip("Only supported in grpc environment") - } - }) - - gg.It("must successfully call info command", func() { - _, err := client.(*as.ProxyClient).RequestInfo(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go b/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go deleted file mode 100644 index 11cfcfae..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_commands.go +++ /dev/null @@ -1,517 +0,0 @@ -//go:build as_proxy - -package aerospike - -import ( - "math/rand" - - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" -) - -func (cmd *readCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - ReadPolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Read(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *batchCommandOperate) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - ReadPolicy: cmd.policy.grpc(), - WritePolicy: cmd.policy.grpc_write(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - streamRes, gerr := client.BatchOperate(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - readCallback := func() ([]byte, Error) { - if cmd.grpcEOS { - return nil, errGRPCStreamEnd - } - - res, gerr := streamRes.Recv() - if gerr != nil { - e := newGrpcError(!cmd.isRead(), gerr) - return nil, e - } - - if res.GetStatus() != 0 { - e := newGrpcStatusError(res) - return res.GetPayload(), e - } - - cmd.grpcEOS = !res.GetHasNext() - - return res.GetPayload(), nil - } - - cmd.conn = newGrpcFakeConnection(nil, readCallback) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil && err != errGRPCStreamEnd { - return err - } - - clnt.returnGrpcConnToPool(conn) - - return nil -} - -func (cmd *deleteCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - WritePolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Delete(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *executeCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - WritePolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Execute(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *existsCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - ReadPolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Exists(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *operateCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - WritePolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Operate(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *readHeaderCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - ReadPolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.GetHeader(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *serverCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - execReq := &kvs.BackgroundExecuteRequest{ - Statement: cmd.statement.grpc(cmd.policy, cmd.operations), - WritePolicy: cmd.writePolicy.grpc_exec(cmd.policy.FilterExpression), - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - BackgroundExecuteRequest: execReq, - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewQueryClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - streamRes, gerr := client.BackgroundExecute(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - readCallback := func() ([]byte, Error) { - res, gerr := streamRes.Recv() - if gerr != nil { - e := newGrpcError(!cmd.isRead(), gerr) - return nil, e - } - - if res.GetStatus() != 0 { - e := newGrpcStatusError(res) - return res.GetPayload(), e - } - - if !res.GetHasNext() { - return nil, errGRPCStreamEnd - } - - return res.GetPayload(), nil - } - - cmd.conn = newGrpcFakeConnection(nil, readCallback) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil && err != errGRPCStreamEnd { - return err - } - - clnt.returnGrpcConnToPool(conn) - - return nil -} - -func (cmd *touchCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - WritePolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Touch(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} - -func (cmd *writeCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - WritePolicy: cmd.policy.grpc(), - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewKVSClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - res, gerr := client.Write(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - defer clnt.returnGrpcConnToPool(conn) - - if res.GetStatus() != 0 { - return newGrpcStatusError(res) - } - - cmd.conn = newGrpcFakeConnection(res.GetPayload(), nil) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil { - return err - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go b/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go deleted file mode 100644 index ecd4fefc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_conv.go +++ /dev/null @@ -1,479 +0,0 @@ -//go:build as_proxy - -package aerospike - -import ( - "context" - "math/rand" - "time" - - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -func (fltr *Filter) grpc() *kvs.Filter { - if fltr == nil { - return nil - } - - res := &kvs.Filter{ - Name: fltr.name, - ColType: fltr.idxType.grpc(), - PackedCtx: fltr.grpcPackCtxPayload(), - ValType: int32(fltr.valueParticleType), - Begin: grpcValuePacked(fltr.begin), - End: grpcValuePacked(fltr.end), - } - - return res -} - -/////////////////////////////////////////////////////////////////// - -var simpleCancelFunc = func() {} - -func (p *InfoPolicy) grpcDeadlineContext() (context.Context, context.CancelFunc) { - timeout := p.timeout() - if timeout <= 0 { - return context.Background(), simpleCancelFunc - - } - ctx, cancel := context.WithTimeout(context.Background(), timeout) - return ctx, cancel -} - -func (p *InfoPolicy) grpc() *kvs.InfoPolicy { - if p == nil { - return nil - } - - Timeout := uint32(p.Timeout / time.Millisecond) - res := &kvs.InfoPolicy{ - Timeout: &Timeout, - } - - return res -} - -/////////////////////////////////////////////////////////////////// - -func (op *Operation) grpc() *kvs.Operation { - BinName := op.binName - return &kvs.Operation{ - Type: op.grpc_op_type(), - BinName: &BinName, - Value: grpcValuePacked(op.binValue), - } -} - -/////////////////////////////////////////////////////////////////// - -func (pf *PartitionFilter) grpc() *kvs.PartitionFilter { - begin := uint32(pf.Begin) - ps := make([]*kvs.PartitionStatus, len(pf.Partitions)) - for i := range pf.Partitions { - ps[i] = pf.Partitions[i].grpc() - } - - return &kvs.PartitionFilter{ - Begin: &begin, - Count: uint32(pf.Count), - Digest: pf.Digest, - PartitionStatuses: ps, - Retry: true, - } - -} - -/////////////////////////////////////////////////////////////////// - -func (ps *PartitionStatus) grpc() *kvs.PartitionStatus { - id := uint32(ps.Id) - bVal := ps.BVal - digest := ps.Digest - return &kvs.PartitionStatus{ - Id: &id, - BVal: &bVal, - Digest: digest, - Retry: ps.Retry, - } -} - -/////////////////////////////////////////////////////////////////// - -func (p *BasePolicy) grpc() *kvs.ReadPolicy { - return &kvs.ReadPolicy{ - Replica: p.ReplicaPolicy.grpc(), - ReadModeSC: p.ReadModeSC.grpc(), - ReadModeAP: p.ReadModeAP.grpc(), - } -} - -func (p *BasePolicy) grpcDeadlineContext() (context.Context, context.CancelFunc) { - timeout := p.timeout() - if timeout <= 0 { - return context.Background(), simpleCancelFunc - - } - ctx, cancel := context.WithTimeout(context.Background(), timeout) - return ctx, cancel -} - -/////////////////////////////////////////////////////////////////// - -func (qp *QueryPolicy) grpc() *kvs.QueryPolicy { - SendKey := qp.SendKey - TotalTimeout := uint32(qp.TotalTimeout / time.Millisecond) - RecordQueueSize := uint32(qp.RecordQueueSize) - MaxConcurrentNodes := uint32(qp.MaxConcurrentNodes) - IncludeBinData := qp.IncludeBinData - FailOnClusterChange := false //qp.FailOnClusterChange - ShortQuery := qp.ShortQuery || qp.ExpectedDuration == SHORT - InfoTimeout := uint32(qp.SocketTimeout / time.Millisecond) - ExpectedDuration := qp.ExpectedDuration.grpc() - - return &kvs.QueryPolicy{ - Replica: qp.ReplicaPolicy.grpc(), - ReadModeAP: qp.ReadModeAP.grpc(), - ReadModeSC: qp.ReadModeSC.grpc(), - SendKey: &SendKey, - Compress: qp.UseCompression, - Expression: qp.FilterExpression.grpc(), - TotalTimeout: &TotalTimeout, - MaxConcurrentNodes: &MaxConcurrentNodes, - RecordQueueSize: &RecordQueueSize, - IncludeBinData: &IncludeBinData, - FailOnClusterChange: &FailOnClusterChange, - ShortQuery: &ShortQuery, - InfoTimeout: &InfoTimeout, - ExpectedDuration: &ExpectedDuration, - } -} - -/////////////////////////////////////////////////////////////////// - -func (sp *ScanPolicy) grpc() *kvs.ScanPolicy { - TotalTimeout := uint32(sp.TotalTimeout / time.Millisecond) - MaxRecords := uint64(sp.MaxRecords) - RecordsPerSecond := uint32(sp.RecordsPerSecond) - MaxConcurrentNodes := uint32(sp.MaxConcurrentNodes) - IncludeBinData := sp.IncludeBinData - ConcurrentNodes := MaxConcurrentNodes > 1 - - return &kvs.ScanPolicy{ - Replica: sp.ReplicaPolicy.grpc(), - ReadModeAP: sp.ReadModeAP.grpc(), - ReadModeSC: sp.ReadModeSC.grpc(), - Compress: sp.UseCompression, - Expression: sp.FilterExpression.grpc(), - TotalTimeout: &TotalTimeout, - MaxRecords: &MaxRecords, - RecordsPerSecond: &RecordsPerSecond, - ConcurrentNodes: &ConcurrentNodes, - MaxConcurrentNodes: &MaxConcurrentNodes, - IncludeBinData: &IncludeBinData, - } -} - -/////////////////////////////////////////////////////////////////// - -func (p *WritePolicy) grpc() *kvs.WritePolicy { - return &kvs.WritePolicy{ - Replica: p.ReplicaPolicy.grpc(), - ReadModeSC: p.ReadModeSC.grpc(), - ReadModeAP: p.ReadModeAP.grpc(), - } -} - -func (p *WritePolicy) grpc_exec(expr *Expression) *kvs.BackgroundExecutePolicy { - if p == nil { - return nil - } - - SendKey := p.SendKey - TotalTimeout := uint32(p.TotalTimeout / time.Millisecond) - RecordExistsAction := p.RecordExistsAction.grpc() - GenerationPolicy := p.GenerationPolicy.grpc() - CommitLevel := p.CommitLevel.grpc() - Generation := p.Generation - Expiration := p.Expiration - RespondAllOps := p.RespondPerEachOp - DurableDelete := p.DurableDelete - - fe := expr - if fe == nil { - fe = p.FilterExpression - } - - res := &kvs.BackgroundExecutePolicy{ - Replica: p.ReplicaPolicy.grpc(), - ReadModeAP: p.ReadModeAP.grpc(), - ReadModeSC: p.ReadModeSC.grpc(), - SendKey: &SendKey, - Compress: p.UseCompression, - Expression: fe.grpc(), - TotalTimeout: &TotalTimeout, - - Xdr: nil, - - RecordExistsAction: &RecordExistsAction, - GenerationPolicy: &GenerationPolicy, - CommitLevel: &CommitLevel, - Generation: &Generation, - Expiration: &Expiration, - RespondAllOps: &RespondAllOps, - DurableDelete: &DurableDelete, - } - - return res -} - -func (p *BatchPolicy) grpc_write() *kvs.WritePolicy { - return &kvs.WritePolicy{ - Replica: p.ReplicaPolicy.grpc(), - ReadModeSC: p.ReadModeSC.grpc(), - ReadModeAP: p.ReadModeAP.grpc(), - } -} - -func (cl CommitLevel) grpc() kvs.CommitLevel { - switch cl { - case COMMIT_ALL: - return kvs.CommitLevel_COMMIT_ALL - case COMMIT_MASTER: - return kvs.CommitLevel_COMMIT_MASTER - } - panic(unreachable) -} - -func newGrpcStatusError(res *kvs.AerospikeResponsePayload) Error { - if res.GetStatus() >= 0 { - return newError(types.ResultCode(res.GetStatus())).markInDoubt(res.GetInDoubt()) - } - - var resultCode = types.OK - switch res.GetStatus() { - case -16: - // BATCH_FAILED - resultCode = types.BATCH_FAILED - case -15: - // NO_RESPONSE - resultCode = types.NO_RESPONSE - case -12: - // MAX_ERROR_RATE - resultCode = types.MAX_ERROR_RATE - case -11: - // MAX_RETRIES_EXCEEDED - resultCode = types.MAX_RETRIES_EXCEEDED - case -10: - // SERIALIZE_ERROR - resultCode = types.SERIALIZE_ERROR - case -9: - // ASYNC_QUEUE_FULL - // resultCode = types.ASYNC_QUEUE_FULL - return newError(types.SERVER_ERROR, "Server ASYNC_QUEUE_FULL").markInDoubt(res.GetInDoubt()) - case -8: - // SERVER_NOT_AVAILABLE - resultCode = types.SERVER_NOT_AVAILABLE - case -7: - // NO_MORE_CONNECTIONS - resultCode = types.NO_AVAILABLE_CONNECTIONS_TO_NODE - case -5: - // QUERY_TERMINATED - resultCode = types.QUERY_TERMINATED - case -4: - // SCAN_TERMINATED - resultCode = types.SCAN_TERMINATED - case -3: - // INVALID_NODE_ERROR - resultCode = types.INVALID_NODE_ERROR - case -2: - // PARSE_ERROR - resultCode = types.PARSE_ERROR - case -1: - // CLIENT_ERROR - resultCode = types.COMMON_ERROR - } - - return newError(resultCode).markInDoubt(res.GetInDoubt()) -} - -func (gp GenerationPolicy) grpc() kvs.GenerationPolicy { - switch gp { - case NONE: - return kvs.GenerationPolicy_NONE - case EXPECT_GEN_EQUAL: - return kvs.GenerationPolicy_EXPECT_GEN_EQUAL - case EXPECT_GEN_GT: - return kvs.GenerationPolicy_EXPECT_GEN_GT - } - panic(unreachable) -} - -func (ict IndexCollectionType) grpc() kvs.IndexCollectionType { - switch ict { - // Normal scalar index. - case ICT_DEFAULT: - return kvs.IndexCollectionType_DEFAULT - // Index list elements. - case ICT_LIST: - return kvs.IndexCollectionType_LIST - // Index map keys. - case ICT_MAPKEYS: - return kvs.IndexCollectionType_MAPKEYS - // Index map values. - case ICT_MAPVALUES: - return kvs.IndexCollectionType_MAPVALUES - } - panic(unreachable) -} - -func (o *Operation) grpc_op_type() kvs.OperationType { - // case _READ: return kvs.OperationType_READ - switch o.opType { - case _READ: - return kvs.OperationType_READ - case _READ_HEADER: - return kvs.OperationType_READ_HEADER - case _WRITE: - return kvs.OperationType_WRITE - case _CDT_READ: - return kvs.OperationType_CDT_READ - case _CDT_MODIFY: - return kvs.OperationType_CDT_MODIFY - case _MAP_READ: - return kvs.OperationType_MAP_READ - case _MAP_MODIFY: - return kvs.OperationType_MAP_MODIFY - case _ADD: - return kvs.OperationType_ADD - case _EXP_READ: - return kvs.OperationType_EXP_READ - case _EXP_MODIFY: - return kvs.OperationType_EXP_MODIFY - case _APPEND: - return kvs.OperationType_APPEND - case _PREPEND: - return kvs.OperationType_PREPEND - case _TOUCH: - return kvs.OperationType_TOUCH - case _BIT_READ: - return kvs.OperationType_BIT_READ - case _BIT_MODIFY: - return kvs.OperationType_BIT_MODIFY - case _DELETE: - return kvs.OperationType_DELETE - case _HLL_READ: - return kvs.OperationType_HLL_READ - case _HLL_MODIFY: - return kvs.OperationType_HLL_MODIFY - } - - panic(unreachable) -} - -func (stmt *Statement) grpc(policy *QueryPolicy, ops []*Operation) *kvs.Statement { - IndexName := stmt.IndexName - // reset taskID every time - TaskId := rand.Int63() - SetName := stmt.SetName - - MaxRecords := uint64(policy.MaxRecords) - RecordsPerSecond := uint32(policy.RecordsPerSecond) - - funcArgs := make([][]byte, 0, len(stmt.functionArgs)) - for i := range stmt.functionArgs { - funcArgs = append(funcArgs, grpcValuePacked(stmt.functionArgs[i])) - } - - return &kvs.Statement{ - Namespace: stmt.Namespace, - SetName: &SetName, - IndexName: &IndexName, - BinNames: stmt.BinNames, - Filter: stmt.Filter.grpc(), - PackageName: stmt.packageName, - FunctionName: stmt.functionName, - FunctionArgs: funcArgs, - Operations: grpcOperations(ops), - TaskId: &TaskId, - MaxRecords: &MaxRecords, - RecordsPerSecond: &RecordsPerSecond, - } -} - -func grpcOperations(ops []*Operation) []*kvs.Operation { - res := make([]*kvs.Operation, 0, len(ops)) - for i := range ops { - res = append(res, ops[i].grpc()) - } - return res -} - -func (qd QueryDuration) grpc() kvs.QueryDuration { - switch qd { - case LONG: - return kvs.QueryDuration(kvs.QueryDuration_LONG) - case SHORT: - return kvs.QueryDuration(kvs.QueryDuration_SHORT) - case LONG_RELAX_AP: - return kvs.QueryDuration(kvs.QueryDuration_LONG_RELAX_AP) - } - panic(unreachable) -} - -func (rm ReadModeAP) grpc() kvs.ReadModeAP { - switch rm { - case ReadModeAPOne: - return kvs.ReadModeAP_ONE - case ReadModeAPAll: - return kvs.ReadModeAP_ALL - } - panic(unreachable) -} - -func (rm ReadModeSC) grpc() kvs.ReadModeSC { - switch rm { - case ReadModeSCSession: - return kvs.ReadModeSC_SESSION - case ReadModeSCLinearize: - return kvs.ReadModeSC_LINEARIZE - case ReadModeSCAllowReplica: - return kvs.ReadModeSC_ALLOW_REPLICA - case ReadModeSCAllowUnavailable: - return kvs.ReadModeSC_ALLOW_UNAVAILABLE - } - panic(unreachable) -} - -func (rea RecordExistsAction) grpc() kvs.RecordExistsAction { - switch rea { - case UPDATE: - return kvs.RecordExistsAction_UPDATE - case UPDATE_ONLY: - return kvs.RecordExistsAction_UPDATE_ONLY - case REPLACE: - return kvs.RecordExistsAction_REPLACE - case REPLACE_ONLY: - return kvs.RecordExistsAction_REPLACE_ONLY - case CREATE_ONLY: - return kvs.RecordExistsAction_CREATE_ONLY - } - panic(unreachable) -} - -func (rp ReplicaPolicy) grpc() kvs.Replica { - switch rp { - case MASTER: - return kvs.Replica_MASTER - case MASTER_PROLES: - return kvs.Replica_MASTER_PROLES - case RANDOM: - return kvs.Replica_RANDOM - case SEQUENCE: - return kvs.Replica_SEQUENCE - case PREFER_RACK: - return kvs.Replica_PREFER_RACK - } - panic(unreachable) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go b/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go deleted file mode 100644 index bc89b966..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_execute_task.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "math/rand" - "time" - - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" -) - -// newGRPCExecuteTask initializes task with fields needed to query server nodes. -func newGRPCExecuteTask(clnt *ProxyClient, statement *Statement) *ExecuteTask { - return &ExecuteTask{ - baseTask: newTask(nil), - taskID: statement.TaskId, - scan: statement.IsScan(), - clnt: clnt, - } -} - -func (etsk *ExecuteTask) grpcIsDone() (bool, Error) { - statusReq := &kvs.BackgroundTaskStatusRequest{ - TaskId: int64(etsk.taskID), - IsScan: etsk.scan, - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - BackgroundTaskStatusRequest: statusReq, - } - - clnt := etsk.clnt.(*ProxyClient) - conn, err := clnt.grpcConn() - if err != nil { - return false, err - } - - client := kvs.NewQueryClient(conn) - - ctx, cancel := context.WithTimeout(context.Background(), NewInfoPolicy().Timeout) - defer cancel() - - streamRes, gerr := client.BackgroundTaskStatus(ctx, &req) - if gerr != nil { - return false, newGrpcError(true, gerr, gerr.Error()) - } - - for { - time.Sleep(time.Second) - - res, gerr := streamRes.Recv() - if gerr != nil { - e := newGrpcError(true, gerr) - return false, e - } - - if res.GetStatus() != 0 { - e := newGrpcStatusError(res) - clnt.returnGrpcConnToPool(conn) - return false, e - } - - switch res.GetBackgroundTaskStatus() { - case kvs.BackgroundTaskStatus_COMPLETE: - clnt.returnGrpcConnToPool(conn) - return true, nil - default: - clnt.returnGrpcConnToPool(conn) - return false, nil - } - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go deleted file mode 100644 index de389261..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_query_partition_command.go +++ /dev/null @@ -1,162 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" -) - -type grpcQueryPartitionCommand struct { - baseMultiCommand - - policy *QueryPolicy - writePolicy *WritePolicy - statement *Statement - partitionFilter *PartitionFilter - operations []*Operation -} - -func newGrpcQueryPartitionCommand( - policy *QueryPolicy, - writePolicy *WritePolicy, - statement *Statement, - operations []*Operation, - partitionTracker *partitionTracker, - partitionFilter *PartitionFilter, - recordset *Recordset, -) *grpcQueryPartitionCommand { - cmd := &grpcQueryPartitionCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), - policy: policy, - writePolicy: writePolicy, - statement: statement, - partitionFilter: partitionFilter, - operations: operations, - } - cmd.rawCDT = policy.RawCDT - cmd.tracker = partitionTracker - cmd.terminationErrorType = statement.terminationError() - cmd.nodePartitions = newNodePartitions(nil, _PARTITIONS) - - return cmd -} - -func (cmd *grpcQueryPartitionCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *grpcQueryPartitionCommand) writeBuffer(ifc command) Error { - return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, nil) -} - -func (cmd *grpcQueryPartitionCommand) shouldRetry(e Error) bool { - panic(unreachable) -} - -func (cmd *grpcQueryPartitionCommand) transactionType() transactionType { - return ttQuery -} - -func (cmd *grpcQueryPartitionCommand) Execute() Error { - panic(unreachable) -} - -func (cmd *grpcQueryPartitionCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.recordset.signalEnd() - - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - queryReq := &kvs.QueryRequest{ - Statement: cmd.statement.grpc(cmd.policy, cmd.operations), - PartitionFilter: cmd.partitionFilter.grpc(), - QueryPolicy: cmd.policy.grpc(), - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - QueryRequest: queryReq, - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewQueryClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - streamRes, gerr := client.Query(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - readCallback := func() ([]byte, Error) { - if cmd.grpcEOS { - return nil, errGRPCStreamEnd - } - - res, gerr := streamRes.Recv() - if gerr != nil { - e := newGrpcError(!cmd.isRead(), gerr) - cmd.recordset.sendError(e) - return nil, e - } - - if res.GetStatus() != 0 { - e := newGrpcStatusError(res) - cmd.recordset.sendError(e) - return res.GetPayload(), e - } - - cmd.grpcEOS = !res.GetHasNext() - - return res.GetPayload(), nil - } - - cmd.conn = newGrpcFakeConnection(nil, readCallback) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil && err != errGRPCStreamEnd { - cmd.recordset.sendError(err) - return err - } - - done, err := cmd.tracker.isComplete(false, &cmd.policy.BasePolicy, []*nodePartitions{cmd.nodePartitions}) - if !cmd.recordset.IsActive() || done || err != nil { - // Query is complete. - if err != nil { - cmd.tracker.partitionError() - cmd.recordset.sendError(err) - } - } - - clnt.returnGrpcConnToPool(conn) - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go b/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go deleted file mode 100644 index 7f0a06c7..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/proxy_scan_command.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build as_proxy - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math/rand" - - kvs "github.com/aerospike/aerospike-client-go/v7/proto/kvs" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -type grpcScanPartitionCommand struct { - baseMultiCommand - - policy *ScanPolicy - namespace string - setName string - binNames []string - partitionFilter *PartitionFilter -} - -func newGrpcScanPartitionCommand( - policy *ScanPolicy, - partitionTracker *partitionTracker, - partitionFilter *PartitionFilter, - namespace string, - setName string, - binNames []string, - recordset *Recordset, -) *grpcScanPartitionCommand { - cmd := &grpcScanPartitionCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), - policy: policy, - namespace: namespace, - setName: setName, - binNames: binNames, - partitionFilter: partitionFilter, - } - cmd.rawCDT = policy.RawCDT - cmd.tracker = partitionTracker - cmd.terminationErrorType = types.SCAN_TERMINATED - cmd.nodePartitions = newNodePartitions(nil, _PARTITIONS) - - return cmd -} - -func (cmd *grpcScanPartitionCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *grpcScanPartitionCommand) writeBuffer(ifc command) Error { - return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, nil) -} - -func (cmd *grpcScanPartitionCommand) shouldRetry(e Error) bool { - panic(unreachable) -} - -func (cmd *grpcScanPartitionCommand) transactionType() transactionType { - return ttScan -} - -func (cmd *grpcScanPartitionCommand) Execute() Error { - panic(unreachable) -} - -func (cmd *grpcScanPartitionCommand) ExecuteGRPC(clnt *ProxyClient) Error { - defer cmd.recordset.signalEnd() - - defer cmd.grpcPutBufferBack() - - err := cmd.prepareBuffer(cmd, cmd.policy.deadline()) - if err != nil { - return err - } - - scanReq := &kvs.ScanRequest{ - Namespace: cmd.namespace, - SetName: &cmd.setName, - BinNames: cmd.binNames, - PartitionFilter: cmd.partitionFilter.grpc(), - ScanPolicy: cmd.policy.grpc(), - } - - req := kvs.AerospikeRequestPayload{ - Id: rand.Uint32(), - Iteration: 1, - Payload: cmd.dataBuffer[:cmd.dataOffset], - ScanRequest: scanReq, - } - - conn, err := clnt.grpcConn() - if err != nil { - return err - } - - client := kvs.NewScanClient(conn) - - ctx, cancel := cmd.policy.grpcDeadlineContext() - defer cancel() - - streamRes, gerr := client.Scan(ctx, &req) - if gerr != nil { - return newGrpcError(!cmd.isRead(), gerr, gerr.Error()) - } - - cmd.commandWasSent = true - - readCallback := func() ([]byte, Error) { - if cmd.grpcEOS { - return nil, errGRPCStreamEnd - } - - res, gerr := streamRes.Recv() - if gerr != nil { - e := newGrpcError(!cmd.isRead(), gerr) - cmd.recordset.sendError(e) - return nil, e - } - - cmd.grpcEOS = !res.GetHasNext() - - if res.GetStatus() != 0 { - e := newGrpcStatusError(res) - cmd.recordset.sendError(e) - return res.GetPayload(), e - } - - return res.GetPayload(), nil - } - - cmd.conn = newGrpcFakeConnection(nil, readCallback) - err = cmd.parseResult(cmd, cmd.conn) - if err != nil && err != errGRPCStreamEnd { - cmd.recordset.sendError(err) - return err - } - - done, err := cmd.tracker.isComplete(false, &cmd.policy.BasePolicy, []*nodePartitions{cmd.nodePartitions}) - if !cmd.recordset.IsActive() || done || err != nil { - // Query is complete. - if err != nil { - cmd.tracker.partitionError() - cmd.recordset.sendError(err) - } - } - - clnt.returnGrpcConnToPool(conn) - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go deleted file mode 100644 index c4693478..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_command.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" - lua "github.com/yuin/gopher-lua" -) - -type queryAggregateCommand struct { - queryCommand - - luaInstance *lua.LState - inputChan chan interface{} -} - -func newQueryAggregateCommand(node *Node, policy *QueryPolicy, statement *Statement, recordset *Recordset) *queryAggregateCommand { - cmd := &queryAggregateCommand{ - queryCommand: *newQueryCommand(node, policy, nil, statement, nil, recordset), - } - - cmd.terminationErrorType = types.QUERY_TERMINATED - - return cmd -} - -func (cmd *queryAggregateCommand) Execute() Error { - cmd.policy.MaxRetries = 0 - err := cmd.execute(cmd) - if err != nil { - cmd.recordset.sendError(err) - } - return err -} - -func (cmd *queryAggregateCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - // Read/parse remaining message bytes one record at a time. - cmd.dataOffset = 0 - var bval int64 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - err = newNodeError(cmd.node, err) - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - if resultCode != 0 { - if resultCode == types.KEY_NOT_FOUND_ERROR { - // consume the rest of the input buffer from the socket - if cmd.dataOffset < receiveSize { - if err := cmd.readBytes(receiveSize - cmd.dataOffset); err != nil { - err = newNodeError(cmd.node, err) - return false, err - } - } - return false, nil - } - return false, newCustomNodeError(cmd.node, resultCode) - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - // generation := Buffer.BytesToUint32(cmd.dataBuffer, 6) - // expiration := TTL(Buffer.BytesToUint32(cmd.dataBuffer, 10)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - - if opCount != 1 { - return false, newCustomNodeError(cmd.node, types.PARSE_ERROR, fmt.Sprintf("Query aggregate command expects exactly only one bin. Received: %d", opCount)) - } - - if _, err := cmd.parseKey(fieldCount, &bval); err != nil { - return false, newNodeError(cmd.node, err) - } - - // if there is a recordset, process the record traditionally - // otherwise, it is supposed to be a record channel - - // Parse bins. - var bins BinMap - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return false, newNodeError(cmd.node, err) - } - - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - particleType := int(cmd.dataBuffer[5]) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return false, newNodeError(cmd.node, err) - } - name := string(cmd.dataBuffer[:nameSize]) - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return false, newNodeError(cmd.node, err) - } - value, err := bytesToParticle(particleType, cmd.dataBuffer, 0, particleBytesSize) - if err != nil { - return false, newNodeError(cmd.node, err) - } - - if bins == nil { - bins = make(BinMap, opCount) - } - bins[name] = value - } - - recs, exists := bins["SUCCESS"] - if !exists { - if errStr, exists := bins["FAILURE"]; exists { - return false, newError(types.QUERY_GENERIC, errStr.(string)) - } - - return false, newError(types.QUERY_GENERIC, fmt.Sprintf("QueryAggregate's expected result was not returned. Received: %v", bins)) - } - - // If the channel is full and it blocks, we don't want this command to - // block forever, or panic in case the channel is closed in the meantime. - select { - // send back the result on the async channel - case cmd.inputChan <- recs: - case <-cmd.recordset.cancelled: - return false, newError(types.QUERY_TERMINATED) - } - } - - return true, nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go b/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go deleted file mode 100644 index adaaac9f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_aggregate_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "os" - "sync" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func registerUDFFromFile(path, filename string) { - regTask, err := nativeClient.RegisterUDFFromFile(nil, path+filename+".lua", filename+".lua", as.LUA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - gm.Expect(<-regTask.OnComplete()).ToNot(gm.HaveOccurred()) -} - -func registerUDF(udf, moduleName string) { - regTask, err := nativeClient.RegisterUDF(nil, []byte(udf), moduleName, as.LUA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - gm.Expect(<-regTask.OnComplete()).ToNot(gm.HaveOccurred()) -} - -func removeUDF(moduleName string) { - remTask, err := nativeClient.RemoveUDF(nil, moduleName) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - gm.Expect(<-remTask.OnComplete()).ToNot(gm.HaveOccurred()) -} - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Query Aggregate operations", func() { - - var sumAll = func(upTo int) float64 { - return float64((1 + upTo) * upTo / 2.0) - } - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - // Set LuaPath - luaPath, _ := os.Getwd() - luaPath += "/test/resources/" - as.SetLuaPath(luaPath) - - const keyCount = 1000 - - createUDFs := new(sync.Once) - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - - createUDFs.Do(func() { - registerUDFFromFile(luaPath, "sum_single_bin") - registerUDFFromFile(luaPath, "average") - }) - - set = randString(50) - for i := 1; i <= keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin1 := as.NewBin("bin1", i) - client.PutBins(nil, key, bin1) - } - - // // queries only work on indices - // idxTask, err := client.CreateIndex(wpolicy, ns, set, set+bin3.Name, bin3.Name, NUMERIC) - // gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until index is created - // gm.Expect(<-idxTask.OnComplete()).ToNot(gm.HaveOccurred()) - }) - - gg.It("must return the sum of specified bin to the client", func() { - stm := as.NewStatement(ns, set) - res, err := client.QueryAggregate(nil, stm, "sum_single_bin", "sum_single_bin", as.StringValue("bin1")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // gm.Expect(res.TaskId()).To(gm.Equal(stm.TaskId)) - gm.Expect(res.TaskId()).To(gm.BeNumerically(">", 0)) - - for rec := range res.Results() { - gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(sumAll(keyCount))) - } - }) - - gg.It("must handle running an aggregate query on a set that does not exist without timing out", func() { - stm := as.NewStatement(ns, set+"_NOT_EXISTS") - res, err := client.QueryAggregate(nil, stm, "sum_single_bin", "sum_single_bin", as.StringValue("bin1")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // gm.Expect(res.TaskId()).To(gm.Equal(stm.TaskId)) - gm.Expect(res.TaskId()).To(gm.BeNumerically(">", 0)) - - cnt := 0 - for rec := range res.Results() { - gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(sumAll(keyCount))) - cnt++ - } - gm.Expect(cnt).To(gm.Equal(0)) - }) - - gg.It("must return Sum and Count to the client", func() { - stm := as.NewStatement(ns, set) - res, err := client.QueryAggregate(nil, stm, "average", "average", as.StringValue("bin1")) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for rec := range res.Results() { - gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Record.Bins["SUCCESS"]).To(gm.Equal(map[interface{}]interface{}{"sum": sumAll(keyCount), "count": float64(keyCount)})) - } - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_command.go b/aerospike-tls/vendor-aerospike-client-go/query_command.go deleted file mode 100644 index b5c2a042..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_command.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type queryCommand struct { - baseMultiCommand - - policy *QueryPolicy - writePolicy *WritePolicy - statement *Statement - operations []*Operation -} - -func newQueryCommand(node *Node, policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, operations []*Operation, recordset *Recordset) *queryCommand { - res := &queryCommand{ - baseMultiCommand: *newStreamingMultiCommand(node, recordset, statement.Namespace, false), - policy: policy, - writePolicy: writePolicy, - statement: statement, - operations: operations, - } - res.rawCDT = policy.RawCDT - - return res -} - -func (cmd *queryCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *queryCommand) writeBuffer(ifc command) (err Error) { - return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, nil) -} - -func (cmd *queryCommand) parseResult(ifc command, conn *Connection) Error { - return cmd.baseMultiCommand.parseResult(ifc, conn) -} - -func (cmd *queryCommand) transactionType() transactionType { - return ttQuery -} - -// Execute will run the query. -func (cmd *queryCommand) Execute() Error { - err := cmd.execute(cmd) - if err != nil { - cmd.recordset.sendError(err) - } - return err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_context_test.go b/aerospike-tls/vendor-aerospike-client-go/query_context_test.go deleted file mode 100644 index 5a18a2ac..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_context_test.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Query operations with Context", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - const keyCount = 1000 - - bin1Name := "List" - var keys map[string]*as.Key - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - keys = make(map[string]*as.Key, keyCount) - set = randString(50) - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - keys[string(key.Digest())] = key - - list := []int{i, i + 1, i + 2, i + 3, i + 4} - bin1 := as.NewBin(bin1Name, list) - err = client.PutBins(wpolicy, key, bin1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - // queries only work on indices - createComplexIndex(wpolicy, ns, set, set+bin1Name, bin1Name, as.NUMERIC, as.ICT_DEFAULT, as.CtxListRank(-1)) - }) - - gg.AfterEach(func() { - dropIndex(nil, ns, set, set+bin1Name) - }) - - var queryPolicy = as.NewQueryPolicy() - - gg.It("must Query with a Context", func() { - begin := 14 - end := 18 - - stm := as.NewStatement(ns, set, bin1Name) - stm.SetFilter(as.NewRangeFilter(bin1Name, int64(begin), int64(end), as.CtxListRank(-1))) - - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - list := rec.Bins[bin1Name].([]interface{}) - received := list[len(list)-1].(int) - - gm.Expect(received < begin || received > end).To(gm.BeFalse()) - - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically("==", 5)) - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_duration.go b/aerospike-tls/vendor-aerospike-client-go/query_duration.go deleted file mode 100644 index 0b4dc8a6..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_duration.go +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -// QueryDuration defines the expected query duration. The server treats the query in different ways depending on the expected duration. -// This enum is ignored for aggregation queries, background queries and server versions < 6.0. -type QueryDuration int - -const ( - // LONG specifies that the query is expected to return more than 100 records per node. The server optimizes for a large record set in - // the following ways: - // - // Allow query to be run in multiple threads using the server's query threading configuration. - // Do not relax read consistency for AP namespaces. - // Add the query to the server's query monitor. - // Do not add the overall latency to the server's latency histogram. - // Do not allow server timeouts. - LONG = iota - - // Short specifies that the query is expected to return less than 100 records per node. The server optimizes for a small record set in - // the following ways: - // Always run the query in one thread and ignore the server's query threading configuration. - // Allow query to be inlined directly on the server's service thread. - // Relax read consistency for AP namespaces. - // Do not add the query to the server's query monitor. - // Add the overall latency to the server's latency histogram. - // Allow server timeouts. The default server timeout for a short query is 1 second. - SHORT - - // LONG_RELAX_AP will treat query as a LONG query, but relax read consistency for AP namespaces. - // This value is treated exactly like LONG for server versions < 7.1. - LONG_RELAX_AP -) diff --git a/aerospike-tls/vendor-aerospike-client-go/query_executor.go b/aerospike-tls/vendor-aerospike-client-go/query_executor.go deleted file mode 100644 index dbf51518..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_executor.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -func (clnt *Client) queryPartitions(policy *QueryPolicy, tracker *partitionTracker, statement *Statement, recordset *Recordset) { - defer recordset.signalEnd() - - // for exponential backoff - interval := policy.SleepBetweenRetries - - var errs Error - for { - list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), statement.Namespace) - if err != nil { - errs = chainErrors(err, errs) - recordset.sendError(errs) - tracker.partitionError() - return - } - - maxConcurrentNodes := policy.MaxConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(list) - } - - if recordset.IsActive() { - weg := newWeightedErrGroup(maxConcurrentNodes) - for _, nodePartition := range list { - cmd := newQueryPartitionCommand(policy, tracker, nodePartition, statement, recordset) - weg.execute(cmd) - } - errs = chainErrors(weg.wait(), errs) - } - - done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) - if !recordset.IsActive() || done || err != nil { - errs = chainErrors(err, errs) - // Query is complete. - if errs != nil { - tracker.partitionError() - recordset.sendError(errs) - } - return - } - - if policy.SleepBetweenRetries > 0 { - // Sleep before trying again. - time.Sleep(interval) - - if policy.SleepMultiplier > 1 { - interval = time.Duration(float64(interval) * policy.SleepMultiplier) - } - } - - recordset.resetTaskID() - } - -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go b/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go deleted file mode 100644 index 63ad74d4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_objects_executor.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "sync" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "golang.org/x/sync/semaphore" -) - -func (clnt *Client) queryPartitionObjects(policy *QueryPolicy, tracker *partitionTracker, statement *Statement, rs *Recordset) Error { - defer rs.signalEnd() - - // for exponential backoff - interval := policy.SleepBetweenRetries - - for { - rs.resetTaskID() - list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), statement.Namespace) - if err != nil { - tracker.partitionError() - return err - } - - wg := new(sync.WaitGroup) - - // the whole call should be wrapped in a goroutine - wg.Add(len(list)) - - // results channel must be async for performance - maxConcurrentNodes := policy.MaxConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(list) - } - - sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) - ctx := context.Background() - - if rs.IsActive() { - for _, nodePartition := range list { - if err := sem.Acquire(ctx, 1); err != nil { - tracker.partitionError() - logger.Logger.Error("Constraint Semaphore failed for Query: %s", err.Error()) - } - go func(nodePartition *nodePartitions) { - defer sem.Release(1) - defer wg.Done() - if err := clnt.queryNodePartitionObjects(policy, rs, tracker, nodePartition, statement); err != nil { - tracker.partitionError() - logger.Logger.Debug("Error while Executing query for node %s: %s", nodePartition.node.String(), err.Error()) - } - }(nodePartition) - } - - wg.Wait() - } - - done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) - if !rs.IsActive() || done || err != nil { - if err != nil { - tracker.partitionError() - } - // Query is complete. - return err - } - - if policy.SleepBetweenRetries > 0 { - // Sleep before trying again. - time.Sleep(interval) - - if policy.SleepMultiplier > 1 { - interval = time.Duration(float64(interval) * policy.SleepMultiplier) - } - } - } -} - -// QueryNode reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) queryNodePartitionObjects(policy *QueryPolicy, recordset *Recordset, tracker *partitionTracker, nodePartition *nodePartitions, statement *Statement) Error { - command := newQueryPartitionObjectsCommand(policy, tracker, nodePartition, statement, recordset) - return command.Execute() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go deleted file mode 100644 index abb0523a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_partition_command.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type queryPartitionCommand queryCommand - -func newQueryPartitionCommand( - policy *QueryPolicy, - tracker *partitionTracker, - nodePartitions *nodePartitions, - statement *Statement, - recordset *Recordset, -) *queryPartitionCommand { - cmd := &queryPartitionCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), - policy: policy, - writePolicy: nil, - statement: statement, - operations: nil, - } - cmd.rawCDT = policy.RawCDT - cmd.terminationErrorType = statement.terminationError() - cmd.tracker = tracker - cmd.nodePartitions = nodePartitions - cmd.node = nodePartitions.node - - return cmd -} - -func (cmd *queryPartitionCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *queryPartitionCommand) writeBuffer(ifc command) Error { - return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, cmd.nodePartitions) -} - -func (cmd *queryPartitionCommand) shouldRetry(e Error) bool { - return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) -} - -func (cmd *queryPartitionCommand) transactionType() transactionType { - return ttQuery -} - -func (cmd *queryPartitionCommand) Execute() Error { - err := cmd.execute(cmd) - if err != nil { - // signal to the executor that no retries should be attempted - // don't send error unless no retries are planned - if !cmd.shouldRetry(err) { - cmd.recordset.sendError(err) - } - } - return err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go b/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go deleted file mode 100644 index 4c68a14c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_partitiopn_objects_command.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -type queryPartitionObjectsCommand queryCommand - -func newQueryPartitionObjectsCommand( - policy *QueryPolicy, - tracker *partitionTracker, - nodePartitions *nodePartitions, - statement *Statement, - recordset *Recordset, -) *queryPartitionObjectsCommand { - cmd := &queryPartitionObjectsCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, statement.Namespace), - policy: policy, - writePolicy: nil, - statement: statement, - operations: nil, - } - cmd.terminationErrorType = statement.terminationError() - cmd.tracker = tracker - cmd.nodePartitions = nodePartitions - cmd.node = nodePartitions.node - - return cmd -} - -func (cmd *queryPartitionObjectsCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *queryPartitionObjectsCommand) writeBuffer(ifc command) Error { - return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.recordset.TaskId(), cmd.operations, cmd.writePolicy != nil, cmd.nodePartitions) -} - -func (cmd *queryPartitionObjectsCommand) shouldRetry(e Error) bool { - return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) -} - -func (cmd *queryPartitionObjectsCommand) transactionType() transactionType { - return ttQuery -} - -func (cmd *queryPartitionObjectsCommand) Execute() Error { - err := cmd.execute(cmd) - if err != nil { - // signal to the executor that no retries should be attempted - // don't send error unless no retries are planned - if !cmd.shouldRetry(err) { - cmd.recordset.sendError(err) - } - } - return err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_policy.go b/aerospike-tls/vendor-aerospike-client-go/query_policy.go deleted file mode 100644 index 747a06c2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_policy.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// QueryPolicy encapsulates parameters for policy attributes used in query operations. -type QueryPolicy struct { - MultiPolicy - - // Expected query duration. The server treats the query in different ways depending on the expected duration. - // This field is ignored for aggregation queries, background queries and server versions < 6.0. - // - // Default: LONG - ExpectedDuration QueryDuration - - // ShortQuery determines wether query expected to return less than 100 records. - // If true, the server will optimize the query for a small record set. - // This field is ignored for aggregation queries, background queries - // and server versions 6.0+. - // - // Default: false - // This field is deprecated and will eventually be removed. Use ExpectedDuration instead. - // For backwards compatibility: If ShortQuery is true, the query is treated as a short query and - // ExpectedDuration is ignored. If shortQuery is false, ExpectedDuration is used defaults to {@link QueryDuration#LONG}. - ShortQuery bool -} - -// NewQueryPolicy generates a new QueryPolicy instance with default values. -// Set MaxRetries for non-aggregation queries with a nil filter on -// server versions >= 4.9. All other queries are not retried. -// -// The latest servers support retries on individual data partitions. -// This feature is useful when a cluster is migrating and partition(s) -// are missed or incomplete on the first query (with nil filter) attempt. -// -// If the first query attempt misses 2 of 4096 partitions, then only -// those 2 partitions are retried in the next query attempt from the -// last key digest received for each respective partition. A higher -// default MaxRetries is used because it's wasteful to invalidate -// all query results because a single partition was missed. -func NewQueryPolicy() *QueryPolicy { - return &QueryPolicy{ - MultiPolicy: *NewMultiPolicy(), - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/query_test.go b/aerospike-tls/vendor-aerospike-client-go/query_test.go deleted file mode 100644 index b8c1570e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/query_test.go +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "bytes" - "errors" - "math" - "math/rand" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -const udfFilter = ` -local function map_profile(record) - -- Add name and age to returned map. - -- Could add other record bins here as well. - -- return map {name=record["name"], age=32} - return map {bin4=record.Aerospike4, bin5=record["Aerospike5"]} -end - -function filter_by_name(stream,name) - local function filter_name(record) - return (record.Aerospike5 == -1) and (record.Aerospike4 == 'constValue') - end - return stream : filter(filter_name) : map(map_profile) -end` - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Query operations", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - const keyCount = 1000 - bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", randString(100)) - bin3 := as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) - bin4 := as.NewBin("Aerospike4", "constValue") - bin5 := as.NewBin("Aerospike5", -1) - bin6 := as.NewBin("Aerospike6", 1) - bin7 := as.NewBin("Aerospike7", nil) - var keys map[string]*as.Key - var indexName string - var indexName2 string - var indexName3 string - - // read all records from the channel and make sure all of them are returned - var checkResults = func(recordset *as.Recordset, cancelCnt int) { - counter := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - - key, exists := keys[string(rec.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(rec.Key.Digest())) - - counter++ - // cancel scan abruptly - if cancelCnt != 0 && counter == cancelCnt { - recordset.Close() - } - } - - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - } - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - nativeClient.Truncate(nil, ns, set, nil) - - keys = make(map[string]*as.Key, keyCount) - set = randString(50) - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - keys[string(key.Digest())] = key - bin3 = as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) - bin7 = as.NewBin("Aerospike7", i%3) - err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4, bin5, bin6, bin7) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - // queries only work on indices - indexName = set + bin3.Name - createIndex(wpolicy, ns, set, indexName, bin3.Name, as.NUMERIC) - - // queries only work on indices - indexName2 = set + bin6.Name - createIndex(wpolicy, ns, set, indexName2, bin6.Name, as.NUMERIC) - - // queries only work on indices - indexName3 = set + bin7.Name - createIndex(wpolicy, ns, set, indexName3, bin7.Name, as.NUMERIC) - }) - - gg.AfterEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - indexName = set + bin3.Name - gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) - - indexName = set + bin6.Name - gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) - - indexName = set + bin7.Name - gm.Expect(nativeClient.DropIndex(nil, ns, set, indexName)).ToNot(gm.HaveOccurred()) - }) - - var queryPolicy = as.NewQueryPolicy() - - gg.It("must Query and get all records back for a specified node using Results() channel", func() { - if *proxy { - gg.Skip("Not Supported for Proxy Client") - } - - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - stm := as.NewStatement(ns, set) - - counter := 0 - for _, node := range client.GetNodes() { - recordset, err := client.QueryNode(queryPolicy, node, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - key, exists := keys[string(res.Record.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(res.Record.Key.Value().GetObject())) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - } - - gm.Expect(len(keys)).To(gm.Equal(0)) - gm.Expect(counter).To(gm.Equal(keyCount)) - }) - - gg.It("must Scan and get all partition records back for a specified key", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - counter := 0 - - var rkey *as.Key - for _, k := range keys { - rkey = k - - pf := as.NewPartitionFilterByKey(rkey) - stm := as.NewStatement(ns, set) - recordset, err := client.QueryPartitions(queryPolicy, stm, pf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - // the key itself should not be returned - gm.Expect(bytes.Equal(rkey.Digest(), res.Record.Key.Digest())).To(gm.BeFalse()) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - - } - gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) - }) - - gg.It("must Query per key partition and get all partition records back for a specified key and filter", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - counter := 0 - - var rkey *as.Key - for _, k := range keys { - rkey = k - - pf := as.NewPartitionFilterByKey(rkey) - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(bin7.Name, 1, 2)) - recordset, err := client.QueryPartitions(queryPolicy, stm, pf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - gm.Expect(res.Record.Bins[bin7.Name]).To(gm.BeNumerically(">=", 1)) - gm.Expect(res.Record.Bins[bin7.Name]).To(gm.BeNumerically("<=", 2)) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - } - - gm.Expect(len(keys)).To(gm.Equal(334)) - // This depends on how many keys end up in the same partition. - // Since keys are statistically distributed randomly and uniformly, - // we expect that there aren't many partitions that share more than one key. - gm.Expect(counter).To(gm.BeNumerically("~", keyCount-334, 50)) - }) - - gg.It("must Query and get all partition records back for a specified key and filter", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - counter := 0 - - pf := as.NewPartitionFilterAll() - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(bin7.Name, 1, 2)) - recordset, err := client.QueryPartitions(queryPolicy, stm, pf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - - gm.Expect(len(keys)).To(gm.Equal(334)) - gm.Expect(counter).To(gm.Equal(keyCount - 334)) - }) - - gg.It("must return error on a Query when index is not found", func() { - pf := as.NewPartitionFilterAll() - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(randString(10), 1, 2)) - recordset, err := client.QueryPartitions(queryPolicy, stm, pf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).To(gm.HaveOccurred()) - gm.Expect(res.Err.Matches(ast.INDEX_NOTFOUND)).To(gm.BeTrue()) - } - }) - - gg.It("must Query and get all partition records back for a specified partition range", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - pbegin := 1000 - for i := 1; i < 10; i++ { - counter := 0 - - pf := as.NewPartitionFilterByRange(pbegin, rand.Intn(i*191)+1) - stm := as.NewStatement(ns, set) - recordset, err := client.QueryPartitions(queryPolicy, stm, pf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) - } - } - gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("must return error if query on non-indexed field", func() { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter("Non-Existing", 0, math.MaxInt16/2)) - - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).To(gm.HaveOccurred()) - } - }) - - gg.It("must Query a range and get all records back", func() { - stm := as.NewStatement(ns, set) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Query a range and get all records back with policy.RecordsPerSecond set", func() { - stm := as.NewStatement(ns, set) - - policy := as.NewQueryPolicy() - policy.RecordsPerSecond = keyCount - 100 - recordset, err := client.Query(policy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Query a range and get all records back without the Bin Data", func() { - stm := as.NewStatement(ns, set) - qp := as.NewQueryPolicy() - qp.IncludeBinData = false - recordset, err := client.Query(qp, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - - key, exists := keys[string(rec.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) - gm.Expect(len(rec.Bins)).To(gm.Equal(0)) - - delete(keys, string(rec.Key.Digest())) - } - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Cancel Query abruptly", func() { - stm := as.NewStatement(ns, set) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, keyCount/2) - - gm.Expect(len(keys)).To(gm.BeNumerically("<=", keyCount/2)) - }) - - gg.It("must Query a specific range and get only relevant records back", func() { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - cnt++ - _, exists := keys[string(rec.Key.Digest())] - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(rec.Bins[bin3.Name]).To(gm.BeNumerically("<=", math.MaxInt16/2)) - } - - gm.Expect(cnt).To(gm.BeNumerically(">", 0)) - }) - - gg.It("must Query a specific range by applying a udf filter and get only relevant records back", func() { - regTask, err := nativeClient.RegisterUDF(nil, []byte(udfFilter), "udfFilter.lua", as.LUA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - err = <-regTask.OnComplete() - gm.Expect(err).ToNot(gm.HaveOccurred()) - - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) - stm.SetAggregateFunction("udfFilter", "filter_by_name", []as.Value{as.NewValue("Aeropsike")}, true) - - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - results := rec.Bins["SUCCESS"].(map[interface{}]interface{}) - gm.Expect(results["bin4"]).To(gm.Equal("constValue")) - // gm.Expect(results["bin5"]).To(gm.Equal(-1)) - cnt++ - } - - gm.Expect(cnt).To(gm.BeNumerically(">", 0)) - }) - - gg.It("must Query specific equality filters and get only relevant records back", func() { - // save a record with requested value - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin3 := as.NewBin("Aerospike3", rand.Intn(math.MaxInt16)) - err = client.PutBins(wpolicy, key, bin3) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - stm := as.NewStatement(ns, set, bin3.Name) - stm.SetFilter(as.NewEqualFilter(bin3.Name, bin3.Value)) - - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := []interface{}{} - // consume recordset and check errors - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - gm.Expect(rec).ToNot(gm.BeNil()) - recs = append(recs, rec.Bins[bin3.Name]) - } - - // there should be at least one result - gm.Expect(len(recs)).To(gm.BeNumerically(">", 0)) - gm.Expect(recs).To(gm.ContainElement(bin3.Value.GetObject())) - }) - - gg.It("must Query specific equality filters and apply operations on the records", func() { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewEqualFilter(bin6.Name, 1)) - - bin7 := as.NewBin("Aerospike7", 42) - tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) - - // read records back - stmRes := as.NewStatement(ns, set) - recordset, err := client.Query(queryPolicy, stmRes) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := []interface{}{} - // consume recordset and check errors - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - gm.Expect(rec).ToNot(gm.BeNil()) - recs = append(recs, rec.Bins[bin3.Name]) - gm.Expect(rec.Bins[bin7.Name]).To(gm.Equal(bin7.Value.GetObject().(int))) - } - - // there should be at least one result - gm.Expect(len(recs)).To(gm.Equal(keyCount)) - }) - - gg.It("must handle a Query on a non-existing set without timing out", func() { - stm := as.NewStatement(ns, set+"NON_EXISTING") - - bin7 := as.NewBin("Aerospike7", 42) - tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) - - rs, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - cnt := 0 - for res := range rs.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - gm.Expect(cnt).To(gm.Equal(0)) - }) - - gg.It("must return an error if read operations are requested in a background query", func() { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewEqualFilter(bin6.Name, 1)) - - bin7 := as.NewBin("Aerospike7", 42) - _, err := client.QueryExecute(queryPolicy, nil, stm, as.GetBinOp(bin7.Name)) - gm.Expect(err).To(gm.HaveOccurred()) - - var typedErr *as.AerospikeError - isAsErr := errors.As(err, &typedErr) - gm.Expect(isAsErr).To(gm.BeTrue()) - gm.Expect(typedErr.ResultCode).To(gm.Equal(ast.PARAMETER_ERROR)) - }) - - gg.It("must Query specific equality filters and apply operations on the records without filters", func() { - stm := as.NewStatement(ns, set) - - bin7 := as.NewBin("Aerospike7", 42) - tsk, err := client.QueryExecute(queryPolicy, nil, stm, as.PutOp(bin7)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(<-tsk.OnComplete()).To(gm.BeNil()) - - // read records back - stmRes := as.NewStatement(ns, set) - recordset, err := client.Query(queryPolicy, stmRes) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := []interface{}{} - // consume recordset and check errors - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - gm.Expect(rec).ToNot(gm.BeNil()) - recs = append(recs, rec.Bins[bin3.Name]) - gm.Expect(rec.Bins[bin7.Name]).To(gm.Equal(bin7.Value.GetObject().(int))) - } - - // there should be at least one result - gm.Expect(len(recs)).To(gm.Equal(keyCount)) - }) - - gg.It("must return the error for invalid expression", func() { - stm := as.NewStatement(ns, set) - stm.SetFilter(as.NewRangeFilter(bin3.Name, 0, math.MaxInt16/2)) - - queryPolicy := as.NewQueryPolicy() - queryPolicy.FilterExpression = as.ExpEq(as.ExpListGetByValueRange(as.ListReturnTypeValue, as.ExpIntVal(10), as.ExpIntVal(13), as.ExpListBin(bin1.Name)), as.ExpIntVal(11)) - - recordset, err := client.Query(queryPolicy, stm) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).To(gm.HaveOccurred()) - gm.Expect(res.Err.Matches(ast.PARAMETER_ERROR)).To(gm.BeTrue()) - } - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go b/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go deleted file mode 100644 index 450c384b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/random_operation_test.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math/rand" - "strings" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -const RANDOM_OPS_RUNS = 1000 - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Aerospike", func() { - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - }) - - gg.Describe("Random Data Operations", func() { - // connection data - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - var rpolicy = as.NewPolicy() - var rec *as.Record - - if *useReplicas { - rpolicy.ReplicaPolicy = as.MASTER_PROLES - } - - gg.Context("Put/Get operations", func() { - - gg.It("must create, update and read keys consistently", func() { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - bin1 := as.NewBin("Aerospike1", 0) - bin2 := as.NewBin("Aerospike2", "a") // to avoid deletion of key - - i := 0 - for i < RANDOM_OPS_RUNS { - iters := rand.Intn(10) + 1 - for wr := 0; wr < iters; wr++ { - i++ - - //reset - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // update - err = client.PutBins(wpolicy, key, as.NewBin("Aerospike1", i), as.NewBin("Aerospike2", strings.Repeat("a", i))) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - rec, err = client.Get(rpolicy, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(i)) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(strings.Repeat("a", i))) - } - }) - - }) // context put/get operations - - gg.Context("Parallel Put/Get/Delete operations", func() { - - gg.It("must save, read, delete keys consistently", func() { - - errChan := make(chan error, 100) - - func_delete := func(keys ...*as.Key) { - defer gg.GinkgoRecover() - for _, key := range keys { - existed, err := client.Delete(wpolicy, key) - gm.Expect(existed).To(gm.BeTrue()) - errChan <- err - } - } - - i := 0 - for i < RANDOM_OPS_RUNS { - iters := rand.Intn(1000) + 1 - for wr := 0; wr < iters; wr++ { - i++ - - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, as.NewBin("Aerospike1", i), as.NewBin("Aerospike2", strings.Repeat("a", i))) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - go func_delete(key) - } - - // Timeout - timeout := time.After(time.Second * 3) - - // Gather errors - for i := 0; i < iters; i++ { - select { - case err := <-errChan: - gm.Expect(err).ToNot(gm.HaveOccurred()) - - case <-timeout: - gm.Expect(timeout).To(gm.BeNil()) - } - } // for i < iters - - } // for i < iters - }) - - }) // context parallel put/get/delete operations - - }) // describe - -}) // describe diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command.go b/aerospike-tls/vendor-aerospike-client-go/read_command.go deleted file mode 100644 index b6a6aaf5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_command.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type readCommand struct { - singleCommand - - policy *BasePolicy - binNames []string - record *Record - - // pointer to the object that's going to be unmarshalled - object *reflect.Value - - replicaSequence int -} - -// this method uses reflection. -// Will not be set if performance flag is passed for the build. -var objectParser func( - cmd *readCommand, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error - -func newReadCommand(cluster *Cluster, policy *BasePolicy, key *Key, binNames []string, partition *Partition) (readCommand, Error) { - var err Error - if partition == nil { - if cluster != nil { - partition, err = PartitionForRead(cluster, policy, key) - if err != nil { - return readCommand{}, err - } - } - } - - return readCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - binNames: binNames, - policy: policy, - }, nil -} - -func (cmd *readCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *readCommand) writeBuffer(ifc command) Error { - return cmd.setRead(cmd.policy, cmd.key, cmd.binNames) -} - -func (cmd *readCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeRead(cmd.cluster) -} - -func (cmd *readCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryRead(isTimeout) - return true -} - -func (cmd *readCommand) parseResult(ifc command, conn *Connection) Error { - // Read proto and check if compressed - if _, err := conn.Read(cmd.dataBuffer, 8); err != nil { - logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) - return err - } - - if compressedSize := cmd.compressedSize(); compressedSize > 0 { - // Read compressed size - if _, err := conn.Read(cmd.dataBuffer, 8); err != nil { - logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) - return err - } - - if err := cmd.conn.initInflater(true, compressedSize); err != nil { - return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize, err.Error())) - } - - // Read header. - if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { - logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) - return err - } - } else { - // Read header. - if _, err := conn.Read(cmd.dataBuffer[8:], int(_MSG_TOTAL_HEADER_SIZE)-8); err != nil { - logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) - return err - } - } - - // A number of these are commented out because we just don't care enough to read - // that section of the header. If we do care, uncomment and check! - sz := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(sz); err != nil { - return err - } - - headerLength := int(cmd.dataBuffer[8]) - resultCode := types.ResultCode(cmd.dataBuffer[13] & 0xFF) - generation := Buffer.BytesToUint32(cmd.dataBuffer, 14) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 18)) - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 26)) // almost certainly 0 - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 28)) - receiveSize := int((sz & 0xFFFFFFFFFFFF) - int64(headerLength)) - - // Read remaining message bytes. - if receiveSize > 0 { - if err := cmd.sizeBufferSz(receiveSize, false); err != nil { - return err - } - if _, err := conn.Read(cmd.dataBuffer, receiveSize); err != nil { - logger.Logger.Debug("Connection error reading data for ReadCommand: %s", err.Error()) - return err - } - - } - - if resultCode != 0 { - if resultCode == types.KEY_NOT_FOUND_ERROR { - return ErrKeyNotFound.err() - } else if resultCode == types.FILTERED_OUT { - return ErrFilteredOut.err() - } else if resultCode == types.UDF_BAD_RESPONSE { - cmd.record, _ = cmd.parseRecord(ifc, opCount, fieldCount, generation, expiration) - err := cmd.handleUdfError(resultCode) - logger.Logger.Debug("UDF execution error: " + err.Error()) - return err - } - - return newError(resultCode) - } - - if cmd.object == nil { - if opCount == 0 { - // data Bin was not returned - cmd.record = newRecord(cmd.node, cmd.key, nil, generation, expiration) - return nil - } - - var err Error - cmd.record, err = cmd.parseRecord(ifc, opCount, fieldCount, generation, expiration) - if err != nil { - return err - } - } else if objectParser != nil { - if err := objectParser(cmd, opCount, fieldCount, generation, expiration); err != nil { - return err - } - } - - return nil -} - -func (cmd *readCommand) handleUdfError(resultCode types.ResultCode) Error { - if ret, exists := cmd.record.Bins["FAILURE"]; exists { - return newError(resultCode, ret.(string)) - } - return newError(resultCode) -} - -func (cmd *readCommand) parseRecord( - ifc command, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) (*Record, Error) { - var bins BinMap - receiveOffset := 0 - - opCmd, isOperate := ifc.(*operateCommand) - var binNamesSet []string - - // There can be fields in the response (setname etc). - // But for now, ignore them. Expose them to the API if needed in the future. - //logger.Logger.Debug("field count: %d, databuffer: %v", fieldCount, cmd.dataBuffer) - if fieldCount > 0 { - // Just skip over all the fields - for i := 0; i < fieldCount; i++ { - //logger.Logger.Debug("%d", receiveOffset) - fieldSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) - receiveOffset += (4 + fieldSize) - } - } - - if opCount > 0 { - bins = make(BinMap, opCount) - } - - for i := 0; i < opCount; i++ { - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) - particleType := int(cmd.dataBuffer[receiveOffset+5]) - nameSize := int(cmd.dataBuffer[receiveOffset+7]) - name := string(cmd.dataBuffer[receiveOffset+8 : receiveOffset+8+nameSize]) - receiveOffset += 4 + 4 + nameSize - - particleBytesSize := opSize - (4 + nameSize) - value, _ := bytesToParticle(particleType, cmd.dataBuffer, receiveOffset, particleBytesSize) - receiveOffset += particleBytesSize - - if bins == nil { - bins = make(BinMap, opCount) - } - - if isOperate { - // for operate list command results - if prev, exists := bins[name]; exists { - if res, ok := prev.(OpResults); ok { - // List already exists. Add to it. - bins[name] = append(res, value) - } else { - // Make a list to store all values. - bins[name] = OpResults{prev, value} - binNamesSet = append(binNamesSet, name) - } - } else { - bins[name] = value - } - } else { - bins[name] = value - } - } - - // TODO: Remove this in the next major release - if isOperate && !opCmd.useOpResults { - for i := range binNamesSet { - bins[binNamesSet[i]] = []interface{}(bins[binNamesSet[i]].(OpResults)) - } - } - - return newRecord(cmd.node, cmd.key, bins, generation, expiration), nil -} - -func (cmd *readCommand) GetRecord() *Record { - return cmd.record -} - -func (cmd *readCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *readCommand) transactionType() transactionType { - return ttGet -} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go deleted file mode 100644 index ba9d91d5..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect.go +++ /dev/null @@ -1,473 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "math" - "reflect" - "strings" - "time" - - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// if this file is included in the build, it will include this method -func init() { - objectParser = parseObject -} - -func parseObject( - cmd *readCommand, - opCount int, - fieldCount int, - generation uint32, - expiration uint32, -) Error { - receiveOffset := 0 - - // There can be fields in the response (setname etc). - // But for now, ignore them. Expose them to the API if needed in the future. - //logger.Logger.Debug("field count: %d, databuffer: %v", fieldCount, cmd.dataBuffer) - if fieldCount > 0 { - // Just skip over all the fields - for i := 0; i < fieldCount; i++ { - //logger.Logger.Debug("%d", receiveOffset) - fieldSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) - receiveOffset += (4 + fieldSize) - } - } - - if opCount > 0 { - rv := *cmd.object - - if rv.Kind() != reflect.Ptr { - return ErrInvalidObjectType.err() - } - rv = rv.Elem() - - if !rv.CanAddr() { - return ErrInvalidObjectType.err() - } - - if rv.Kind() != reflect.Struct { - return ErrInvalidObjectType.err() - } - - // find the name based on tag mapping - iobj := indirect(rv) - mappings := objectMappings.getMapping(iobj.Type()) - - if err := setObjectMetaFields(iobj, expiration, generation); err != nil { - return err - } - - for i := 0; i < opCount; i++ { - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, receiveOffset)) - particleType := int(cmd.dataBuffer[receiveOffset+5]) - nameSize := int(cmd.dataBuffer[receiveOffset+7]) - name := string(cmd.dataBuffer[receiveOffset+8 : receiveOffset+8+nameSize]) - receiveOffset += 4 + 4 + nameSize - - particleBytesSize := opSize - (4 + nameSize) - value, _ := bytesToParticle(particleType, cmd.dataBuffer, receiveOffset, particleBytesSize) - if err := setObjectField(mappings, iobj, name, value); err != nil { - return err - } - - receiveOffset += particleBytesSize - } - } - - return nil -} - -func setObjectMetaFields(obj reflect.Value, ttl, gen uint32) Error { - // find the name based on tag mapping - iobj := indirect(obj) - - ttlMap, genMap := objectMappings.getMetaMappings(iobj.Type()) - - for i := range ttlMap { - f := iobj.FieldByIndex(ttlMap[i]) - if err := setValue(f, ttl); err != nil { - return err - } - } - - for i := range genMap { - f := iobj.FieldByIndex(genMap[i]) - if err := setValue(f, gen); err != nil { - return err - } - } - - return nil -} - -func setObjectField(mappings map[string][]int, obj reflect.Value, fieldName string, value interface{}) Error { - if value == nil { - return nil - } - - var f reflect.Value - - if index, exists := mappings[fieldName]; exists { - f = obj.FieldByIndex(index) - } else { - f = obj.FieldByName(fieldName) - } - return setValue(f, value) -} - -func fillMap(f, newMap, emptyStruct reflect.Value, key, elem, value interface{}, fieldKind reflect.Kind) Error { - var newKey, newVal reflect.Value - fKeyType := f.Type().Key() - if key != nil { - newKey = reflect.ValueOf(key) - } else { - newKey = reflect.Zero(fKeyType) - } - - if newKey.Type() != fKeyType { - if !newKey.CanConvert(fKeyType) { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid key `%#v` for %s field", value, fieldKind)) - } - newKey = newKey.Convert(fKeyType) - } - - fElemType := f.Type().Elem() - if elem != nil { - newVal = reflect.ValueOf(elem) - } else { - newVal = reflect.Zero(fElemType) - } - - if newVal.Type() != fElemType { - switch newVal.Kind() { - case reflect.Map, reflect.Slice, reflect.Array: - newVal = reflect.New(fElemType) - if err := setValue(newVal.Elem(), elem); err != nil { - return err - } - newVal = reflect.Indirect(newVal) - default: - if !newVal.CanConvert(fElemType) { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - newVal = newVal.Convert(fElemType) - } - } - - if newVal.Kind() == reflect.Map && newVal.Len() == 0 && newMap.Type().Elem().Kind() == emptyStruct.Type().Kind() { - if newMap.Type().Elem().NumField() == 0 { - newMap.SetMapIndex(newKey, emptyStruct) - } else { - return newError(types.PARSE_ERROR, "Map value type is struct{}, but data returned from database is a non-empty map[interface{}]interface{}") - } - } else { - newMap.SetMapIndex(newKey, newVal) - } - return nil -} - -func setValue(f reflect.Value, value interface{}) Error { - // find the name based on tag mapping - if f.CanSet() { - if value == nil { - if f.IsValid() && !f.IsNil() { - f.Set(reflect.ValueOf(value)) - } - return nil - } - - switch fieldKind := f.Kind(); fieldKind { - case reflect.Int, reflect.Int64, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint16, reflect.Uint32: - v := reflect.ValueOf(value) - t := f.Type() - if !v.CanConvert(t) { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - - v = v.Convert(t) - f.Set(v) - case reflect.Float64, reflect.Float32: - switch v := value.(type) { - case float64: - f.SetFloat(v) - case float32: - f.SetFloat(float64(v)) - case int: - f.SetFloat(float64(v)) - default: - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - case reflect.String: - v, ok := value.(string) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - - rv := reflect.ValueOf(v) - if rv.Type() != f.Type() { - rv = rv.Convert(f.Type()) - } - f.Set(rv) - case reflect.Bool: - switch v := value.(type) { - case int: - f.SetBool(v == 1) - case bool: - f.SetBool(v) - default: - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - case reflect.Interface: - if value != nil { - f.Set(reflect.ValueOf(value)) - } - case reflect.Ptr: - switch fieldKind := f.Type().Elem().Kind(); fieldKind { - case reflect.String: - tempV, ok := value.(string) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) - } - rv := reflect.ValueOf(&tempV) - if rv.Type() != f.Type() { - rv = rv.Convert(f.Type()) - } - f.Set(rv) - case reflect.Int, reflect.Int64, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Uint, reflect.Uint64, reflect.Uint8, reflect.Uint16, reflect.Uint32: - v := reflect.ValueOf(value) - t := f.Type().Elem() - if !v.CanConvert(t) { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) - } - v = v.Convert(t) - if f.IsZero() { - f.Set(reflect.New(f.Type().Elem())) - } - - f.Elem().Set(v) - case reflect.Float64: - // it is possible that the value is an integer set in the field - // via the old float<->int64 type cast - var tempV float64 - if fv, ok := value.(float64); ok { - tempV = fv - } else { - v, ok := value.(int) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) - } - tempV = math.Float64frombits(uint64(v)) - } - - rv := reflect.ValueOf(&tempV) - if rv.Type() != f.Type() { - rv = rv.Convert(f.Type()) - } - f.Set(rv) - case reflect.Bool: - var tempV bool - switch v := value.(type) { - case int: - tempV = v == 1 - case bool: - tempV = v - default: - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for boolean field", value)) - } - - rv := reflect.ValueOf(&tempV) - if rv.Type() != f.Type() { - rv = rv.Convert(f.Type()) - } - f.Set(rv) - case reflect.Float32: - if v, ok := value.(float32); ok { - value = float64(v) - } - - // it is possible that the value is an integer set in the field - // via the old float<->int64 type cast - var tempV64 float64 - if fv, ok := value.(float64); ok { - tempV64 = fv - } else { - v, ok := value.(int) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) - } - tempV64 = math.Float64frombits(uint64(v)) - } - - tempV := float32(tempV64) - rv := reflect.ValueOf(&tempV) - if rv.Type() != f.Type() { - rv = rv.Convert(f.Type()) - } - f.Set(rv) - case reflect.Interface: - f.Set(reflect.ValueOf(&value)) - case reflect.Struct: - // support time.Time - if f.Type().Elem().PkgPath() == "time" && f.Type().Elem().Name() == "Time" { - v, ok := value.(int) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for *%s field", value, fieldKind)) - } - tm := time.Unix(0, int64(v)) - f.Set(reflect.ValueOf(&tm)) - break - } - valMap, ok := value.(map[interface{}]interface{}) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - // iterate over struct fields and recursively fill them up - if valMap != nil { - newObjPtr := f - if f.IsNil() { - newObjPtr = reflect.New(f.Type().Elem()) - } - - theStruct := newObjPtr.Elem() - if err := setStructValue(theStruct, valMap, theStruct.Type(), nil); err != nil { - return err - } - - // set the field - f.Set(newObjPtr) - } - } // switch ptr - case reflect.Slice, reflect.Array: - // BLOBs come back as []byte - theArray := reflect.ValueOf(value) - if theArray.Kind() != reflect.Slice { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - - if f.Kind() == reflect.Slice { - if f.IsNil() { - f.Set(reflect.MakeSlice(reflect.SliceOf(f.Type().Elem()), theArray.Len(), theArray.Len())) - } else if f.Len() < theArray.Len() { - count := theArray.Len() - f.Len() - f.Set(reflect.AppendSlice(f, reflect.MakeSlice(reflect.SliceOf(f.Type().Elem()), count, count))) - } - } - - for i := 0; i < theArray.Len(); i++ { - if err := setValue(f.Index(i), theArray.Index(i).Interface()); err != nil { - return err - } - } - case reflect.Map: - emptyStruct := reflect.ValueOf(struct{}{}) - if theMap, ok := value.(map[interface{}]interface{}); ok { - newMap := reflect.MakeMap(f.Type()) - for key, elem := range theMap { - if err := fillMap(f, newMap, emptyStruct, key, elem, value, fieldKind); err != nil { - return err - } - } - f.Set(newMap) - } else if theMap, ok := value.([]MapPair); ok { - newMap := reflect.MakeMap(f.Type()) - for _, mp := range theMap { - key, elem := mp.Key, mp.Value - if err := fillMap(f, newMap, emptyStruct, key, elem, value, fieldKind); err != nil { - return err - } - } - f.Set(newMap) - } else { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - - case reflect.Struct: - // support MapPair - if f.Type().Name() == "MapPair" { - v, ok := value.(MapPair) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for MapPair %s field", value, fieldKind)) - } - f.Set(reflect.ValueOf(v)) - break - } - - // support time.Time - if f.Type().PkgPath() == "time" && f.Type().Name() == "Time" { - v, ok := value.(int) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for time %s field", value, fieldKind)) - } - f.Set(reflect.ValueOf(time.Unix(0, int64(v)))) - break - } - - valMap, ok := value.(map[interface{}]interface{}) - if !ok { - return newError(types.PARSE_ERROR, fmt.Sprintf("Invalid value `%#v` for %s field", value, fieldKind)) - } - // iterate over struct fields and recursively fill them up - if err := setStructValue(f, valMap, f.Type(), nil); err != nil { - return err - } - - // set the field - f.Set(f) - } - } - - return nil -} - -func setStructValue(f reflect.Value, valMap map[interface{}]interface{}, typeOfT reflect.Type, index []int) (err Error) { - numFields := typeOfT.NumField() - for i := 0; i < numFields; i++ { - fld := typeOfT.Field(i) - fldIndex := append(index, fld.Index...) - if fld.Anonymous && fld.Type.Kind() == reflect.Struct { - if err := setStructValue(f, valMap, fld.Type, fldIndex); err != nil { - return err - } - continue - } - - if fld.PkgPath != "" { - continue - } - - alias := fld.Name - tag := strings.Trim(stripOptions(fld.Tag.Get(aerospikeTag)), " ") - if tag != "" { - alias = tag - } - - if valMap[alias] != nil { - if err := setValue(f.FieldByIndex(fldIndex), valMap[alias]); err != nil { - return err - } - } - } - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go b/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go deleted file mode 100644 index 48a65a4f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_command_reflect_test.go +++ /dev/null @@ -1,96 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("Read Command Reflect setValue", func() { - type testStruct struct { - Int int - Bool bool - Int64 int64 - String string - Float64 float64 - SliceString []string - SliceInt []int - SliceFloat64 []float64 - MapStringFloat64 map[string]float64 - MapStringString map[string]string - MapInterfaceInterface map[interface{}]interface{} - } - - ts := &testStruct{} - reflectField := func(name string) reflect.Value { - return reflect.Indirect(reflect.ValueOf(ts)).FieldByName(name) - } - - tests := []struct { - name string - field reflect.Value - obj interface{} - error bool - }{ - {name: "int->int", field: reflectField("Int"), obj: 5}, - {name: "int->int64", field: reflectField("Int64"), obj: int64(5)}, - {name: "int->bool", field: reflectField("Bool"), obj: true}, - {name: "int->float64", field: reflectField("Float64"), obj: 5}, - {name: "[]string->[]string", field: reflectField("SliceString"), obj: []string{"1", "2"}}, - {name: "[]int->[]int", field: reflectField("SliceInt"), obj: []int{1, 2}}, - {name: "map[string]string->map[string]string", field: reflectField("MapStringString"), obj: map[interface{}]interface{}{"1": "2"}}, - {name: "map[string]float64->map[string]float64", field: reflectField("MapStringFloat64"), obj: map[interface{}]interface{}{"1": 2}}, - {name: "map[interface{}]interface{}->map[interface{}]interface{}", field: reflectField("MapInterfaceInterface"), obj: map[interface{}]interface{}{"1": 2}}, - - {name: "string->int", field: reflectField("Int"), obj: "5", error: true}, - {name: "string->bool", field: reflectField("Bool"), obj: "true", error: true}, - {name: "int->string", field: reflectField("String"), obj: 5, error: true}, - {name: "bool->int", field: reflectField("Int"), obj: true, error: true}, - {name: "bool->string", field: reflectField("String"), obj: true, error: true}, - {name: "int->[]string", field: reflectField("SliceString"), obj: 5, error: true}, - {name: "int->[]int", field: reflectField("SliceInt"), obj: 5, error: true}, - {name: "int->[]float64", field: reflectField("SliceFloat64"), obj: 5, error: true}, - {name: "[]string->int", field: reflectField("Int"), obj: []string{"1", "2"}, error: true}, - {name: "[]string->int64", field: reflectField("Int64"), obj: []string{"1", "2"}, error: true}, - {name: "[]string->float64", field: reflectField("Float64"), obj: []string{"1", "2"}, error: true}, - {name: "[]int->int", field: reflectField("Int"), obj: []int{1, 2}, error: true}, - {name: "[]int->int64", field: reflectField("Int64"), obj: []int{1, 2}, error: true}, - {name: "[]string->[]int", field: reflectField("SliceInt"), obj: []string{"1", "2"}, error: true}, - {name: "map[string]string->[]int", field: reflectField("SliceInt"), obj: map[interface{}]interface{}{"1": "2"}, error: true}, - {name: "[]int->map[string]string", field: reflectField("MapStringString"), obj: []int{1, 2}, error: true}, - {name: "map[string]string->map[string]float64", field: reflectField("MapStringFloat64"), obj: map[interface{}]interface{}{"1": "2"}, error: true}, - } - - for _, tt := range tests { - tc := tt - gg.Context(tc.name, func() { - gg.It("Should return correct error", func() { - gm.Expect(func() { - err := setValue(tc.field, tc.obj) - if tc.error { - gm.Expect(err).To(gm.HaveOccurred()) - return - } - gm.Expect(err).ToNot(gm.HaveOccurred()) - }).To(gm.Not(gm.Panic())) - }) - }) - } -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/read_header_command.go b/aerospike-tls/vendor-aerospike-client-go/read_header_command.go deleted file mode 100644 index f21a09b4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_header_command.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type readHeaderCommand struct { - singleCommand - - policy *BasePolicy - record *Record -} - -func newReadHeaderCommand(cluster *Cluster, policy *BasePolicy, key *Key) (readHeaderCommand, Error) { - var err Error - var partition *Partition - if cluster != nil { - partition, err = PartitionForRead(cluster, policy, key) - if err != nil { - return readHeaderCommand{}, err - } - } - - newReadHeaderCmd := readHeaderCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - policy: policy, - } - - return newReadHeaderCmd, nil -} - -func (cmd *readHeaderCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *readHeaderCommand) writeBuffer(ifc command) Error { - return cmd.setReadHeader(cmd.policy, cmd.key) -} - -func (cmd *readHeaderCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeRead(cmd.cluster) -} - -func (cmd *readHeaderCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryRead(isTimeout) - return true -} - -func (cmd *readHeaderCommand) parseResult(ifc command, conn *Connection) Error { - // Read header. - if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { - return err - } - - header := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(header); err != nil { - return err - } - - resultCode := cmd.dataBuffer[13] & 0xFF - - if resultCode == 0 { - generation := Buffer.BytesToUint32(cmd.dataBuffer, 14) - expiration := types.TTL(Buffer.BytesToUint32(cmd.dataBuffer, 18)) - cmd.record = newRecord(cmd.node, cmd.key, nil, generation, expiration) - } else { - if types.ResultCode(resultCode) == types.KEY_NOT_FOUND_ERROR { - cmd.record = nil - } else if types.ResultCode(resultCode) == types.FILTERED_OUT { - return ErrFilteredOut.err() - } else { - return newError(types.ResultCode(resultCode)) - } - } - return cmd.emptySocket(conn) -} - -func (cmd *readHeaderCommand) GetRecord() *Record { - return cmd.record -} - -func (cmd *readHeaderCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *readHeaderCommand) transactionType() transactionType { - return ttGetHeader -} diff --git a/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go b/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go deleted file mode 100644 index ca5af369..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_mode_ap.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -// ReadModeAP is the read policy in AP (availability) mode namespaces. -// It indicates how duplicates should be consulted in a read operation. -// Only makes a difference during migrations and only applicable in AP mode. -type ReadModeAP int - -const ( - // ReadModeAPOne indicates that a single node should be involved in the read operation. - ReadModeAPOne ReadModeAP = iota - - // ReadModeAPAll indicates that all duplicates should be consulted in - // the read operation. - ReadModeAPAll -) diff --git a/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go b/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go deleted file mode 100644 index 38ea6c6e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/read_mode_sc.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -// ReadModeSC is the read policy in SC (strong consistency) mode namespaces. -// Determines SC read consistency options. -type ReadModeSC int - -const ( - // ReadModeSCSession ensures this client will only see an increasing sequence of record versions. - // Client only reads from master. This is the default. - ReadModeSCSession ReadModeSC = iota - - // ReadModeSCLinearize ensures all clients will only see an increasing sequence of record versions. - // Client only reads from master. - ReadModeSCLinearize - - // ReadModeSCAllowReplica indicates that the client may read from master or any full (non-migrating) replica. - // Increasing sequence of record versions is not guaranteed. - ReadModeSCAllowReplica - - // ReadModeSCAllowUnavailable indicates that the client may read from master or any full (non-migrating) replica or from unavailable - // partitions. Increasing sequence of record versions is not guaranteed. - ReadModeSCAllowUnavailable -) diff --git a/aerospike-tls/vendor-aerospike-client-go/record.go b/aerospike-tls/vendor-aerospike-client-go/record.go deleted file mode 100644 index fe123e6d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/record.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "fmt" - -// Record is the container struct for database records. -// Records are equivalent to rows. -type Record struct { - // Key is the record's key. - // Might be empty, or may only consist of digest value. - Key *Key - - // Node from which the Record is originating from. - Node *Node - - // Bins is the map of requested name/value bins. - Bins BinMap - - // Generation shows record modification count. - Generation uint32 - - // Expiration is TTL (Time-To-Live). - // Number of seconds until record expires. - Expiration uint32 -} - -func newRecord(node *Node, key *Key, bins BinMap, generation, expiration uint32) *Record { - r := &Record{ - Node: node, - Key: key, - Bins: bins, - Generation: generation, - Expiration: expiration, - } - - // always assign a map of length zero if Bins is nil - if r.Bins == nil { - r.Bins = make(BinMap) - } - - return r -} - -// String implements the Stringer interface. -// Returns string representation of record. -func (rc *Record) String() string { - return fmt.Sprintf("%s %v", rc.Key, rc.Bins) -} - -// udfError returns the the error string returned by a UDF execute in a batch. -// Returns nil if an error did not occur. -func (rc *Record) udfError() string { - return rc.Bins["FAILURE"].(string) -} - -// udfResult returns the value returned by a UDF execute in a batch. -// The result may be nil. -func (rc *Record) udfResult() BinMap { - return BinMap(rc.Bins["SUCCESS"].(map[string]interface{})) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go b/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go deleted file mode 100644 index d3c81f11..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/record_exists_action.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// RecordExistsAction determines how to handle writes when -// the record already exists. -type RecordExistsAction int - -const ( - - // UPDATE means: Create or update record. - // Merge write command bins with existing bins. - UPDATE RecordExistsAction = iota - - // UPDATE_ONLY means: Update record only. Fail if record does not exist. - // Merge write command bins with existing bins. - UPDATE_ONLY - - // REPLACE means: Create or replace record. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike 2 server versions >= 2.7.5 and - // Aerospike 3 server versions >= 3.1.6 and later. - REPLACE - - // REPLACE_ONLY means: Replace record only. Fail if record does not exist. - // Delete existing bins not referenced by write command bins. - // Supported by Aerospike 2 server versions >= 2.7.5 and - // Aerospike 3 server versions >= 3.1.6 and later. - REPLACE_ONLY - - // CREATE_ONLY means: Create only. Fail if record exists. - CREATE_ONLY -) diff --git a/aerospike-tls/vendor-aerospike-client-go/recordset.go b/aerospike-tls/vendor-aerospike-client-go/recordset.go deleted file mode 100644 index 16b85f9e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/recordset.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "math/rand" - "reflect" - "runtime" - "sync" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" -) - -// Result is the value returned by Recordset's Results() function. -type Result struct { - Record *Record - Err Error - BVal *int64 -} - -// String implements the Stringer interface -func (res *Result) String() string { - if res.Record != nil { - return fmt.Sprintf("%v", res.Record) - } - return fmt.Sprintf("%v", res.Err) -} - -// Objectset encapsulates the result of Scan and Query commands. -type objectset struct { - // a reference to the object channel to close on end signal - objChan reflect.Value - - // errors is a channel on which all errors will be sent back. - errors chan Error - - wgGoroutines sync.WaitGroup - goroutines *atomic.Int - - closed, active *atomic.Bool - cancelled chan struct{} - - chanLock sync.Mutex - - taskID uint64 -} - -// TaskId returns the transactionId/jobId sent to the server for this recordset. -func (os *objectset) TaskId() uint64 { - os.chanLock.Lock() - defer os.chanLock.Unlock() - return os.taskID -} - -// Always set the taskID client-side to a non-zero random value -func (os *objectset) resetTaskID() { - os.chanLock.Lock() - defer os.chanLock.Unlock() - os.taskID = rand.Uint64() -} - -// Recordset encapsulates the result of Scan and Query commands. -type Recordset struct { - objectset - - // Records is a channel on which the resulting records will be sent back. - // NOTE: Do not use Records directly. Range on channel returned by Results() instead. - // Will be unexported in the future - records chan *Result -} - -// makes sure the recordset is closed eventually, even if it is not consumed -func recordsetFinalizer(rs *Recordset) { - rs.Close() -} - -// newObjectset generates a new RecordSet instance. -func newObjectset(objChan reflect.Value, goroutines int) *objectset { - - if objChan.Kind() != reflect.Chan || - objChan.Type().Elem().Kind() != reflect.Ptr || - objChan.Type().Elem().Elem().Kind() != reflect.Struct { - panic("Scan/Query object channels should be of type `chan *T`") - } - - rs := &objectset{ - objChan: objChan, - errors: make(chan Error, goroutines), - active: atomic.NewBool(true), - closed: atomic.NewBool(false), - goroutines: atomic.NewInt(goroutines), - cancelled: make(chan struct{}), - } - rs.wgGoroutines.Add(goroutines) - rs.resetTaskID() - return rs -} - -// newRecordset generates a new RecordSet instance. -func newRecordset(recSize, goroutines int) *Recordset { - var nilChan chan *struct{} - - rs := &Recordset{ - records: make(chan *Result, recSize), - objectset: *newObjectset(reflect.ValueOf(nilChan), goroutines), - } - - runtime.SetFinalizer(rs, recordsetFinalizer) - return rs -} - -// IsActive returns true if the operation hasn't been finished or cancelled. -func (rcs *Recordset) IsActive() bool { - return rcs.active.Get() -} - -// Errors returns a read-only Error channel for the objectset. It will panic -// for recordsets returned for non-reflection APIs. -func (rcs *Recordset) Errors() <-chan Error { - if rcs.records == nil { - return (<-chan Error)(rcs.errors) - } - panic("Errors chan not valid for non-reflection API") -} - -// Results returns a new receive-only channel with the results of the Scan/Query. -// This is a more idiomatic approach to the iterator pattern in getting the -// results back from the recordset, and doesn't require the user to write the -// ugly select in their code. -// Result contains a Record and an error reference. -// -// Example: -// -// recordset, err := client.ScanAll(nil, namespace, set) -// handleError(err) -// for res := range recordset.Results() { -// if res.Err != nil { -// // handle error here -// } else { -// // process record here -// fmt.Println(res.Record.Bins) -// } -// } -func (rcs *Recordset) Results() <-chan *Result { - return (<-chan *Result)(rcs.records) -} - -// Close all streams from different nodes. A successful close return nil, -// subsequent calls to the method will return ErrRecordsetClosed.err(). -func (rcs *Recordset) Close() Error { - // do it only once - if !rcs.closed.CompareAndToggle(false) { - return ErrRecordsetClosed.err() - } - - // mark the recordset as inactive - rcs.active.Set(false) - - close(rcs.cancelled) - - // wait till all goroutines are done, and signalEnd is called by the scan command - rcs.wgGoroutines.Wait() - - return nil -} - -func (rcs *Recordset) signalEnd() { - rcs.wgGoroutines.Done() - if rcs.goroutines.DecrementAndGet() == 0 { - // mark the recordset as inactive - rcs.active.Set(false) - - rcs.chanLock.Lock() - defer rcs.chanLock.Unlock() - - if rcs.records != nil { - close(rcs.records) - } else if rcs.objChan.IsValid() { - rcs.objChan.Close() - } - - close(rcs.errors) - } -} - -func (rcs *Recordset) sendError(err Error) { - rcs.chanLock.Lock() - defer rcs.chanLock.Unlock() - if rcs.IsActive() { - if rcs.records != nil { - rcs.records <- &Result{Err: err} - } else { - rcs.errors <- err - } - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/recordset_test.go b/aerospike-tls/vendor-aerospike-client-go/recordset_test.go deleted file mode 100644 index d0f12426..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/recordset_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" - - "github.com/aerospike/aerospike-client-go/v7/types" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Recordset test", func() { - - gg.It("must avoid panic on sendError", func() { - rs := newRecordset(100, 1) - - rs.sendError(newError(types.PARAMETER_ERROR, "Error")) - rs.wgGoroutines.Done() - rs.Close() - rs.sendError(newError(types.PARAMETER_ERROR, "Error")) - - timeout := time.After(time.Second) - select { - case res := <-rs.Results(): - gm.Expect(res).ToNot(gm.BeNil()) - case <-timeout: - panic("wrong result!") - } - }) - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/replica_policy.go b/aerospike-tls/vendor-aerospike-client-go/replica_policy.go deleted file mode 100644 index 766d844c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/replica_policy.go +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2014-2022 Aerospike, Inc. - * - * Portions may be licensed to Aerospike, Inc. under one or more contributor - * license agreements. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package aerospike - -// ReplicaPolicy defines type of node partition targeted by read commands. -type ReplicaPolicy int - -const ( - // MASTER reads from node containing key's master partition. - // This is the default behavior. - MASTER ReplicaPolicy = iota - - // MASTER_PROLES Distributes reads across nodes containing key's master and replicated partitions - // in round-robin fashion. - MASTER_PROLES - - // RANDOM Distribute reads across all nodes in cluster in round-robin fashion. - // This option is useful when the replication factor equals the number - // of nodes in the cluster and the overhead of requesting proles is not desired. - RANDOM - - // SEQUENCE Tries node containing master partition first. - // If connection fails, all commands try nodes containing replicated partitions. - // If socketTimeout is reached, reads also try nodes containing replicated partitions, - // but writes remain on master node. - SEQUENCE - - // PREFER_RACK Tries nodes on the same rack first. - // - // This option requires ClientPolicy.Rackaware to be enabled - // in order to function properly. - PREFER_RACK -) diff --git a/aerospike-tls/vendor-aerospike-client-go/role.go b/aerospike-tls/vendor-aerospike-client-go/role.go deleted file mode 100644 index 4f558134..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/role.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -// Role allows granular access to database entities for users. -type Role struct { - // Name is role name - Name string - - // Privilege is the list of assigned privileges - Privileges []Privilege - - // While is the list of allowable IP addresses - Whitelist []string - - // ReadQuota is the maximum reads per second limit for the role - ReadQuota uint32 - - // WriteQuota is the maximum writes per second limit for the role - WriteQuota uint32 -} - -// Pre-defined user roles. -const ( - // UserAdmin allows to manages users and their roles. - UserAdmin privilegeCode = "user-admin" - - // SysAdmin allows to manage indexes, user defined functions and server configuration. - SysAdmin privilegeCode = "sys-admin" - - // DataAdmin allows to manage indicies and user defined functions. - DataAdmin privilegeCode = "data-admin" - - // UDFAdmin allows to manage user defined functions. - UDFAdmin privilegeCode = "udf-admin" - - // SIndexAdmin allows to manage indicies. - SIndexAdmin privilegeCode = "sindex-admin" - - // ReadWriteUDF allows read, write and UDF transactions with the database. - ReadWriteUDF privilegeCode = "read-write-udf" - - // ReadWrite allows read and write transactions with the database. - ReadWrite privilegeCode = "read-write" - - // Read allows read transactions with the database. - Read privilegeCode = "read" - - // Write allows write transactions with the database. - Write privilegeCode = "write" - - // Truncate allow issuing truncate commands. - Truncate privilegeCode = "truncate" -) diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_executor.go b/aerospike-tls/vendor-aerospike-client-go/scan_executor.go deleted file mode 100644 index 5b9c21af..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_executor.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" -) - -func (clnt *Client) scanPartitions(policy *ScanPolicy, tracker *partitionTracker, namespace string, setName string, recordset *Recordset, binNames ...string) { - defer recordset.signalEnd() - - // for exponential backoff - interval := policy.SleepBetweenRetries - - var errs Error - for { - list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), namespace) - if err != nil { - errs = chainErrors(err, errs) - recordset.sendError(errs) - tracker.partitionError() - return - } - - maxConcurrentNodes := policy.MaxConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(list) - } - - if recordset.IsActive() { - weg := newWeightedErrGroup(maxConcurrentNodes) - for _, nodePartition := range list { - cmd := newScanPartitionCommand(policy, tracker, nodePartition, namespace, setName, binNames, recordset) - weg.execute(cmd) - } - errs = chainErrors(weg.wait(), errs) - } - - if done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy); !recordset.IsActive() || done || err != nil { - errs = chainErrors(err, errs) - // Scan is complete. - if errs != nil { - tracker.partitionError() - recordset.sendError(errs) - } - return - } - - if policy.SleepBetweenRetries > 0 { - // Sleep before trying again. - time.Sleep(interval) - - if policy.SleepMultiplier > 1 { - interval = time.Duration(float64(interval) * policy.SleepMultiplier) - } - } - - recordset.resetTaskID() - } - -} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go b/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go deleted file mode 100644 index 0ee92a36..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_objects_executor.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "sync" - "time" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "golang.org/x/sync/semaphore" -) - -func (clnt *Client) scanPartitionObjects(policy *ScanPolicy, tracker *partitionTracker, namespace string, setName string, rs *Recordset, binNames ...string) Error { - defer rs.signalEnd() - - // for exponential backoff - interval := policy.SleepBetweenRetries - - for { - rs.resetTaskID() - list, err := tracker.assignPartitionsToNodes(clnt.Cluster(), namespace) - if err != nil { - tracker.partitionError() - return err - } - - wg := new(sync.WaitGroup) - - // the whole call should be wrapped in a goroutine - wg.Add(len(list)) - - // the whole call should be wrapped in a goroutine - maxConcurrentNodes := policy.MaxConcurrentNodes - if maxConcurrentNodes <= 0 { - maxConcurrentNodes = len(list) - } - - sem := semaphore.NewWeighted(int64(maxConcurrentNodes)) - ctx := context.Background() - - for _, nodePartition := range list { - if err := sem.Acquire(ctx, 1); err != nil { - logger.Logger.Error("Constraint Semaphore failed for Scan: %s", err.Error()) - } - go func(nodePartition *nodePartitions) { - defer sem.Release(1) - defer wg.Done() - if err := clnt.scanNodePartitionObjects(policy, rs, tracker, nodePartition, namespace, setName, binNames...); err != nil { - tracker.partitionError() - logger.Logger.Debug("Error while Executing scan for node %s: %s", nodePartition.node.String(), err.Error()) - } - }(nodePartition) - } - - wg.Wait() - - done, err := tracker.isClusterComplete(clnt.Cluster(), &policy.BasePolicy) - if done || err != nil { - if err != nil { - tracker.partitionError() - } - // Scan is complete. - return err - } - - if policy.SleepBetweenRetries > 0 { - // Sleep before trying again. - time.Sleep(interval) - - if policy.SleepMultiplier > 1 { - interval = time.Duration(float64(interval) * policy.SleepMultiplier) - } - } - } - -} - -// ScanNode reads all records in specified namespace and set for one node only. -// If the policy is nil, the default relevant policy will be used. -func (clnt *Client) scanNodePartitionObjects(policy *ScanPolicy, recordset *Recordset, tracker *partitionTracker, nodePartition *nodePartitions, namespace string, setName string, binNames ...string) Error { - command := newScanPartitionObjectsCommand(policy, tracker, nodePartition, namespace, setName, binNames, recordset) - return command.Execute() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go b/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go deleted file mode 100644 index 6727c693..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_partition_command.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -type scanPartitionCommand struct { - baseMultiCommand - - policy *ScanPolicy - namespace string - setName string - binNames []string -} - -func newScanPartitionCommand( - policy *ScanPolicy, - tracker *partitionTracker, - nodePartitions *nodePartitions, - namespace string, - setName string, - binNames []string, - recordset *Recordset, -) *scanPartitionCommand { - cmd := &scanPartitionCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), - policy: policy, - namespace: namespace, - setName: setName, - binNames: binNames, - } - cmd.rawCDT = policy.RawCDT - cmd.terminationErrorType = types.SCAN_TERMINATED - cmd.tracker = tracker - cmd.nodePartitions = nodePartitions - cmd.node = nodePartitions.node - - return cmd -} - -func (cmd *scanPartitionCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *scanPartitionCommand) writeBuffer(ifc command) Error { - return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, cmd.nodePartitions) -} - -func (cmd *scanPartitionCommand) shouldRetry(e Error) bool { - return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) -} - -func (cmd *scanPartitionCommand) transactionType() transactionType { - return ttScan -} - -func (cmd *scanPartitionCommand) Execute() Error { - err := cmd.execute(cmd) - if err != nil { - // signal to the executor that no retries should be attempted - // don't send error unless no retries are planned - if !cmd.shouldRetry(err) { - cmd.recordset.sendError(err) - } - } - return err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go b/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go deleted file mode 100644 index 6fc51234..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_partition_objects_command.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import "github.com/aerospike/aerospike-client-go/v7/types" - -type scanPartitionObjectsCommand struct { - baseMultiCommand - - policy *ScanPolicy - namespace string - setName string - binNames []string - taskID uint64 -} - -func newScanPartitionObjectsCommand( - policy *ScanPolicy, - tracker *partitionTracker, - nodePartitions *nodePartitions, - namespace string, - setName string, - binNames []string, - recordset *Recordset, -) *scanPartitionObjectsCommand { - cmd := &scanPartitionObjectsCommand{ - baseMultiCommand: *newCorrectStreamingMultiCommand(recordset, namespace), - policy: policy, - namespace: namespace, - setName: setName, - binNames: binNames, - } - cmd.terminationErrorType = types.SCAN_TERMINATED - cmd.tracker = tracker - cmd.nodePartitions = nodePartitions - cmd.node = nodePartitions.node - - return cmd -} - -func (cmd *scanPartitionObjectsCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *scanPartitionObjectsCommand) writeBuffer(ifc command) Error { - return cmd.setScan(cmd.policy, &cmd.namespace, &cmd.setName, cmd.binNames, cmd.recordset.taskID, cmd.nodePartitions) -} - -func (cmd *scanPartitionObjectsCommand) parseResult(ifc command, conn *Connection) Error { - return cmd.baseMultiCommand.parseResult(ifc, conn) -} - -func (cmd *scanPartitionObjectsCommand) shouldRetry(e Error) bool { - return cmd.tracker != nil && cmd.tracker.shouldRetry(cmd.nodePartitions, e) -} - -func (cmd *scanPartitionObjectsCommand) transactionType() transactionType { - return ttScan -} - -func (cmd *scanPartitionObjectsCommand) Execute() Error { - err := cmd.execute(cmd) - if err != nil { - // signal to the executor that no retries should be attempted - // don't send error unless no retries are planned - if !cmd.shouldRetry(err) { - cmd.recordset.sendError(err) - } - } - return err -} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_policy.go b/aerospike-tls/vendor-aerospike-client-go/scan_policy.go deleted file mode 100644 index 400850db..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_policy.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// ScanPolicy encapsulates parameters used in scan operations. -type ScanPolicy struct { - MultiPolicy -} - -// NewScanPolicy creates a new ScanPolicy instance with default values. -// Set MaxRetries for scans on server versions >= 4.9. All other -// scans are not retried. -// -// The latest servers support retries on individual data partitions. -// This feature is useful when a cluster is migrating and partition(s) -// are missed or incomplete on the first scan attempt. -// -// If the first scan attempt misses 2 of 4096 partitions, then only -// those 2 partitions are retried in the next scan attempt from the -// last key digest received for each respective partition. A higher -// default MaxRetries is used because it's wasteful to invalidate -// all scan results because a single partition was missed. -func NewScanPolicy() *ScanPolicy { - mp := *NewMultiPolicy() - mp.TotalTimeout = 0 - - return &ScanPolicy{ - MultiPolicy: mp, - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/scan_test.go b/aerospike-tls/vendor-aerospike-client-go/scan_test.go deleted file mode 100644 index 7c56c0c0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/scan_test.go +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "bytes" - "math" - "math/rand" - - as "github.com/aerospike/aerospike-client-go/v7" - ast "github.com/aerospike/aerospike-client-go/v7/types" - particleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Scan operations", func() { - - // connection data - var ns = *namespace - var set = randString(50) - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - const keyCount = 1000 - const ldtElemCount = 10 - bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", randString(100)) - bin3 := as.NewBin("map", map[string]int{"1": 1, "2": 2}) - bin4 := as.NewBin("list", []int{1, 2, 3}) - var keys map[string]*as.Key - - // read all records from the channel and make sure all of them are returned - // if cancelCnt is set, it will cancel the scan after specified record count - var checkResults = func(recordset *as.Recordset, cancelCnt int, rawCDT bool) int { - counter := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - key, exists := keys[string(rec.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) - - gm.Expect(res.Record.Bins[bin3.Name]).NotTo(gm.BeNil()) - gm.Expect(res.Record.Bins[bin4.Name]).NotTo(gm.BeNil()) - if rawCDT { - gm.Expect(res.Record.Bins[bin3.Name].(*as.RawBlobValue).ParticleType).To(gm.Equal(particleType.MAP)) - gm.Expect(res.Record.Bins[bin4.Name].(*as.RawBlobValue).ParticleType).To(gm.Equal(particleType.LIST)) - - // rewrite the record to the database to see if the values are correctly written - err := client.Put(nil, res.Record.Key, res.Record.Bins) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } else { - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - gm.Expect(res.Record.Bins[bin3.Name]).To(gm.Equal(map[interface{}]interface{}{"1": 1, "2": 2})) - gm.Expect(res.Record.Bins[bin4.Name]).To(gm.Equal([]interface{}{1, 2, 3})) - - delete(keys, string(rec.Key.Digest())) - } - - counter++ - // cancel scan abruptly - if cancelCnt != 0 && counter == cancelCnt { - recordset.Close() - } - } - - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - return counter - } - - gg.BeforeEach(func() { - keys = make(map[string]*as.Key, keyCount) - set = randString(50) - for i := 0; i < keyCount; i++ { - key, err := as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - keys[string(key.Digest())] = key - err = client.PutBins(wpolicy, key, bin1, bin2, bin3, bin4) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - var scanPolicy = as.NewScanPolicy() - - gg.It("must Scan and paginate to get all records back from all partitions concurrently", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - pf := as.NewPartitionFilterAll() - spolicy := as.NewScanPolicy() - spolicy.MaxRecords = 30 - - times := 0 - received := 0 - for received < keyCount { - times++ - recordset, err := client.ScanPartitions(spolicy, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := checkResults(recordset, 0, false) - gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) - received += recs - } - - gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and paginate to get all records back from all partitions concurrently, ONE BY ONE", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - pf := as.NewPartitionFilterAll() - spolicy := as.NewScanPolicy() - spolicy.MaxRecords = 1 - - times := 0 - received := 0 - for received < keyCount { - times++ - recordset, err := client.ScanPartitions(spolicy, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := checkResults(recordset, 0, false) - gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) - received += recs - } - - gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and paginate using a persisted cursor to get all records back from all partitions concurrently", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - spolicy := as.NewScanPolicy() - spolicy.MaxRecords = 30 - - received := 0 - var buf []byte - times := 0 - for received < keyCount { - times++ - pf := as.NewPartitionFilterAll() - - if len(buf) > 0 { - err = pf.DecodeCursor(buf) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - recordset, err := client.ScanPartitions(spolicy, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - recs := checkResults(recordset, 0, false) - gm.Expect(recs).To(gm.BeNumerically("<=", int(spolicy.MaxRecords))) - received += recs - - buf, err = pf.EncodeCursor() - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - gm.Expect(times).To(gm.BeNumerically(">=", keyCount/spolicy.MaxRecords)) - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back from all partitions concurrently", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - pf := as.NewPartitionFilterByRange(0, 4096) - recordset, err := client.ScanPartitions(nil, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, false) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all partition records back for a specified key", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - counter := 0 - - var rkey *as.Key - for _, k := range keys { - rkey = k - - pf := as.NewPartitionFilterByKey(rkey) - recordset, err := client.ScanPartitions(scanPolicy, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - // the key itself should not be returned - gm.Expect(bytes.Equal(rkey.Digest(), res.Record.Key.Digest())).To(gm.BeFalse()) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - - } - gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) - }) - - gg.It("must Scan and get all partition records back for a specified partition range", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - pbegin := 1000 - for i := 1; i < 10; i++ { - counter := 0 - - pf := as.NewPartitionFilterByRange(pbegin, rand.Intn(i*191)+1) - recordset, err := client.ScanPartitions(scanPolicy, pf, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - - gm.Expect(counter).To(gm.BeNumerically(">", 0)) - gm.Expect(counter).To(gm.BeNumerically("<", keyCount)) - } - } - gm.Expect(len(keys)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("must Scan and get all records back for a specified node using Results() channel", func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - counter := 0 - for _, node := range client.GetNodes() { - recordset, err := client.ScanNode(scanPolicy, node, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).NotTo(gm.HaveOccurred()) - key, exists := keys[string(res.Record.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(res.Record.Key.Value().GetObject())) - gm.Expect(res.Record.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(res.Record.Bins[bin2.Name]).To(gm.Equal(bin2.Value.GetObject())) - - delete(keys, string(res.Record.Key.Digest())) - - counter++ - } - } - - gm.Expect(len(keys)).To(gm.Equal(0)) - gm.Expect(counter).To(gm.Equal(keyCount)) - }) - - gg.It("must Scan and get all records back for a specified node", func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - for _, node := range client.GetNodes() { - recordset, err := client.ScanNode(scanPolicy, node, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, false) - } - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back from all nodes concurrently", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, false) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back from all nodes concurrently with policy.RecordsPerSecond set", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - policy := as.NewScanPolicy() - policy.RecordsPerSecond = keyCount - 100 - recordset, err := client.ScanAll(policy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, false) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back from all nodes concurrently without the Bin Data", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - sp := as.NewScanPolicy() - sp.IncludeBinData = false - recordset, err := client.ScanAll(sp, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for res := range recordset.Results() { - gm.Expect(res.Err).ToNot(gm.HaveOccurred()) - rec := res.Record - key, exists := keys[string(rec.Key.Digest())] - - gm.Expect(exists).To(gm.Equal(true)) - gm.Expect(key.Value().GetObject()).To(gm.Equal(rec.Key.Value().GetObject())) - gm.Expect(len(rec.Bins)).To(gm.Equal(0)) - - delete(keys, string(res.Record.Key.Digest())) - } - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back from all nodes sequentially", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - scanPolicy := as.NewScanPolicy() - scanPolicy.MaxConcurrentNodes = 1 - - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, false) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Scan and get all records back in RawBlobValue when policy.RawCDT is set to true", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - scanPolicy := as.NewScanPolicy() - scanPolicy.MaxConcurrentNodes = 1 - scanPolicy.RawCDT = true - - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, scanPolicy.RawCDT) - - scanPolicy.RawCDT = false - - recordset, err = client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, 0, scanPolicy.RawCDT) - - gm.Expect(len(keys)).To(gm.Equal(0)) - }) - - gg.It("must Cancel Scan", func() { - gm.Expect(len(keys)).To(gm.Equal(keyCount)) - - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - checkResults(recordset, keyCount/2, false) - - gm.Expect(len(keys)).To(gm.BeNumerically("<=", keyCount/2)) - }) - - gg.It("must return the error for invalid expression", func() { - scanPolicy := as.NewScanPolicy() - // the right expression has to be as.ExpListVal(as.NewIntegerValue(11)) for valid expression - scanPolicy.FilterExpression = as.ExpEq(as.ExpListGetByValueRange(as.ListReturnTypeValue, as.ExpIntVal(10), as.ExpIntVal(13), as.ExpListBin(bin1.Name)), as.ExpIntVal(11)) - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - counter := 0 - for res := range recordset.Results() { - gm.Expect(res.Err).To(gm.HaveOccurred()) - gm.Expect(res.Err.Matches(ast.PARAMETER_ERROR)).To(gm.BeTrue()) - } - - gm.Expect(counter).To(gm.Equal(0)) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/security_test.go b/aerospike-tls/vendor-aerospike-client-go/security_test.go deleted file mode 100644 index b53c5327..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/security_test.go +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "fmt" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Security tests", func() { - - var ns = *namespace - - // connection data - var client *as.Client - var err error - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - - if !securityEnabled() { - gg.Skip("Security Tests are not supported in the Community Edition, or when security is not enabled for the Enterprise Edition.") - } - - client, err = as.NewClientWithPolicy(clientPolicy, *host, *port) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - - gg.AfterEach(func() { - if securityEnabled() { - dropUser(nil, "test_user") - time.Sleep(time.Second) - } - }) - - gg.Context("Roles", func() { - - gg.BeforeEach(func() { - client.CreateUser(nil, "test_user", "test", []string{"user-admin"}) - time.Sleep(time.Second) - }) - - gg.It("Must work with Roles Perfectly", func() { - defer client.DropRole(nil, "role-read-test-test") - defer client.DropRole(nil, "role-write-test") - defer client.DropRole(nil, "dummy-role") - - // Add a user defined Role - err := client.CreateRole(nil, "role-read-test-test", []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, []string{getOutboundIP().String()}, 0, 0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.CreateRole(nil, "role-write-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, []string{getOutboundIP().String()}, 0, 0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - // Add privileges to the roles - err = client.GrantPrivileges(nil, "role-read-test-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: "bar"}, {Code: as.ReadWriteUDF, Namespace: ns, SetName: "test"}}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Wait until servers syncronize - time.Sleep(1 * time.Second) - - // Revoke privileges from the roles - err = client.RevokePrivileges(nil, "role-read-test-test", []as.Privilege{{Code: as.ReadWriteUDF, Namespace: ns, SetName: "test"}}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.CreateRole(nil, "dummy-role", []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, []string{getOutboundIP().String()}, 0, 0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - // Drop the dummy role to make sure DropRoles Works - err = client.DropRole(nil, "dummy-role") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Wait until servers syncronize - time.Sleep(3 * time.Second) - - roles, err := client.QueryRoles(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // gm.Expect(len(roles)).To(gm.Equal(8)) - - // Predefined Roles - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read", Privileges: []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read-write", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: "", SetName: ""}}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "read-write-udf", Privileges: []as.Privilege{{Code: as.ReadWriteUDF, Namespace: "", SetName: ""}}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "sys-admin", Privileges: []as.Privilege{{Code: as.SysAdmin, Namespace: "", SetName: ""}}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "user-admin", Privileges: []as.Privilege{{Code: as.UserAdmin, Namespace: "", SetName: ""}}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "data-admin", Privileges: []as.Privilege{{Code: as.DataAdmin, Namespace: "", SetName: ""}}})) - - // Our test Roles - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}, {Code: as.ReadWrite, Namespace: ns, SetName: "bar"}}, Whitelist: []string{getOutboundIP().String()}})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-write-test", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, Whitelist: []string{getOutboundIP().String()}})) - }) - - gg.It("Must work with Quotas Perfectly", func() { - defer client.DropRole(nil, "role-read-test-test") - defer client.DropRole(nil, "role-write-test") - - // Add a user defined Role - err := client.CreateRole(nil, "role-read-test-test", []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, []string{}, 1000, 2000) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.CreateRole(nil, "role-write-test", []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, []string{}, 1001, 2002) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - roles, err := client.QueryRoles(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // Our test Roles - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, ReadQuota: 1000, WriteQuota: 2000})) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-write-test", Privileges: []as.Privilege{{Code: as.ReadWrite, Namespace: ns, SetName: ""}}, ReadQuota: 1001, WriteQuota: 2002})) - - err = client.SetQuotas(nil, "role-read-test-test", 10010, 20020) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(1 * time.Second) - - roles, err = client.QueryRoles(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(roles).To(gm.ContainElement(&as.Role{Name: "role-read-test-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: ns, SetName: "test"}}, ReadQuota: 10010, WriteQuota: 20020})) - }) - - gg.It("Must set and query Whitelist for Roles Perfectly", func() { - defer client.DropRole(nil, "whitelist-test") - - err = client.CreateRole(nil, "whitelist-test", []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, []string{}, 0, 0) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - err = client.SetWhitelist(nil, "whitelist-test", []string{getOutboundIP().String()}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - role, err := client.QueryRole(nil, "whitelist-test") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(role).To(gm.Equal(&as.Role{Name: "whitelist-test", Privileges: []as.Privilege{{Code: as.Read, Namespace: "", SetName: ""}}, Whitelist: []string{getOutboundIP().String()}})) - }) - - gg.It("Must query User Roles Perfectly", func() { - admin, err := client.QueryUser(nil, "test_user") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(admin.User).To(gm.Equal("test_user")) - gm.Expect(admin.Roles).To(gm.ContainElement("user-admin")) - }) - - gg.It("Must Revoke/Grant Roles Perfectly", func() { - err := client.GrantRoles(nil, "test_user", []string{"user-admin", "sys-admin", "read-write", "read"}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - admin, err := client.QueryUser(nil, "test_user") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(admin.User).To(gm.Equal("test_user")) - gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "sys-admin", "read-write", "read")) - - err = client.RevokeRoles(nil, "test_user", []string{"sys-admin"}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - admin, err = client.QueryUser(nil, "test_user") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(admin.User).To(gm.Equal("test_user")) - gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read-write", "read")) - }) - - }) // describe roles - - gg.Describe("Users", func() { - - gg.It("Must Create/Drop User", func() { - // drop before test - client.DropUser(nil, "test_user") - - err := client.CreateUser(nil, "test_user", "test", []string{"user-admin", "read"}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - admin, err := client.QueryUser(nil, "test_user") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(admin.User).To(gm.Equal("test_user")) - gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read")) - }) - - gg.It("Must Change User Password", func() { - // drop before test - client.DropUser(nil, "test_user") - - err := client.CreateUser(nil, "test_user", "test", []string{"user-admin", "read"}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - // connect using the new user - clientPolicy := as.NewClientPolicy() - clientPolicy.TlsConfig = tlsConfig - clientPolicy.User = "test_user" - clientPolicy.Password = "test" - new_client, err := as.NewClientWithPolicy(clientPolicy, *host, *port) - gm.Expect(err).ToNot(gm.HaveOccurred()) - defer new_client.Close() - - // change current user's password on the fly - err = new_client.ChangePassword(nil, "test_user", "test1") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - - // exhaust all node connections - for _, node := range new_client.GetNodes() { - for i := 0; i < clientPolicy.ConnectionQueueSize; i++ { - conn, err := node.GetConnection(time.Second) - gm.Expect(err).ToNot(gm.HaveOccurred()) - node.InvalidateConnection(conn) - } - } - - // should have the password changed in the cluster, so that a new connection - // will be established and used - admin, err := new_client.QueryUser(nil, "test_user") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - gm.Expect(admin.User).To(gm.Equal("test_user")) - gm.Expect(admin.Roles).To(gm.ConsistOf("user-admin", "read")) - }) - - gg.It("Must Query all users", func() { - const USER_COUNT = 10 - // drop before test - for i := 1; i < USER_COUNT; i++ { - client.DropUser(nil, fmt.Sprintf("test_user%d", i)) - } - - for i := 1; i < USER_COUNT; i++ { - err := client.CreateUser(nil, fmt.Sprintf("test_user%d", i), "test", []string{"read"}) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - time.Sleep(time.Second) - - // should have the password changed in the cluster, so that a new connection - // will be established and used - users, err := client.QueryUsers(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(users)).To(gm.BeNumerically(">=", USER_COUNT-1)) - - for i := 1; i < USER_COUNT; i++ { - err := client.DropUser(nil, fmt.Sprintf("test_user%d", i)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - - }) - - }) // describe users -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/server_command.go b/aerospike-tls/vendor-aerospike-client-go/server_command.go deleted file mode 100644 index 73f8371f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/server_command.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type serverCommand struct { - queryCommand -} - -func newServerCommand(node *Node, policy *QueryPolicy, writePolicy *WritePolicy, statement *Statement, taskId uint64, operations []*Operation) *serverCommand { - return &serverCommand{ - queryCommand: *newQueryCommand(node, policy, writePolicy, statement, operations, nil), - } -} - -func (cmd *serverCommand) writeBuffer(ifc command) (err Error) { - return cmd.setQuery(cmd.policy, cmd.writePolicy, cmd.statement, cmd.statement.TaskId, cmd.operations, cmd.writePolicy != nil, nil) -} - -func (cmd *serverCommand) parseRecordResults(ifc command, receiveSize int) (bool, Error) { - // Server commands (Query/Execute UDF) should only send back a return code. - // Keep parsing logic to empty socket buffer just in case server does - // send records back. - cmd.dataOffset = 0 - var bval int64 - - for cmd.dataOffset < receiveSize { - if err := cmd.readBytes(int(_MSG_REMAINING_HEADER_SIZE)); err != nil { - return false, err - } - resultCode := types.ResultCode(cmd.dataBuffer[5] & 0xFF) - - if resultCode != 0 { - if resultCode == types.KEY_NOT_FOUND_ERROR { - return false, nil - } - return false, newError(resultCode) - } - - info3 := int(cmd.dataBuffer[3]) - - // If cmd is the end marker of the response, do not proceed further - if (info3 & _INFO3_LAST) == _INFO3_LAST { - return false, nil - } - - fieldCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 18)) - opCount := int(Buffer.BytesToUint16(cmd.dataBuffer, 20)) - - if _, err := cmd.parseKey(fieldCount, &bval); err != nil { - return false, err - } - - for i := 0; i < opCount; i++ { - if err := cmd.readBytes(8); err != nil { - return false, err - } - opSize := int(Buffer.BytesToUint32(cmd.dataBuffer, 0)) - nameSize := int(cmd.dataBuffer[7]) - - if err := cmd.readBytes(nameSize); err != nil { - return false, err - } - - particleBytesSize := opSize - (4 + nameSize) - if err := cmd.readBytes(particleBytesSize); err != nil { - return false, err - } - } - } - return true, nil -} - -func (cmd *serverCommand) isRead() bool { - return true -} - -func (cmd *serverCommand) Execute() Error { - return cmd.execute(cmd) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/single_command.go b/aerospike-tls/vendor-aerospike-client-go/single_command.go deleted file mode 100644 index 9739288a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/single_command.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type singleCommand struct { - baseCommand - - cluster *Cluster - key *Key - partition *Partition -} - -func newSingleCommand(cluster *Cluster, key *Key, partition *Partition) singleCommand { - return singleCommand{ - baseCommand: baseCommand{}, - cluster: cluster, - key: key, - partition: partition, - } -} - -func (cmd *singleCommand) getConnection(policy Policy) (*Connection, Error) { - return cmd.node.getConnectionWithHint(policy.GetBasePolicy().deadline(), policy.GetBasePolicy().socketTimeout(), cmd.key.digest[0]) -} - -func (cmd *singleCommand) putConnection(conn *Connection) { - cmd.node.putConnectionWithHint(conn, cmd.key.digest[0]) -} - -func (cmd *singleCommand) emptySocket(conn *Connection) Error { - // There should not be any more bytes. - // Empty the socket to be safe. - sz := Buffer.BytesToInt64(cmd.dataBuffer, 0) - headerLength := cmd.dataBuffer[8] - receiveSize := int(sz&0xFFFFFFFFFFFF) - int(headerLength) - - // Read remaining message bytes. - if receiveSize > 0 { - if err := cmd.sizeBufferSz(receiveSize, false); err != nil { - return err - } - if _, err := conn.Read(cmd.dataBuffer, receiveSize); err != nil { - return err - } - } - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/statement.go b/aerospike-tls/vendor-aerospike-client-go/statement.go deleted file mode 100644 index a9d3857d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/statement.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "math/rand" - - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Statement encapsulates query statement parameters. -type Statement struct { - // Namespace determines query Namespace - Namespace string - - // SetName determines query Set name (Optional) - SetName string - - // IndexName determines query index name (Optional) - // If not set, the server will determine the index from the filter's bin name. - IndexName string - - // BinNames determines bin names (optional) - BinNames []string - - // Filter determines query index filter (Optional). - // This filter is applied to the secondary index on query. - // Query index filters must reference a bin which has a secondary index defined. - Filter *Filter - - packageName string - functionName string - functionArgs []Value - - // TaskId determines query task id. (Optional) - // This value is not used anymore and will be removed later. - TaskId uint64 - - // determines if the query should return data - ReturnData bool -} - -// NewStatement initializes a new Statement instance. -func NewStatement(ns string, set string, binNames ...string) *Statement { - return &Statement{ - Namespace: ns, - SetName: set, - BinNames: binNames, - ReturnData: true, - TaskId: rand.Uint64(), - } -} - -func (stmt *Statement) String() string { - return fmt.Sprintf("Statement: {Namespace: %s, set: %s, IndexName: %s, BinNames: %v, Filter: %s, UDF: %s.%s(%v), TaskId: %d, return data: %v}", - stmt.Namespace, - stmt.SetName, - stmt.IndexName, - stmt.BinNames, - stmt.Filter, - stmt.packageName, - stmt.functionName, - stmt.functionArgs, - stmt.TaskId, - stmt.ReturnData, - ) -} - -// SetFilter Sets a filter for the statement. -// Aerospike Server currently only supports using a single filter per statement/query. -func (stmt *Statement) SetFilter(filter *Filter) Error { - stmt.Filter = filter - - return nil -} - -// SetAggregateFunction sets aggregation function parameters. -// This function will be called on both the server -// and client for each selected item. -func (stmt *Statement) SetAggregateFunction(packageName string, functionName string, functionArgs []Value, returnData bool) { - stmt.packageName = packageName - stmt.functionName = functionName - stmt.functionArgs = functionArgs - stmt.ReturnData = returnData -} - -// IsScan determines is the Statement is a full namespace/set scan or a selective Query. -func (stmt *Statement) IsScan() bool { - return stmt.Filter == nil -} - -func (stmt *Statement) terminationError() types.ResultCode { - if stmt.IsScan() { - return types.SCAN_TERMINATED - } - return types.QUERY_TERMINATED -} - -// Always set the taskID client-side to a non-zero random value -func (stmt *Statement) prepare(returnData bool) { - stmt.ReturnData = returnData -} diff --git a/aerospike-tls/vendor-aerospike-client-go/task.go b/aerospike-tls/vendor-aerospike-client-go/task.go deleted file mode 100644 index c019ad4a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/task.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "time" - - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" - "github.com/aerospike/aerospike-client-go/v7/types" -) - -// Task interface defines methods for asynchronous tasks. -type Task interface { - IsDone() (bool, Error) - - onComplete(ifc Task) chan Error - OnComplete() chan Error -} - -// baseTask is used to poll for server task completion. -type baseTask struct { - retries atomic.Int - cluster *Cluster -} - -// newTask initializes task with fields needed to query server nodes. -func newTask(cluster *Cluster) *baseTask { - return &baseTask{ - cluster: cluster, - } -} - -// Wait for asynchronous task to complete using default sleep interval. -func (btsk *baseTask) onComplete(ifc Task) chan Error { - ch := make(chan Error, 1) - - // goroutine will loop every until IsDone() returns true or error - go func() { - // always close the channel on return - defer close(ch) - - var interval = 100 * time.Millisecond - - for { - time.Sleep(interval) - - done, err := ifc.IsDone() - // Every 5 failed retries increase the interval - if btsk.retries.IncrementAndGet()%5 == 0 { - interval *= 2 - - if interval > 5*time.Second { - interval = 5 * time.Second - } - } - if err != nil { - if err.Matches(types.TIMEOUT) { - err.markInDoubt(true) - } - ch <- err - return - } else if done { - ch <- nil - return - } - } // for - }() - - return ch -} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go b/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go deleted file mode 100644 index 9f648ae0..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/task_drop_index.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// DropIndexTask is used to poll for long running create index completion. -type DropIndexTask struct { - *baseTask - - namespace string - indexName string -} - -// NewDropIndexTask initializes a task with fields needed to query server nodes. -func NewDropIndexTask(cluster *Cluster, namespace string, indexName string) *DropIndexTask { - return &DropIndexTask{ - baseTask: newTask(cluster), - namespace: namespace, - indexName: indexName, - } -} - -// IsDone queries all nodes for task completion status. -func (tski *DropIndexTask) IsDone() (bool, Error) { - command := "sindex-exists:ns=" + tski.namespace + ";indexname=" + tski.indexName - nodes := tski.cluster.GetNodes() - complete := false - - for _, node := range nodes { - responseMap, err := node.requestInfoWithRetry(&tski.cluster.infoPolicy, 5, command) - if err != nil { - return false, err - } - - for _, response := range responseMap { - if response == "false" { - complete = true - continue - } - - return false, nil - } - } - return complete, nil -} - -// OnComplete returns a channel that will be closed as soon as the task is finished. -// If an error is encountered during operation, an error will be sent on the channel. -func (tski *DropIndexTask) OnComplete() chan Error { - return tski.onComplete(tski) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_index.go b/aerospike-tls/vendor-aerospike-client-go/task_index.go deleted file mode 100644 index 9149629b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/task_index.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "regexp" - "strconv" - "strings" -) - -// IndexTask is used to poll for long running create index completion. -type IndexTask struct { - *baseTask - - namespace string - indexName string -} - -// NewIndexTask initializes a task with fields needed to query server nodes. -func NewIndexTask(cluster *Cluster, namespace string, indexName string) *IndexTask { - return &IndexTask{ - baseTask: newTask(cluster), - namespace: namespace, - indexName: indexName, - } -} - -// IsDone queries all nodes for task completion status. -func (tski *IndexTask) IsDone() (bool, Error) { - command := "sindex/" + tski.namespace + "/" + tski.indexName - nodes := tski.cluster.GetNodes() - complete := false - - r := regexp.MustCompile(`\.*load_pct=(\d+)\.*`) - - for _, node := range nodes { - responseMap, err := node.requestInfoWithRetry(&tski.cluster.infoPolicy, 5, command) - if err != nil { - return false, err - } - - for _, response := range responseMap { - find := "load_pct=" - index := strings.Index(response, find) - - if index < 0 { - if tski.retries.Get() > 20 { - complete = true - } - continue - } - - matchRes := r.FindStringSubmatch(response) - // we know it exists and is a valid number - pct, _ := strconv.Atoi(matchRes[1]) - - if pct >= 0 && pct < 100 { - return false, nil - } - complete = true - } - } - return complete, nil -} - -// OnComplete returns a channel that will be closed as soon as the task is finished. -// If an error is encountered during operation, an error will be sent on the channel. -func (tski *IndexTask) OnComplete() chan Error { - return tski.onComplete(tski) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_register.go b/aerospike-tls/vendor-aerospike-client-go/task_register.go deleted file mode 100644 index 49ae2119..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/task_register.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "strings" -) - -// RegisterTask is used to poll for UDF registration completion. -type RegisterTask struct { - *baseTask - - packageName string -} - -// NewRegisterTask initializes a RegisterTask with fields needed to query server nodes. -func NewRegisterTask(cluster *Cluster, packageName string) *RegisterTask { - return &RegisterTask{ - baseTask: newTask(cluster), - packageName: packageName, - } -} - -// IsDone will query all nodes for task completion status. -func (tskr *RegisterTask) IsDone() (bool, Error) { - command := "udf-list" - nodes := tskr.cluster.GetNodes() - done := false - - for _, node := range nodes { - responseMap, err := node.requestInfoWithRetry(&tskr.cluster.infoPolicy, 5, command) - if err != nil { - return false, err - } - - for _, response := range responseMap { - find := "filename=" + tskr.packageName - index := strings.Index(response, find) - - if index < 0 { - return false, nil - } - done = true - } - } - return done, nil -} - -// OnComplete returns a channel that will be closed as soon as the task is finished. -// If an error is encountered during operation, an error will be sent on the channel. -func (tskr *RegisterTask) OnComplete() chan Error { - return tskr.onComplete(tskr) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/task_remove.go b/aerospike-tls/vendor-aerospike-client-go/task_remove.go deleted file mode 100644 index 17d86a7c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/task_remove.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "strings" -) - -// RemoveTask is used to poll for UDF registration completion. -type RemoveTask struct { - *baseTask - - packageName string -} - -// NewRemoveTask initializes a RemoveTask with fields needed to query server nodes. -func NewRemoveTask(cluster *Cluster, packageName string) *RemoveTask { - return &RemoveTask{ - baseTask: newTask(cluster), - packageName: packageName, - } -} - -// IsDone will query all nodes for task completion status. -func (tskr *RemoveTask) IsDone() (bool, Error) { - command := "udf-list" - nodes := tskr.cluster.GetNodes() - done := false - - find := "filename=" + tskr.packageName - for _, node := range nodes { - responseMap, err := node.requestInfoWithRetry(&tskr.cluster.infoPolicy, 5, command) - if err != nil { - return false, err - } - - for _, response := range responseMap { - index := strings.Index(response, find) - - if index >= 0 { - return false, nil - } - done = true - } - } - return done, nil -} - -// OnComplete returns a channel that will be closed as soon as the task is finished. -// If an error is encountered during operation, an error will be sent on the channel. -func (tskr *RemoveTask) OnComplete() chan Error { - return tskr.onComplete(tskr) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua b/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua deleted file mode 100644 index 053e3ca1..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/test/resources/average.lua +++ /dev/null @@ -1,18 +0,0 @@ -function average(s, name) - - local function mapper(out, rec) - out['sum'] = (out['sum'] or 0) + (rec[name] or 0) - out['count'] = (out['count'] or 0) + 1 - return out - end - - local function reducer(a, b) - local out = map() - - out['sum'] = a['sum'] + b['sum'] - out['count'] = a['count'] + b['count'] - return out - end - - return s : aggregate(map{sum = 0, count = 0}, mapper) : reduce(reducer) -end diff --git a/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua b/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua deleted file mode 100644 index d273521e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/test/resources/sum_single_bin.lua +++ /dev/null @@ -1,11 +0,0 @@ -local function reducer(val1,val2) - return val1 + val2 -end - -function sum_single_bin(stream,name) - local function mapper(rec) - return rec[name] - end - - return stream : map(mapper) : reduce(reducer) -end diff --git a/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go b/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go deleted file mode 100644 index a46c8791..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/test_utils_test.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "log" - "math/rand" - "net" - "reflect" - - gm "github.com/onsi/gomega" -) - -type testBLOB struct { - name string -} - -func (tb *testBLOB) EncodeBlob() ([]byte, error) { - return []byte(tb.name), nil -} - -// generates a random string of specified length -func randString(size int) string { - const random_alpha_num = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - const l = 62 - buf := make([]byte, size) - for i := 0; i < size; i++ { - buf[i] = random_alpha_num[rand.Intn(l)] - } - return string(buf) -} - -func normalizeValue(v interface{}, isMapKey bool) interface{} { - if v != nil { - switch v.(type) { - case int8, int16, int32, int, int64: - return reflect.ValueOf(v).Int() - case uint8, uint16, uint32, uint: - return int64(reflect.ValueOf(v).Uint()) - } - - // check for array and map - switch reflect.TypeOf(v).Kind() { - case reflect.Array: - if isMapKey { - return v - } - return sliceToIfcSlice(v) - case reflect.Slice: - return sliceToIfcSlice(v) - case reflect.Map: - return mapToIfcMap(v) - } - - return v - } - - return nil -} - -func mapToIfcMap(v interface{}) map[interface{}]interface{} { - s := reflect.ValueOf(v) - l := s.Len() - res := make(map[interface{}]interface{}, l) - for _, k := range s.MapKeys() { - v := s.MapIndex(k).Interface() - res[normalizeValue(k.Interface(), true)] = normalizeValue(v, false) - } - - return res -} - -func sliceToIfcSlice(v interface{}) []interface{} { - s := reflect.ValueOf(v) - l := s.Len() - res := make([]interface{}, l) - for i := 0; i < l; i++ { - t := s.Index(i).Interface() - res[i] = normalizeValue(t, false) - } - - return res -} - -func arraysEqual(ia, ib interface{}) { - a := sliceToIfcSlice(ia) - b := sliceToIfcSlice(ib) - - gm.Expect(len(a)).To(gm.Equal(len(b))) - // gm.Expect(a).To(gm.BeEquivalentTo(b)) - - for i := range a { - switch reflect.ValueOf(a[i]).Kind() { - case reflect.Map: - mapsEqual(a[i], b[i]) - case reflect.Slice: - arraysEqual(a[i], b[i]) - default: - if a[i] != nil { - gm.Expect(a[i]).To(gm.BeEquivalentTo(b[i])) - } else { - gm.Expect(b[i]).To(gm.BeNil()) - } - } - } -} - -func mapsEqual(ia, ib interface{}) { - a := mapToIfcMap(ia) - b := mapToIfcMap(ib) - - gm.Expect(len(a)).To(gm.Equal(len(b))) - gm.Expect(a).To(gm.BeEquivalentTo(b)) -} - -func getOutboundIP() net.IP { - conn, err := net.Dial("udp", "8.8.8.8:80") - if err != nil { - log.Fatal(err) - } - defer conn.Close() - - localAddr := conn.LocalAddr().(*net.UDPAddr) - - return localAddr.IP -} diff --git a/aerospike-tls/vendor-aerospike-client-go/touch_command.go b/aerospike-tls/vendor-aerospike-client-go/touch_command.go deleted file mode 100644 index fe0723ab..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/touch_command.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - - "github.com/aerospike/aerospike-client-go/v7/logger" - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// guarantee touchCommand implements command interface -var _ command = &touchCommand{} - -type touchCommand struct { - singleCommand - - policy *WritePolicy -} - -func newTouchCommand(cluster *Cluster, policy *WritePolicy, key *Key) (touchCommand, Error) { - var err Error - var partition *Partition - if cluster != nil { - partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) - if err != nil { - return touchCommand{}, err - } - } - - newTouchCmd := touchCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - policy: policy, - } - - return newTouchCmd, nil -} - -func (cmd *touchCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *touchCommand) writeBuffer(ifc command) Error { - return cmd.setTouch(cmd.policy, cmd.key) -} - -func (cmd *touchCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeWrite(cmd.cluster) -} - -func (cmd *touchCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryWrite(isTimeout) - return true -} - -func (cmd *touchCommand) parseResult(ifc command, conn *Connection) Error { - // Read header. - _, err := conn.Read(cmd.dataBuffer, 8) - if err != nil { - return err - } - - if compressedSize := cmd.compressedSize(); compressedSize > 0 { - // Read compressed size - _, err = conn.Read(cmd.dataBuffer, compressedSize) - if err != nil { - logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) - return err - } - - // Read compressed size - _, err = conn.Read(cmd.dataBuffer, 8) - if err != nil { - logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) - return err - } - - if err = cmd.conn.initInflater(true, compressedSize); err != nil { - return newError(types.PARSE_ERROR, fmt.Sprintf("Error setting up zlib inflater for size `%d`: %s", compressedSize, err.Error())) - } - - // Read header. - _, err = conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)) - if err != nil { - logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) - return err - } - } else { - // Read header. - _, err = conn.Read(cmd.dataBuffer[8:], int(_MSG_TOTAL_HEADER_SIZE)-8) - if err != nil { - logger.Logger.Debug("Connection error reading data for TouchCommand: %s", err.Error()) - return err - } - } - - // Read header. - header := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(header); err != nil { - return err - } - - resultCode := cmd.dataBuffer[13] & 0xFF - - if resultCode != 0 { - if resultCode == byte(types.KEY_NOT_FOUND_ERROR) { - return ErrKeyNotFound.err() - } else if types.ResultCode(resultCode) == types.FILTERED_OUT { - return ErrFilteredOut.err() - } - - return newError(types.ResultCode(resultCode)) - } - return cmd.emptySocket(conn) -} - -func (cmd *touchCommand) isRead() bool { - return false -} - -func (cmd *touchCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *touchCommand) transactionType() transactionType { - return ttPut -} diff --git a/aerospike-tls/vendor-aerospike-client-go/truncate_test.go b/aerospike-tls/vendor-aerospike-client-go/truncate_test.go deleted file mode 100644 index 94ed72fe..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/truncate_test.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "math/rand" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("Truncate operations test", func() { - - gg.BeforeEach(func() { - if *proxy { - gg.Skip("Not supported in Proxy Client") - } - }) - - gg.Context("Truncate", func() { - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - wpolicy.SendKey = true - - const keyCount = 1000 - bin1 := as.NewBin("Aerospike1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("Aerospike2", randString(100)) - - gg.BeforeEach(func() { - err := client.Truncate(nil, ns, set, nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - for i := 0; i < keyCount; i++ { - key, err = as.NewKey(ns, set, i) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Operate(wpolicy, key, as.PutOp(bin1), as.PutOp(bin2), as.GetOp()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - var countRecords = func(namespace, setName string) int { - stmt := as.NewStatement(namespace, setName) - res, err := client.Query(nil, stmt) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - cnt := 0 - for rec := range res.Results() { - gm.Expect(rec.Err).ToNot(gm.HaveOccurred()) - cnt++ - } - - return cnt - } - - gg.It("must truncate only the current set", func() { - gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) - - err := client.Truncate(nil, ns, set, nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - gm.Expect(countRecords(ns, set)).To(gm.Equal(0)) - }) - - gg.It("must truncate the whole namespace", func() { - gm.Expect(countRecords(ns, "")).ToNot(gm.Equal(0)) - - err := client.Truncate(nil, ns, "", nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(time.Second) - gm.Expect(countRecords(ns, "")).To(gm.Equal(0)) - }) - - gg.It("must truncate only older records", func() { - time.Sleep(1 * time.Second) - t := time.Now() - time.Sleep(1 * time.Second) - - gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) - - for i := keyCount; i < 2*keyCount; i++ { - key, err = as.NewKey(ns, set, i) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - _, err = client.Operate(wpolicy, key, as.PutOp(bin1), as.PutOp(bin2), as.GetOp()) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - gm.Expect(countRecords(ns, set)).To(gm.Equal(2 * keyCount)) - - err := client.Truncate(nil, ns, set, &t) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(3 * time.Second) - gm.Expect(countRecords(ns, set)).To(gm.Equal(keyCount)) - }) - - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/epoc.go b/aerospike-tls/vendor-aerospike-client-go/types/epoc.go deleted file mode 100644 index 52776160..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/epoc.go +++ /dev/null @@ -1,30 +0,0 @@ -package types - -import ( - "math" - "time" -) - -const ( - // CITRUSLEAF_EPOCH defines the citrusleaf epoc: Jan 01 2010 00:00:00 GMT - CITRUSLEAF_EPOCH = 1262304000 -) - -// TTL converts an Expiration time from citrusleaf epoc to TTL in seconds. -func TTL(secsFromCitrusLeafEpoc uint32) uint32 { - switch secsFromCitrusLeafEpoc { - // don't convert magic values - case 0: // when set to don't expire, this value is returned - return math.MaxUint32 - default: - // Record may not have expired on server, but delay or clock differences may - // cause it to look expired on client. Floor at 1, not 0, to avoid old - // "never expires" interpretation. - now := time.Now().Unix() - expiration := int64(CITRUSLEAF_EPOCH + secsFromCitrusLeafEpoc) - if (expiration < 0 && now >= 0) || expiration > now { - return uint32(expiration - now) - } - return 1 - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go deleted file mode 100644 index 48ea8824..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/histogram/bench_histogram_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2014-2024 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package histogram_test - -import ( - "testing" - - "github.com/aerospike/aerospike-client-go/v7/types/histogram" -) - -var ( - _median int - _medianu64 uint64 -) - -func Benchmark_Histogram_Linear_Add(b *testing.B) { - h := histogram.New[int](histogram.Linear, 5, 10) - for i := 0; i < b.N; i++ { - h.Add(i) - } -} - -func Benchmark_Histogram_Linear_Median(b *testing.B) { - h := histogram.New[int](histogram.Linear, 50, 101) - for i := 0; i < 10000; i++ { - h.Add(i) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _median = h.Median() - } -} - -func Benchmark_Histogram_Log_Add(b *testing.B) { - h := histogram.NewExponential[int](2, 10) - for i := 0; i < b.N; i++ { - h.Add(i) - } -} - -func Benchmark_Histogram_Log_Median(b *testing.B) { - h := histogram.NewExponential[int](2, 32) - for i := 0; i < 100000; i++ { - h.Add(i) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _median = h.Median() - } -} - -func Benchmark_Histogram_Log2_Add(b *testing.B) { - h := histogram.NewLog2(10) - for i := 0; i < b.N; i++ { - h.Add(uint64(i)) - } -} - -func Benchmark_Histogram_Log2_Median(b *testing.B) { - h := histogram.NewLog2(32) - for i := 0; i < 100000; i++ { - h.Add(uint64(i)) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - _medianu64 = h.Median() - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go deleted file mode 100644 index bf2cb7a8..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2014-2024 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package histogram - -import ( - "errors" - "fmt" - "math" - "strings" -) - -type Type byte - -const ( - Linear Type = iota - Logarithmic -) - -type hvals interface { - ~int | ~uint | - ~int64 | ~int32 | ~int16 | ~int8 | - ~uint64 | ~uint32 | ~uint16 | ~uint8 | - ~float64 | ~float32 -} - -type Histogram[T hvals] struct { - htype Type - base T - - Buckets []uint64 `json:"buckets"` // slot -> count - Min T `json:"min"` - Max T `json:"max"` - Sum float64 `json:"sum"` - Count uint64 `json:"count"` -} - -func New[T hvals](htype Type, base T, buckets int) *Histogram[T] { - return &Histogram[T]{ - htype: htype, - base: base, - Buckets: make([]uint64, buckets), - } -} - -func NewLinear[T hvals](base T, buckets int) *Histogram[T] { - return &Histogram[T]{ - htype: Linear, - base: base, - Buckets: make([]uint64, buckets), - } -} - -func NewExponential[T hvals](base T, buckets int) *Histogram[T] { - return &Histogram[T]{ - htype: Logarithmic, - base: base, - Buckets: make([]uint64, buckets), - } -} - -func (h *Histogram[T]) Reset() { - for i := range h.Buckets { - h.Buckets[i] = 0 - } - - h.Min = 0 - h.Max = 0 - h.Sum = 0 - h.Count = 0 -} - -func (h *Histogram[T]) Reshape(htype Type, base T, buckets int) { - if h.htype == htype && h.base == base && len(h.Buckets) == buckets { - return - } - - h.htype = htype - h.base = base - h.Buckets = make([]uint64, buckets) - - h.Min = 0 - h.Max = 0 - h.Sum = 0 - h.Count = 0 -} - -func (h *Histogram[T]) String() string { - res := new(strings.Builder) - switch h.htype { - case Linear: - for i := 0; i < len(h.Buckets)-1; i++ { - v := float64(h.base) * float64(i) - fmt.Fprintf(res, "[%v, %v) => %d\n", v, v+float64(h.base), h.Buckets[i]) - } - fmt.Fprintf(res, "[%v, inf) => %d\n", float64(h.base)*float64(len(h.Buckets)-1), h.Buckets[len(h.Buckets)-1]) - case Logarithmic: - fmt.Fprintf(res, "[0, %v) => %d\n", float64(h.base), h.Buckets[0]) - for i := 1; i < len(h.Buckets)-1; i++ { - v := math.Pow(float64(h.base), float64(i)) - fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*float64(h.base), h.Buckets[i]) - } - fmt.Fprintf(res, "[%v, inf) => %d\n", math.Pow(float64(h.base), float64(len(h.Buckets))-1), h.Buckets[len(h.Buckets)-1]) - } - return res.String() -} - -func (h *Histogram[T]) Clone() *Histogram[T] { - b := make([]uint64, len(h.Buckets)) - copy(b, h.Buckets) - return &Histogram[T]{ - htype: h.htype, - base: h.base, - - Buckets: b, - Min: h.Min, - Max: h.Max, - Sum: h.Sum, - Count: h.Count, - } -} - -func (h *Histogram[T]) CloneAndReset() *Histogram[T] { - res := h.Clone() - h.Reset() - return res -} - -func (h *Histogram[T]) Merge(other *Histogram[T]) error { - if h.base != other.base || h.htype != other.htype || len(h.Buckets) != len(other.Buckets) { - return errors.New("Histograms to not match") - } - - if other.Min < h.Min || h.Min == 0 { - h.Min = other.Min - } - - if other.Max > h.Max { - h.Max = other.Max - } - - h.Sum += other.Sum - h.Count += uint64(other.Count) - - for i := range h.Buckets { - h.Buckets[i] += other.Buckets[i] - } - - return nil -} - -func (h *Histogram[T]) Average() float64 { - if h.Count > 0 { - return h.Sum / float64(h.Count) - } - return 0 -} - -func (h *Histogram[T]) Median() T { - var s uint64 = 0 - c := h.Count / 2 - for i, bv := range h.Buckets { - s += bv - if s >= c { - // found the bucket - if h.htype == Linear { - return T(i+1) * h.base - } - return T(math.Pow(float64(h.base), float64(i+1))) - } - } - return h.Max -} - -func (h *Histogram[T]) Add(v T) { - if h.Count == 0 { - h.Max = v - h.Min = v - } else { - if v > h.Max { - h.Max = v - } else if v < h.Min { - h.Min = v - } - } - - h.Sum += float64(v) - h.Count++ - - var slot int - if v > 0 { - switch h.htype { - case Linear: - slot = int(math.Floor(float64(v / T(h.base)))) - case Logarithmic: - slot = int(math.Floor(math.Log(float64(v)) / math.Log(float64(h.base)))) - } - } - - if slot >= len(h.Buckets) { - h.Buckets[len(h.Buckets)-1]++ - } else if slot < 0 { - h.Buckets[0]++ - } else { - h.Buckets[slot]++ - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go deleted file mode 100644 index 6b231ee2..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/histogram/histogram_test.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2014-2024 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package histogram_test - -import ( - "testing" - - "github.com/aerospike/aerospike-client-go/v7/types/histogram" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func TestHistogram(t *testing.T) { - gm.RegisterFailHandler(gg.Fail) - gg.RunSpecs(t, "Histogram Suite") -} - -var _ = gg.Describe("Histogram", func() { - - gg.Context("Integer Values", func() { - - gg.Context("Linear", func() { - - gg.It("must make the correct histogram", func() { - l := []int{1, 1, 3, 4, 5, 5, 9, 11, 11, 11, 16, 16, 21} - h := histogram.New[int](histogram.Linear, 5, 5) - - sum := 0 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(1)) - gm.Expect(h.Max).To(gm.Equal(21)) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(float64(sum))) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{4, 3, 3, 2, 1})) - }) - - gg.It("must find the correct median", func() { - l := []int{1e3, 2e3, 3e3, 4e3, 5e3, 6e3, 7e3, 8e3, 9e3, 10e3, 11e3, 12e3, 13e3} - h := histogram.New[int](histogram.Linear, 1000, 10) - - sum := 0 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(1000)) - gm.Expect(h.Max).To(gm.Equal(13000)) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(float64(sum))) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 1, 1, 1, 1, 1, 1, 1, 1, 5})) - gm.Expect(h.Median()).To(gm.Equal(7000)) - }) - - }) - - gg.Context("Exponential", func() { - - gg.It("must make the correct histogram", func() { - l := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} - h := histogram.New[int](histogram.Logarithmic, 2, 5) - - sum := 0 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(0)) - gm.Expect(h.Max).To(gm.Equal(20)) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(float64(sum))) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{2, 2, 4, 8, 5})) - }) - - gg.It("must make the correct histogram on barriers", func() { - l := []int{0, 1, 2, 3, 4, 5, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 129, 255, 256, 257, 511, 512, 513, 1023, 1024, 1025} - h := histogram.New[int](histogram.Logarithmic, 4, 8) - - sum := 0 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(0)) - gm.Expect(h.Max).To(gm.Equal(1025)) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(float64(sum))) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{4, 6, 6, 6, 6, 2, 0, 0})) - }) - - gg.It("must find the correct median", func() { - l := []int{10e3, 12e3, 3e3, 4e3, 50e3, 6e5, 75e3, 7e3, 21e3, 11e3, 113e3, 29e3, 189e3} - h := histogram.New[int](histogram.Logarithmic, 2, 18) - - sum := 0 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(int(3e3))) - gm.Expect(h.Max).To(gm.Equal(int(600e3))) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(float64(sum))) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 1, 2, 2})) - gm.Expect(h.Median()).To(gm.Equal(1 << 14)) - }) - }) - - gg.Context("Log2Histogram", func() { - - gg.It("must make the correct histogram", func() { - l := []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} - h := histogram.NewLog2(5) - - var sum uint64 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(uint64(0))) - gm.Expect(h.Max).To(gm.Equal(uint64(20))) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(sum)) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{2, 2, 4, 8, 5})) - }) - - gg.It("must find the correct median", func() { - l := []uint64{10e3, 12e3, 3e3, 4e3, 50e3, 6e5, 75e3, 7e3, 21e3, 11e3, 113e3, 29e3, 189e3} - h := histogram.NewLog2(18) - - var sum uint64 - for _, v := range l { - sum += v - h.Add(v) - } - - gm.Expect(h.Min).To(gm.Equal(uint64(3000))) - gm.Expect(h.Max).To(gm.Equal(uint64(600000))) - gm.Expect(uint64(h.Count)).To(gm.Equal(uint64(len(l)))) - gm.Expect(h.Sum).To(gm.Equal(sum)) - gm.Expect(h.Buckets).To(gm.Equal([]uint64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 3, 2, 1, 2, 2})) - gm.Expect(h.Median()).To(gm.Equal(uint64(1 << 14))) - }) - }) - }) -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go deleted file mode 100644 index b81cc055..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/histogram/log2hist.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2014-2024 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package histogram - -import ( - "fmt" - "strings" -) - -type Log2 struct { - Buckets []uint64 // slot -> count - Min, Max uint64 - Sum uint64 - Count uint64 -} - -func NewLog2(buckets int) *Log2 { - return &Log2{ - Buckets: make([]uint64, buckets), - } -} - -func (h *Log2) Reset() { - for i := range h.Buckets { - h.Buckets[i] = 0 - } - - h.Min = 0 - h.Max = 0 - h.Sum = 0 - h.Count = 0 -} - -func (h *Log2) String() string { - res := new(strings.Builder) - - fmt.Fprintf(res, "[0, %v) => %d\n", 2, h.Buckets[0]) - for i := 1; i < len(h.Buckets)-1; i++ { - v := 2 << i - fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*2, h.Buckets[i]) - } - fmt.Fprintf(res, "[%v, inf) => %d\n", 2<= c { - return 1 << (i + 1) - } - } - return h.Max -} - -func (h *Log2) Add(v uint64) { - if h.Count == 0 { - h.Max = v - h.Min = v - } else { - if v > h.Max { - h.Max = v - } else if v < h.Min { - h.Min = v - } - } - - h.Sum += v - h.Count++ - - var slot int - if v > 0 { - slot = fastLog2(v) - } - - if slot >= len(h.Buckets) { - h.Buckets[len(h.Buckets)-1]++ - } else if slot < 0 { - h.Buckets[0]++ - } else { - h.Buckets[slot]++ - } -} - -/////////////////////////////////////////////////////////////////// - -var log2tab64 = [64]int8{ - 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, 61, - 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, 62, - 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, 56, - 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5, 63, -} - -// FastLog2 implements the FastLog2 function for uint64 values. -func fastLog2(value uint64) int { - value |= value >> 1 - value |= value >> 2 - value |= value >> 4 - value |= value >> 8 - value |= value >> 16 - value |= value >> 32 - - return int(log2tab64[(value*0x03f6eaf2cd271461)>>58]) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go b/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go deleted file mode 100644 index 45d2da76..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/histogram/sync_histogram.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2014-2024 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package histogram - -import ( - "errors" - "fmt" - "math" - "strings" - "sync" -) - -type SyncHistogram[T hvals] struct { - l sync.RWMutex - htype Type - base T - - Buckets []uint64 `json:"buckets"` // slot -> count - Min T `json:"min"` - Max T `json:"max"` - Sum float64 `json:"sum"` - Count uint64 `json:"count"` -} - -func NewSync[T hvals](htype Type, base T, buckets int) *SyncHistogram[T] { - return &SyncHistogram[T]{ - htype: htype, - base: base, - Buckets: make([]uint64, buckets), - } -} - -func (h *SyncHistogram[T]) Reset() { - h.l.Lock() - for i := range h.Buckets { - h.Buckets[i] = 0 - } - - h.Min = 0 - h.Max = 0 - h.Sum = 0 - h.Count = 0 - h.l.Unlock() -} - -func (h *SyncHistogram[T]) Reshape(htype Type, base T, buckets int) { - h.l.Lock() - if h.htype == htype && h.base == base && len(h.Buckets) == buckets { - h.l.Unlock() - return - } - - h.htype = htype - h.base = base - h.Buckets = make([]uint64, buckets) - h.l.Unlock() -} - -func (h *SyncHistogram[T]) String() string { - h.l.RLock() - res := new(strings.Builder) - switch h.htype { - case Linear: - for i := 0; i < len(h.Buckets)-1; i++ { - v := float64(h.base) * float64(i) - fmt.Fprintf(res, "[%v, %v) => %d\n", v, v+float64(h.base), h.Buckets[i]) - } - fmt.Fprintf(res, "[%v, inf) => %d\n", float64(h.base)*float64(len(h.Buckets)-1), h.Buckets[len(h.Buckets)-1]) - case Logarithmic: - fmt.Fprintf(res, "[0, %v) => %d\n", float64(h.base), h.Buckets[0]) - for i := 1; i < len(h.Buckets)-1; i++ { - v := math.Pow(float64(h.base), float64(i)) - fmt.Fprintf(res, "[%v, %v) => %d\n", v, v*float64(h.base), h.Buckets[i]) - } - fmt.Fprintf(res, "[%v, inf) => %d\n", math.Pow(float64(h.base), float64(len(h.Buckets))-1), h.Buckets[len(h.Buckets)-1]) - } - h.l.RUnlock() - return res.String() -} - -func (h *SyncHistogram[T]) Clone() *SyncHistogram[T] { - h.l.Lock() - b := make([]uint64, len(h.Buckets)) - copy(b, h.Buckets) - res := &SyncHistogram[T]{ - htype: h.htype, - base: h.base, - - Buckets: b, - Min: h.Min, - Max: h.Max, - Sum: h.Sum, - Count: h.Count, - } - h.l.Unlock() - return res -} - -func (h *SyncHistogram[T]) CloneAndReset() *SyncHistogram[T] { - h.l.Lock() - b := make([]uint64, len(h.Buckets)) - copy(b, h.Buckets) - res := &SyncHistogram[T]{ - htype: h.htype, - base: h.base, - - Buckets: b, - Min: h.Min, - Max: h.Max, - Sum: h.Sum, - Count: h.Count, - } - - // Reset - for i := range h.Buckets { - h.Buckets[i] = 0 - } - - h.Min = 0 - h.Max = 0 - h.Sum = 0 - h.Count = 0 - h.l.Unlock() - return res -} - -func (h *SyncHistogram[T]) Merge(other *SyncHistogram[T]) error { - h.l.Lock() - other.l.RLock() - if h.base != other.base || h.htype != other.htype || len(h.Buckets) != len(other.Buckets) { - other.l.RUnlock() - h.l.Unlock() - return errors.New("Histograms to not match") - } - - if other.Min < h.Min || h.Min == 0 { - h.Min = other.Min - } - - if other.Max > h.Max { - h.Max = other.Max - } - - h.Sum += other.Sum - h.Count += uint64(other.Count) - - for i := range h.Buckets { - h.Buckets[i] += other.Buckets[i] - } - other.l.RUnlock() - h.l.Unlock() - - return nil -} - -func (h *SyncHistogram[T]) Average() float64 { - h.l.RLock() - if h.Count > 0 { - res := h.Sum / float64(h.Count) - h.l.RUnlock() - return res - } - h.l.RUnlock() - return 0 -} - -func (h *SyncHistogram[T]) Median() T { - h.l.RLock() - var s uint64 = 0 - c := h.Count / 2 - for i, bv := range h.Buckets { - s += bv - if s >= c { - // found the bucket - if h.htype == Linear { - res := T(i+1) * h.base - h.l.RUnlock() - return res - } - res := T(math.Pow(float64(h.base), float64(i+1))) - h.l.RUnlock() - return res - } - } - res := h.Max - h.l.RUnlock() - return res -} - -func (h *SyncHistogram[T]) Add(v T) { - h.l.Lock() - if h.Count == 0 { - h.Max = v - h.Min = v - } else { - if v > h.Max { - h.Max = v - } else if v < h.Min { - h.Min = v - } - } - - h.Sum += float64(v) - h.Count++ - - var slot int - if v > 0 { - switch h.htype { - case Linear: - slot = int(math.Floor(float64(v / T(h.base)))) - case Logarithmic: - slot = int(math.Floor(math.Log(float64(v)) / math.Log(float64(h.base)))) - } - } - - if slot >= len(h.Buckets) { - h.Buckets[len(h.Buckets)-1]++ - } else if slot < 0 { - h.Buckets[0]++ - } else { - h.Buckets[slot]++ - } - h.l.Unlock() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/message.go b/aerospike-tls/vendor-aerospike-client-go/types/message.go deleted file mode 100644 index 145e42ce..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/message.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "bytes" - "encoding/binary" - "fmt" -) - -type messageType uint8 - -const ( - // MSG_HEADER_SIZE is a message's header size - MSG_HEADER_SIZE = 8 - - // MSG_INFO defines an info message - MSG_INFO messageType = 1 - // MSG_MESSAGE defines an info message - MSG_MESSAGE = 3 -) - -// MessageHeader is the message's header -type MessageHeader struct { - Version uint8 - Type uint8 - DataLen [6]byte -} - -// Length returns the length of the message -func (msg *MessageHeader) Length() int64 { - return msgLenFromBytes(msg.DataLen) -} - -// Message encapsulates a message sent or received from the Aerospike server -type Message struct { - MessageHeader - - Data []byte -} - -// NewMessage generates a new Message instance. -func NewMessage(mtype messageType, data []byte) *Message { - return &Message{ - MessageHeader: MessageHeader{ - Version: uint8(2), - Type: uint8(mtype), - DataLen: msgLenToBytes(int64(len(data))), - }, - Data: data, - } -} - -const maxAllowedBufferSize = 64 * 1024 * 1024 // 64MiB max - -// Resize changes the internal buffer size for the message. -func (msg *Message) Resize(newSize int64) error { - if newSize > maxAllowedBufferSize || newSize < 0 { - return fmt.Errorf("Requested new buffer size is invalid. Requested: %d, allowed: 0..%d", newSize, maxAllowedBufferSize) - } - if int64(len(msg.Data)) == newSize { - return nil - } - msg.Data = make([]byte, newSize) - return nil -} - -// Serialize returns a byte slice containing the message. -func (msg *Message) Serialize() ([]byte, error) { - msg.DataLen = msgLenToBytes(int64(len(msg.Data))) - buf := bytes.NewBuffer([]byte{}) - if err := binary.Write(buf, binary.BigEndian, msg.MessageHeader); err != nil { - return nil, err - } - if err := binary.Write(buf, binary.BigEndian, msg.Data[:]); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -func msgLenFromBytes(buf [6]byte) int64 { - nbytes := append([]byte{0, 0}, buf[:]...) - DataLen := binary.BigEndian.Uint64(nbytes) - return int64(DataLen) -} - -// converts a -func msgLenToBytes(DataLen int64) [6]byte { - b := make([]byte, 8) - binary.BigEndian.PutUint64(b, uint64(DataLen)) - res := [6]byte{} - copy(res[:], b[2:]) - return res -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go b/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go deleted file mode 100644 index 292c5841..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/particle_type/particle_type.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package particleType - -// Server particle types. Unsupported types are commented out. -const ( - //revive:disable - NULL = 0 - INTEGER = 1 - FLOAT = 2 - STRING = 3 - BLOB = 4 - DIGEST = 6 - BOOL = 17 - HLL = 18 - MAP = 19 - LIST = 20 - LDT = 21 - GEOJSON = 23 - //revive:enable -) diff --git a/aerospike-tls/vendor-aerospike-client-go/types/pool.go b/aerospike-tls/vendor-aerospike-client-go/types/pool.go deleted file mode 100644 index ddcfd71c..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/pool.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import ( - "github.com/aerospike/aerospike-client-go/v7/internal/atomic" -) - -// Pool implements a general purpose fixed-size pool. -type Pool struct { - pool *atomic.Queue - - // New will create a new object - New func(params ...interface{}) interface{} - // IsUsable checks if the object polled from the pool is still fresh and usable - IsUsable func(obj interface{}, params ...interface{}) bool - // CanReturn checkes if the object is eligible to go back to the pool - CanReturn func(obj interface{}) bool - // Finalize will be called when an object is not eligible to go back to the pool. - // Usable to close connections, file handles, ... - Finalize func(obj interface{}) -} - -// NewPool creates a new fixed size pool. -func NewPool(poolSize int) *Pool { - return &Pool{ - pool: atomic.NewQueue(poolSize), - } -} - -// Get returns an element from the pool. -// If the pool is empty, or the returned element is not usable, -// nil or the result of the New function will be returned -func (bp *Pool) Get(params ...interface{}) interface{} { - res := bp.pool.Poll() - if res == nil || (bp.IsUsable != nil && !bp.IsUsable(res, params...)) { - // not usable, so finalize - if res != nil && bp.Finalize != nil { - bp.Finalize(res) - } - - if bp.New != nil { - res = bp.New(params...) - } - } - - return res -} - -// Put will add the elem back to the pool, unless the pool is full. -func (bp *Pool) Put(obj interface{}) { - finalize := true - if bp.CanReturn == nil || bp.CanReturn(obj) { - finalize = !bp.pool.Offer(obj) - } - - if finalize && bp.Finalize != nil { - bp.Finalize(obj) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go b/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go deleted file mode 100644 index 5cbef9db..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/pool/buffer_pool_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2014-2021 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pool - -import ( - "math/rand" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -var _ = gg.Describe("BufferPool Test", func() { - - const ( - Min = 1 << 10 - Max = 1 << 16 - ) - - gg.Context("Any size Buffer Pool", func() { - bp := NewTieredBufferPool(Min, Max) - check := func(sz int) { - buf := bp.Get(sz) - - gm.Expect(len(buf)).To(gm.BeNumerically(">=", sz)) - if sz <= Max { - if powerOf2(sz) { - gm.Expect(len(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))))) - gm.Expect(cap(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))))) - } else { - gm.Expect(len(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))+1))) - gm.Expect(cap(buf)).To(gm.BeNumerically("==", 1<<(fastLog2(uint64(sz))+1))) - } - } else { - gm.Expect(len(buf)).To(gm.BeNumerically("==", sz)) - } - bp.Put(buf) - } - - gg.It("should return a buffer with correct size", func() { - bp = NewTieredBufferPool(Min, Max) - - for i := 1; i < 24; i++ { - check(1<= 0 && szl < len(bp.pools) { - return szl - } - return -1 -} - -// Get returns a buffer from the pool. If sz is bigger than maxBufferSize, -// a fresh buffer will be created and not taken from the pool. -func (bp *TieredBufferPool) Get(sz int) []byte { - // Short circuit. We know we don't have buffers this size in the pool. - if sz > bp.Max { - return make([]byte, sz, sz) - } - - // do not allocate buffers smaller than a certain size - if sz < bp.Min { - sz = bp.Min - } - - if szl := bp.poolIndex(sz); szl >= 0 { - res := bp.pools[szl].Get().([]byte) - origLen := 1 << (szl + 1) - return res[:origLen] // return the slice to its max capacity - } - - // this line will never be reached, but Go would complain if omitted - return make([]byte, sz, sz) -} - -// Put will put the buffer back in the pool, unless cap(buf) is smaller than Min -// or larger than Max, or the size of the buffer is not a power of 2 -// in which case it will be thrown away. -func (bp *TieredBufferPool) Put(buf []byte) { - sz := cap(buf) - // throw away random non-power of 2 buffer sizes - if len(buf) > bp.Min && len(buf) <= bp.Max && powerOf2(sz) { - if szl := bp.poolIndex(sz); szl >= 0 { - bp.pools[szl].Put(buf) - return - } - } -} - -/////////////////////////////////////////////////////////////////// - -// powerOf2 returns true if a number is an EXACT power of 2. -func powerOf2(sz int) bool { - return sz > 0 && (sz&(sz-1)) == 0 -} - -var log2tab64 = [64]int8{ - 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3, 61, - 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4, 62, - 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21, 56, - 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5, 63, -} - -// fast log2 implementation -func fastLog2(value uint64) int { - value |= value >> 1 - value |= value >> 2 - value |= value >> 4 - value |= value >> 8 - value |= value >> 16 - value |= value >> 32 - - return int(log2tab64[(value*0x03f6eaf2cd271461)>>58]) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go b/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go deleted file mode 100644 index 5e37665e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/rand/xor_shift128.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rand - -import ( - "encoding/binary" - "math/rand" -) - -// Xor128Rand is a random number generator -type Xor128Rand struct { - src [2]uint64 -} - -// NewXorRand creates a XOR Shift random number generator. -func NewXorRand() *Xor128Rand { - return &Xor128Rand{src: [2]uint64{rand.Uint64(), rand.Uint64()}} -} - -// Int64 returns a random int64 number. It can be negative. -func (r *Xor128Rand) Int64() int64 { - return int64(r.Uint64()) -} - -// Uint64 returns a random uint64 number. -func (r *Xor128Rand) Uint64() uint64 { - s1 := r.src[0] - s0 := r.src[1] - r.src[0] = s0 - s1 ^= s1 << 23 - r.src[1] = (s1 ^ s0 ^ (s1 >> 17) ^ (s0 >> 26)) - res := r.src[1] + s0 - return res -} - -// Read will fill the argument slice with random bytes. -// Implements the Reader interface. -func (r *Xor128Rand) Read(p []byte) (n int, err error) { - l := len(p) / 8 - for i := 0; i < l; i += 8 { - binary.PutUvarint(p[i:], r.Uint64()) - } - return len(p), nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/result_code.go b/aerospike-tls/vendor-aerospike-client-go/types/result_code.go deleted file mode 100644 index df79029e..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/result_code.go +++ /dev/null @@ -1,793 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.proto -// See the License for the specific language governing permissions and -// limitations under the License. - -package types - -import "fmt" - -// ResultCode signifies the database operation error codes. -// The positive numbers align with the server side file kvs.h. -type ResultCode int - -const ( - // GRPC_ERROR is wrapped and directly returned from the grpc library - GRPC_ERROR ResultCode = -21 - - // BATCH_FAILED means one or more keys failed in a batch. - BATCH_FAILED ResultCode = -20 - - // NO_RESPONSE means no response was received from the server. - NO_RESPONSE ResultCode = -19 - - // NETWORK_ERROR defines a network error. Checked the wrapped error for detail. - NETWORK_ERROR ResultCode = -18 - - // COMMON_ERROR defines a common, none-aerospike error. Checked the wrapped error for detail. - COMMON_ERROR ResultCode = -17 - - // MAX_RETRIES_EXCEEDED defines max retries limit reached. - MAX_RETRIES_EXCEEDED ResultCode = -16 - - // MAX_ERROR_RATE defines max errors limit reached. - MAX_ERROR_RATE ResultCode = -15 - - // RACK_NOT_DEFINED defines requested Rack for node/namespace was not defined in the cluster. - RACK_NOT_DEFINED ResultCode = -13 - - // INVALID_CLUSTER_PARTITION_MAP defines cluster has an invalid partition map, usually due to bad configuration. - INVALID_CLUSTER_PARTITION_MAP ResultCode = -12 - - // SERVER_NOT_AVAILABLE defines server is not accepting requests. - SERVER_NOT_AVAILABLE ResultCode = -11 - - // CLUSTER_NAME_MISMATCH_ERROR defines cluster Name does not match the ClientPolicy.ClusterName value. - CLUSTER_NAME_MISMATCH_ERROR ResultCode = -10 - - // RECORDSET_CLOSED defines recordset has already been closed or cancelled - RECORDSET_CLOSED ResultCode = -9 - - // NO_AVAILABLE_CONNECTIONS_TO_NODE defines there were no connections available to the node in the pool, and the pool was limited - NO_AVAILABLE_CONNECTIONS_TO_NODE ResultCode = -8 - - // TYPE_NOT_SUPPORTED defines data type is not supported by aerospike server. - TYPE_NOT_SUPPORTED ResultCode = -7 - - // COMMAND_REJECTED defines info Command was rejected by the server. - COMMAND_REJECTED ResultCode = -6 - - // QUERY_TERMINATED defines query was terminated by user. - QUERY_TERMINATED ResultCode = -5 - - // SCAN_TERMINATED defines scan was terminated by user. - SCAN_TERMINATED ResultCode = -4 - - // INVALID_NODE_ERROR defines chosen node is not currently active. - INVALID_NODE_ERROR ResultCode = -3 - - // PARSE_ERROR defines client parse error. - PARSE_ERROR ResultCode = -2 - - // SERIALIZE_ERROR defines client serialization error. - SERIALIZE_ERROR ResultCode = -1 - - // OK defines operation was successful. - OK ResultCode = 0 - - // SERVER_ERROR defines unknown server failure. - SERVER_ERROR ResultCode = 1 - - // KEY_NOT_FOUND_ERROR defines on retrieving, touching or replacing a record that doesn't exist. - KEY_NOT_FOUND_ERROR ResultCode = 2 - - // GENERATION_ERROR defines on modifying a record with unexpected generation. - GENERATION_ERROR ResultCode = 3 - - // PARAMETER_ERROR defines bad parameter(s) were passed in database operation call. - PARAMETER_ERROR ResultCode = 4 - - // KEY_EXISTS_ERROR defines on create-only (write unique) operations on a record that already - // exists. - KEY_EXISTS_ERROR ResultCode = 5 - - // BIN_EXISTS_ERROR defines bin already exists on a create-only operation. - BIN_EXISTS_ERROR ResultCode = 6 - - // CLUSTER_KEY_MISMATCH defines expected cluster ID was not received. - CLUSTER_KEY_MISMATCH ResultCode = 7 - - // SERVER_MEM_ERROR defines server has run out of memory. - SERVER_MEM_ERROR ResultCode = 8 - - // TIMEOUT defines client or server has timed out. - TIMEOUT ResultCode = 9 - - // ALWAYS_FORBIDDEN defines operation not allowed in current configuration. - ALWAYS_FORBIDDEN ResultCode = 10 - - // PARTITION_UNAVAILABLE defines partition is unavailable. - PARTITION_UNAVAILABLE ResultCode = 11 - - // BIN_TYPE_ERROR defines operation is not supported with configured bin type (single-bin or - // multi-bin). - BIN_TYPE_ERROR ResultCode = 12 - - // RECORD_TOO_BIG defines record size exceeds limit. - RECORD_TOO_BIG ResultCode = 13 - - // KEY_BUSY defines too many concurrent operations on the same record. - KEY_BUSY ResultCode = 14 - - // SCAN_ABORT defines scan aborted by server. - SCAN_ABORT ResultCode = 15 - - // UNSUPPORTED_FEATURE defines unsupported Server Feature (e.g. Scan + UDF) - UNSUPPORTED_FEATURE ResultCode = 16 - - // BIN_NOT_FOUND defines bin not found on update-only operation. - BIN_NOT_FOUND ResultCode = 17 - - // DEVICE_OVERLOAD defines device not keeping up with writes. - DEVICE_OVERLOAD ResultCode = 18 - - // KEY_MISMATCH defines key type mismatch. - KEY_MISMATCH ResultCode = 19 - - // INVALID_NAMESPACE defines invalid namespace. - INVALID_NAMESPACE ResultCode = 20 - - // BIN_NAME_TOO_LONG defines bin name length greater than 14 characters, - // or maximum number of unique bin names are exceeded. - BIN_NAME_TOO_LONG ResultCode = 21 - - // FAIL_FORBIDDEN defines operation not allowed at this time. - FAIL_FORBIDDEN ResultCode = 22 - - // FAIL_ELEMENT_NOT_FOUND defines element Not Found in CDT - FAIL_ELEMENT_NOT_FOUND ResultCode = 23 - - // FAIL_ELEMENT_EXISTS defines element Already Exists in CDT - FAIL_ELEMENT_EXISTS ResultCode = 24 - - // ENTERPRISE_ONLY defines attempt to use an Enterprise feature on a Community server or a server - // without the applicable feature key. - ENTERPRISE_ONLY ResultCode = 25 - - // OP_NOT_APPLICABLE defines the operation cannot be applied to the current bin value on the server. - OP_NOT_APPLICABLE ResultCode = 26 - - // FILTERED_OUT defines the transaction was not performed because the filter was false. - FILTERED_OUT ResultCode = 27 - - // LOST_CONFLICT defines write command loses conflict to XDR. - LOST_CONFLICT = 28 - - // Write can't complete until XDR finishes shipping. - XDR_KEY_BUSY = 32 - - // QUERY_END defines there are no more records left for query. - QUERY_END ResultCode = 50 - - // SECURITY_NOT_SUPPORTED defines security type not supported by connected server. - SECURITY_NOT_SUPPORTED ResultCode = 51 - - // SECURITY_NOT_ENABLED defines administration command is invalid. - SECURITY_NOT_ENABLED ResultCode = 52 - - // SECURITY_SCHEME_NOT_SUPPORTED defines administration field is invalid. - SECURITY_SCHEME_NOT_SUPPORTED ResultCode = 53 - - // INVALID_COMMAND defines administration command is invalid. - INVALID_COMMAND ResultCode = 54 - - // INVALID_FIELD defines administration field is invalid. - INVALID_FIELD ResultCode = 55 - - // ILLEGAL_STATE defines security protocol not followed. - ILLEGAL_STATE ResultCode = 56 - - // INVALID_USER defines user name is invalid. - INVALID_USER ResultCode = 60 - - // USER_ALREADY_EXISTS defines user was previously created. - USER_ALREADY_EXISTS ResultCode = 61 - - // INVALID_PASSWORD defines password is invalid. - INVALID_PASSWORD ResultCode = 62 - - // EXPIRED_PASSWORD defines security credential is invalid. - EXPIRED_PASSWORD ResultCode = 63 - - // FORBIDDEN_PASSWORD defines forbidden password (e.g. recently used) - FORBIDDEN_PASSWORD ResultCode = 64 - - // INVALID_CREDENTIAL defines security credential is invalid. - INVALID_CREDENTIAL ResultCode = 65 - - // EXPIRED_SESSION defines login session expired. - EXPIRED_SESSION ResultCode = 66 - - // INVALID_ROLE defines role name is invalid. - INVALID_ROLE ResultCode = 70 - - // ROLE_ALREADY_EXISTS defines role already exists. - ROLE_ALREADY_EXISTS ResultCode = 71 - - // INVALID_PRIVILEGE defines privilege is invalid. - INVALID_PRIVILEGE ResultCode = 72 - - // INVALID_WHITELIST defines invalid IP address whiltelist - INVALID_WHITELIST = 73 - - // QUOTAS_NOT_ENABLED defines Quotas not enabled on server. - QUOTAS_NOT_ENABLED = 74 - - // INVALID_QUOTA defines invalid quota value. - INVALID_QUOTA = 75 - - // NOT_AUTHENTICATED defines user must be authentication before performing database operations. - NOT_AUTHENTICATED ResultCode = 80 - - // ROLE_VIOLATION defines user does not posses the required role to perform the database operation. - ROLE_VIOLATION ResultCode = 81 - - // NOT_WHITELISTED defines command not allowed because sender IP address not whitelisted. - NOT_WHITELISTED = 82 - - // QUOTA_EXCEEDED defines Quota exceeded. - QUOTA_EXCEEDED = 83 - - // UDF_BAD_RESPONSE defines a user defined function returned an error code. - UDF_BAD_RESPONSE ResultCode = 100 - - // BATCH_DISABLED defines batch functionality has been disabled. - BATCH_DISABLED ResultCode = 150 - - // BATCH_MAX_REQUESTS_EXCEEDED defines batch max requests have been exceeded. - BATCH_MAX_REQUESTS_EXCEEDED ResultCode = 151 - - // BATCH_QUEUES_FULL defines all batch queues are full. - BATCH_QUEUES_FULL ResultCode = 152 - - // GEO_INVALID_GEOJSON defines invalid GeoJSON on insert/update - GEO_INVALID_GEOJSON ResultCode = 160 - - // INDEX_FOUND defines secondary index already exists. - INDEX_FOUND ResultCode = 200 - - // INDEX_NOTFOUND defines requested secondary index does not exist. - INDEX_NOTFOUND ResultCode = 201 - - // INDEX_OOM defines secondary index memory space exceeded. - INDEX_OOM ResultCode = 202 - - // INDEX_NOTREADABLE defines secondary index not available. - INDEX_NOTREADABLE ResultCode = 203 - - // INDEX_GENERIC defines generic secondary index error. - INDEX_GENERIC ResultCode = 204 - - // INDEX_NAME_MAXLEN defines index name maximum length exceeded. - INDEX_NAME_MAXLEN ResultCode = 205 - - // INDEX_MAXCOUNT defines maximum number of indexes exceeded. - INDEX_MAXCOUNT ResultCode = 206 - - // QUERY_ABORTED defines secondary index query aborted. - QUERY_ABORTED ResultCode = 210 - - // QUERY_QUEUEFULL defines secondary index queue full. - QUERY_QUEUEFULL ResultCode = 211 - - // QUERY_TIMEOUT defines secondary index query timed out on server. - QUERY_TIMEOUT ResultCode = 212 - - // QUERY_GENERIC defines generic query error. - QUERY_GENERIC ResultCode = 213 - - // QUERY_NETIO_ERR defines query NetIO error on server - QUERY_NETIO_ERR ResultCode = 214 - - // QUERY_DUPLICATE defines duplicate TaskId sent for the statement - QUERY_DUPLICATE ResultCode = 215 - - // AEROSPIKE_ERR_UDF_NOT_FOUND defines uDF does not exist. - AEROSPIKE_ERR_UDF_NOT_FOUND ResultCode = 1301 - - // AEROSPIKE_ERR_LUA_FILE_NOT_FOUND defines lUA file does not exist. - AEROSPIKE_ERR_LUA_FILE_NOT_FOUND ResultCode = 1302 -) - -// ResultCodeToString returns a human readable errors message based on the result code. -func ResultCodeToString(resultCode ResultCode) string { - switch ResultCode(resultCode) { - case GRPC_ERROR: - return "GRPC error" - case BATCH_FAILED: - return "one or more keys failed in a batch" - - case NO_RESPONSE: - return "no response was received from the server" - - case NETWORK_ERROR: - return "network error. Checked the wrapped error for detail" - - case COMMON_ERROR: - return "common, none-aerospike error. Checked the wrapped error for detail" - - case MAX_RETRIES_EXCEEDED: - return "Max retries exceeded" - - case MAX_ERROR_RATE: - return "Max errors limit reached for node" - - case RACK_NOT_DEFINED: - return "Requested Rack for node/namespace was not defined in the cluster." - - case INVALID_CLUSTER_PARTITION_MAP: - return "Cluster has an invalid partition map, usually due to bad configuration." - - case SERVER_NOT_AVAILABLE: - return "Server is not accepting requests." - - case CLUSTER_NAME_MISMATCH_ERROR: - return "Cluster Name does not match the ClientPolicy.ClusterName value" - - case RECORDSET_CLOSED: - return "Recordset has already been closed or cancelled." - - case NO_AVAILABLE_CONNECTIONS_TO_NODE: - return "No available connections to the node. Connection Pool was empty, and limited to certain number of connections." - - case TYPE_NOT_SUPPORTED: - return "Type cannot be converted to Value Type." - - case COMMAND_REJECTED: - return "command rejected" - - case QUERY_TERMINATED: - return "Query terminated" - - case SCAN_TERMINATED: - return "Scan terminated" - - case INVALID_NODE_ERROR: - return "Invalid node" - - case PARSE_ERROR: - return "Parse error" - - case SERIALIZE_ERROR: - return "Serialize error" - - case OK: - return "ok" - - case SERVER_ERROR: - return "Server error" - - case KEY_NOT_FOUND_ERROR: - return "Key not found" - - case GENERATION_ERROR: - return "Generation error" - - case PARAMETER_ERROR: - return "Parameter error" - - case KEY_EXISTS_ERROR: - return "Key already exists" - - case BIN_EXISTS_ERROR: - return "Bin already exists" - - case CLUSTER_KEY_MISMATCH: - return "Cluster key mismatch" - - case SERVER_MEM_ERROR: - return "Server memory error" - - case TIMEOUT: - return "Timeout" - - case ALWAYS_FORBIDDEN: - return "Operation not allowed in current configuration." - - case PARTITION_UNAVAILABLE: - return "Partition not available" - - case BIN_TYPE_ERROR: - return "Bin type error" - - case RECORD_TOO_BIG: - return "Record too big" - - case KEY_BUSY: - return "Hot key" - - case SCAN_ABORT: - return "Scan aborted" - - case UNSUPPORTED_FEATURE: - return "Unsupported Server Feature" - - case BIN_NOT_FOUND: - return "Bin not found" - - case DEVICE_OVERLOAD: - return "Device overload" - - case KEY_MISMATCH: - return "Key mismatch" - - case INVALID_NAMESPACE: - return "Namespace not found" - - case BIN_NAME_TOO_LONG: - return "Bin name length greater than 15 characters, or maximum number of unique bin names are exceeded" - - case FAIL_FORBIDDEN: - return "Operation not allowed at this time" - - case FAIL_ELEMENT_NOT_FOUND: - return "Element not found." - - case FAIL_ELEMENT_EXISTS: - return "Element exists" - - case ENTERPRISE_ONLY: - return "Enterprise only" - - case OP_NOT_APPLICABLE: - return "Operation not applicable" - - case FILTERED_OUT: - return "Transaction filtered out" - - case LOST_CONFLICT: - return "Write command loses conflict to XDR." - - case XDR_KEY_BUSY: - return "Write can't complete until XDR finishes shipping." - - case QUERY_END: - return "Query end" - - case SECURITY_NOT_SUPPORTED: - return "Security not supported" - - case SECURITY_NOT_ENABLED: - return "Security not enabled" - - case SECURITY_SCHEME_NOT_SUPPORTED: - return "Security scheme not supported" - - case INVALID_COMMAND: - return "Invalid command" - - case INVALID_FIELD: - return "Invalid field" - - case ILLEGAL_STATE: - return "Illegal state" - - case INVALID_USER: - return "Invalid user" - - case USER_ALREADY_EXISTS: - return "User already exists" - - case INVALID_PASSWORD: - return "Invalid password" - - case EXPIRED_PASSWORD: - return "Expired password" - - case FORBIDDEN_PASSWORD: - return "Forbidden password" - - case INVALID_CREDENTIAL: - return "Invalid credential" - - case EXPIRED_SESSION: - return "Login session expired" - - case INVALID_ROLE: - return "Invalid role" - - case ROLE_ALREADY_EXISTS: - return "Role already exists" - - case INVALID_PRIVILEGE: - return "Invalid privilege" - - case INVALID_WHITELIST: - return "Invalid whitelist" - - case QUOTAS_NOT_ENABLED: - return "Quotas not enabled" - - case INVALID_QUOTA: - return "Invalid quota" - - case NOT_AUTHENTICATED: - return "Not authenticated" - - case ROLE_VIOLATION: - return "Role violation" - - case NOT_WHITELISTED: - return "Command not whitelisted" - - case QUOTA_EXCEEDED: - return "Quota exceeded" - - case UDF_BAD_RESPONSE: - return "UDF returned error" - - case BATCH_DISABLED: - return "Batch functionality has been disabled" - - case BATCH_MAX_REQUESTS_EXCEEDED: - return "Batch max requests have been exceeded" - - case BATCH_QUEUES_FULL: - return "All batch queues are full" - - case GEO_INVALID_GEOJSON: - return "Invalid GeoJSON on insert/update" - - case INDEX_FOUND: - return "Index already exists" - - case INDEX_NOTFOUND: - return "Index not found" - - case INDEX_OOM: - return "Index out of memory" - - case INDEX_NOTREADABLE: - return "Index not readable" - - case INDEX_GENERIC: - return "Index error" - - case INDEX_NAME_MAXLEN: - return "Index name max length exceeded" - - case INDEX_MAXCOUNT: - return "Index count exceeds max" - - case QUERY_ABORTED: - return "Query aborted" - - case QUERY_QUEUEFULL: - return "Query queue full" - - case QUERY_TIMEOUT: - return "Query timeout" - - case QUERY_GENERIC: - return "Query error" - - case QUERY_NETIO_ERR: - return "Query NetIO error on server" - - case QUERY_DUPLICATE: - return "Duplicate TaskId sent for the statement" - - case AEROSPIKE_ERR_UDF_NOT_FOUND: - return "UDF does not exist." - - case AEROSPIKE_ERR_LUA_FILE_NOT_FOUND: - return "LUA package/file does not exist." - - default: - return fmt.Sprintf("Error code (%v) not available yet - please file an issue on github.", resultCode) - } -} - -func (rc ResultCode) String() string { - switch rc { - case GRPC_ERROR: - return "GRPC error" - case BATCH_FAILED: - return "BATCH_FAILED" - case NO_RESPONSE: - return "NO_RESPONSE" - case NETWORK_ERROR: - return "NETWORK_ERROR" - case COMMON_ERROR: - return "COMMON_ERROR" - case MAX_RETRIES_EXCEEDED: - return "MAX_RETRIES_EXCEEDED" - case MAX_ERROR_RATE: - return "MAX_ERROR_RATE" - case RACK_NOT_DEFINED: - return "RACK_NOT_DEFINED" - case INVALID_CLUSTER_PARTITION_MAP: - return "INVALID_CLUSTER_PARTITION_MAP" - case SERVER_NOT_AVAILABLE: - return "SERVER_NOT_AVAILABLE" - case CLUSTER_NAME_MISMATCH_ERROR: - return "CLUSTER_NAME_MISMATCH_ERROR" - case RECORDSET_CLOSED: - return "RECORDSET_CLOSED" - case NO_AVAILABLE_CONNECTIONS_TO_NODE: - return "NO_AVAILABLE_CONNECTIONS_TO_NODE" - case TYPE_NOT_SUPPORTED: - return "TYPE_NOT_SUPPORTED" - case COMMAND_REJECTED: - return "COMMAND_REJECTED" - case QUERY_TERMINATED: - return "QUERY_TERMINATED" - case SCAN_TERMINATED: - return "SCAN_TERMINATED" - case INVALID_NODE_ERROR: - return "INVALID_NODE_ERROR" - case PARSE_ERROR: - return "PARSE_ERROR" - case SERIALIZE_ERROR: - return "SERIALIZE_ERROR" - case OK: - return "OK" - case SERVER_ERROR: - return "SERVER_ERROR" - case KEY_NOT_FOUND_ERROR: - return "KEY_NOT_FOUND_ERROR" - case GENERATION_ERROR: - return "GENERATION_ERROR" - case PARAMETER_ERROR: - return "PARAMETER_ERROR" - case KEY_EXISTS_ERROR: - return "KEY_EXISTS_ERROR" - case BIN_EXISTS_ERROR: - return "BIN_EXISTS_ERROR" - case CLUSTER_KEY_MISMATCH: - return "CLUSTER_KEY_MISMATCH" - case SERVER_MEM_ERROR: - return "SERVER_MEM_ERROR" - case TIMEOUT: - return "TIMEOUT" - case ALWAYS_FORBIDDEN: - return "ALWAYS_FORBIDDEN" - case PARTITION_UNAVAILABLE: - return "PARTITION_UNAVAILABLE" - case BIN_TYPE_ERROR: - return "BIN_TYPE_ERROR" - case RECORD_TOO_BIG: - return "RECORD_TOO_BIG" - case KEY_BUSY: - return "KEY_BUSY" - case SCAN_ABORT: - return "SCAN_ABORT" - case UNSUPPORTED_FEATURE: - return "UNSUPPORTED_FEATURE" - case BIN_NOT_FOUND: - return "BIN_NOT_FOUND" - case DEVICE_OVERLOAD: - return "DEVICE_OVERLOAD" - case KEY_MISMATCH: - return "KEY_MISMATCH" - case INVALID_NAMESPACE: - return "INVALID_NAMESPACE" - case BIN_NAME_TOO_LONG: - return "BIN_NAME_TOO_LONG" - case FAIL_FORBIDDEN: - return "FAIL_FORBIDDEN" - case FAIL_ELEMENT_NOT_FOUND: - return "FAIL_ELEMENT_NOT_FOUND" - case FAIL_ELEMENT_EXISTS: - return "FAIL_ELEMENT_EXISTS" - case ENTERPRISE_ONLY: - return "ENTERPRISE_ONLY" - case OP_NOT_APPLICABLE: - return "OP_NOT_APPLICABLE" - case FILTERED_OUT: - return "FILTERED_OUT" - case LOST_CONFLICT: - return "LOST_CONFLICT" - case XDR_KEY_BUSY: - return "XDR_KEY_BUSY" - case QUERY_END: - return "QUERY_END" - case SECURITY_NOT_SUPPORTED: - return "SECURITY_NOT_SUPPORTED" - case SECURITY_NOT_ENABLED: - return "SECURITY_NOT_ENABLED" - case SECURITY_SCHEME_NOT_SUPPORTED: - return "SECURITY_SCHEME_NOT_SUPPORTED" - case INVALID_COMMAND: - return "INVALID_COMMAND" - case INVALID_FIELD: - return "INVALID_FIELD" - case ILLEGAL_STATE: - return "ILLEGAL_STATE" - case INVALID_USER: - return "INVALID_USER" - case USER_ALREADY_EXISTS: - return "USER_ALREADY_EXISTS" - case INVALID_PASSWORD: - return "INVALID_PASSWORD" - case EXPIRED_PASSWORD: - return "EXPIRED_PASSWORD" - case FORBIDDEN_PASSWORD: - return "FORBIDDEN_PASSWORD" - case INVALID_CREDENTIAL: - return "INVALID_CREDENTIAL" - case EXPIRED_SESSION: - return "EXPIRED_SESSION" - case INVALID_ROLE: - return "INVALID_ROLE" - case ROLE_ALREADY_EXISTS: - return "ROLE_ALREADY_EXISTS" - case INVALID_PRIVILEGE: - return "INVALID_PRIVILEGE" - case INVALID_WHITELIST: - return "INVALID_WHITELIST" - case QUOTAS_NOT_ENABLED: - return "QUOTAS_NOT_ENABLED" - case INVALID_QUOTA: - return "INVALID_QUOTA" - case NOT_AUTHENTICATED: - return "NOT_AUTHENTICATED" - case ROLE_VIOLATION: - return "ROLE_VIOLATION" - case NOT_WHITELISTED: - return "NOT_WHITELISTED" - case QUOTA_EXCEEDED: - return "QUOTA_EXCEEDED" - case UDF_BAD_RESPONSE: - return "UDF_BAD_RESPONSE" - case BATCH_DISABLED: - return "BATCH_DISABLED" - case BATCH_MAX_REQUESTS_EXCEEDED: - return "BATCH_MAX_REQUESTS_EXCEEDED" - case BATCH_QUEUES_FULL: - return "BATCH_QUEUES_FULL" - case GEO_INVALID_GEOJSON: - return "GEO_INVALID_GEOJSON" - case INDEX_FOUND: - return "INDEX_FOUND" - case INDEX_NOTFOUND: - return "INDEX_NOTFOUND" - case INDEX_OOM: - return "INDEX_OOM" - case INDEX_NOTREADABLE: - return "INDEX_NOTREADABLE" - case INDEX_GENERIC: - return "INDEX_GENERIC" - case INDEX_NAME_MAXLEN: - return "INDEX_NAME_MAXLEN" - case INDEX_MAXCOUNT: - return "INDEX_MAXCOUNT" - case QUERY_ABORTED: - return "QUERY_ABORTED" - case QUERY_QUEUEFULL: - return "QUERY_QUEUEFULL" - case QUERY_TIMEOUT: - return "QUERY_TIMEOUT" - case QUERY_GENERIC: - return "QUERY_GENERIC" - case QUERY_NETIO_ERR: - return "QUERY_NETIO_ERR" - case QUERY_DUPLICATE: - return "QUERY_DUPLICATE" - case AEROSPIKE_ERR_UDF_NOT_FOUND: - return "AEROSPIKE_ERR_UDF_NOT_FOUND" - case AEROSPIKE_ERR_LUA_FILE_NOT_FOUND: - return "AEROSPIKE_ERR_LUA_FILE_NOT_FOUND" - default: - return fmt.Sprintf("invalid ResultCode %d. Please report on https://github.com/aerospike/aerospike-client.go", rc) - } -} diff --git a/aerospike-tls/vendor-aerospike-client-go/types/types.go b/aerospike-tls/vendor-aerospike-client-go/types/types.go deleted file mode 100644 index 0bbcf9cc..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/types.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types diff --git a/aerospike-tls/vendor-aerospike-client-go/types/types_test.go b/aerospike-tls/vendor-aerospike-client-go/types/types_test.go deleted file mode 100644 index 784f01b4..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/types/types_test.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package types_test - -import ( - "testing" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -func TestTypes(t *testing.T) { - gm.RegisterFailHandler(gg.Fail) - gg.RunSpecs(t, "Aerospike Client Library Types Suite") -} diff --git a/aerospike-tls/vendor-aerospike-client-go/udf.go b/aerospike-tls/vendor-aerospike-client-go/udf.go deleted file mode 100644 index 366d5a62..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/udf.go +++ /dev/null @@ -1,11 +0,0 @@ -package aerospike - -// UDF carries information about UDFs on the server -type UDF struct { - // Filename of the UDF - Filename string - // Hash digest of the UDF - Hash string - // Language of UDF - Language Language -} diff --git a/aerospike-tls/vendor-aerospike-client-go/udf_test.go b/aerospike-tls/vendor-aerospike-client-go/udf_test.go deleted file mode 100644 index 29067377..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/udf_test.go +++ /dev/null @@ -1,441 +0,0 @@ -//go:build !app_engine - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike_test - -import ( - "math" - "math/rand" - "strings" - "sync" - "time" - - as "github.com/aerospike/aerospike-client-go/v7" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" -) - -const udfBody = `function testFunc1(rec, div) - local ret = map() -- Initialize the return value (a map) - - local x = rec['bin1'] -- Get the value from record bin named "bin1" - - rec['bin2'] = math.floor(x / div) -- Set the value in record bin named "bin2" - - aerospike:update(rec) -- Update the main record - - ret['status'] = 'OK' -- Populate the return status - return ret -- Return the Return value and/or status -end` - -const udfDelete = `function deleteRecord(rec) - aerospike:remove(rec) -- Delete main record, Populate the return status -end` - -const udfEcho = `function echo(rec, param) - local ret = map() - ret['val'] = param - ret['str_val'] = tostring(param) - return ret -- return the same value to make sure serializations are working well -end` - -const udfCreateWithSendKey = `function createRecWithSendKey(rec) - rec['otherBin'] = 1 - aerospike:create(rec) -end - -function getRecordKeyValue(rec) - local r = record.key(rec) - aerospike:remove(rec) - return r -end -` - -const invalidUdfBody = `function testFunc1(rec, div) - asdf - returned ret -- Return the Return value and/or status -end` - -// ALL tests are isolated by SetName and Key, which are 50 random characters -var _ = gg.Describe("UDF/Query tests", func() { - - var err error - var ns = *namespace - var set = randString(50) - var key *as.Key - var wpolicy = as.NewWritePolicy(0, 0) - - const keyCount = 1000 - bin1 := as.NewBin("bin1", rand.Intn(math.MaxInt16)) - bin2 := as.NewBin("bin2", 1) - - gg.BeforeEach(func() { - if *dbaas { - gg.Skip("Not supported in DBAAS environment") - } - - if *proxy { - gg.Skip("Not supported in proxy environment") - } - }) - - gg.It("must Register a UDF", func() { - regTask, err := client.RegisterUDF(wpolicy, []byte(udfBody), "udf1.lua", as.LUA) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is created - gm.Expect(<-regTask.OnComplete()).NotTo(gm.HaveOccurred()) - }) - - gg.It("must parse invalid UDF error", func() { - _, err := client.RegisterUDF(wpolicy, []byte(invalidUdfBody), "invalid_udf1.lua", as.LUA) - gm.Expect(err).To(gm.HaveOccurred()) - gm.Expect(err.Error()).To(gm.HaveSuffix(`compile_error -File: invalid_udf1.lua -Line: 3 -Message: syntax error near 'returned'`)) - }) - - gg.It("must run a UDF on a single record", func() { - registerUDF(udfBody, "udf1.lua") - - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - nsup := nsupPeriod(ns) - - var wpolicy *as.WritePolicy - if nsup > 0 { - wpolicy = as.NewWritePolicy(0, 1000) - } else { - wpolicy = as.NewWritePolicy(0, 0) - } - res, err := client.Execute(wpolicy, key, "udf1", "testFunc1", as.NewValue(2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res).To(gm.Equal(map[interface{}]interface{}{"status": "OK"})) - - time.Sleep(3 * time.Second) - - // read all data and make sure it is consistent - rec, err := client.Get(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - if nsup > 0 { - gm.Expect(rec.Expiration).To(gm.BeNumerically("<=", 997)) - gm.Expect(rec.Expiration).To(gm.BeNumerically(">", 900)) // give a bit of leeway for slow testing VMs - } - - gm.Expect(rec.Bins[bin1.Name]).To(gm.Equal(bin1.Value.GetObject())) - gm.Expect(rec.Bins[bin2.Name]).To(gm.Equal(bin1.Value.GetObject().(int) / 2)) - }) - - gg.It("must run a UDF to create single record and persist the original key value", func() { - registerUDF(udfCreateWithSendKey, "sendKey.lua") - - tSet := randString(50) - key, err := as.NewKey(ns, tSet, -1) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // make sure the record doesn't exist yet - _, err = client.Delete(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - exists, err := client.Exists(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.BeFalse()) - - wp := as.NewWritePolicy(0, 0) - wp.SendKey = true - _, err = client.Execute(wp, key, "sendKey", "createRecWithSendKey") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // read all data and make sure it is consistent - exists, err = client.Exists(nil, key) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(exists).To(gm.BeTrue()) - - res, err := client.Execute(nil, key, "sendKey", "getRecordKeyValue") - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res).To(gm.Equal(-1)) - }) - - gg.It("must list all udfs on the server", func() { - udfList, err := client.ListUDF(nil) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(len(udfList)).To(gm.BeNumerically(">", 0)) - }) - - gg.It("must drop a udf on the server", func() { - registerUDF(udfBody, "udfToBeDropped.lua") - - delTask, err := client.RemoveUDF(wpolicy, "udfToBeDropped.lua") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is deleted - gm.Expect(<-delTask.OnComplete()).NotTo(gm.HaveOccurred()) - }) - - gg.Context("must run the UDF on all records", func() { - - var scanPolicy = as.NewScanPolicy() - var queryPolicy = as.NewQueryPolicy() - - gg.BeforeEach(func() { - set = randString(50) - for i := 0; i < keyCount; i++ { - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - err = client.PutBins(wpolicy, key, bin1, bin2) - gm.Expect(err).ToNot(gm.HaveOccurred()) - } - }) - - gg.It("must run a UDF on all records", func() { - registerUDF(udfBody, "udf1.lua") - - // run the UDF 3 times consecutively - for i := 1; i <= 3; i++ { - statement := as.NewStatement(ns, set) - exTask, err := client.ExecuteUDF(queryPolicy, statement, "udf1", "testFunc1", as.NewValue(i*2)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is run on all records - err = <-exTask.OnComplete() - gm.Expect(err).ToNot(gm.HaveOccurred()) - - time.Sleep(3 * time.Second) - - // read all data and make sure it is consistent - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - for fullRec := range recordset.Results() { - gm.Expect(fullRec.Err).ToNot(gm.HaveOccurred()) - gm.Expect(fullRec.Record.Bins[bin2.Name]).To(gm.Equal(bin1.Value.GetObject().(int) / (i * 2))) - } - } - }) - - gg.It("must run a DeleteUDF on a range of records", func() { - createIndex(wpolicy, ns, set, set+bin1.Name, bin1.Name, as.NUMERIC) - defer dropIndex(nil, ns, set, set+bin1.Name) - - registerUDF(udfDelete, "udfDelete.lua") - - // a new record that is not in the range - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - err = client.PutBins(wpolicy, key, as.NewBin(bin1.Name, math.MaxInt16+1)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - statement := as.NewStatement(ns, set) - statement.SetFilter(as.NewRangeFilter(bin1.Name, 0, math.MaxInt16)) - exTask, err := client.ExecuteUDF(queryPolicy, statement, "udfDelete", "deleteRecord") - gm.Expect(err).ToNot(gm.HaveOccurred()) - - // wait until UDF is run on all records - gm.Expect(<-exTask.OnComplete()).ToNot(gm.HaveOccurred()) - - time.Sleep(3 * time.Second) - - // read all data and make sure it is consistent - recordset, err := client.ScanAll(scanPolicy, ns, set) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - i := 0 - for fullRec := range recordset.Results() { - gm.Expect(fullRec.Err).ToNot(gm.HaveOccurred()) - i++ - // only one record should be returned - gm.Expect(fullRec.Record.Bins[bin1.Name]).To(gm.Equal(math.MaxInt16 + 1)) - } - gm.Expect(i).To(gm.Equal(1)) - }) - }) // context - - gg.Context("must serialize parameters and return values sensibly", func() { - - var udfReg sync.Once - - gg.BeforeEach(func() { - udfReg.Do(func() { - registerUDF(udfEcho, "udfEcho.lua") - - // a new record that is not in the range - key, err = as.NewKey(ns, set, randString(50)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - }) - }) - - testMatrix := map[interface{}]interface{}{ - math.MinInt64: math.MinInt64, - // math.MaxInt64: int64(math.MaxInt64), // TODO: Wrong serialization on server - sign-bit is wrong - math.MinInt32: math.MinInt32, // TODO: Wrong serialization type on server - math.MaxUint32: math.MaxUint32, - math.MinInt16: math.MinInt16, - math.MaxInt16: math.MaxInt16, - math.MaxUint16: math.MaxUint16, - math.MinInt8: math.MinInt8, - math.MaxInt8: math.MaxInt8, - math.MaxUint8: math.MaxUint8, - -1: -1, - 0: 0, - "": "", - strings.Repeat("s", 1): strings.Repeat("s", 1), - strings.Repeat("s", 10): strings.Repeat("s", 10), - strings.Repeat("s", 100): strings.Repeat("s", 100), - strings.Repeat("s", 1000): strings.Repeat("s", 1000), - strings.Repeat("s", 10000): strings.Repeat("s", 10000), - strings.Repeat("s", 33781): strings.Repeat("s", 33781), - strings.Repeat("s", 100000): strings.Repeat("s", 100000), - "Hello, 世界": "Hello, 世界", - } - - gg.It("must serialize nil values to echo function and get the same value back", func() { - - res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(nil)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.BeNil()) - - }) // it - - gg.It("must serialize values to echo function and get the same value back", func() { - - for k, v := range testMatrix { - res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(k)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.Equal(v)) - } - - }) // it - - gg.It("must serialize list values to echo function and get the same value back", func() { - - v := []interface{}{ - nil, - math.MinInt64, - math.MinInt32, - math.MinInt16, - math.MinInt8, - -1, - 0, - 1, - math.MaxInt8, - math.MaxUint8, - math.MaxInt16, - math.MaxUint16, - math.MaxInt32, - math.MaxUint32, - math.MaxInt64, - uint64(math.MaxUint64), // This value is returned as a negative integer from the server - "", - "Hello, 世界", - } - - vExpected := []interface{}{ - nil, - int(math.MinInt64), - int(math.MinInt32), - int(math.MinInt16), - int(math.MinInt8), - int(-1), - int(0), - int(1), - int(math.MaxInt8), - int(math.MaxUint8), - int(math.MaxInt16), - int(math.MaxUint16), - int(math.MaxInt32), - int(math.MaxUint32), - math.MaxInt64, - int(-1), - "", - "Hello, 世界", - } - - res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(v)) - - // for i := range v { - // fmt.Printf("%v => %T\n", res.(map[interface{}]interface{})["val"].([]interface{})[i], res.(map[interface{}]interface{})["val"].([]interface{})[i]) - // fmt.Printf("%v => %T\n", vExpected[i], vExpected[i]) - // } - - gm.Expect(err).ToNot(gm.HaveOccurred()) - gm.Expect(res.(map[interface{}]interface{})["val"]).To(gm.Equal(vExpected)) - - }) // it - - gg.It("must serialize map values to echo function and get the same value back", func() { - - v := map[interface{}]interface{}{ - // nil: nil, - math.MinInt64: math.MinInt64, - math.MinInt32: math.MinInt32, - math.MinInt16: math.MinInt16, - math.MinInt8: math.MinInt8, - -1: -1, - 0: 0, - 1: 1, - math.MaxInt8: math.MaxInt8, - math.MaxUint8: math.MaxUint8, - math.MaxInt16: math.MaxInt16, - math.MaxUint16: math.MaxUint16, - math.MaxInt32: math.MaxInt32, - math.MaxUint32: math.MaxUint32, - math.MaxInt64: math.MaxInt64, - "": "", - "Hello, 世界": "Hello, 世界", - } - - vExpected := map[interface{}]interface{}{ - // nil: nil, - math.MinInt64: math.MinInt64, - math.MinInt32: math.MinInt32, - math.MinInt16: math.MinInt16, - math.MinInt8: math.MinInt8, - -1: -1, - 0: 0, - 1: 1, - math.MaxInt8: math.MaxInt8, - math.MaxUint8: math.MaxUint8, - math.MaxInt16: math.MaxInt16, - math.MaxUint16: math.MaxUint16, - math.MaxInt32: math.MaxInt32, - math.MaxUint32: math.MaxUint32, - math.MaxInt64: math.MaxInt64, - "": "", - "Hello, 世界": "Hello, 世界", - } - - res, err := client.Execute(nil, key, "udfEcho", "echo", as.NewValue(v)) - gm.Expect(err).ToNot(gm.HaveOccurred()) - - resMap := res.(map[interface{}]interface{})["val"].(map[interface{}]interface{}) - // for k := range resMap { - // fmt.Printf("%v : %v => %T: %T\n", k, k, resMap[k], resMap[k]) - // fmt.Printf("%v => %T\n", vExpected[k], vExpected[k]) - // } - - gm.Expect(resMap).To(gm.Equal(vExpected)) - - }) // it - - }) // context - -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/unpacker.go b/aerospike-tls/vendor-aerospike-client-go/unpacker.go deleted file mode 100644 index e7a35a1b..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/unpacker.go +++ /dev/null @@ -1,420 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "math" - "reflect" - - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type unpacker struct { - buffer []byte - offset int - length int -} - -func newUnpacker(buffer []byte, offset int, length int) *unpacker { - return &unpacker{ - buffer: buffer, - offset: offset, - length: length, - } -} - -func (upckr *unpacker) UnpackList() ([]interface{}, Error) { - if upckr.length <= 0 { - return nil, nil - } - - theType := upckr.buffer[upckr.offset] & 0xff - upckr.offset++ - var count int - - if (theType & 0xf0) == 0x90 { - count = int(theType & 0x0f) - } else if theType == 0xdc { - count = int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - } else if theType == 0xdd { - count = int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - } else { - return nil, nil - } - - return upckr.unpackList(count) -} - -func (upckr *unpacker) unpackList(count int) ([]interface{}, Error) { - if count == 0 { - return make([]interface{}, 0), nil - } - - mark := upckr.offset - size := count - - val, err := upckr.unpackObject(false) - if err != nil && err != errSkipHeader { - return nil, err - } - - if val == nil { - // Determine if nil value is because of an extension type. - typ := upckr.buffer[mark] & 0xff - - if typ != 0xc0 { // not nil type - // Ignore extension type. - size-- - } - } - - out := make([]interface{}, 0, count) - if size == count { - out = append(out, val) - } - - for i := 1; i < count; i++ { - obj, err := upckr.unpackObject(false) - if err != nil { - return nil, err - } - out = append(out, obj) - } - return out, nil -} - -func (upckr *unpacker) UnpackMap() (interface{}, Error) { - if upckr.length <= 0 { - return nil, nil - } - - theType := upckr.buffer[upckr.offset] & 0xff - upckr.offset++ - var count int - - if (theType & 0xf0) == 0x80 { - count = int(theType & 0x0f) - } else if theType == 0xde { - count = int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - } else if theType == 0xdf { - count = int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - } else { - return make(map[interface{}]interface{}), nil - } - return upckr.unpackMap(count) -} - -func (upckr *unpacker) unpackMap(count int) (interface{}, Error) { - if count <= 0 { - return make(map[interface{}]interface{}), nil - } - - if upckr.isMapCDT() { - return upckr.unpackCDTMap(count) - } - return upckr.unpackMapNormal(count) -} - -func (upckr *unpacker) unpackMapNormal(count int) (map[interface{}]interface{}, Error) { - out := make(map[interface{}]interface{}, count) - - for i := 0; i < count; i++ { - key, err := upckr.unpackObject(true) - if err != nil { - return nil, err - } - - val, err := upckr.unpackObject(false) - if err != nil { - return nil, err - } - out[key] = val - } - return out, nil -} - -func (upckr *unpacker) unpackCDTMap(count int) ([]MapPair, Error) { - out := make([]MapPair, 0, count-1) - - for i := 0; i < count; i++ { - key, err := upckr.unpackObject(true) - if err != nil && err != errSkipHeader { - return nil, err - } - - val, err := upckr.unpackObject(false) - if err != nil && err != errSkipHeader { - return nil, err - } - - if key != nil { - out = append(out, MapPair{Key: key, Value: val}) - } - } - - return out, nil -} - -func (upckr *unpacker) isMapCDT() bool { - // make sure the buffer is long enough (for empty maps), and map type is ordered map - if upckr.offset >= len(upckr.buffer) || upckr.buffer[upckr.offset]&0xff != 0xc7 { - return false - } - - extensionType := upckr.buffer[upckr.offset+1] & 0xff - - if extensionType == 0 { - mapBits := upckr.buffer[upckr.offset+2] & 0xff - - // Extension is a map type. Determine which one. - if (mapBits & (0x04 | 0x08)) != 0 { - // Index/rank range result where order needs to be preserved. - return true - } else if (mapBits & 0x01) != 0 { - // Sorted map - return true - } - } - - return false -} - -func (upckr *unpacker) unpackObjects() (interface{}, Error) { - if upckr.length <= 0 { - return nil, nil - } - - return upckr.unpackObject(false) -} - -func (upckr *unpacker) unpackBlob(count int, isMapKey bool) (interface{}, Error) { - theType := upckr.buffer[upckr.offset] & 0xff - upckr.offset++ - count-- - var val interface{} - - switch theType { - case ParticleType.STRING: - val = string(upckr.buffer[upckr.offset : upckr.offset+count]) - - case ParticleType.BLOB: - if isMapKey { - b := reflect.Indirect(reflect.New(reflect.ArrayOf(count, reflect.TypeOf(byte(0))))) - reflect.Copy(b, reflect.ValueOf(upckr.buffer[upckr.offset:upckr.offset+count])) - - val = b.Interface() - } else { - b := make([]byte, count) - copy(b, upckr.buffer[upckr.offset:upckr.offset+count]) - val = b - } - - case ParticleType.GEOJSON: - val = NewGeoJSONValue(string(upckr.buffer[upckr.offset : upckr.offset+count])) - - default: - return nil, newError(types.PARSE_ERROR, fmt.Sprintf("Error while unpacking BLOB. Type-header with code `%d` not recognized.", theType)) - } - upckr.offset += count - - return val, nil -} - -// errSkipHeader is used internally as a signal; it is never sent back to the user -var errSkipHeader = newError(types.OK, "Skip the unpacker error") - -func (upckr *unpacker) unpackObject(isMapKey bool) (interface{}, Error) { - theType := upckr.buffer[upckr.offset] & 0xff - upckr.offset++ - - switch theType { - case 0xc0: - return nil, nil - - case 0xc3: - return true, nil - - case 0xc2: - return false, nil - - case 0xca: - val := Buffer.BytesToFloat32(upckr.buffer, upckr.offset) - upckr.offset += 4 - return val, nil - - case 0xcb: - val := Buffer.BytesToFloat64(upckr.buffer, upckr.offset) - upckr.offset += 8 - return val, nil - - case 0xcc: - r := upckr.buffer[upckr.offset] & 0xff - upckr.offset++ - - return int(r), nil - - case 0xcd: - val := uint16(Buffer.BytesToInt16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - return int(val), nil - - case 0xce: - val := uint32(Buffer.BytesToInt32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - - if Buffer.Arch64Bits { - return int(val), nil - } - return int64(val), nil - - case 0xcf: - val := Buffer.BytesToInt64(upckr.buffer, upckr.offset) - upckr.offset += 8 - if val <= math.MaxInt { - return int(val), nil - } - return int64(val), nil - - case 0xd0: - r := int8(upckr.buffer[upckr.offset]) - upckr.offset++ - return int(r), nil - - case 0xd1: - val := Buffer.BytesToInt16(upckr.buffer, upckr.offset) - upckr.offset += 2 - return int(val), nil - - case 0xd2: - val := Buffer.BytesToInt32(upckr.buffer, upckr.offset) - upckr.offset += 4 - return int(val), nil - - case 0xd3: - val := Buffer.BytesToInt64(upckr.buffer, upckr.offset) - upckr.offset += 8 - if Buffer.Arch64Bits { - return int(val), nil - } - return val, nil - - case 0xc4, 0xd9: - count := int(upckr.buffer[upckr.offset] & 0xff) - upckr.offset++ - return upckr.unpackBlob(count, isMapKey) - - case 0xc5, 0xda: - count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - return upckr.unpackBlob(count, isMapKey) - - case 0xc6, 0xdb: - count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - return upckr.unpackBlob(count, isMapKey) - - case 0xdc: - count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - return upckr.unpackList(count) - - case 0xdd: - count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - return upckr.unpackList(count) - - case 0xde: - count := int(Buffer.BytesToUint16(upckr.buffer, upckr.offset)) - upckr.offset += 2 - return upckr.unpackMap(count) - - case 0xdf: - count := int(Buffer.BytesToUint32(upckr.buffer, upckr.offset)) - upckr.offset += 4 - return upckr.unpackMap(count) - - case 0xd4: - // Skip over type extension with 1 byte - upckr.offset += 1 + 1 - return nil, errSkipHeader - - case 0xd5: - // Skip over type extension with 2 bytes - upckr.offset += 1 + 2 - return nil, errSkipHeader - - case 0xd6: - // Skip over type extension with 4 bytes - upckr.offset += 1 + 4 - return nil, errSkipHeader - - case 0xd7: - // Skip over type extension with 8 bytes - upckr.offset += 1 + 8 - return nil, errSkipHeader - - case 0xd8: - // Skip over type extension with 16 bytes - upckr.offset += 1 + 16 - return nil, errSkipHeader - - case 0xc7: // Skip over type extension with 8 bit header and bytes - count := int(upckr.buffer[upckr.offset] & 0xff) - upckr.offset += count + 1 + 1 - return nil, errSkipHeader - - case 0xc8: // Skip over type extension with 16 bit header and bytes - count := int(Buffer.BytesToInt16(upckr.buffer, upckr.offset)) - upckr.offset += count + 1 + 2 - return nil, errSkipHeader - - case 0xc9: // Skip over type extension with 32 bit header and bytes - count := int(Buffer.BytesToInt32(upckr.buffer, upckr.offset)) - upckr.offset += count + 1 + 4 - return nil, errSkipHeader - - default: - if (theType & 0xe0) == 0xa0 { - return upckr.unpackBlob(int(theType&0x1f), isMapKey) - } - - if (theType & 0xf0) == 0x80 { - return upckr.unpackMap(int(theType & 0x0f)) - } - - if (theType & 0xf0) == 0x90 { - count := int(theType & 0x0f) - return upckr.unpackList(count) - } - - if theType < 0x80 { - return int(theType), nil - } - - if theType >= 0xe0 { - return int(theType) - 0xe0 - 32, nil - } - } - - return nil, newError(types.SERIALIZE_ERROR) -} diff --git a/aerospike-tls/vendor-aerospike-client-go/user_roles.go b/aerospike-tls/vendor-aerospike-client-go/user_roles.go deleted file mode 100644 index 61f8d151..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/user_roles.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Portions may be licensed to Aerospike, Inc. under one or more contributor -// license agreements. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -package aerospike - -// UserRoles contains information about a user. -type UserRoles struct { - // User name. - User string - - // Roles is a list of assigned roles. - Roles []string - - // ReadInfo is the list of read statistics. List may be nil. - // Current statistics by offset are: - // - // 0: read quota in records per second - // 1: single record read transaction rate (TPS) - // 2: read scan/query record per second rate (RPS) - // 3: number of limitless read scans/queries - // - // Future server releases may add additional statistics. - ReadInfo []int - - // WriteInfo is the list of write statistics. List may be nil. - // Current statistics by offset are: - // - // 0: write quota in records per second - // 1: single record write transaction rate (TPS) - // 2: write scan/query record per second rate (RPS) - // 3: number of limitless write scans/queries - // - // Future server releases may add additional statistics. - WriteInfo []int - - // ConnsInUse is the number of currently open connections for the user - ConnsInUse int -} diff --git a/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go b/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go deleted file mode 100644 index e37f623f..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/utils/buffer/buffer.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffer - -import ( - "encoding/binary" - "math" -) - -const ( - // SizeOfInt32 defines the size of int32 - SizeOfInt32 = uintptr(4) - // SizeOfInt64 defines the size of int64 - SizeOfInt64 = uintptr(8) - - uint64sz = int(8) - uint32sz = int(4) - uint16sz = int(2) - - float32sz = int(4) - float64sz = int(8) -) - -// SizeOfInt defines the size of native int -var SizeOfInt uintptr - -// Arch64Bits defines if the system is 64 bits -var Arch64Bits bool - -// Arch32Bits defines if the system is 32 bits -var Arch32Bits bool - -func init() { - if 0 == ^uint(0xffffffff) { - SizeOfInt = 4 - } else { - SizeOfInt = 8 - } - Arch64Bits = (SizeOfInt == SizeOfInt64) - Arch32Bits = (SizeOfInt == SizeOfInt32) -} - -// LittleBytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used -func LittleBytesToInt32(buf []byte, offset int) int32 { - l := len(buf[offset:]) - if l > uint32sz { - l = uint32sz - } - r := int32(binary.LittleEndian.Uint32(buf[offset : offset+l])) - return r -} - -// LittleBytesToInt64 converts a slice into int64; only maximum of 8 bytes will be used -func LittleBytesToInt64(buf []byte, offset int) int64 { - l := len(buf[offset:]) - if l > uint64sz { - l = uint64sz - } - r := int64(binary.LittleEndian.Uint64(buf[offset : offset+l])) - return r -} - -// BytesToInt64 converts a slice into int64; only maximum of 8 bytes will be used -func BytesToInt64(buf []byte, offset int) int64 { - l := len(buf[offset:]) - if l > uint64sz { - l = uint64sz - } - r := int64(binary.BigEndian.Uint64(buf[offset : offset+l])) - return r -} - -// VarBytesToInt64 will convert a 8, 4 or 2 byte slice into an int64 -func VarBytesToInt64(buf []byte, offset int, len int) int64 { - switch len { - case 2: - return int64(BytesToInt16(buf, offset)) - case 4: - return int64(BytesToInt32(buf, offset)) - case 8: - return BytesToInt64(buf, offset) - } - - val := int64(0) - for i := 0; i < len; i++ { - val <<= 8 - val |= int64(buf[offset+i] & 0xFF) - } - return val -} - -// BytesToInt32 converts a slice into int32; only maximum of 4 bytes will be used -func BytesToInt32(buf []byte, offset int) int32 { - return int32(binary.BigEndian.Uint32(buf[offset : offset+uint32sz])) -} - -// BytesToUint32 converts a slice into uint32; only maximum of 4 bytes will be used -func BytesToUint32(buf []byte, offset int) uint32 { - return binary.BigEndian.Uint32(buf[offset : offset+uint32sz]) -} - -// BytesToInt16 converts a slice of bytes to an int16 -func BytesToInt16(buf []byte, offset int) int16 { - return int16(binary.BigEndian.Uint16(buf[offset : offset+uint16sz])) -} - -// BytesToUint16 converts a byte slice to a uint16 -func BytesToUint16(buf []byte, offset int) uint16 { - return binary.BigEndian.Uint16(buf[offset : offset+uint16sz]) -} - -// BytesToFloat32 converts a byte slice to a float32 -func BytesToFloat32(buf []byte, offset int) float32 { - bits := binary.BigEndian.Uint32(buf[offset : offset+float32sz]) - return math.Float32frombits(bits) -} - -// BytesToFloat64 converts a byte slice to a float64 -func BytesToFloat64(buf []byte, offset int) float64 { - bits := binary.BigEndian.Uint64(buf[offset : offset+float64sz]) - return math.Float64frombits(bits) -} - -// BytesToBool converts a byte slice to a bool -func BytesToBool(buf []byte, offset, length int) bool { - if length <= 0 { - return false - } - return buf[offset] != 0 -} diff --git a/aerospike-tls/vendor-aerospike-client-go/value.go b/aerospike-tls/vendor-aerospike-client-go/value.go deleted file mode 100644 index 297581a3..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/value.go +++ /dev/null @@ -1,1318 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "fmt" - "reflect" - "strconv" - - "github.com/aerospike/aerospike-client-go/v7/types" - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// this function will be set in value_slow file if included -var newValueReflect func(interface{}) Value - -// MapPair is used when the client returns sorted maps from the server -// Since the default map in Go is a hash map, we will use a slice -// to return the results in server order -type MapPair struct{ Key, Value interface{} } - -// Value interface is used to efficiently serialize objects into the wire protocol. -type Value interface { - - // Calculate number of vl.bytes necessary to serialize the value in the wire protocol. - EstimateSize() (int, Error) - - // Serialize the value in the wire protocol. - write(cmd BufferEx) (int, Error) - - // Serialize the value using MessagePack. - pack(cmd BufferEx) (int, Error) - - // GetType returns wire protocol value type. - GetType() int - - // GetObject returns original value as an interface{}. - GetObject() interface{} - - // String implements Stringer interface. - String() string -} - -//revive:disable - -// AerospikeBlob interface allows the user to write a conversion function from their value to []bytes. -type AerospikeBlob interface { - // EncodeBlob returns a byte slice representing the encoding of the - // receiver for transmission to a Decoder, usually of the same - // concrete type. - EncodeBlob() ([]byte, error) -} - -//revive:enable - -// tryConcreteValue will return an aerospike value. -// If the encoder does not exist, it will not try to use reflection. -func tryConcreteValue(v interface{}) Value { - switch val := v.(type) { - case Value: - return val - case int: - return IntegerValue(val) - case int64: - return LongValue(val) - case string: - return StringValue(val) - case []interface{}: - return ListValue(val) - case map[string]interface{}: - return JsonValue(val) - case map[interface{}]interface{}: - return NewMapValue(val) - case nil: - return nullValue - case []Value: - return NewValueArray(val) - case []byte: - return BytesValue(val) - case int8: - return IntegerValue(int(val)) - case int16: - return IntegerValue(int(val)) - case int32: - return IntegerValue(int(val)) - case uint8: // byte supported here - return IntegerValue(int(val)) - case uint16: - return IntegerValue(int(val)) - case uint32: - return IntegerValue(int(val)) - case float32: - return FloatValue(float64(val)) - case float64: - return FloatValue(val) - case uint: - // if it doesn't overflow int64, it is OK - if int64(val) >= 0 { - return LongValue(int64(val)) - } - case bool: - return BoolValue(val) - case MapIter: - return NewMapperValue(val) - case ListIter: - return NewListerValue(val) - case AerospikeBlob: - return NewBlobValue(val) - - /* - The following cases will try to avoid using reflection by matching against the - internal generic types. - If you have custom type aliases in your code, you can use the same aerospike types to cast your type into, - to avoid hitting the reflection. - */ - case []string: - return NewListerValue(stringSlice(val)) - case []int: - return NewListerValue(intSlice(val)) - case []int8: - return NewListerValue(int8Slice(val)) - case []int16: - return NewListerValue(int16Slice(val)) - case []int32: - return NewListerValue(int32Slice(val)) - case []int64: - return NewListerValue(int64Slice(val)) - case []uint16: - return NewListerValue(uint16Slice(val)) - case []uint32: - return NewListerValue(uint32Slice(val)) - case []uint64: - return NewListerValue(uint64Slice(val)) - case []float32: - return NewListerValue(float32Slice(val)) - case []float64: - return NewListerValue(float64Slice(val)) - case map[string]string: - return NewMapperValue(stringStringMap(val)) - case map[string]int: - return NewMapperValue(stringIntMap(val)) - case map[string]int8: - return NewMapperValue(stringInt8Map(val)) - case map[string]int16: - return NewMapperValue(stringInt16Map(val)) - case map[string]int32: - return NewMapperValue(stringInt32Map(val)) - case map[string]int64: - return NewMapperValue(stringInt64Map(val)) - case map[string]uint16: - return NewMapperValue(stringUint16Map(val)) - case map[string]uint32: - return NewMapperValue(stringUint32Map(val)) - case map[string]float32: - return NewMapperValue(stringFloat32Map(val)) - case map[string]float64: - return NewMapperValue(stringFloat64Map(val)) - case map[int]string: - return NewMapperValue(intStringMap(val)) - case map[int]int: - return NewMapperValue(intIntMap(val)) - case map[int]int8: - return NewMapperValue(intInt8Map(val)) - case map[int]int16: - return NewMapperValue(intInt16Map(val)) - case map[int]int32: - return NewMapperValue(intInt32Map(val)) - case map[int]int64: - return NewMapperValue(intInt64Map(val)) - case map[int]uint16: - return NewMapperValue(intUint16Map(val)) - case map[int]uint32: - return NewMapperValue(intUint32Map(val)) - case map[int]float32: - return NewMapperValue(intFloat32Map(val)) - case map[int]float64: - return NewMapperValue(intFloat64Map(val)) - case map[int]interface{}: - return NewMapperValue(intInterfaceMap(val)) - case map[int8]string: - return NewMapperValue(int8StringMap(val)) - case map[int8]int: - return NewMapperValue(int8IntMap(val)) - case map[int8]int8: - return NewMapperValue(int8Int8Map(val)) - case map[int8]int16: - return NewMapperValue(int8Int16Map(val)) - case map[int8]int32: - return NewMapperValue(int8Int32Map(val)) - case map[int8]int64: - return NewMapperValue(int8Int64Map(val)) - case map[int8]uint16: - return NewMapperValue(int8Uint16Map(val)) - case map[int8]uint32: - return NewMapperValue(int8Uint32Map(val)) - case map[int8]float32: - return NewMapperValue(int8Float32Map(val)) - case map[int8]float64: - return NewMapperValue(int8Float64Map(val)) - case map[int8]interface{}: - return NewMapperValue(int8InterfaceMap(val)) - case map[int16]string: - return NewMapperValue(int16StringMap(val)) - case map[int16]int: - return NewMapperValue(int16IntMap(val)) - case map[int16]int8: - return NewMapperValue(int16Int8Map(val)) - case map[int16]int16: - return NewMapperValue(int16Int16Map(val)) - case map[int16]int32: - return NewMapperValue(int16Int32Map(val)) - case map[int16]int64: - return NewMapperValue(int16Int64Map(val)) - case map[int16]uint16: - return NewMapperValue(int16Uint16Map(val)) - case map[int16]uint32: - return NewMapperValue(int16Uint32Map(val)) - case map[int16]float32: - return NewMapperValue(int16Float32Map(val)) - case map[int16]float64: - return NewMapperValue(int16Float64Map(val)) - case map[int16]interface{}: - return NewMapperValue(int16InterfaceMap(val)) - case map[int32]string: - return NewMapperValue(int32StringMap(val)) - case map[int32]int: - return NewMapperValue(int32IntMap(val)) - case map[int32]int8: - return NewMapperValue(int32Int8Map(val)) - case map[int32]int16: - return NewMapperValue(int32Int16Map(val)) - case map[int32]int32: - return NewMapperValue(int32Int32Map(val)) - case map[int32]int64: - return NewMapperValue(int32Int64Map(val)) - case map[int32]uint16: - return NewMapperValue(int32Uint16Map(val)) - case map[int32]uint32: - return NewMapperValue(int32Uint32Map(val)) - case map[int32]float32: - return NewMapperValue(int32Float32Map(val)) - case map[int32]float64: - return NewMapperValue(int32Float64Map(val)) - case map[int32]interface{}: - return NewMapperValue(int32InterfaceMap(val)) - case map[int64]string: - return NewMapperValue(int64StringMap(val)) - case map[int64]int: - return NewMapperValue(int64IntMap(val)) - case map[int64]int8: - return NewMapperValue(int64Int8Map(val)) - case map[int64]int16: - return NewMapperValue(int64Int16Map(val)) - case map[int64]int32: - return NewMapperValue(int64Int32Map(val)) - case map[int64]int64: - return NewMapperValue(int64Int64Map(val)) - case map[int64]uint16: - return NewMapperValue(int64Uint16Map(val)) - case map[int64]uint32: - return NewMapperValue(int64Uint32Map(val)) - case map[int64]float32: - return NewMapperValue(int64Float32Map(val)) - case map[int64]float64: - return NewMapperValue(int64Float64Map(val)) - case map[int64]interface{}: - return NewMapperValue(int64InterfaceMap(val)) - case map[uint16]string: - return NewMapperValue(uint16StringMap(val)) - case map[uint16]int: - return NewMapperValue(uint16IntMap(val)) - case map[uint16]int8: - return NewMapperValue(uint16Int8Map(val)) - case map[uint16]int16: - return NewMapperValue(uint16Int16Map(val)) - case map[uint16]int32: - return NewMapperValue(uint16Int32Map(val)) - case map[uint16]int64: - return NewMapperValue(uint16Int64Map(val)) - case map[uint16]uint16: - return NewMapperValue(uint16Uint16Map(val)) - case map[uint16]uint32: - return NewMapperValue(uint16Uint32Map(val)) - case map[uint16]float32: - return NewMapperValue(uint16Float32Map(val)) - case map[uint16]float64: - return NewMapperValue(uint16Float64Map(val)) - case map[uint16]interface{}: - return NewMapperValue(uint16InterfaceMap(val)) - case map[uint32]string: - return NewMapperValue(uint32StringMap(val)) - case map[uint32]int: - return NewMapperValue(uint32IntMap(val)) - case map[uint32]int8: - return NewMapperValue(uint32Int8Map(val)) - case map[uint32]int16: - return NewMapperValue(uint32Int16Map(val)) - case map[uint32]int32: - return NewMapperValue(uint32Int32Map(val)) - case map[uint32]int64: - return NewMapperValue(uint32Int64Map(val)) - case map[uint32]uint16: - return NewMapperValue(uint32Uint16Map(val)) - case map[uint32]uint32: - return NewMapperValue(uint32Uint32Map(val)) - case map[uint32]float32: - return NewMapperValue(uint32Float32Map(val)) - case map[uint32]float64: - return NewMapperValue(uint32Float64Map(val)) - case map[uint32]interface{}: - return NewMapperValue(uint32InterfaceMap(val)) - case map[float32]string: - return NewMapperValue(float32StringMap(val)) - case map[float32]int: - return NewMapperValue(float32IntMap(val)) - case map[float32]int8: - return NewMapperValue(float32Int8Map(val)) - case map[float32]int16: - return NewMapperValue(float32Int16Map(val)) - case map[float32]int32: - return NewMapperValue(float32Int32Map(val)) - case map[float32]int64: - return NewMapperValue(float32Int64Map(val)) - case map[float32]uint16: - return NewMapperValue(float32Uint16Map(val)) - case map[float32]uint32: - return NewMapperValue(float32Uint32Map(val)) - case map[float32]float32: - return NewMapperValue(float32Float32Map(val)) - case map[float32]float64: - return NewMapperValue(float32Float64Map(val)) - case map[float32]interface{}: - return NewMapperValue(float32InterfaceMap(val)) - case map[float64]string: - return NewMapperValue(float64StringMap(val)) - case map[float64]int: - return NewMapperValue(float64IntMap(val)) - case map[float64]int8: - return NewMapperValue(float64Int8Map(val)) - case map[float64]int16: - return NewMapperValue(float64Int16Map(val)) - case map[float64]int32: - return NewMapperValue(float64Int32Map(val)) - case map[float64]int64: - return NewMapperValue(float64Int64Map(val)) - case map[float64]uint16: - return NewMapperValue(float64Uint16Map(val)) - case map[float64]uint32: - return NewMapperValue(float64Uint32Map(val)) - case map[float64]float32: - return NewMapperValue(float64Float32Map(val)) - case map[float64]float64: - return NewMapperValue(float64Float64Map(val)) - case map[float64]interface{}: - return NewMapperValue(float64InterfaceMap(val)) - case map[string]uint64: - return NewMapperValue(stringUint64Map(val)) - case map[int]uint64: - return NewMapperValue(intUint64Map(val)) - case map[int8]uint64: - return NewMapperValue(int8Uint64Map(val)) - case map[int16]uint64: - return NewMapperValue(int16Uint64Map(val)) - case map[int32]uint64: - return NewMapperValue(int32Uint64Map(val)) - case map[int64]uint64: - return NewMapperValue(int64Uint64Map(val)) - case map[uint16]uint64: - return NewMapperValue(uint16Uint64Map(val)) - case map[uint32]uint64: - return NewMapperValue(uint32Uint64Map(val)) - case map[float32]uint64: - return NewMapperValue(float32Uint64Map(val)) - case map[float64]uint64: - return NewMapperValue(float64Uint64Map(val)) - case map[uint64]string: - return NewMapperValue(uint64StringMap(val)) - case map[uint64]int: - return NewMapperValue(uint64IntMap(val)) - case map[uint64]int8: - return NewMapperValue(uint64Int8Map(val)) - case map[uint64]int16: - return NewMapperValue(uint64Int16Map(val)) - case map[uint64]int32: - return NewMapperValue(uint64Int32Map(val)) - case map[uint64]int64: - return NewMapperValue(uint64Int64Map(val)) - case map[uint64]uint16: - return NewMapperValue(uint64Uint16Map(val)) - case map[uint64]uint32: - return NewMapperValue(uint64Uint32Map(val)) - case map[uint64]uint64: - return NewMapperValue(uint64Uint64Map(val)) - case map[uint64]float32: - return NewMapperValue(uint64Float32Map(val)) - case map[uint64]float64: - return NewMapperValue(uint64Float64Map(val)) - case map[uint64]interface{}: - return NewMapperValue(uint64InterfaceMap(val)) - } - - return nil -} - -// OpResults encapsulates the results of batch read operations -type OpResults []interface{} - -// NewValue generates a new Value object based on the type. -// If the type is not supported, NewValue will panic. -// This method is a convenience method, and should not be used -// when absolute performance is required unless for the reason mentioned below. -// -// If you have custom maps or slices like: -// -// type MyMap map[primitive1]primitive2, eg: map[int]string -// -// or -// -// type MySlice []primitive, eg: []float64 -// -// cast them to their primitive type when passing them to this method: -// -// v := NewValue(map[int]string(myVar)) -// v := NewValue([]float64(myVar)) -// -// This way you will avoid hitting reflection. -// To completely avoid reflection in the library, -// use the build tag: as_performance while building your program. -func NewValue(v interface{}) Value { - if value := tryConcreteValue(v); value != nil { - return value - } - - if newValueReflect != nil { - if res := newValueReflect(v); res != nil { - return res - } - } - - // panic for anything that is not supported. - panic(newError(types.TYPE_NOT_SUPPORTED, fmt.Sprintf("Value type '%v' (%s) not supported (if you are compiling via 'as_performance' tag, use cast either to primitives, or use ListIter or MapIter interfaces.)", v, reflect.TypeOf(v).String()))) -} - -// NullValue is an empty value. -type NullValue struct{} - -var nullValue NullValue - -// NewNullValue generates a NullValue instance. -func NewNullValue() NullValue { - return nullValue -} - -// EstimateSize returns the size of the NullValue in wire protocol. -func (vl NullValue) EstimateSize() (int, Error) { - return 0, nil -} - -func (vl NullValue) write(cmd BufferEx) (int, Error) { - return 0, nil -} - -func (vl NullValue) pack(cmd BufferEx) (int, Error) { - return packNil(cmd) -} - -// GetType returns wire protocol value type. -func (vl NullValue) GetType() int { - return ParticleType.NULL -} - -// GetObject returns original value as an interface{}. -func (vl NullValue) GetObject() interface{} { - return nil -} - -func (vl NullValue) String() string { - return "" -} - -/////////////////////////////////////////////////////////////////////////////// - -// InfinityValue is an empty value. -type InfinityValue struct{} - -var infinityValue InfinityValue - -// NewInfinityValue generates a InfinityValue instance. -func NewInfinityValue() InfinityValue { - return infinityValue -} - -// EstimateSize returns the size of the InfinityValue in wire protocol. -func (vl InfinityValue) EstimateSize() (int, Error) { - return 0, nil -} - -func (vl InfinityValue) write(cmd BufferEx) (int, Error) { - return 0, nil -} - -func (vl InfinityValue) pack(cmd BufferEx) (int, Error) { - return packInfinity(cmd) -} - -// GetType returns wire protocol value type. -func (vl InfinityValue) GetType() int { - panic("Invalid particle type: INF") -} - -// GetObject returns original value as an interface{}. -func (vl InfinityValue) GetObject() interface{} { - return nil -} - -func (vl InfinityValue) String() string { - return "INF" -} - -/////////////////////////////////////////////////////////////////////////////// - -// WildCardValue is an empty value. -type WildCardValue struct{} - -var wildCardValue WildCardValue - -// NewWildCardValue generates a WildCardValue instance. -func NewWildCardValue() WildCardValue { - return wildCardValue -} - -// EstimateSize returns the size of the WildCardValue in wire protocol. -func (vl WildCardValue) EstimateSize() (int, Error) { - return 0, nil -} - -func (vl WildCardValue) write(cmd BufferEx) (int, Error) { - return 0, nil -} - -func (vl WildCardValue) pack(cmd BufferEx) (int, Error) { - return packWildCard(cmd) -} - -// GetType returns wire protocol value type. -func (vl WildCardValue) GetType() int { - panic("Invalid particle type: WildCard") -} - -// GetObject returns original value as an interface{}. -func (vl WildCardValue) GetObject() interface{} { - return nil -} - -func (vl WildCardValue) String() string { - return "*" -} - -/////////////////////////////////////////////////////////////////////////////// - -// BytesValue encapsulates an array of bytes. -type BytesValue []byte - -// NewBytesValue generates a ByteValue instance. -func NewBytesValue(bytes []byte) BytesValue { - return BytesValue(bytes) -} - -// NewBlobValue accepts an AerospikeBlob interface, and automatically -// converts it to a BytesValue. -// If Encode returns an err, it will panic. -func NewBlobValue(object AerospikeBlob) BytesValue { - buf, err := object.EncodeBlob() - if err != nil { - panic(err) - } - - return NewBytesValue(buf) -} - -// EstimateSize returns the size of the BytesValue in wire protocol. -func (vl BytesValue) EstimateSize() (int, Error) { - return len(vl), nil -} - -func (vl BytesValue) write(cmd BufferEx) (int, Error) { - return cmd.Write(vl) -} - -func (vl BytesValue) pack(cmd BufferEx) (int, Error) { - return packBytes(cmd, vl) -} - -// GetType returns wire protocol value type. -func (vl BytesValue) GetType() int { - return ParticleType.BLOB -} - -// GetObject returns original value as an interface{}. -func (vl BytesValue) GetObject() interface{} { - return []byte(vl) -} - -// String implements Stringer interface. -func (vl BytesValue) String() string { - return fmt.Sprintf("% 02x", []byte(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// StringValue encapsulates a string value. -type StringValue string - -// NewStringValue generates a StringValue instance. -func NewStringValue(value string) StringValue { - return StringValue(value) -} - -// EstimateSize returns the size of the StringValue in wire protocol. -func (vl StringValue) EstimateSize() (int, Error) { - return len(vl), nil -} - -func (vl StringValue) write(cmd BufferEx) (int, Error) { - return cmd.WriteString(string(vl)) -} - -func (vl StringValue) pack(cmd BufferEx) (int, Error) { - return packString(cmd, string(vl)) -} - -// GetType returns wire protocol value type. -func (vl StringValue) GetType() int { - return ParticleType.STRING -} - -// GetObject returns original value as an interface{}. -func (vl StringValue) GetObject() interface{} { - return string(vl) -} - -// String implements Stringer interface. -func (vl StringValue) String() string { - return string(vl) -} - -/////////////////////////////////////////////////////////////////////////////// - -// IntegerValue encapsulates an integer value. -type IntegerValue int - -// NewIntegerValue generates an IntegerValue instance. -func NewIntegerValue(value int) IntegerValue { - return IntegerValue(value) -} - -// EstimateSize returns the size of the IntegerValue in wire protocol. -func (vl IntegerValue) EstimateSize() (int, Error) { - return 8, nil -} - -func (vl IntegerValue) write(cmd BufferEx) (int, Error) { - n := cmd.WriteInt64(int64(vl)) - return n, nil -} - -func (vl IntegerValue) pack(cmd BufferEx) (int, Error) { - return packAInt64(cmd, int64(vl)) -} - -// GetType returns wire protocol value type. -func (vl IntegerValue) GetType() int { - return ParticleType.INTEGER -} - -// GetObject returns original value as an interface{}. -func (vl IntegerValue) GetObject() interface{} { - return int(vl) -} - -// String implements Stringer interface. -func (vl IntegerValue) String() string { - return strconv.Itoa(int(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// LongValue encapsulates an int64 value. -type LongValue int64 - -// NewLongValue generates a LongValue instance. -func NewLongValue(value int64) LongValue { - // TODO: Remove this type, it's not necessary next to IntegerValue - return LongValue(value) -} - -// EstimateSize returns the size of the LongValue in wire protocol. -func (vl LongValue) EstimateSize() (int, Error) { - return 8, nil -} - -func (vl LongValue) write(cmd BufferEx) (int, Error) { - n := cmd.WriteInt64(int64(vl)) - return n, nil -} - -func (vl LongValue) pack(cmd BufferEx) (int, Error) { - return packAInt64(cmd, int64(vl)) -} - -// GetType returns wire protocol value type. -func (vl LongValue) GetType() int { - return ParticleType.INTEGER -} - -// GetObject returns original value as an interface{}. -func (vl LongValue) GetObject() interface{} { - return int64(vl) -} - -// String implements Stringer interface. -func (vl LongValue) String() string { - return strconv.Itoa(int(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// FloatValue encapsulates an float64 value. -type FloatValue float64 - -// NewFloatValue generates a FloatValue instance. -func NewFloatValue(value float64) FloatValue { - return FloatValue(value) -} - -// EstimateSize returns the size of the FloatValue in wire protocol. -func (vl FloatValue) EstimateSize() (int, Error) { - return 8, nil -} - -func (vl FloatValue) write(cmd BufferEx) (int, Error) { - n := cmd.WriteFloat64(float64(vl)) - return n, nil -} - -func (vl FloatValue) pack(cmd BufferEx) (int, Error) { - return packFloat64(cmd, float64(vl)) -} - -// GetType returns wire protocol value type. -func (vl FloatValue) GetType() int { - return ParticleType.FLOAT -} - -// GetObject returns original value as an interface{}. -func (vl FloatValue) GetObject() interface{} { - return float64(vl) -} - -// String implements Stringer interface. -func (vl FloatValue) String() string { - return (fmt.Sprintf("%f", vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// BoolValue encapsulates a boolean value. -// Supported by Aerospike server v5.6+ only. -type BoolValue bool - -// EstimateSize returns the size of the BoolValue in wire protocol. -func (vb BoolValue) EstimateSize() (int, Error) { - return PackBool(nil, bool(vb)) -} - -func (vb BoolValue) write(cmd BufferEx) (int, Error) { - n := cmd.WriteBool(bool(vb)) - return n, nil -} - -func (vb BoolValue) pack(cmd BufferEx) (int, Error) { - return PackBool(cmd, bool(vb)) -} - -// GetType returns wire protocol value type. -func (vb BoolValue) GetType() int { - return ParticleType.BOOL -} - -// GetObject returns original value as an interface{}. -func (vb BoolValue) GetObject() interface{} { - return bool(vb) -} - -// String implements Stringer interface. -func (vb BoolValue) String() string { - return (fmt.Sprintf("%v", bool(vb))) -} - -/////////////////////////////////////////////////////////////////////////////// - -// ValueArray encapsulates an array of Value. -// Supported by Aerospike 3+ servers only. -type ValueArray []Value - -// NewValueArray generates a ValueArray instance. -func NewValueArray(array []Value) *ValueArray { - // return &ValueArray{*NewListerValue(valueList(array))} - res := ValueArray(array) - return &res -} - -// EstimateSize returns the size of the ValueArray in wire protocol. -func (va ValueArray) EstimateSize() (int, Error) { - return packValueArray(nil, va) -} - -func (va ValueArray) write(cmd BufferEx) (int, Error) { - return packValueArray(cmd, va) -} - -func (va ValueArray) pack(cmd BufferEx) (int, Error) { - return packValueArray(cmd, []Value(va)) -} - -// GetType returns wire protocol value type. -func (va ValueArray) GetType() int { - return ParticleType.LIST -} - -// GetObject returns original value as an interface{}. -func (va ValueArray) GetObject() interface{} { - return []Value(va) -} - -// String implements Stringer interface. -func (va ValueArray) String() string { - return fmt.Sprintf("%v", []Value(va)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// ListValue encapsulates any arbitrary array. -// Supported by Aerospike 3+ servers only. -type ListValue []interface{} - -// NewListValue generates a ListValue instance. -func NewListValue(list []interface{}) ListValue { - return ListValue(list) -} - -// EstimateSize returns the size of the ListValue in wire protocol. -func (vl ListValue) EstimateSize() (int, Error) { - return packIfcList(nil, vl) -} - -func (vl ListValue) write(cmd BufferEx) (int, Error) { - return packIfcList(cmd, vl) -} - -func (vl ListValue) pack(cmd BufferEx) (int, Error) { - return packIfcList(cmd, []interface{}(vl)) -} - -// GetType returns wire protocol value type. -func (vl ListValue) GetType() int { - return ParticleType.LIST -} - -// GetObject returns original value as an interface{}. -func (vl ListValue) GetObject() interface{} { - return []interface{}(vl) -} - -// String implements Stringer interface. -func (vl ListValue) String() string { - return fmt.Sprintf("%v", []interface{}(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// ListerValue encapsulates any arbitrary array. -// Supported by Aerospike 3+ servers only. -type ListerValue struct { - list ListIter -} - -// NewListerValue generates a NewListerValue instance. -func NewListerValue(list ListIter) *ListerValue { - res := &ListerValue{ - list: list, - } - - return res -} - -// EstimateSize returns the size of the ListerValue in wire protocol. -func (vl *ListerValue) EstimateSize() (int, Error) { - return packList(nil, vl.list) -} - -func (vl *ListerValue) write(cmd BufferEx) (int, Error) { - return packList(cmd, vl.list) -} - -func (vl *ListerValue) pack(cmd BufferEx) (int, Error) { - return packList(cmd, vl.list) -} - -// GetType returns wire protocol value type. -func (vl *ListerValue) GetType() int { - return ParticleType.LIST -} - -// GetObject returns original value as an interface{}. -func (vl *ListerValue) GetObject() interface{} { - return vl.list -} - -// String implements Stringer interface. -func (vl *ListerValue) String() string { - return fmt.Sprintf("%v", vl.list) -} - -/////////////////////////////////////////////////////////////////////////////// - -// MapValue encapsulates an arbitrary map. -// Supported by Aerospike 3+ servers only. -type MapValue map[interface{}]interface{} - -// NewMapValue generates a MapValue instance. -func NewMapValue(vmap map[interface{}]interface{}) MapValue { - return MapValue(vmap) -} - -// EstimateSize returns the size of the MapValue in wire protocol. -func (vl MapValue) EstimateSize() (int, Error) { - return packIfcMap(nil, vl) -} - -func (vl MapValue) write(cmd BufferEx) (int, Error) { - return packIfcMap(cmd, vl) -} - -func (vl MapValue) pack(cmd BufferEx) (int, Error) { - return packIfcMap(cmd, vl) -} - -// GetType returns wire protocol value type. -func (vl MapValue) GetType() int { - return ParticleType.MAP -} - -// GetObject returns original value as an interface{}. -func (vl MapValue) GetObject() interface{} { - return map[interface{}]interface{}(vl) -} - -func (vl MapValue) String() string { - return fmt.Sprintf("%v", map[interface{}]interface{}(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// JsonValue encapsulates a Json map. -// Supported by Aerospike 3+ servers only. -type JsonValue map[string]interface{} - -// NewJsonValue generates a JsonValue instance. -func NewJsonValue(vmap map[string]interface{}) JsonValue { - return JsonValue(vmap) -} - -// EstimateSize returns the size of the JsonValue in wire protocol. -func (vl JsonValue) EstimateSize() (int, Error) { - return packJsonMap(nil, vl) -} - -func (vl JsonValue) write(cmd BufferEx) (int, Error) { - return packJsonMap(cmd, vl) -} - -func (vl JsonValue) pack(cmd BufferEx) (int, Error) { - return packJsonMap(cmd, vl) -} - -// GetType returns wire protocol value type. -func (vl JsonValue) GetType() int { - return ParticleType.MAP -} - -// GetObject returns original value as an interface{}. -func (vl JsonValue) GetObject() interface{} { - return map[string]interface{}(vl) -} - -func (vl JsonValue) String() string { - return fmt.Sprintf("%v", map[string]interface{}(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// MapperValue encapsulates an arbitrary map which implements a MapIter interface. -// Supported by Aerospike 3+ servers only. -type MapperValue struct { - vmap MapIter -} - -// NewMapperValue generates a MapperValue instance. -func NewMapperValue(vmap MapIter) *MapperValue { - res := &MapperValue{ - vmap: vmap, - } - - return res -} - -// EstimateSize returns the size of the MapperValue in wire protocol. -func (vl *MapperValue) EstimateSize() (int, Error) { - return packMap(nil, vl.vmap) -} - -func (vl *MapperValue) write(cmd BufferEx) (int, Error) { - return packMap(cmd, vl.vmap) -} - -func (vl *MapperValue) pack(cmd BufferEx) (int, Error) { - return packMap(cmd, vl.vmap) -} - -// GetType returns wire protocol value type. -func (vl *MapperValue) GetType() int { - return ParticleType.MAP -} - -// GetObject returns original value as an interface{}. -func (vl *MapperValue) GetObject() interface{} { - return vl.vmap -} - -func (vl *MapperValue) String() string { - return fmt.Sprintf("%v", vl.vmap) -} - -/////////////////////////////////////////////////////////////////////////////// - -// GeoJSONValue encapsulates a 2D Geo point. -// Supported by Aerospike 3.6.1 servers and later only. -type GeoJSONValue string - -// NewGeoJSONValue generates a GeoJSONValue instance. -func NewGeoJSONValue(value string) GeoJSONValue { - res := GeoJSONValue(value) - return res -} - -// EstimateSize returns the size of the GeoJSONValue in wire protocol. -func (vl GeoJSONValue) EstimateSize() (int, Error) { - // flags + ncells + jsonstr - return 1 + 2 + len(string(vl)), nil -} - -func (vl GeoJSONValue) write(cmd BufferEx) (int, Error) { - cmd.WriteByte(0) // flags - cmd.WriteByte(0) // flags - cmd.WriteByte(0) // flags - - return cmd.WriteString(string(vl)) -} - -func (vl GeoJSONValue) pack(cmd BufferEx) (int, Error) { - return packGeoJson(cmd, string(vl)) -} - -// GetType returns wire protocol value type. -func (vl GeoJSONValue) GetType() int { - return ParticleType.GEOJSON -} - -// GetObject returns original value as an interface{}. -func (vl GeoJSONValue) GetObject() interface{} { - return string(vl) -} - -// String implements Stringer interface. -func (vl GeoJSONValue) String() string { - return string(vl) -} - -/////////////////////////////////////////////////////////////////////////////// - -// HLLValue encapsulates a HyperLogLog value. -type HLLValue []byte - -// NewHLLValue generates a ByteValue instance. -func NewHLLValue(bytes []byte) HLLValue { - return HLLValue(bytes) -} - -// EstimateSize returns the size of the HLLValue in wire protocol. -func (vl HLLValue) EstimateSize() (int, Error) { - return len(vl), nil -} - -func (vl HLLValue) write(cmd BufferEx) (int, Error) { - return cmd.Write(vl) -} - -func (vl HLLValue) pack(cmd BufferEx) (int, Error) { - return packBytes(cmd, vl) -} - -// GetType returns wire protocol value type. -func (vl HLLValue) GetType() int { - return ParticleType.HLL -} - -// GetObject returns original value as an interface{}. -func (vl HLLValue) GetObject() interface{} { - return []byte(vl) -} - -// String implements Stringer interface. -func (vl HLLValue) String() string { - return fmt.Sprintf("% 02x", []byte(vl)) -} - -/////////////////////////////////////////////////////////////////////////////// - -// RawBlobValue encapsulates a CDT BLOB value. -// Notice: Do not use this value, it is for internal aerospike use only. -type RawBlobValue struct { - // ParticleType signifies the data - ParticleType int - // Data carries the data - Data []byte -} - -// NewRawBlobValue generates a RawBlobValue instance for a CDT List or map using a particle type. -func NewRawBlobValue(pt int, b []byte) *RawBlobValue { - data := make([]byte, len(b)) - copy(data, b) - return &RawBlobValue{ParticleType: pt, Data: data} -} - -// EstimateSize returns the size of the RawBlobValue in wire protocol. -func (vl *RawBlobValue) EstimateSize() (int, Error) { - return len(vl.Data), nil -} - -func (vl *RawBlobValue) write(cmd BufferEx) (int, Error) { - return cmd.Write(vl.Data) -} - -func (vl *RawBlobValue) pack(cmd BufferEx) (int, Error) { - panic(unreachable) -} - -// GetType returns wire protocol value type. -func (vl *RawBlobValue) GetType() int { - return vl.ParticleType -} - -// GetObject returns original value as an interface{}. -func (vl *RawBlobValue) GetObject() interface{} { - return []byte(vl.Data) -} - -// String implements Stringer interface. -func (vl *RawBlobValue) String() string { - return fmt.Sprintf("% 02x", vl.Data) -} - -////////////////////////////////////////////////////////////////////////////// - -func bytesToParticleRaw(ptype int, buf []byte, offset int, length int, raw bool) (interface{}, Error) { - switch ptype { - case ParticleType.MAP: - if raw { - return NewRawBlobValue(ptype, buf[offset:offset+length]), nil - } - return newUnpacker(buf, offset, length).UnpackMap() - - case ParticleType.LIST: - if raw { - return NewRawBlobValue(ptype, buf[offset:offset+length]), nil - } - return newUnpacker(buf, offset, length).UnpackList() - } - return bytesToParticle(ptype, buf, offset, length) -} - -func bytesToParticle(ptype int, buf []byte, offset int, length int) (interface{}, Error) { - - switch ptype { - case ParticleType.INTEGER: - // return `int` for 64bit platforms for compatibility reasons - if Buffer.Arch64Bits { - return int(Buffer.VarBytesToInt64(buf, offset, length)), nil - } - return Buffer.VarBytesToInt64(buf, offset, length), nil - - case ParticleType.STRING: - return string(buf[offset : offset+length]), nil - - case ParticleType.FLOAT: - return Buffer.BytesToFloat64(buf, offset), nil - - case ParticleType.BOOL: - return Buffer.BytesToBool(buf, offset, length), nil - - case ParticleType.MAP: - return newUnpacker(buf, offset, length).UnpackMap() - - case ParticleType.LIST: - return newUnpacker(buf, offset, length).UnpackList() - - case ParticleType.GEOJSON: - ncells := int(Buffer.BytesToInt16(buf, offset+1)) - headerSize := 1 + 2 + (ncells * 8) - return GeoJSONValue(string(buf[offset+headerSize : offset+length])), nil - - case ParticleType.HLL: - newObj := make([]byte, length) - copy(newObj, buf[offset:offset+length]) - return HLLValue(newObj), nil - - case ParticleType.BLOB: - newObj := make([]byte, length) - copy(newObj, buf[offset:offset+length]) - return newObj, nil - - case ParticleType.LDT: - return newUnpacker(buf, offset, length).unpackObjects() - - } - return nil, nil -} - -func bytesToKeyValue(pType int, buf []byte, offset int, length int) (Value, Error) { - - switch pType { - case ParticleType.STRING: - return NewStringValue(string(buf[offset : offset+length])), nil - - case ParticleType.INTEGER: - return NewLongValue(Buffer.VarBytesToInt64(buf, offset, length)), nil - - case ParticleType.FLOAT: - return NewFloatValue(Buffer.BytesToFloat64(buf, offset)), nil - - case ParticleType.BLOB: - bytes := make([]byte, length) - copy(bytes, buf[offset:offset+length]) - return NewBytesValue(bytes), nil - - case ParticleType.LIST: - v, err := newUnpacker(buf, offset, length).UnpackList() - if err != nil { - return nil, err - } - return ListValue(v), nil - - case ParticleType.NULL: - return NewNullValue(), nil - - default: - return nil, newError(types.PARSE_ERROR, fmt.Sprintf("ParticleType %d not recognized. Please file a github issue.", pType)) - } -} - -func unwrapValue(v interface{}) interface{} { - if v == nil { - return nil - } - - if uv, ok := v.(Value); ok { - return unwrapValue(uv.GetObject()) - } else if uv, ok := v.([]Value); ok { - a := make([]interface{}, len(uv)) - for i := range uv { - a[i] = unwrapValue(uv[i].GetObject()) - } - return a - } - - return v -} - -func grpcValuePacked(v Value) []byte { - if v == nil { - return nil - } - - sz, err := v.pack(nil) - if err != nil { - panic(err) - } - buf := newBuffer(sz) - if _, err := v.pack(buf); err != nil { - panic(err) - } - return buf.Bytes() -} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_helpers.go b/aerospike-tls/vendor-aerospike-client-go/value_helpers.go deleted file mode 100644 index d06c1cdf..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/value_helpers.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -// MapIter allows to define general maps of your own type to be used in the Go client -// without the use of reflection. -// function PackMap should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods): -// -// func (cm *CustomMap) PackMap(buf aerospike.BufferEx) (int, error) { -// size := 0 -// for k, v := range cm { -// n, err := PackXXX(buf, k) -// size += n -// if err != nil { -// return size, err -// } -// -// n, err = PackXXX(buf, v) -// size += n -// if err != nil { -// return size, err -// } -// } -// return size, nil -// } -type MapIter interface { - PackMap(buf BufferEx) (int, error) - Len() int -} - -// ListIter allows to define general maps of your own type to be used in the Go client -// without the use of reflection. -// function PackList should be exactly Like the following (Do not change, just copy/paste and adapt PackXXX methods): -// -// func (cs *CustomSlice) PackList(buf aerospike.BufferEx) (int, error) { -// size := 0 -// for _, elem := range cs { -// n, err := PackXXX(buf, elem) -// size += n -// if err != nil { -// return size, err -// } -// } -// return size, nil -// } -type ListIter interface { - PackList(buf BufferEx) (int, error) - Len() int -} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_reflect.go b/aerospike-tls/vendor-aerospike-client-go/value_reflect.go deleted file mode 100644 index c2387b40..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/value_reflect.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build !as_performance - -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "reflect" -) - -func init() { - newValueReflect = concreteNewValueReflect -} - -// if the returned value is nil, the caller will panic -func concreteNewValueReflect(v interface{}) Value { - // check for array and map - rv := reflect.ValueOf(v) - switch rv.Kind() { - case reflect.Array, reflect.Slice: - l := rv.Len() - arr := make([]interface{}, l) - for i := 0; i < l; i++ { - arr[i] = rv.Index(i).Interface() - } - - return NewListValue(arr) - case reflect.Map: - l := rv.Len() - amap := make(map[interface{}]interface{}, l) - for _, i := range rv.MapKeys() { - amap[i.Interface()] = rv.MapIndex(i).Interface() - } - - return NewMapValue(amap) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return NewLongValue(reflect.ValueOf(v).Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: - return NewLongValue(int64(reflect.ValueOf(v).Uint())) - case reflect.String: - return NewStringValue(rv.String()) - } - - return nil -} diff --git a/aerospike-tls/vendor-aerospike-client-go/value_test.go b/aerospike-tls/vendor-aerospike-client-go/value_test.go deleted file mode 100644 index 7c92487d..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/value_test.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math" - "reflect" - - gg "github.com/onsi/ginkgo/v2" - gm "github.com/onsi/gomega" - - ParticleType "github.com/aerospike/aerospike-client-go/v7/types/particle_type" - "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -type testBLOB struct { - name string -} - -func (b *testBLOB) EncodeBlob() ([]byte, error) { - return []byte(b.name), nil -} - -func isValidIntegerValue(i int, v Value) bool { - gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewIntegerValue(0)))) - gm.Expect(v.GetObject()).To(gm.Equal(i)) - gm.Expect(v.EstimateSize()).To(gm.Equal(int(buffer.SizeOfInt))) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.INTEGER)) - - return true -} - -func isValidLongValue(i int64, v Value) bool { - gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewLongValue(0)))) - gm.Expect(v.GetObject().(int64)).To(gm.Equal(i)) - gm.Expect(v.EstimateSize()).To(gm.Equal(int(buffer.SizeOfInt64))) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.INTEGER)) - - return true -} - -func isValidFloatValue(i float64, v Value) bool { - gm.Expect(reflect.TypeOf(v)).To(gm.Equal(reflect.TypeOf(NewFloatValue(0)))) - gm.Expect(v.GetObject().(float64)).To(gm.Equal(i)) - gm.Expect(v.EstimateSize()).To(gm.Equal(8)) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.FLOAT)) - - return true -} - -var _ = gg.Describe("Value Test", func() { - - gg.Context("NullValue", func() { - gg.It("should create a valid NullValue", func() { - v := NewValue(nil) - - gm.Expect(v.GetObject()).To(gm.BeNil()) - gm.Expect(v.EstimateSize()).To(gm.Equal(0)) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.NULL)) - }) - }) - - gg.Context("StringValues", func() { - gg.It("should create a valid string value", func() { - str := "string value" - v := NewValue(str) - - gm.Expect(v.GetObject()).To(gm.Equal(str)) - gm.Expect(v.EstimateSize()).To(gm.Equal(len(str))) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.STRING)) - }) - - gg.It("should create a valid empty string value", func() { - str := "" - v := NewValue(str) - - gm.Expect(v.GetObject()).To(gm.Equal(str)) - gm.Expect(v.EstimateSize()).To(gm.Equal(len(str))) - gm.Expect(v.GetType()).To(gm.Equal(ParticleType.STRING)) - }) - }) - - gg.Context("Blob Values", func() { - - gg.It("should create a BytesValue on valid types, and encode", func() { - person := &testBLOB{name: "SomeDude"} - - bval := NewValue(person) - gm.Expect(bval.GetType()).To(gm.Equal(ParticleType.BLOB)) - gm.Expect(bval).To(gm.BeAssignableToTypeOf(BytesValue{})) - gm.Expect(bval.GetObject()).To(gm.Equal([]byte(person.name))) - }) - }) - - gg.Context("Numeric Values", func() { - - gg.It("should create a valid IntegerValue on boundries of int8", func() { - i := int8(math.MinInt8) - v := NewValue(i) - isValidIntegerValue(int(i), v) - - i = int8(math.MaxInt8) - v = NewValue(i) - isValidIntegerValue(int(i), v) - }) - - gg.It("should create a valid IntegerValue on boundries of uint8", func() { - i := uint8(0) - v := NewValue(i) - isValidIntegerValue(int(i), v) - - i = uint8(math.MaxUint8) - v = NewValue(i) - isValidIntegerValue(int(i), v) - }) - - gg.It("should create a valid IntegerValue on boundries of int16", func() { - i := int16(math.MinInt16) - v := NewValue(i) - isValidIntegerValue(int(i), v) - - i = int16(math.MaxInt16) - v = NewValue(i) - isValidIntegerValue(int(i), v) - }) - - gg.It("should create a valid IntegerValue on boundries of uint16", func() { - i := uint16(0) - v := NewValue(i) - isValidIntegerValue(int(i), v) - - i = uint16(math.MaxUint16) - v = NewValue(i) - isValidIntegerValue(int(i), v) - }) - - gg.It("should create a valid IntegerValue on boundries of int32", func() { - i := int32(math.MinInt32) - v := NewValue(i) - isValidIntegerValue(int(i), v) - - i = int32(math.MaxInt32) - v = NewValue(i) - isValidIntegerValue(int(i), v) - }) - - gg.It("should create a valid IntegerValue on boundries of native int on 32 bit machines", func() { - if buffer.Arch32Bits { - i := math.MinInt32 - v := NewValue(i) - isValidIntegerValue(i, v) - - i = math.MaxInt32 - v = NewValue(i) - isValidIntegerValue(i, v) - } - }) - - gg.It("should create a valid LongValue after boundries of int32 is passed on 32 bit machines", func() { - if buffer.Arch32Bits { - i := math.MinInt32 - 1 - v := NewValue(i) - isValidLongValue(int64(i), v) - - i = math.MaxInt32 + 1 - v = NewValue(i) - isValidLongValue(int64(i), v) - } - }) - - gg.It("should create a valid IntegerValue on boundries of native int on 64 bit machines", func() { - if buffer.Arch64Bits { - i := math.MinInt64 - v := NewValue(i) - isValidIntegerValue(i, v) - - i = math.MaxInt64 - v = NewValue(i) - isValidIntegerValue(i, v) - } - }) - - gg.It("should create a valid LongValue on boundries of int64", func() { - i := int64(math.MinInt64) - v := NewValue(i) - isValidLongValue(i, v) - - i = int64(math.MaxInt64) - v = NewValue(i) - isValidLongValue(i, v) - }) - - gg.It("should create a valid FloatValue on boundries of float64", func() { - i := float64(-math.MaxFloat64) - v := NewValue(i) - isValidFloatValue(i, v) - - i = float64(math.MaxFloat64) - v = NewValue(i) - isValidFloatValue(i, v) - }) - - }) // numeric values context -}) diff --git a/aerospike-tls/vendor-aerospike-client-go/werrgroup.go b/aerospike-tls/vendor-aerospike-client-go/werrgroup.go deleted file mode 100644 index 7e36d334..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/werrgroup.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "context" - "sync" - - "golang.org/x/sync/semaphore" - - "github.com/aerospike/aerospike-client-go/v7/logger" -) - -type werrGroup struct { - sem *semaphore.Weighted - ctx context.Context - wg sync.WaitGroup - el sync.Mutex - errs Error - - // function to defer; used for recordset signals - f func() -} - -func newWeightedErrGroup(maxConcurrency int) *werrGroup { - if maxConcurrency <= 0 { - maxConcurrency = 1 - } - - return &werrGroup{ - sem: semaphore.NewWeighted(int64(maxConcurrency)), - ctx: context.Background(), - } -} - -func (weg *werrGroup) execute(cmd command) { - weg.wg.Add(1) - - if err := weg.sem.Acquire(weg.ctx, 1); err != nil { - logger.Logger.Error("Constraint Semaphore failed: %s", err.Error()) - } - - go func() { - defer weg.sem.Release(1) - defer weg.wg.Done() - if weg.f != nil { - defer weg.f() - } - - if err := cmd.Execute(); err != nil { - weg.el.Lock() - weg.errs = chainErrors(err, weg.errs) - weg.el.Unlock() - } - }() -} - -func (weg *werrGroup) wait() Error { - weg.wg.Wait() - return weg.errs -} diff --git a/aerospike-tls/vendor-aerospike-client-go/write_command.go b/aerospike-tls/vendor-aerospike-client-go/write_command.go deleted file mode 100644 index 9d23432a..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/write_command.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "github.com/aerospike/aerospike-client-go/v7/types" - - Buffer "github.com/aerospike/aerospike-client-go/v7/utils/buffer" -) - -// guarantee writeCommand implements command interface -var _ command = &writeCommand{} - -type writeCommand struct { - singleCommand - - policy *WritePolicy - bins []*Bin - binMap BinMap - operation OperationType -} - -func newWriteCommand(cluster *Cluster, - policy *WritePolicy, - key *Key, - bins []*Bin, - binMap BinMap, - operation OperationType) (writeCommand, Error) { - - var partition *Partition - var err Error - if cluster != nil { - partition, err = PartitionForWrite(cluster, &policy.BasePolicy, key) - if err != nil { - return writeCommand{}, err - } - } - - newWriteCmd := writeCommand{ - singleCommand: newSingleCommand(cluster, key, partition), - policy: policy, - bins: bins, - binMap: binMap, - operation: operation, - } - - return newWriteCmd, nil -} - -func (cmd *writeCommand) getPolicy(ifc command) Policy { - return cmd.policy -} - -func (cmd *writeCommand) writeBuffer(ifc command) Error { - return cmd.setWrite(cmd.policy, cmd.operation, cmd.key, cmd.bins, cmd.binMap) -} - -func (cmd *writeCommand) getNode(ifc command) (*Node, Error) { - return cmd.partition.GetNodeWrite(cmd.cluster) -} - -func (cmd *writeCommand) prepareRetry(ifc command, isTimeout bool) bool { - cmd.partition.PrepareRetryWrite(isTimeout) - return true -} - -func (cmd *writeCommand) parseResult(ifc command, conn *Connection) Error { - // Read header. - if _, err := conn.Read(cmd.dataBuffer, int(_MSG_TOTAL_HEADER_SIZE)); err != nil { - return err - } - - header := Buffer.BytesToInt64(cmd.dataBuffer, 0) - - // Validate header to make sure we are at the beginning of a message - if err := cmd.validateHeader(header); err != nil { - return err - } - - resultCode := cmd.dataBuffer[13] & 0xFF - - if resultCode != 0 { - if resultCode == byte(types.KEY_NOT_FOUND_ERROR) { - return ErrKeyNotFound.err() - } else if types.ResultCode(resultCode) == types.FILTERED_OUT { - return ErrFilteredOut.err() - } - - return newCustomNodeError(cmd.node, types.ResultCode(resultCode)) - } - return cmd.emptySocket(conn) -} - -func (cmd *writeCommand) isRead() bool { - return false -} - -func (cmd *writeCommand) Execute() Error { - return cmd.execute(cmd) -} - -func (cmd *writeCommand) transactionType() transactionType { - return ttPut -} diff --git a/aerospike-tls/vendor-aerospike-client-go/write_policy.go b/aerospike-tls/vendor-aerospike-client-go/write_policy.go deleted file mode 100644 index 492fc384..00000000 --- a/aerospike-tls/vendor-aerospike-client-go/write_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2014-2022 Aerospike, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aerospike - -import ( - "math" -) - -const ( - // TTLServerDefault will default to namespace configuration variable "default-ttl" on the server. - TTLServerDefault = 0 - // TTLDontExpire will never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server. - TTLDontExpire = math.MaxUint32 - // TTLDontUpdate will not change the record's ttl when record is written. Supported by Aerospike server versions >= 3.10.1 - TTLDontUpdate = math.MaxUint32 - 1 -) - -// WritePolicy encapsulates parameters for policy attributes used in write operations. -// This object is passed into methods where database writes can occur. -type WritePolicy struct { - BasePolicy - - // RecordExistsAction qualifies how to handle writes where the record already exists. - RecordExistsAction RecordExistsAction //= RecordExistsAction.UPDATE; - - // GenerationPolicy qualifies how to handle record writes based on record generation. The default (NONE) - // indicates that the generation is not used to restrict writes. - GenerationPolicy GenerationPolicy //= GenerationPolicy.NONE; - - // Desired consistency guarantee when committing a transaction on the server. The default - // (COMMIT_ALL) indicates that the server should wait for master and all replica commits to - // be successful before returning success to the client. - CommitLevel CommitLevel //= COMMIT_ALL - - // Generation determines expected generation. - // Generation is the number of times a record has been - // modified (including creation) on the server. - // If a write operation is creating a record, the expected generation would be 0. - Generation uint32 - - // Expiration determines record expiration in seconds. Also known as TTL (Time-To-Live). - // Seconds record will live before being removed by the server. - // Expiration values: - // TTLServerDefault (0): Default to namespace configuration variable "default-ttl" on the server. - // TTLDontExpire (MaxUint32): Never expire for Aerospike 2 server versions >= 2.7.2 and Aerospike 3+ server - // TTLDontUpdate (MaxUint32 - 1): Do not change ttl when record is written. Supported by Aerospike server versions >= 3.10.1 - // > 0: Actual expiration in seconds. - Expiration uint32 - - // RespondPerEachOp defines for client.Operate() method, return a result for every operation. - // Some list operations do not return results by default (ListClearOp() for example). - // This can sometimes make it difficult to determine the desired result offset in the returned - // bin's result list. - // - // Setting RespondPerEachOp to true makes it easier to identify the desired result offset - // (result offset equals bin's operate sequence). This only makes sense when multiple list - // operations are used in one operate call and some of those operations do not return results - // by default. - RespondPerEachOp bool - - // DurableDelete leaves a tombstone for the record if the transaction results in a record deletion. - // This prevents deleted records from reappearing after node failures. - // Valid for Aerospike Server Enterprise Edition 3.10+ only. - DurableDelete bool -} - -// NewWritePolicy initializes a new WritePolicy instance with default parameters. -func NewWritePolicy(generation, expiration uint32) *WritePolicy { - res := &WritePolicy{ - BasePolicy: *NewPolicy(), - RecordExistsAction: UPDATE, - GenerationPolicy: NONE, - CommitLevel: COMMIT_ALL, - Generation: generation, - Expiration: expiration, - } - - // Writes may not be idempotent. - // do not allow retries on writes by default. - res.MaxRetries = 0 - - return res -} From f7d9dcd06036729f932f6f5f0d8cfa2f565c2158 Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 16:24:53 +0530 Subject: [PATCH 3/8] aerospike-tls: drop MOCKS_FLOW.md, keep README as the only doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The annotated mock walk-through was useful while iterating on the parser but isn't load-bearing for the sample — anyone curious about the mock layout can read mocks.yaml directly. Drop it and the README section that pointed at it. Co-Authored-By: Claude Opus 4.7 (1M context) --- aerospike-tls/MOCKS_FLOW.md | 240 ------------------------------------ aerospike-tls/README.md | 8 -- 2 files changed, 248 deletions(-) delete mode 100644 aerospike-tls/MOCKS_FLOW.md diff --git a/aerospike-tls/MOCKS_FLOW.md b/aerospike-tls/MOCKS_FLOW.md deleted file mode 100644 index d3c2afec..00000000 --- a/aerospike-tls/MOCKS_FLOW.md +++ /dev/null @@ -1,240 +0,0 @@ -# Keploy Mocks — End-to-End Flow - -This document walks through every Keploy mock captured for the -`e2e-tls-run` sample app, in the exact order Keploy recorded them, and -maps them onto the HTTP tests in `keploy/test-set-0/tests/`. The -sample app is an Aerospike-Go client talking to Aerospike over TLS -(port 3001) via Keploy's TLS-terminating proxy, so every entry in -`mocks.yaml` is an Aerospike wire-protocol exchange that the proxy -intercepted in front of the parser. - -* Source recording: `keploy/test-set-0/mocks.yaml` (4104 lines, 114 - mocks numbered `mock-0` … `mock-113`). -* Source tests: `keploy/test-set-0/tests/*.yaml` (7 HTTP tests). - ---- - -## 1. Mock anatomy - -Every mock is one Aerospike request/response pair with the same -top-level shape: - -```yaml -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-N -spec: - metadata: - protocol: aerospike - reqType: Info | Message - respType: Info | Message - type: config | mocks - requests: [ { header, meta, message } ] - responses: [ { header, meta, message } ] - ReqTimestampMock: - ResTimestampMock: -``` - -Two `metadata.type` buckets cover the whole file: - -| `metadata.type` | Wire | `packet_type` | Protocol byte (header.type) | What it carries | -|-----------------|------|---------------|-----------------------------|------------------------------------------------| -| `config` | Info | `Info` | `1` | ASCII info commands: `build`, `node`, `peers-clear-std`, `partition-generation`, … | -| `mocks` | Data | `Message` | `3` | Binary Aerospike Message protocol: PUT, GET, BATCH, TOUCH, DELETE, … | - -The `meta` block is parser-decoded sugar (the human-readable view of -`raw_body`, base64 of the original bytes). `message: null` means the -parser did not need a structured `message` field — the `meta` + raw -bytes are authoritative. - ---- - -## 2. The two big phases - -The recording splits cleanly into two phases: - -1. **Bootstrap + tend chatter (`type: config`, packet `Info`).** - The Aerospike Go client uses ASCII info commands to learn cluster - topology at startup and to keep its view fresh via a ~250 ms tend - loop. Most of `mocks.yaml` is this background traffic. - -2. **Actual application traffic (`type: mocks`, packet `Message`).** - Each HTTP test in `tests/` is backed by one or more binary - Aerospike Message requests. There are only a handful of these - compared to the tend chatter. - -Counts in this run: - -* `type: config` mocks: ~107 -* `type: mocks` mocks: 7 — one per data operation the app issued - ---- - -## 3. Bootstrap (mocks 0–4) — initial cluster discovery - -These fire once, before any HTTP test runs, while -`as.NewClientWithPolicyAndHost` is establishing the cluster view. - -| Mock | `info_command` (request) | Response highlights | Purpose | -|-----------|--------------------------|----------------------------------------------|----------------------------------------| -| `mock-0` | `build` | `build\t7.2.0.1` | Server version probe | -| `mock-1` | `node\npartition-generation\nfeatures` | `node\tBB9D8CBBBBACB36` + `partition-generation\t0` + long `features\t…` list (`batch-any;batch-index;cdt-list;cdt-map;udf;…`) | Identify node + read its capabilities | -| `mock-2` | `node\npeers-generation\npartition-generation` | same node id + generations `0` / `0` | First combined tend probe | -| `mock-3` | `peers-clear-std` | `peers-clear-std\t0,3000,[]` (no peers, port 3000) | Peer list (empty — single-node) | -| `mock-4` | `partition-generation` | `partition-generation\t0` | Partition-map version (still 0) | - -The empty `peers-clear-std` response is why `main.go` sets -`policy.SeedOnlyCluster = true` — Aerospike CE only advertises the -clear-text peer endpoint, which is unreachable behind the TLS -terminator, so the client must stay pinned to the seed. - ---- - -## 4. Tend loop pattern (mocks 5–26, and sprinkled throughout) - -After bootstrap, the Aerospike Go client's tend goroutine repeats a -two-mock pair roughly every 250–500 ms while the app is idle: - -* **`node` + `peers-generation` + `partition-generation`** — node id + - whether peers or partitions have changed. Always responds with the - same id and generations `0` (no topology drift in this single-node - recording). -* **`peers-clear-std`** — full peer list. Always empty. - -These pairs (mocks 5/6, 7/8, 9/10, …) make up the bulk of -`mocks.yaml`. They are **only there to satisfy the client's -periodic refresh**; they do not correspond to any HTTP test. Replays -serve them on demand so the client stays "connected" between data -ops. - -You will see exactly this `node` / `peers-clear-std` pair re-appear -between every pair of HTTP tests below. - ---- - -## 5. The seven application operations (Message mocks) - -The seven binary-protocol mocks line up one-to-one with the seven HTTP -tests, in capture order: - -| Mock | Test file | App endpoint | Aerospike op (decoded) | Notes | -|------------|---------------------------------|-------------------------|------------------------------------|------------------------------------------------------| -| `mock-27` | `post-put-1.yaml` | `POST /put` | PUT `test/demo/alice` | Bins `{name:"Alice", age:30}`. Request 101 B → 22 B ack. | -| `mock-30` | `get-get-alice-1.yaml` | `GET /get/alice` | GET `test/demo/alice` | Request 65 B → 22 B + bin payload. | -| `mock-33` | `post-batch-put-1.yaml` (1/2) | `POST /batch/put` | PUT `test/demo/a` `{n:1}` | Implemented as a sequential PUT loop in `main.go`. | -| `mock-34` | `post-batch-put-1.yaml` (2/2) | `POST /batch/put` | PUT `test/demo/b` `{n:2}` | Second PUT in the same handler. | -| `mock-37` | `get-batch-get-1.yaml` | `GET /batch/get?k=a&k=b`| BATCH_READ digests for `a`, `b` | Request 105 B → 78 B with two records. | -| `mock-42` | `get-batch-get-1.yaml` (retry) | (same) | Large BATCH_READ retry | 8259 B request, fires after the test handler already returned `500 TIMEOUT` — see §6. | -| `mock-55` | `post-touch-alice-1.yaml` | `POST /touch/alice` | TOUCH `test/demo/alice` | `Operate(... 0x0B)` — touch generation/TTL. | -| `mock-58` | `delete-key-alice-1.yaml` | `DELETE /key/alice` | DELETE `test/demo/alice` | Final cleanup. info3 flag `0x04` = delete. | - -Every Message mock carries `namespace: test`, `set: demo`, matching -the keys `main.go` constructs with `as.NewKey("test","demo",…)`. - -### How to spot which is which - -* Look at `requests[0].header.header.length` and the leading byte of - the decoded `raw_body`: - * info1/info2/info3 byte 1 of the body tells you the opcode flags - (READ / WRITE / DELETE / TOUCH / BATCH). -* `meta.namespace` and `meta.set` confirm the target. -* Pair it with the nearest test by timestamp (`ReqTimestampMock` vs. - the test's `req.timestamp`). - ---- - -## 6. Special case — the BatchGet timeout (mocks 37 → 42) - -`get-batch-get-1.yaml` is the only test that did **not** return 200. -Its recorded response is: - -``` -status_code: 500 -body: | - ResultCode: TIMEOUT, Iteration: 1, InDoubt: false, … - read tcp 127.0.0.1:50236->127.0.0.1:3001: i/o timeout -``` - -That timeout is exactly what produces the unusual pair: - -1. `mock-37` (`14:06:28.494`) — the first BATCH_READ attempt for - `{a, b}`. Server returns successfully (78 B), but the client - considers the call timed out. -2. The HTTP handler returns 500 to the curl at `14:06:29.490`. -3. `mock-42` (`14:06:30.501`) — the Aerospike client's retry path - fires a much larger BATCH_READ (8259 B) on its own goroutine, - well after the HTTP response was already sent. The response is - 164 B containing the two records' digests. - -The same shape repeats much later in the recording as `mock-101` -(`14:07:00.622`, 8300 B), an even later orphaned retry — both are -artifacts of the timeout path, not new application traffic. - ---- - -## 7. End-to-end flow diagram - -``` -T=0 App starts → Aerospike client constructor - ├─ mock-0 .. mock-4 : bootstrap (build, node+features, peers, partition-gen) - └─ (tend goroutine begins; mock-5..mock-26 fire every ~250 ms) - -T+12s curl GET /health - └─ no Aerospike traffic (handler only calls client.GetNodes() in-process) - - curl POST /put alice ───────────────────► mock-27 (PUT alice, ack) - - [tend pair: mock-28 / mock-29] - - curl GET /get/alice ───────────────────► mock-30 (GET alice) - - [tend pair: mock-31 / mock-32] - - curl POST /batch/put ───────────────────► mock-33 (PUT a {n:1}) - ─────────────────────► mock-34 (PUT b {n:2}) - - [tend pairs: mock-35 / mock-36] - - curl GET /batch/get?k=a&k=b ──────────────► mock-37 (BATCH_READ {a,b}) - ↓ client-side timeout - HTTP 500 TIMEOUT to curl - [tend pairs: mock-38 .. mock-41] - mock-42 (retry, 8259 B request) - - [long tend stretch: mock-43 .. mock-54] - - curl POST /touch/alice ──────────────────► mock-55 (TOUCH alice) - - [tend pair: mock-56 / mock-57] - - curl DELETE /key/alice ──────────────────► mock-58 (DELETE alice) - - [tail tend stretch: mock-59 .. mock-100] - mock-101 (late BATCH_READ retry) - [tail tend stretch: mock-102 .. mock-113] -``` - -The numbered mocks not explicitly called out are all tend-loop -`node` / `peers-clear-std` pairs — the same two requests, with the -same two responses, replayed by Keploy to keep the Aerospike Go -client happy while it waits for the next HTTP test. - ---- - -## 8. What the parser sees vs. what the proxy sees - -Because the proxy terminates TLS upstream of the Aerospike parser, -every byte you see in `mocks.yaml` is **plain Aerospike wire -protocol** — there is no TLS framing in `raw_body`, even though the -app dials port 3001 with a real TLS ClientHello. That is the second -claim called out in `main.go`'s header comment: - -> Proxy TLS detection is byte-pattern driven, not port driven. -> This client sends a real TLS ClientHello on a non-3306, non-443 -> port; the proxy still recognises it via `Peek(5) → IsTLSHandshake` -> and MITMs the connection. - -If you want to verify, base64-decode any `raw_body` and confirm the -leading byte is the Aerospike message header (`0x16` for Message -ops, ASCII text for Info ops) — never a TLS record (`0x16 0x03 …` -ClientHello). diff --git a/aerospike-tls/README.md b/aerospike-tls/README.md index 40718511..93844070 100644 --- a/aerospike-tls/README.md +++ b/aerospike-tls/README.md @@ -38,7 +38,6 @@ aerospike-tls/ │ ├── test-set-0/ # single-endpoint CRUD: put/get/batch/touch/delete │ ├── test-set-1/ # /parallel: shared client, n = 4..24 │ └── test-set-2/ # /multiclient + /freshclient -├── MOCKS_FLOW.md # annotated walk-through of test-set-0's mocks.yaml └── stunnel/ # (referenced by docker-compose for TLS termination) ``` @@ -153,10 +152,3 @@ against CE, the cleanest options are to point at Aerospike Enterprise, or to apply the two-line `serviceString` / `peersString` override locally before recording. The bundled test-sets in this repo were recorded with that override in place. - -## What `MOCKS_FLOW.md` is for - -It walks through `test-set-0/mocks.yaml` mock-by-mock and shows -how each HTTP test maps onto the binary Aerospike traffic the -proxy captured. It is intentionally `test-set-0`-specific — -test-set-1 and test-set-2 follow the same shape. From bddb3111b40b5f7ced232e074c49a72769f25057 Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 16:39:15 +0530 Subject: [PATCH 4/8] aerospike-tls: drop TLS, switch to scripted record/replay per test-set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sample was originally TLS-fronted by socat/stunnel on port 3001, which forced a vendored aerospike-client-go fork (CE doesn't answer EE-only service-tls-std/peers-tls-std). With the vendor patch already gone, the upstream client failed cluster discovery against CE on the TLS port. The simpler fix is to drop TLS from the sample entirely: * main.go: remove crypto/tls + tls-* flags + buildTLSConfig. The default Aerospike port is now 3000 (clear-text); host/port are still flag-driven. * docker-compose.yml: drop the socat sidecar, expose aerospike:3000 directly, drop the cert volume from the sample service. * Delete gen-certs.sh, stunnel/, certs/, and the .gitignore that listed them. Nothing in the project needs PKI anymore. In place of a static keploy/ folder, add three pipeline-ready scripts: * scripts/common.sh — shared boot/build/record/replay/normalise * scripts/script-1.sh — test-set-0: single-endpoint CRUD coverage * scripts/script-2.sh — test-set-1: /parallel n = 4, 8, 12, 24 * scripts/script-3.sh — test-set-2: /multiclient + /freshclient Each script records its set fresh, normalises the test-set directory naming (keploy auto-numbers when the target dir is missing), applies body.duration noise to time-bearing responses, and runs `keploy test`. KEPLOY / PORT / LOG_DIR / SKIP_DOCKER / SKIP_BUILD env vars cover the CI matrix knobs. Verified locally — all three scripts run record + replay end-to-end: test-set-0: 8/8 pass (CRUD + auto-captured tend healths) test-set-1: 6/6 pass (/parallel up to n=24) test-set-2: 8/8 pass (/multiclient n=24 + /freshclient n=8) README rewritten around the new flow. Co-Authored-By: Claude Opus 4.7 (1M context) --- aerospike-tls/.gitignore | 1 - aerospike-tls/README.md | 174 +- aerospike-tls/aerospike-conf/aerospike.conf | 7 +- aerospike-tls/docker-compose.yml | 39 +- aerospike-tls/gen-certs.sh | 60 - aerospike-tls/keploy.yml | 2 +- aerospike-tls/keploy/.gitignore | 2 - aerospike-tls/keploy/test-set-0/mocks.yaml | 4104 --- .../test-set-0/tests/delete-key-alice-1.yaml | 41 - .../test-set-0/tests/get-batch-get-1.yaml | 46 - .../test-set-0/tests/get-get-alice-1.yaml | 41 - .../keploy/test-set-0/tests/get-health-1.yaml | 41 - .../test-set-0/tests/post-batch-put-1.yaml | 45 - .../keploy/test-set-0/tests/post-put-1.yaml | 45 - .../test-set-0/tests/post-touch-alice-1.yaml | 41 - aerospike-tls/keploy/test-set-1/mocks.yaml | 8820 ----- .../keploy/test-set-1/tests/get-health-1.yaml | 41 - .../test-set-1/tests/post-parallel-1.yaml | 45 - .../test-set-1/tests/post-parallel-2.yaml | 45 - .../test-set-1/tests/post-parallel-3.yaml | 45 - .../test-set-1/tests/post-parallel-4.yaml | 45 - aerospike-tls/keploy/test-set-2/mocks.yaml | 30708 ---------------- .../keploy/test-set-2/tests/get-health-1.yaml | 41 - .../test-set-2/tests/post-freshclient-1.yaml | 45 - .../test-set-2/tests/post-freshclient-2.yaml | 45 - .../test-set-2/tests/post-multiclient-1.yaml | 45 - .../test-set-2/tests/post-multiclient-2.yaml | 45 - .../test-set-2/tests/post-multiclient-3.yaml | 45 - .../test-set-2/tests/post-multiclient-4.yaml | 45 - aerospike-tls/main.go | 148 +- aerospike-tls/scripts/common.sh | 165 + aerospike-tls/scripts/script-1.sh | 34 + aerospike-tls/scripts/script-2.sh | 23 + aerospike-tls/scripts/script-3.sh | 28 + aerospike-tls/stunnel/stunnel.conf | 9 - 35 files changed, 377 insertions(+), 44779 deletions(-) delete mode 100644 aerospike-tls/.gitignore delete mode 100755 aerospike-tls/gen-certs.sh delete mode 100644 aerospike-tls/keploy/.gitignore delete mode 100644 aerospike-tls/keploy/test-set-0/mocks.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/delete-key-alice-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/get-batch-get-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/mocks.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml delete mode 100644 aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/mocks.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml delete mode 100644 aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml create mode 100755 aerospike-tls/scripts/common.sh create mode 100755 aerospike-tls/scripts/script-1.sh create mode 100755 aerospike-tls/scripts/script-2.sh create mode 100755 aerospike-tls/scripts/script-3.sh delete mode 100644 aerospike-tls/stunnel/stunnel.conf diff --git a/aerospike-tls/.gitignore b/aerospike-tls/.gitignore deleted file mode 100644 index df912870..00000000 --- a/aerospike-tls/.gitignore +++ /dev/null @@ -1 +0,0 @@ -certs/ diff --git a/aerospike-tls/README.md b/aerospike-tls/README.md index 93844070..a41607bf 100644 --- a/aerospike-tls/README.md +++ b/aerospike-tls/README.md @@ -1,26 +1,24 @@ -# aerospike-tls — Aerospike-Go sample with Keploy record/replay over TLS - -A small Go HTTP service that talks to **Aerospike on a TLS-only -port (3001)** via the official `aerospike-client-go/v7` driver. It is -recorded and replayed end-to-end through Keploy, which transparently -MITMs the TLS connection and serves binary Aerospike traffic from -captured mocks at replay time. - -The point of the sample is to demonstrate three things: - -* **Keploy records Aerospike traffic over TLS** the same way it does - over clear text — the proxy detects the TLS handshake by byte - pattern (not by port) and terminates it upstream of the parser. - What lands in `keploy/*/mocks.yaml` is plaintext Aerospike wire - protocol, not ciphertext. -* **The recordings replay deterministically** at any concurrency the - app exposes — single-client parallel ops, multiple-client - round-robin, and per-request fresh-client construction all pass - 3× in a row. -* **Realistic Aerospike usage shapes** — connection pool sizing, - retry policy, and warmup that survive the burst-load characteristics - of mocked replay (which is much faster than real Aerospike and - exposes pool-acquire races a regular load test would never hit). +# aerospike-tls — Aerospike-Go sample with Keploy record/replay + +A small Go HTTP service that talks to Aerospike CE over the clear-text +service port (3000) using `aerospike-client-go/v7`. The sample is +recorded and replayed end-to-end with Keploy: bundled scripts spin +up the dependency, drive the API with `curl`, record the resulting +Aerospike traffic, and replay it deterministically against captured +mocks. + +What the sample demonstrates: + +* **Keploy records binary Aerospike protocol traffic** — Info, + AS_MSG (single-record PUT/GET/TOUCH/DELETE), BATCH_READ/WRITE, + SCAN, QUERY, UDF, CDT — and replays them from `mocks.yaml` + without needing the real cluster. +* **Replay stays deterministic at any concurrency the app exposes** — + single-client `/parallel`, multi-client round-robin, and per-request + fresh-client construction all pass cleanly. +* **A pipeline-friendly shape**. Three `scripts/script-{1,2,3}.sh` + entry points each record and replay one test-set independently, + so CI can call them as separate jobs (or as one matrix). ## Layout @@ -28,19 +26,22 @@ The point of the sample is to demonstrate three things: aerospike-tls/ ├── main.go # the HTTP service ├── go.mod / go.sum -├── gen-certs.sh # self-signed CA + server + (optional) client certs ├── aerospike-conf/ -│ └── aerospike.conf # CE config: TLS-only service on 3001 -├── docker-compose.yml # Aerospike CE + stunnel TLS terminator -├── Dockerfile # builds the sample binary +│ └── aerospike.conf # CE config: clear-text on 3000 +├── docker-compose.yml # Aerospike CE + the sample +├── Dockerfile # builds the sample binary for compose ├── keploy.yml # Keploy CLI config (command, ports) -├── keploy/ # captured test-sets + mocks -│ ├── test-set-0/ # single-endpoint CRUD: put/get/batch/touch/delete -│ ├── test-set-1/ # /parallel: shared client, n = 4..24 -│ └── test-set-2/ # /multiclient + /freshclient -└── stunnel/ # (referenced by docker-compose for TLS termination) +└── scripts/ + ├── common.sh # shared helpers (boot, build, record, replay) + ├── script-1.sh # records + replays test-set-0 (CRUD) + ├── script-2.sh # records + replays test-set-1 (/parallel) + └── script-3.sh # records + replays test-set-2 (/multiclient + /freshclient) ``` +There is no committed `keploy/` directory — the scripts produce it +from scratch every run. That keeps the repo lean and means every CI +run validates the full record-then-replay loop. + ## Endpoints | Method | Path | What it does | @@ -57,98 +58,83 @@ aerospike-tls/ | POST | `/cdt/map/put` | CDT map put | | POST | `/touch/{key}` | TOUCH | | DELETE | `/key/{key}` | DELETE | -| POST | `/parallel?n=N&prefix=P` | fans out N goroutines, each PUT+GET a unique key — **one shared client** | +| POST | `/parallel?n=N&prefix=P` | fans out N goroutines, each PUT+GET on a unique key — **one shared client** | | POST | `/multiclient?n=N&prefix=P`| same, but round-robins across **4 pre-built `*as.Client` instances** | | POST | `/freshclient?n=N&prefix=P`| **each goroutine builds its own `*as.Client`** inside the request | -## Run it +## Run it manually ```bash -cd aerospike-tls - -# 1) Self-signed PKI under ./certs (CN = aerospike.local). -./gen-certs.sh +# 1) Boot Aerospike CE on clear-text 3000. +docker compose up -d aerospike -# 2) Start the TLS-only Aerospike + stunnel. -docker compose up -d aerospike stunnel - -# 3) Build + run the app. +# 2) Build + run the sample. go build -o aerospike-tls . -./aerospike-tls --aerospike-port=3001 --tls-name=aerospike.local --tls-ca=./certs/ca.pem --tls-insecure=true +./aerospike-tls -# 4) Hit it. +# 3) Hit it. curl -s localhost:8080/health curl -s -XPOST localhost:8080/put -d '{"key":"alice","bins":{"age":30}}' curl -s localhost:8080/get/alice -curl -s -XPOST 'localhost:8080/parallel?n=24&prefix=run4' -curl -s -XPOST 'localhost:8080/multiclient?n=24&prefix=mc4' -curl -s -XPOST 'localhost:8080/freshclient?n=8&prefix=fc' +curl -s -XPOST 'localhost:8080/parallel?n=24&prefix=run1' +curl -s -XPOST 'localhost:8080/multiclient?n=24&prefix=mc1' +curl -s -XPOST 'localhost:8080/freshclient?n=8&prefix=fc1' ``` -## Record / replay with Keploy - -`keploy.yml` is already wired with the command line above. To record: +## Record + replay with the scripts ```bash -sudo keploy record -# in another shell — fire the curls from "Run it" -# then Ctrl+C the recorder +# Each script is self-contained: brings up Aerospike, builds, records, +# replays. Exit code is non-zero if any case fails on replay. +sudo ./scripts/script-1.sh # test-set-0: single-endpoint CRUD +sudo ./scripts/script-2.sh # test-set-1: /parallel n = 4..24 +sudo ./scripts/script-3.sh # test-set-2: /multiclient + /freshclient ``` -To replay only one test-set: +Pipeline-friendly knobs (env vars): -```bash -sudo keploy test --test-sets test-set-2 -``` +| Var | Default | What it does | +|--------------|---------------|---------------------------------------------------------------| +| `KEPLOY` | `sudo keploy` | binary + auth invocation. Override to `keploy` if root | +| `PORT` | `8090` | HTTP port the recorded sample listens on | +| `LOG_DIR` | `/tmp` | where to drop the keploy record log | +| `SKIP_DOCKER`| (unset) | `=1` skips `docker compose up -d aerospike` (already running) | +| `SKIP_BUILD` | (unset) | `=1` skips `go build` (binary already in place) | -The bundled `keploy/test-set-{0,1,2}/` directories were recorded with -the dev Aerospike parser; the replay path serves binary Aerospike -ops from `mocks.yaml` so the app never touches the real cluster. +A typical CI job looks like: + +```yaml +- run: docker compose up -d aerospike +- run: go build -o aerospike-tls . +- run: SKIP_DOCKER=1 SKIP_BUILD=1 ./scripts/script-1.sh +- run: SKIP_DOCKER=1 SKIP_BUILD=1 ./scripts/script-2.sh +- run: SKIP_DOCKER=1 SKIP_BUILD=1 ./scripts/script-3.sh +``` ## Concurrency notes — what makes replay deterministic Mocked replay through Keploy is roughly 20× faster than real -Aerospike for the same op. A burst of N concurrent goroutines on -a cold client pool then races to open N fresh TLS-MITM'd sockets, -and the goroutine that loses the race surfaces as -`MAX_RETRIES_EXCEEDED` at the application — even though every peer -in the same burst succeeds. +Aerospike for the same op. A burst of N concurrent goroutines on a +cold client pool then races to open N fresh sockets, and the +goroutine that loses the race surfaces as `MAX_RETRIES_EXCEEDED` at +the application — even though every peer in the same burst succeeds. `main.go` paints over this with four layered changes; together they -make N up to 24 (the largest burst in `test-set-1`) replay 5/5 on -every run: +make `/parallel?n=24`, `/multiclient?n=24`, and `/freshclient?n=8` +replay clean on every run: 1. **Sized pool** — `ClientPolicy.ConnectionQueueSize = 256`, - `OpeningConnectionThreshold = 16`. The threshold is kept low so - stunnel's `fork()` model on the upstream doesn't get hammered. + `OpeningConnectionThreshold = 16`. 2. **Tolerant per-op policy** — `parallelWritePolicy` and `parallelReadPolicy` set `SocketTimeout 10s`, `TotalTimeout 30s`, `MaxRetries 10`, `SleepBetweenRetries 5ms`. -3. **Two-phase warmup** on the main client at startup: an 8-op - sequential prelude (walks the proxy past cold-start TLS) followed - by a 32-op parallel fill (puts 32 idle connections in the pool). +3. **Two-phase warmup** on the main client at startup: a sequential + prelude that walks the cluster past cold-start latencies, + followed by a parallel fill that puts idle connections in the + pool before the HTTP server accepts the first request. 4. **App-level retry wrapper** (`parallelDo`) around each PUT and - GET in `/parallel`, `/multiclient`, and `/freshclient`. Cooperative - goroutines in the same burst return their connections during the - 10 ms backoff, so the retry hits a warm pool. + GET in `/parallel`, `/multiclient`, and `/freshclient`. `/multiclient`'s extra clients are deliberately NOT warmed at -startup — five clients warming in parallel produces hundreds of -concurrent TLS dials and starves stunnel's fork rate. The retry -wrapper covers their first burst instead. - -## A note on Aerospike CE vs EE for TLS discovery - -The upstream `aerospike-client-go/v7` driver assumes the cluster -answers Enterprise-only info commands (`service-tls-std` / -`peers-tls-std`) during topology discovery on a TLS connection. -Aerospike Community Edition replies `ERROR:25:enterprise only`, -which fails node validation even though the TLS handshake itself -succeeded. - -For replay (`keploy test`) that doesn't matter — Keploy serves the -recorded discovery responses from `mocks.yaml`. For live record -against CE, the cleanest options are to point at Aerospike -Enterprise, or to apply the two-line `serviceString` / -`peersString` override locally before recording. The bundled -test-sets in this repo were recorded with that override in place. +startup — a hundred concurrent dials at boot can stall a record-time +proxy. The retry wrapper covers their first burst instead. diff --git a/aerospike-tls/aerospike-conf/aerospike.conf b/aerospike-tls/aerospike-conf/aerospike.conf index 3fee77bf..8c22d390 100644 --- a/aerospike-tls/aerospike-conf/aerospike.conf +++ b/aerospike-tls/aerospike-conf/aerospike.conf @@ -1,11 +1,8 @@ -# Aerospike CE config — clear-text only on port 3000 inside the docker -# network. TLS is terminated by stunnel sitting in front of this service -# (see docker-compose.yml + stunnel/stunnel.conf). From the app and the -# Keploy proxy's perspective the wire is TLS on 3001 either way. +# Aerospike CE config — clear-text on port 3000. service { proto-fd-max 15000 - cluster-name aerospike-tls-sample + cluster-name aerospike-sample } logging { diff --git a/aerospike-tls/docker-compose.yml b/aerospike-tls/docker-compose.yml index 39c86d99..6dec9577 100644 --- a/aerospike-tls/docker-compose.yml +++ b/aerospike-tls/docker-compose.yml @@ -1,11 +1,13 @@ -# Aerospike CE on plain 3000 (inside docker network), stunnel in front -# terminating TLS on 3001 (exposed to host). Run ./gen-certs.sh first. +# Aerospike CE on clear-text 3000, exposed to the host. The sample +# dials it directly — no TLS terminator in the path. services: aerospike: image: aerospike/aerospike-server:7.2.0.1 - container_name: aerospike-tls + container_name: aerospike networks: - aerospike-net + ports: + - "3000:3000" volumes: - ./aerospike-conf/aerospike.conf:/etc/aerospike/aerospike.conf:ro entrypoint: ["/usr/bin/asd", "--foreground", "--config-file", "/etc/aerospike/aerospike.conf"] @@ -20,47 +22,22 @@ services: timeout: 3s retries: 20 - stunnel: - image: alpine/socat:latest - container_name: aerospike-stunnel - depends_on: - aerospike: - condition: service_healthy - networks: - - aerospike-net - ports: - - "3001:3001" # TLS endpoint - volumes: - - ./certs/server.pem:/certs/server.pem:ro - - ./certs/server.key:/certs/server.key:ro - command: - - "-d" - - "-d" - - "OPENSSL-LISTEN:3001,reuseaddr,fork,cert=/certs/server.pem,key=/certs/server.key,verify=0" - - "TCP:aerospike:3000" - sample: build: context: . dockerfile: Dockerfile - container_name: aerospike-tls-sample + container_name: aerospike-sample depends_on: - stunnel: - condition: service_started aerospike: condition: service_healthy environment: - AEROSPIKE_HOST: stunnel - AEROSPIKE_PORT: "3001" - AEROSPIKE_TLS_NAME: aerospike.local - AEROSPIKE_TLS_CA: /certs/ca.pem + AEROSPIKE_HOST: aerospike + AEROSPIKE_PORT: "3000" LISTEN: ":8080" ports: - "8080:8080" networks: - aerospike-net - volumes: - - ./certs:/certs:ro networks: aerospike-net: diff --git a/aerospike-tls/gen-certs.sh b/aerospike-tls/gen-certs.sh deleted file mode 100755 index 41ffb314..00000000 --- a/aerospike-tls/gen-certs.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# Generate a self-signed PKI for the TLS sample: -# certs/ca.{pem,key} — root CA -# certs/server.{pem,key} — Aerospike server cert with -# CN/SAN = aerospike.local (and 127.0.0.1) -# certs/client.{pem,key} — client cert (optional mTLS) -# -# Re-run any time. Existing files are overwritten. -set -euo pipefail - -DIR="$(cd "$(dirname "$0")" && pwd)/certs" -mkdir -p "$DIR" -cd "$DIR" - -TLS_NAME="${TLS_NAME:-aerospike.local}" -DAYS="${DAYS:-825}" - -cat > openssl.cnf <127.0.0.1:3001: i/o timeout - status_message: Internal Server Error - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:29.490010468+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488589 - app_port: 8090 -curl: | - curl --request GET \ - --url http://127.0.0.1:8090/batch/get?k=a&k=b \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml b/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml deleted file mode 100644 index ad074958..00000000 --- a/aerospike-tls/keploy/test-set-0/tests/get-get-alice-1.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: get-get-alice-1 -spec: - metadata: {} - req: - method: GET - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/get/alice - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T14:06:26.337947982+05:30 - resp: - status_code: 200 - header: - Content-Length: "26" - Content-Type: application/json - Date: Mon, 11 May 2026 08:36:26 GMT - body: | - {"age":30,"name":"Alice"} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:26.381983885+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488586 - app_port: 8090 -curl: | - curl --request GET \ - --url http://127.0.0.1:8090/get/alice \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml deleted file mode 100644 index 37a06567..00000000 --- a/aerospike-tls/keploy/test-set-0/tests/get-health-1.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: get-health-1 -spec: - metadata: {} - req: - method: GET - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/health - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T14:06:25.267608531+05:30 - resp: - status_code: 200 - header: - Content-Length: "32" - Content-Type: application/json - Date: Mon, 11 May 2026 08:36:25 GMT - body: | - {"namespaces":"test","nodes":1} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:25.268882767+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488585 - app_port: 8090 -curl: | - curl --request GET \ - --url http://127.0.0.1:8090/health \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml deleted file mode 100644 index 13c602a1..00000000 --- a/aerospike-tls/keploy/test-set-0/tests/post-batch-put-1.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-batch-put-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/batch/put - header: - Accept: '*/*' - Content-Length: "55" - Content-Type: application/x-www-form-urlencoded - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: '[{"key":"a","bins":{"n":1}},{"key":"b","bins":{"n":2}}]' - timestamp: 2026-05-11T14:06:27.391618301+05:30 - resp: - status_code: 200 - header: - Content-Length: "14" - Content-Type: application/json - Date: Mon, 11 May 2026 08:36:27 GMT - body: | - {"written":2} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:27.476590033+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488587 - app_port: 8090 -curl: |- - curl --request POST \ - --url http://127.0.0.1:8090/batch/put \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --header 'Host: 127.0.0.1:8090' \ - --data "[{\"key\":\"a\",\"bins\":{\"n\":1}},{\"key\":\"b\",\"bins\":{\"n\":2}}]" diff --git a/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml deleted file mode 100644 index 399ca2bb..00000000 --- a/aerospike-tls/keploy/test-set-0/tests/post-put-1.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-put-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/put - header: - Accept: '*/*' - Content-Length: "48" - Content-Type: application/x-www-form-urlencoded - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: '{"key":"alice","bins":{"age":30,"name":"Alice"}}' - timestamp: 2026-05-11T14:06:25.275482695+05:30 - resp: - status_code: 200 - header: - Content-Length: "16" - Content-Type: application/json - Date: Mon, 11 May 2026 08:36:25 GMT - body: | - {"status":"ok"} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:25.327629738+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488585 - app_port: 8090 -curl: |- - curl --request POST \ - --url http://127.0.0.1:8090/put \ - --header 'Content-Type: application/x-www-form-urlencoded' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ - --data "{\"key\":\"alice\",\"bins\":{\"age\":30,\"name\":\"Alice\"}}" diff --git a/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml b/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml deleted file mode 100644 index ebf32759..00000000 --- a/aerospike-tls/keploy/test-set-0/tests/post-touch-alice-1.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-touch-alice-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/touch/alice - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T14:06:36.511778713+05:30 - resp: - status_code: 200 - header: - Content-Length: "21" - Content-Type: application/json - Date: Mon, 11 May 2026 08:36:36 GMT - body: | - {"status":"touched"} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T14:06:36.558020606+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778488596 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/touch/alice \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/mocks.yaml b/aerospike-tls/keploy/test-set-1/mocks.yaml deleted file mode 100644 index 1d0319b5..00000000 --- a/aerospike-tls/keploy/test-set-1/mocks.yaml +++ /dev/null @@ -1,8820 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-0 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:15.094099667+05:30 - ResTimestampMock: 2026-05-11T15:08:15.134870927+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-1 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:08:15.135424237+05:30 - ResTimestampMock: 2026-05-11T15:08:15.177802699+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-2 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:15.184588645+05:30 - ResTimestampMock: 2026-05-11T15:08:15.225962614+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-3 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:15.226102715+05:30 - ResTimestampMock: 2026-05-11T15:08:15.268804124+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-4 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:08:15.269564996+05:30 - ResTimestampMock: 2026-05-11T15:08:15.311383418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-5 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:15.312817434+05:30 - ResTimestampMock: 2026-05-11T15:08:15.35556731+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-6 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:15.356112243+05:30 - ResTimestampMock: 2026-05-11T15:08:15.39794675+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-7 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm7Z8HoDojq5sExP90yq0/vy0Es= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.407462339+05:30 - ResTimestampMock: 2026-05-11T15:08:15.448959281+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-8 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEyjW+uSujaSSpLkvcjJx526MXP3s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.449045521+05:30 - ResTimestampMock: 2026-05-11T15:08:15.490449226+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-9 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUbk90BIccGQEzT0EjCjmPuTdfbY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.491085737+05:30 - ResTimestampMock: 2026-05-11T15:08:15.533838609+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-10 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELk9B6gLZul7w3rZUkdLt3oCk8Mc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.534492664+05:30 - ResTimestampMock: 2026-05-11T15:08:15.57815772+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-11 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+u0Wl6Zbe+2U56imaXcc4pDGlEY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.578323925+05:30 - ResTimestampMock: 2026-05-11T15:08:15.620354346+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-12 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdoIqKZd8llL4FjreA3uX8Sa1VxI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.62078845+05:30 - ResTimestampMock: 2026-05-11T15:08:15.663748557+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-13 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUESa3CiabUr9TS3DOSFtRvW9PL6Sc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.664188435+05:30 - ResTimestampMock: 2026-05-11T15:08:15.706486509+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-14 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/RcjySXX6UJuuZyoQFB+/jFe0M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.707204725+05:30 - ResTimestampMock: 2026-05-11T15:08:15.749383267+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-15 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeCqzmqhoxj5KH8h3hUosBTY5fOA= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.750122272+05:30 - ResTimestampMock: 2026-05-11T15:08:15.792985069+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-16 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcHz2ThFz5IG0rOFzA3OHLsZ7VvM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.765784789+05:30 - ResTimestampMock: 2026-05-11T15:08:15.806877579+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-17 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3vg7UwLzyPVPuB6KgYgYLMrl320= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.766406302+05:30 - ResTimestampMock: 2026-05-11T15:08:15.807837707+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-18 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIp7YXQBKMDd878u1aM5Xd5xpRXU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.768124736+05:30 - ResTimestampMock: 2026-05-11T15:08:15.809697681+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-19 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUiAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEhNj2vZ5iG/o+5sVovV9pTgLKvco= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.770269362+05:30 - ResTimestampMock: 2026-05-11T15:08:15.810860345+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-20 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFnJdVIgGp5T+nXxVkFrPL6qW3zs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.769248911+05:30 - ResTimestampMock: 2026-05-11T15:08:15.810860425+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-21 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfoeVd8un+Ruyu1/RbStzNIpB4i8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.768021947+05:30 - ResTimestampMock: 2026-05-11T15:08:15.810916457+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-22 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkxDg97mW8wzTJku+YctR+hSR7pE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.770211721+05:30 - ResTimestampMock: 2026-05-11T15:08:15.810945226+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-23 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEuFyUPdp5uhobFE9ERfp0xak7Zpc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.769944174+05:30 - ResTimestampMock: 2026-05-11T15:08:15.81097327+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-24 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcCSkDCRS7ntdSxqs9rrh3xpFWuY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.769562027+05:30 - ResTimestampMock: 2026-05-11T15:08:15.810980374+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-25 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AuK1AqTddC1uICi6xezW2B+pXs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.769876134+05:30 - ResTimestampMock: 2026-05-11T15:08:15.811927659+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-26 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUlAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGJ7MitZe3Ggl/3+VMYcsOP1gJSY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.771114541+05:30 - ResTimestampMock: 2026-05-11T15:08:15.811989817+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-27 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+hZY9lzv+F8AI3Q+fK4kms28mUY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.770748323+05:30 - ResTimestampMock: 2026-05-11T15:08:15.812005638+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-28 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVuBZop6gxSc1AqAZgR656D6is0A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.779963218+05:30 - ResTimestampMock: 2026-05-11T15:08:15.822917749+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-29 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7uGPnFz6/JTw2eY2BOa1I4hp+2g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.788848649+05:30 - ResTimestampMock: 2026-05-11T15:08:15.829900855+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-30 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzuT6goK4w2WA6FItl7L/rK+jgJo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.788438784+05:30 - ResTimestampMock: 2026-05-11T15:08:15.831225671+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-31 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4n+knG98esZS5Yb7OZZi2sNpENM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.788440087+05:30 - ResTimestampMock: 2026-05-11T15:08:15.831857052+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-32 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE25G6l2Ks35hkEEM19gdQD5nyft4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.789454094+05:30 - ResTimestampMock: 2026-05-11T15:08:15.831944249+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-33 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvkBTJHi1UdvMEzG558Eq7ZofNVw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.791054593+05:30 - ResTimestampMock: 2026-05-11T15:08:15.832599578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-34 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6PRXbuHynEfQsryFas9bYawoGd4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.792101855+05:30 - ResTimestampMock: 2026-05-11T15:08:15.83269393+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-35 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEL5XfeNiO/E/EOcZzydKOBEKz/z0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.791722552+05:30 - ResTimestampMock: 2026-05-11T15:08:15.832720659+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-36 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEktDyftO1+p/jx06GYn+eAiE9Qos= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.791447253+05:30 - ResTimestampMock: 2026-05-11T15:08:15.832727748+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-37 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/oKHaTSUAtQIHEKEJpx9xqBklc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.792087223+05:30 - ResTimestampMock: 2026-05-11T15:08:15.832738176+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-38 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE764awLdaGMTMQKwPNItoaxebDrI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.788514134+05:30 - ResTimestampMock: 2026-05-11T15:08:15.832820677+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-39 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEiV2n29yj1tTyBOAQpR3jD9B99BM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.792911602+05:30 - ResTimestampMock: 2026-05-11T15:08:15.833716404+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-40 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFIDeQlHYxiq6MekYWEpT9f5hB8U= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.792624493+05:30 - ResTimestampMock: 2026-05-11T15:08:15.834944419+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-41 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUElc0WFcO2m+uxVRQr/E1Dyhv/HcY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.793239963+05:30 - ResTimestampMock: 2026-05-11T15:08:15.834952464+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-42 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZioxhu1q7P1hMzcmS/wTuTE6dHI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.794472234+05:30 - ResTimestampMock: 2026-05-11T15:08:15.835820325+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-43 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUECzKdb8zf/y77ElQT0q53OW17Mvg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.796863655+05:30 - ResTimestampMock: 2026-05-11T15:08:15.837971607+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-44 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/+ahIZTsC8XT2nTJyK4IIngLubs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.796777274+05:30 - ResTimestampMock: 2026-05-11T15:08:15.838010739+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-45 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEelzl+o/cOX38GpPGcdnXDijYl8M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:15.799963066+05:30 - ResTimestampMock: 2026-05-11T15:08:15.841727976+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-46 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:16.398761866+05:30 - ResTimestampMock: 2026-05-11T15:08:16.44028297+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-47 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:16.440745787+05:30 - ResTimestampMock: 2026-05-11T15:08:16.482807963+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-48 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEsQYK1+nDliXATczhHtFqPyB+fxw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.800545288+05:30 - ResTimestampMock: 2026-05-11T15:08:16.842253144+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-49 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEgtypEIIP2pJn1ELAXabfAb24JGk= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.800759624+05:30 - ResTimestampMock: 2026-05-11T15:08:16.842254515+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-50 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKMRc+hiEhwC9MWup9R2MiKKgk34= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.800815309+05:30 - ResTimestampMock: 2026-05-11T15:08:16.842301454+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-51 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETSaNkFILKbNgj8iCCG4LDy98QSU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.80054538+05:30 - ResTimestampMock: 2026-05-11T15:08:16.84229638+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-52 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUSAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7wS8Va9ccFZOoD7lVMRXbKf4z0g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.803724522+05:30 - ResTimestampMock: 2026-05-11T15:08:16.845011807+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-53 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDJEUpkgUCt8k8KoUp0DTPoyT5Rw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.803511573+05:30 - ResTimestampMock: 2026-05-11T15:08:16.845031683+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-54 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqqA46Dtokv802UZc5Oca5vM3sMs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.803008136+05:30 - ResTimestampMock: 2026-05-11T15:08:16.845085679+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-55 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYIrzLeAUTzYZEfjyirsgWPJW07M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.802869957+05:30 - ResTimestampMock: 2026-05-11T15:08:16.846301523+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-56 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHERAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3YgNabidB3m4T8X0iM5TUnT+qnY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.806922796+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849605489+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-57 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHEQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVXMxpB2zL6pyIh1YsthkL8ISlUE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.808152385+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849760015+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-58 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHEaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEsEfmx49lzZY7ihyhZwAggC1myfU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.808368756+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849954585+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-59 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHEPAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2Hce5mS+SRp4X6oRj/zhtdg0k6M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.808354911+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849966888+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-60 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHEOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2HHs+PA+07pTLn5jq0b8Mn27jSg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.808375639+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849953009+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-61 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHEVAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7LeYYlrf6bvohLp5W/5kY8HzDmM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:16.808354765+05:30 - ResTimestampMock: 2026-05-11T15:08:16.849966942+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-62 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:17.484190423+05:30 - ResTimestampMock: 2026-05-11T15:08:17.527936501+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-63 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:17.528586579+05:30 - ResTimestampMock: 2026-05-11T15:08:17.570001076+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-64 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwrVFuoSqePBd4HGZDdQJEBGzvck= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.823803274+05:30 - ResTimestampMock: 2026-05-11T15:08:17.865380072+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-65 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZfG/i/i3Of1GOvaQbGNIBKTSaCg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.82386119+05:30 - ResTimestampMock: 2026-05-11T15:08:17.86612574+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-66 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETres2lCD6qj6CWNaiz48TbC1iRs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.823799664+05:30 - ResTimestampMock: 2026-05-11T15:08:17.866125605+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-67 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfVSZb4nrpUQ6IYmnsvfbD+fKWwI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.826393361+05:30 - ResTimestampMock: 2026-05-11T15:08:17.867655882+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-68 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUTAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjz1PE3036rbk/ubHRSDNkyKnj4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.82640228+05:30 - ResTimestampMock: 2026-05-11T15:08:17.867753283+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-69 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHQ46JSEZ597WemoXtNTj12l8prY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.826069689+05:30 - ResTimestampMock: 2026-05-11T15:08:17.867819948+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-70 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUOAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAnKrVebX6Z/hxinN8eJshnB1lEo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.826316509+05:30 - ResTimestampMock: 2026-05-11T15:08:17.868226131+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-71 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUUAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUERr4ANKatEvHcx+j558LxopMdjKc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.82631646+05:30 - ResTimestampMock: 2026-05-11T15:08:17.868321864+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-72 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUaAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu0wwQ8xl+zBaA1sxGHqEfBNGPYo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:17.826426679+05:30 - ResTimestampMock: 2026-05-11T15:08:17.86833519+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-73 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxHAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQY9aD49BW9kYI1oFfsh7JZyNZnQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033779025+05:30 - ResTimestampMock: 2026-05-11T15:08:18.074975242+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-74 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxJAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUaTnYhEbMCoV4lSftpOW6L8oZ30= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033723226+05:30 - ResTimestampMock: 2026-05-11T15:08:18.074975072+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-75 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxEAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKjrYJHZ0fhzBaxg5vp06IBhcOyg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033688005+05:30 - ResTimestampMock: 2026-05-11T15:08:18.075015791+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-76 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxHAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpl+duSGuhkZvEJdtWlmtxwcXJZA= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033675156+05:30 - ResTimestampMock: 2026-05-11T15:08:18.07503187+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-77 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxGAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEaZBs4AGhoU7luWwEni90LxgWPM0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033708799+05:30 - ResTimestampMock: 2026-05-11T15:08:18.07502697+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-78 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxGAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEthZJrs97U1So2VXs2/TJZNZllQs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.0337784+05:30 - ResTimestampMock: 2026-05-11T15:08:18.075134578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-79 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfCxw5iFpLedvWrNf/Jcq2UtWHPU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033768564+05:30 - ResTimestampMock: 2026-05-11T15:08:18.075230383+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-80 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxIAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAIdgviivFMWUmbxGWHtXOmwGwt8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033675141+05:30 - ResTimestampMock: 2026-05-11T15:08:18.075230513+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-81 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxFAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEknpy17QJxd6R+UIoxfw5uiOJAhI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.033768313+05:30 - ResTimestampMock: 2026-05-11T15:08:18.075265292+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-82 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAGxEAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJoF4v/5insbDuZmjBybfklzGsLw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:18.038703575+05:30 - ResTimestampMock: 2026-05-11T15:08:18.080901048+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-83 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:18.571183634+05:30 - ResTimestampMock: 2026-05-11T15:08:18.613330972+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-84 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:18.613525998+05:30 - ResTimestampMock: 2026-05-11T15:08:18.655290405+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-85 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:19.655651536+05:30 - ResTimestampMock: 2026-05-11T15:08:19.697672994+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-86 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:19.69789115+05:30 - ResTimestampMock: 2026-05-11T15:08:19.74036841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-87 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:20.741213909+05:30 - ResTimestampMock: 2026-05-11T15:08:20.783177578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-88 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:20.783344194+05:30 - ResTimestampMock: 2026-05-11T15:08:20.825912422+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-89 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:21.826958211+05:30 - ResTimestampMock: 2026-05-11T15:08:21.868529704+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-90 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:21.868789585+05:30 - ResTimestampMock: 2026-05-11T15:08:21.910060874+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-91 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:22.911526174+05:30 - ResTimestampMock: 2026-05-11T15:08:22.953535019+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-92 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:22.953677477+05:30 - ResTimestampMock: 2026-05-11T15:08:22.996561321+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-93 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:23.998127004+05:30 - ResTimestampMock: 2026-05-11T15:08:24.040476636+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-94 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:24.040949351+05:30 - ResTimestampMock: 2026-05-11T15:08:24.082598664+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-95 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:25.083518441+05:30 - ResTimestampMock: 2026-05-11T15:08:25.125645816+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-96 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:25.126249528+05:30 - ResTimestampMock: 2026-05-11T15:08:25.169446119+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-97 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:26.169934202+05:30 - ResTimestampMock: 2026-05-11T15:08:26.212295144+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-98 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:26.212367217+05:30 - ResTimestampMock: 2026-05-11T15:08:26.252767849+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-99 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:27.253872705+05:30 - ResTimestampMock: 2026-05-11T15:08:27.295550018+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-100 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:27.295658546+05:30 - ResTimestampMock: 2026-05-11T15:08:27.337376382+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-101 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:28.33889236+05:30 - ResTimestampMock: 2026-05-11T15:08:28.381354067+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-102 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:28.381713985+05:30 - ResTimestampMock: 2026-05-11T15:08:28.423536689+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-103 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:29.42402774+05:30 - ResTimestampMock: 2026-05-11T15:08:29.465850014+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-104 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:29.466381385+05:30 - ResTimestampMock: 2026-05-11T15:08:29.508531733+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-105 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+9T4kIC9uEWoHUHpyrRfeVxWWGcAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4x - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.844461853+05:30 - ResTimestampMock: 2026-05-11T15:08:29.887107256+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-106 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUELFOL/Kge3l3sPdQOVrRKgiFHx5oAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW4x - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.844506356+05:30 - ResTimestampMock: 2026-05-11T15:08:29.88724793+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-107 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP+0J0iXd+gOukOofPpNqmlccDcYAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4x - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.844505877+05:30 - ResTimestampMock: 2026-05-11T15:08:29.887309196+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-108 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtnPiAy8ss4/5niQj5pe4IJkazkQAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4x - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.844461798+05:30 - ResTimestampMock: 2026-05-11T15:08:29.887409801+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-109 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP+0J0iXd+gOukOofPpNqmlccDcY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjE= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.887332377+05:30 - ResTimestampMock: 2026-05-11T15:08:29.928217096+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-110 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELFOL/Kge3l3sPdQOVrRKgiFHx5o= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjE= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.887289204+05:30 - ResTimestampMock: 2026-05-11T15:08:29.928659193+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-111 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtnPiAy8ss4/5niQj5pe4IJkazkQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjE= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.887471282+05:30 - ResTimestampMock: 2026-05-11T15:08:29.929361743+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-112 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+9T4kIC9uEWoHUHpyrRfeVxWWGc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjE= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:29.887387718+05:30 - ResTimestampMock: 2026-05-11T15:08:29.930575031+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-113 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:30.509646465+05:30 - ResTimestampMock: 2026-05-11T15:08:30.551645965+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-114 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:30.551750185+05:30 - ResTimestampMock: 2026-05-11T15:08:30.593294795+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-115 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:31.594008115+05:30 - ResTimestampMock: 2026-05-11T15:08:31.637606585+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-116 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:31.638009453+05:30 - ResTimestampMock: 2026-05-11T15:08:31.679120403+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-117 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE283bj3osBukXFdp/sILehSUYCRUAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941335057+05:30 - ResTimestampMock: 2026-05-11T15:08:31.983642816+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-118 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDKGY3izaRm4vm2pFvWl/vvQAnQ0AAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.94135248+05:30 - ResTimestampMock: 2026-05-11T15:08:31.983637701+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-119 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeM63vWofhmXb99Np7t1gYEM2boAAAAAPAgEAA2lkeAAAAAAAAAAHAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941437483+05:30 - ResTimestampMock: 2026-05-11T15:08:31.983646873+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-120 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+n//VDIJF+S0JkGY3qlZAS+WEa4AAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941414494+05:30 - ResTimestampMock: 2026-05-11T15:08:31.984096656+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-121 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9WHojh3iZAw+HziwhDN1r66C20IAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941438847+05:30 - ResTimestampMock: 2026-05-11T15:08:31.984093873+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-122 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEd8m9P8Klr3XpPtuN9yjk5Nr1s4cAAAAPAgEAA2lkeAAAAAAAAAAFAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941378958+05:30 - ResTimestampMock: 2026-05-11T15:08:31.984125345+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-123 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnNvGFpckWb1Nuve1r2Ox8Zz/3MoAAAALAgMAA3RhZ3J1bjIAAAAPAgEAA2lkeAAAAAAAAAAD - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941577187+05:30 - ResTimestampMock: 2026-05-11T15:08:31.984127153+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-124 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQmEKvnS/duo8rsgUvySnylY073AAAAAPAgEAA2lkeAAAAAAAAAAEAAAACwIDAAN0YWdydW4y - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.941395787+05:30 - ResTimestampMock: 2026-05-11T15:08:31.98489336+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-125 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE283bj3osBukXFdp/sILehSUYCRU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.983743292+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025225582+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-126 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeM63vWofhmXb99Np7t1gYEM2boA= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.9837592+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025324757+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-127 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEd8m9P8Klr3XpPtuN9yjk5Nr1s4c= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.984233677+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025401394+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-128 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDKGY3izaRm4vm2pFvWl/vvQAnQ0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.983750588+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025616059+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-129 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+n//VDIJF+S0JkGY3qlZAS+WEa4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.984246835+05:30 - ResTimestampMock: 2026-05-11T15:08:32.02563715+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-130 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnNvGFpckWb1Nuve1r2Ox8Zz/3Mo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.984234536+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025679548+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-131 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9WHojh3iZAw+HziwhDN1r66C20I= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.984253267+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025685461+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-132 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQmEKvnS/duo8rsgUvySnylY073A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjI= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:31.984954466+05:30 - ResTimestampMock: 2026-05-11T15:08:32.025735213+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-133 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:32.68014683+05:30 - ResTimestampMock: 2026-05-11T15:08:32.722619152+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-134 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:32.723097396+05:30 - ResTimestampMock: 2026-05-11T15:08:32.76411118+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-135 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:33.764798817+05:30 - ResTimestampMock: 2026-05-11T15:08:33.807196264+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-136 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:33.807294221+05:30 - ResTimestampMock: 2026-05-11T15:08:33.848102722+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-137 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKL3FE+e59PbajRwhKH7S12Jey1UAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAF - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035923378+05:30 - ResTimestampMock: 2026-05-11T15:08:34.076985412+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-138 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnXkUSzOT/QCNUokxIsLggNqB1coAAAAPAgEAA2lkeAAAAAAAAAAHAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.03588514+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077069873+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-139 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4Msyj6xM3TAg1XHuV8317rFCtVEAAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035875942+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077082862+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-140 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEajBifl9epW4pmiGJs+OXfY7rxAQAAAAPAgEAA2lkeAAAAAAAAAAKAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035931513+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077164092+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-141 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGRlCDASH1q/mf+WZaPTn135AV2sAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035943725+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077430957+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-142 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvLSxmBcOpQAoZMxtAS56J0OSw/UAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035884935+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077601941+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-143 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqoNYQ1HlcKcchY9nGICOniNZdvkAAAAPAgEAA2lkeAAAAAAAAAAJAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035836501+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077702404+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-144 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFYN84OKf+CxFTAmRU9hjaKZu7mMAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAL - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.03590646+05:30 - ResTimestampMock: 2026-05-11T15:08:34.07783004+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-145 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEitH7ZTrXVs2FvZ3MrbxbIh/BuiEAAAAPAgEAA2lkeAAAAAAAAAAIAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035836507+05:30 - ResTimestampMock: 2026-05-11T15:08:34.077889418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-146 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmbOz2m9PmqLAm1nexWktrdYpSEkAAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035884942+05:30 - ResTimestampMock: 2026-05-11T15:08:34.078103299+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-147 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu5LTZbKscLhj8BR3Vf81IKaEN64AAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW4z - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.035890443+05:30 - ResTimestampMock: 2026-05-11T15:08:34.078890555+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-148 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtV9n5gbX6wHmj+Gz/lTw3mOILPoAAAALAgMAA3RhZ3J1bjMAAAAPAgEAA2lkeAAAAAAAAAAE - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.040724004+05:30 - ResTimestampMock: 2026-05-11T15:08:34.081842336+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-149 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvLSxmBcOpQAoZMxtAS56J0OSw/U= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077643626+05:30 - ResTimestampMock: 2026-05-11T15:08:34.118997806+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-150 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEajBifl9epW4pmiGJs+OXfY7rxAQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077546005+05:30 - ResTimestampMock: 2026-05-11T15:08:34.118997815+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-151 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4Msyj6xM3TAg1XHuV8317rFCtVE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077509647+05:30 - ResTimestampMock: 2026-05-11T15:08:34.118997733+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-152 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFYN84OKf+CxFTAmRU9hjaKZu7mM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077884868+05:30 - ResTimestampMock: 2026-05-11T15:08:34.11902842+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-153 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEnXkUSzOT/QCNUokxIsLggNqB1co= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.07751341+05:30 - ResTimestampMock: 2026-05-11T15:08:34.11905397+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-154 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGRlCDASH1q/mf+WZaPTn135AV2s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077529611+05:30 - ResTimestampMock: 2026-05-11T15:08:34.119047987+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-155 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEqoNYQ1HlcKcchY9nGICOniNZdvk= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077802404+05:30 - ResTimestampMock: 2026-05-11T15:08:34.119082686+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-156 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEitH7ZTrXVs2FvZ3MrbxbIh/BuiE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.07792607+05:30 - ResTimestampMock: 2026-05-11T15:08:34.119413724+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-157 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKL3FE+e59PbajRwhKH7S12Jey1U= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.077504257+05:30 - ResTimestampMock: 2026-05-11T15:08:34.119580562+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-158 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmbOz2m9PmqLAm1nexWktrdYpSEk= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.078590614+05:30 - ResTimestampMock: 2026-05-11T15:08:34.120227488+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-159 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu5LTZbKscLhj8BR3Vf81IKaEN64= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.078930966+05:30 - ResTimestampMock: 2026-05-11T15:08:34.120252265+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-160 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtV9n5gbX6wHmj+Gz/lTw3mOILPo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjM= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:34.081910317+05:30 - ResTimestampMock: 2026-05-11T15:08:34.124228401+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-161 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:34.84901049+05:30 - ResTimestampMock: 2026-05-11T15:08:34.89264285+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-162 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:34.89301955+05:30 - ResTimestampMock: 2026-05-11T15:08:34.934692402+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-163 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:35.93519691+05:30 - ResTimestampMock: 2026-05-11T15:08:35.979683003+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-164 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:35.980183814+05:30 - ResTimestampMock: 2026-05-11T15:08:36.023336201+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-165 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE18sB6RDczwa1lJVXwjqtm/WH0+wAAAAPAgEAA2lkeAAAAAAAAAAVAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135651476+05:30 - ResTimestampMock: 2026-05-11T15:08:36.176915305+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-166 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpaCksbscfgFTZNnqLOwyPWMFvF8AAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAT - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135667183+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177003863+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-167 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7E5HSwalAJWCLIkQXY3tK7EHMlMAAAAPAgEAA2lkeAAAAAAAAAAWAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135611964+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177002301+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-168 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEN4Es3SsFtjV0rbNkmrav5qOulgEAAAAPAgEAA2lkeAAAAAAAAAAOAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.13563567+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177020228+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-169 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUERUCvUgZRqLsdItQvzxiUeIuYco0AAAAPAgEAA2lkeAAAAAAAAAAXAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135374744+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177039223+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-170 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUENQgqr+t1LGQ6xbUvTRW/taJXPdsAAAAPAgEAA2lkeAAAAAAAAAASAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135674169+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177023201+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-171 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfBEGMLFWobcRihEmdCCvgE3nN5sAAAAPAgEAA2lkeAAAAAAAAAAFAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135574496+05:30 - ResTimestampMock: 2026-05-11T15:08:36.177086398+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-172 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDvMnneIbhJFTPd9IQh9jv02C6koAAAAPAgEAA2lkeAAAAAAAAAAAAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.136036715+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178886637+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-173 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEl95tyS0ZItIQnmxO1I6gx1cmmTcAAAAPAgEAA2lkeAAAAAAAAAADAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135589186+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178888647+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-174 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJg+tcUGpU9qivTLm3KE2hFNaFk0AAAAPAgEAA2lkeAAAAAAAAAABAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135580463+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178886546+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-175 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHh/vzJD+PYZqQr8tR419r2FbF0AAAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAR - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135696433+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178894899+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-176 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDpAHtvbWZduSawJ8FE9X/7jkNUoAAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAE - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135583813+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178900968+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-177 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUETqxkj79K1pGrk4QSTotF2AxCztQAAAAPAgEAA2lkeAAAAAAAAAALAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135611155+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178906954+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-178 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEipS4oGbR1YwLc543Yzp8XZx9Wc4AAAALAgMAA3RhZ3J1bjQAAAAPAgEAA2lkeAAAAAAAAAAH - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135599866+05:30 - ResTimestampMock: 2026-05-11T15:08:36.17891802+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-179 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEC66hzfdC5P15pa2xJK9zQ9eozlkAAAAPAgEAA2lkeAAAAAAAAAACAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135602292+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178920076+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-180 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZCnAY+QZDkWSCdHU6CIUB6YBjWMAAAAPAgEAA2lkeAAAAAAAAAAUAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135681756+05:30 - ResTimestampMock: 2026-05-11T15:08:36.1789276+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-181 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEr1PD9/2ssuJvMFc6rAdt/8BYV1oAAAAPAgEAA2lkeAAAAAAAAAANAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135708005+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178932945+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-182 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHs/2tKwpsbxKqcC/uhTe+edc4ssAAAAPAgEAA2lkeAAAAAAAAAAGAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135598049+05:30 - ResTimestampMock: 2026-05-11T15:08:36.17894247+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-183 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEO+2tCvhkgmHXzyBLwvaGf2rkJcMAAAAPAgEAA2lkeAAAAAAAAAAQAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135556603+05:30 - ResTimestampMock: 2026-05-11T15:08:36.17895121+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-184 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIpTHopKDH670j3LyOJ9yNBAs1e8AAAAPAgEAA2lkeAAAAAAAAAAKAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135629936+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178958033+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-185 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZNgOBB9068sjh7KRn/E9u2UKU9IAAAAPAgEAA2lkeAAAAAAAAAAIAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135584111+05:30 - ResTimestampMock: 2026-05-11T15:08:36.17897841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-186 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMXzCOrlEq+sL6bsFvQ/z3TdtO74AAAAPAgEAA2lkeAAAAAAAAAAPAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135682875+05:30 - ResTimestampMock: 2026-05-11T15:08:36.178984955+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-187 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6+R4FWEU/VxeFAJEHNgQOGnjHdoAAAAPAgEAA2lkeAAAAAAAAAAJAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.135694184+05:30 - ResTimestampMock: 2026-05-11T15:08:36.179107777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-188 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 99 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMqIr8TW1nxn2f/XCVx2c484bVSwAAAAPAgEAA2lkeAAAAAAAAAAMAAAACwIDAAN0YWdydW40 - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.139737598+05:30 - ResTimestampMock: 2026-05-11T15:08:36.181586069+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-189 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEN4Es3SsFtjV0rbNkmrav5qOulgE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAAsBAwADdGFncnVuNAAAAA8BAQADaWR4AAAAAAAAAA4= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178962044+05:30 - ResTimestampMock: 2026-05-11T15:08:36.220715787+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-190 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEipS4oGbR1YwLc543Yzp8XZx9Wc4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179226598+05:30 - ResTimestampMock: 2026-05-11T15:08:36.220801928+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-191 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMXzCOrlEq+sL6bsFvQ/z3TdtO74= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA8AAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.17924937+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221072844+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-192 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZNgOBB9068sjh7KRn/E9u2UKU9I= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179252293+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221103856+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-193 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHh/vzJD+PYZqQr8tR419r2FbF0A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABEAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.17929825+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221141553+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-194 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEHs/2tKwpsbxKqcC/uhTe+edc4ss= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.17927388+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221153672+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-195 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUERUCvUgZRqLsdItQvzxiUeIuYco0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABcAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178965495+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221200153+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-196 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEO+2tCvhkgmHXzyBLwvaGf2rkJcM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABAAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179215349+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221201573+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-197 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpaCksbscfgFTZNnqLOwyPWMFvF8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABMAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178945473+05:30 - ResTimestampMock: 2026-05-11T15:08:36.22120814+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-198 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEC66hzfdC5P15pa2xJK9zQ9eozlk= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179199443+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221217217+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-199 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIpTHopKDH670j3LyOJ9yNBAs1e8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179235426+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221223837+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-200 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDvMnneIbhJFTPd9IQh9jv02C6ko= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179197388+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221231148+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-201 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEr1PD9/2ssuJvMFc6rAdt/8BYV1o= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAAsBAwADdGFncnVuNAAAAA8BAQADaWR4AAAAAAAAAA0= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179259371+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221231128+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-202 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEDpAHtvbWZduSawJ8FE9X/7jkNUo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179203554+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221252001+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-203 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUENQgqr+t1LGQ6xbUvTRW/taJXPds= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABIAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.17894748+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221252087+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-204 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJg+tcUGpU9qivTLm3KE2hFNaFk0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179240729+05:30 - ResTimestampMock: 2026-05-11T15:08:36.2212548+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-205 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZCnAY+QZDkWSCdHU6CIUB6YBjWM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABQAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179217365+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221252379+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-206 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE18sB6RDczwa1lJVXwjqtm/WH0+w= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABUAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178908296+05:30 - ResTimestampMock: 2026-05-11T15:08:36.22127841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-207 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7E5HSwalAJWCLIkQXY3tK7EHMlM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABYAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178928262+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221334571+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-208 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfBEGMLFWobcRihEmdCCvgE3nN5s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.178943391+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221518181+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-209 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETqxkj79K1pGrk4QSTotF2AxCztQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179225784+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221612866+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-210 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6+R4FWEU/VxeFAJEHNgQOGnjHdo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179208347+05:30 - ResTimestampMock: 2026-05-11T15:08:36.22170584+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-211 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEl95tyS0ZItIQnmxO1I6gx1cmmTc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.179197316+05:30 - ResTimestampMock: 2026-05-11T15:08:36.221797467+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-212 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMqIr8TW1nxn2f/XCVx2c484bVSw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 56 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAABAAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAwAAAALAQMAA3RhZ3J1bjQ= - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:08:36.182106072+05:30 - ResTimestampMock: 2026-05-11T15:08:36.224693797+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-213 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:37.024083995+05:30 - ResTimestampMock: 2026-05-11T15:08:37.067613457+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-214 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:37.067782117+05:30 - ResTimestampMock: 2026-05-11T15:08:37.110155882+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-215 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:38.110958555+05:30 - ResTimestampMock: 2026-05-11T15:08:38.152453675+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-216 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:38.152629884+05:30 - ResTimestampMock: 2026-05-11T15:08:38.196437655+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-217 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:39.196943704+05:30 - ResTimestampMock: 2026-05-11T15:08:39.238310917+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-218 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:39.238506989+05:30 - ResTimestampMock: 2026-05-11T15:08:39.280185382+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-219 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:40.281611528+05:30 - ResTimestampMock: 2026-05-11T15:08:40.324462562+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-220 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:40.324778366+05:30 - ResTimestampMock: 2026-05-11T15:08:40.367957549+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-221 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:41.368999995+05:30 - ResTimestampMock: 2026-05-11T15:08:41.411380238+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-222 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:41.411524954+05:30 - ResTimestampMock: 2026-05-11T15:08:41.453752298+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-223 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:42.454185109+05:30 - ResTimestampMock: 2026-05-11T15:08:42.496307982+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-224 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:42.49642027+05:30 - ResTimestampMock: 2026-05-11T15:08:42.538834183+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-225 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:43.539849907+05:30 - ResTimestampMock: 2026-05-11T15:08:43.583731971+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-226 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:43.583947753+05:30 - ResTimestampMock: 2026-05-11T15:08:43.625765392+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-227 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:44.626874994+05:30 - ResTimestampMock: 2026-05-11T15:08:44.669302274+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-228 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:44.669899854+05:30 - ResTimestampMock: 2026-05-11T15:08:44.711818702+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-229 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:45.713778378+05:30 - ResTimestampMock: 2026-05-11T15:08:45.756370204+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-230 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:45.756908882+05:30 - ResTimestampMock: 2026-05-11T15:08:45.798483097+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-231 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:46.799623094+05:30 - ResTimestampMock: 2026-05-11T15:08:46.842196204+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-232 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:46.842581439+05:30 - ResTimestampMock: 2026-05-11T15:08:46.884565764+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-233 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:47.885070573+05:30 - ResTimestampMock: 2026-05-11T15:08:47.92634107+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-234 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:47.926663173+05:30 - ResTimestampMock: 2026-05-11T15:08:47.968649022+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-235 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:48.970033288+05:30 - ResTimestampMock: 2026-05-11T15:08:49.012169777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-236 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:49.012297288+05:30 - ResTimestampMock: 2026-05-11T15:08:49.055897853+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-237 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:50.057434136+05:30 - ResTimestampMock: 2026-05-11T15:08:50.100175734+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-238 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:50.100329332+05:30 - ResTimestampMock: 2026-05-11T15:08:50.141362275+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-239 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:51.142167266+05:30 - ResTimestampMock: 2026-05-11T15:08:51.183623635+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-240 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:51.183946628+05:30 - ResTimestampMock: 2026-05-11T15:08:51.22663209+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-241 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:52.228088254+05:30 - ResTimestampMock: 2026-05-11T15:08:52.269974283+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-242 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:52.27009579+05:30 - ResTimestampMock: 2026-05-11T15:08:52.310912535+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-243 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB9DD7F191BBC4A" - info_kind: unknown - raw_body: bm9kZQlCQjlERDdGMTkxQkJDNEEKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:08:53.311932474+05:30 - ResTimestampMock: 2026-05-11T15:08:53.353917691+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-244 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:08:53.354722265+05:30 - ResTimestampMock: 2026-05-11T15:08:53.396966687+05:30 diff --git a/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml deleted file mode 100644 index 169ffbe7..00000000 --- a/aerospike-tls/keploy/test-set-1/tests/get-health-1.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: get-health-1 -spec: - metadata: {} - req: - method: GET - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/health - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:08:27.832765535+05:30 - resp: - status_code: 200 - header: - Content-Length: "32" - Content-Type: application/json - Date: Mon, 11 May 2026 09:38:27 GMT - body: | - {"namespaces":"test","nodes":1} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:08:27.83372744+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778492307 - app_port: 8090 -curl: | - curl --request GET \ - --url http://127.0.0.1:8090/health \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml deleted file mode 100644 index 8a4c0173..00000000 --- a/aerospike-tls/keploy/test-set-1/tests/post-parallel-1.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-parallel-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/parallel?n=4&prefix=run1 - url_params: - "n": "4" - prefix: run1 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:08:29.843545766+05:30 - resp: - status_code: 200 - header: - Content-Length: "255" - Content-Type: application/json - Date: Mon, 11 May 2026 09:38:29 GMT - body: | - {"duration":"86.786344ms","prefix":"run1","results":[{"key":"run1-0","bins":{"idx":0,"tag":"run1"}},{"key":"run1-1","bins":{"idx":1,"tag":"run1"}},{"key":"run1-2","bins":{"idx":2,"tag":"run1"}},{"key":"run1-3","bins":{"idx":3,"tag":"run1"}}],"workers":4} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:08:29.931449044+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492309 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/parallel?n=4&prefix=run1 \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml deleted file mode 100644 index b43c3aff..00000000 --- a/aerospike-tls/keploy/test-set-1/tests/post-parallel-2.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-parallel-2 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/parallel?n=8&prefix=run2 - url_params: - "n": "8" - prefix: run2 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:08:31.940384552+05:30 - resp: - status_code: 200 - header: - Content-Length: "443" - Content-Type: application/json - Date: Mon, 11 May 2026 09:38:32 GMT - body: | - {"duration":"84.873283ms","prefix":"run2","results":[{"key":"run2-0","bins":{"idx":0,"tag":"run2"}},{"key":"run2-1","bins":{"idx":1,"tag":"run2"}},{"key":"run2-2","bins":{"idx":2,"tag":"run2"}},{"key":"run2-3","bins":{"idx":3,"tag":"run2"}},{"key":"run2-4","bins":{"idx":4,"tag":"run2"}},{"key":"run2-5","bins":{"idx":5,"tag":"run2"}},{"key":"run2-6","bins":{"idx":6,"tag":"run2"}},{"key":"run2-7","bins":{"idx":7,"tag":"run2"}}],"workers":8} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:08:32.026009717+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492312 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/parallel?n=8&prefix=run2 \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml deleted file mode 100644 index aeea369f..00000000 --- a/aerospike-tls/keploy/test-set-1/tests/post-parallel-3.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-parallel-3 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/parallel?n=12&prefix=run3 - url_params: - "n": "12" - prefix: run3 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:08:34.035290318+05:30 - resp: - status_code: 200 - header: - Content-Length: "636" - Content-Type: application/json - Date: Mon, 11 May 2026 09:38:34 GMT - body: | - {"duration":"88.719056ms","prefix":"run3","results":[{"key":"run3-0","bins":{"idx":0,"tag":"run3"}},{"key":"run3-1","bins":{"idx":1,"tag":"run3"}},{"key":"run3-2","bins":{"idx":2,"tag":"run3"}},{"key":"run3-3","bins":{"idx":3,"tag":"run3"}},{"key":"run3-4","bins":{"idx":4,"tag":"run3"}},{"key":"run3-5","bins":{"idx":5,"tag":"run3"}},{"key":"run3-6","bins":{"idx":6,"tag":"run3"}},{"key":"run3-7","bins":{"idx":7,"tag":"run3"}},{"key":"run3-8","bins":{"idx":8,"tag":"run3"}},{"key":"run3-9","bins":{"idx":9,"tag":"run3"}},{"key":"run3-10","bins":{"idx":10,"tag":"run3"}},{"key":"run3-11","bins":{"idx":11,"tag":"run3"}}],"workers":12} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:08:34.124672722+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492314 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/parallel?n=12&prefix=run3 \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml b/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml deleted file mode 100644 index dcf48824..00000000 --- a/aerospike-tls/keploy/test-set-1/tests/post-parallel-4.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-parallel-4 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/parallel?n=24&prefix=run4 - url_params: - "n": "24" - prefix: run4 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:08:36.134786796+05:30 - resp: - status_code: 200 - header: - Content-Length: "1223" - Content-Type: application/json - Date: Mon, 11 May 2026 09:38:36 GMT - body: | - {"duration":"89.55741ms","prefix":"run4","results":[{"key":"run4-0","bins":{"idx":0,"tag":"run4"}},{"key":"run4-1","bins":{"idx":1,"tag":"run4"}},{"key":"run4-2","bins":{"idx":2,"tag":"run4"}},{"key":"run4-3","bins":{"idx":3,"tag":"run4"}},{"key":"run4-4","bins":{"idx":4,"tag":"run4"}},{"key":"run4-5","bins":{"idx":5,"tag":"run4"}},{"key":"run4-6","bins":{"idx":6,"tag":"run4"}},{"key":"run4-7","bins":{"idx":7,"tag":"run4"}},{"key":"run4-8","bins":{"idx":8,"tag":"run4"}},{"key":"run4-9","bins":{"idx":9,"tag":"run4"}},{"key":"run4-10","bins":{"idx":10,"tag":"run4"}},{"key":"run4-11","bins":{"idx":11,"tag":"run4"}},{"key":"run4-12","bins":{"idx":12,"tag":"run4"}},{"key":"run4-13","bins":{"idx":13,"tag":"run4"}},{"key":"run4-14","bins":{"idx":14,"tag":"run4"}},{"key":"run4-15","bins":{"idx":15,"tag":"run4"}},{"key":"run4-16","bins":{"idx":16,"tag":"run4"}},{"key":"run4-17","bins":{"idx":17,"tag":"run4"}},{"key":"run4-18","bins":{"idx":18,"tag":"run4"}},{"key":"run4-19","bins":{"idx":19,"tag":"run4"}},{"key":"run4-20","bins":{"idx":20,"tag":"run4"}},{"key":"run4-21","bins":{"idx":21,"tag":"run4"}},{"key":"run4-22","bins":{"idx":22,"tag":"run4"}},{"key":"run4-23","bins":{"idx":23,"tag":"run4"}}],"workers":24} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:08:36.225172317+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492316 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/parallel?n=24&prefix=run4 \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-2/mocks.yaml b/aerospike-tls/keploy/test-set-2/mocks.yaml deleted file mode 100644 index 96096b15..00000000 --- a/aerospike-tls/keploy/test-set-2/mocks.yaml +++ /dev/null @@ -1,30708 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-0 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.187630184+05:30 - ResTimestampMock: 2026-05-11T15:15:29.228900833+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-1 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.229555273+05:30 - ResTimestampMock: 2026-05-11T15:15:29.271059826+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-2 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:29.279130946+05:30 - ResTimestampMock: 2026-05-11T15:15:29.320743018+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-3 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.320910818+05:30 - ResTimestampMock: 2026-05-11T15:15:29.362627751+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-4 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:15:29.362760132+05:30 - ResTimestampMock: 2026-05-11T15:15:29.404590534+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-5 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:29.406014214+05:30 - ResTimestampMock: 2026-05-11T15:15:29.447203321+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-6 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.447307322+05:30 - ResTimestampMock: 2026-05-11T15:15:29.489822558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-7 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm7Z8HoDojq5sExP90yq0/vy0Es= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.500903626+05:30 - ResTimestampMock: 2026-05-11T15:15:29.542819566+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-8 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEyjW+uSujaSSpLkvcjJx526MXP3s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.543060387+05:30 - ResTimestampMock: 2026-05-11T15:15:29.584435419+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-9 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUbk90BIccGQEzT0EjCjmPuTdfbY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.58466497+05:30 - ResTimestampMock: 2026-05-11T15:15:29.627228303+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-10 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUELk9B6gLZul7w3rZUkdLt3oCk8Mc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.627326258+05:30 - ResTimestampMock: 2026-05-11T15:15:29.668963317+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-11 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+u0Wl6Zbe+2U56imaXcc4pDGlEY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.669228719+05:30 - ResTimestampMock: 2026-05-11T15:15:29.711446301+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-12 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdoIqKZd8llL4FjreA3uX8Sa1VxI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.711602177+05:30 - ResTimestampMock: 2026-05-11T15:15:29.754517905+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-13 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUESa3CiabUr9TS3DOSFtRvW9PL6Sc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.75504845+05:30 - ResTimestampMock: 2026-05-11T15:15:29.797890323+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-14 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/RcjySXX6UJuuZyoQFB+/jFe0M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.798289659+05:30 - ResTimestampMock: 2026-05-11T15:15:29.841090652+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-15 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEvkBTJHi1UdvMEzG558Eq7ZofNVw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.841317555+05:30 - ResTimestampMock: 2026-05-11T15:15:29.882828508+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-16 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE764awLdaGMTMQKwPNItoaxebDrI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.853097963+05:30 - ResTimestampMock: 2026-05-11T15:15:29.894049019+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-17 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEKjrYJHZ0fhzBaxg5vp06IBhcOyg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.853792894+05:30 - ResTimestampMock: 2026-05-11T15:15:29.894575949+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-18 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2HHs+PA+07pTLn5jq0b8Mn27jSg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.853451997+05:30 - ResTimestampMock: 2026-05-11T15:15:29.894625516+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-19 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAnKrVebX6Z/hxinN8eJshnB1lEo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.852699346+05:30 - ResTimestampMock: 2026-05-11T15:15:29.894679797+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-20 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUpAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEL5XfeNiO/E/EOcZzydKOBEKz/z0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.853809422+05:30 - ResTimestampMock: 2026-05-11T15:15:29.895994496+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-21 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUoAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE4n+knG98esZS5Yb7OZZi2sNpENM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.855579226+05:30 - ResTimestampMock: 2026-05-11T15:15:29.897097298+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-22 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUqAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVuBZop6gxSc1AqAZgR656D6is0A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.854818338+05:30 - ResTimestampMock: 2026-05-11T15:15:29.897765326+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-23 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUkAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu0wwQ8xl+zBaA1sxGHqEfBNGPYo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.859515148+05:30 - ResTimestampMock: 2026-05-11T15:15:29.901913468+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-24 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7wS8Va9ccFZOoD7lVMRXbKf4z0g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.860891346+05:30 - ResTimestampMock: 2026-05-11T15:15:29.902653237+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-25 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEelzl+o/cOX38GpPGcdnXDijYl8M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.860719434+05:30 - ResTimestampMock: 2026-05-11T15:15:29.903691913+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-26 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUkAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7uGPnFz6/JTw2eY2BOa1I4hp+2g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.861082+05:30 - ResTimestampMock: 2026-05-11T15:15:29.90371665+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-27 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3YgNabidB3m4T8X0iM5TUnT+qnY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.861071115+05:30 - ResTimestampMock: 2026-05-11T15:15:29.90372803+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-28 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUjAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFIDeQlHYxiq6MekYWEpT9f5hB8U= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.864137297+05:30 - ResTimestampMock: 2026-05-11T15:15:29.905019137+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-29 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZfG/i/i3Of1GOvaQbGNIBKTSaCg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.866311043+05:30 - ResTimestampMock: 2026-05-11T15:15:29.906596079+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-30 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5/oKHaTSUAtQIHEKEJpx9xqBklc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.866198336+05:30 - ResTimestampMock: 2026-05-11T15:15:29.906646554+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-31 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEQY9aD49BW9kYI1oFfsh7JZyNZnQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.864765948+05:30 - ResTimestampMock: 2026-05-11T15:15:29.906651865+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-32 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7LeYYlrf6bvohLp5W/5kY8HzDmM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.867302546+05:30 - ResTimestampMock: 2026-05-11T15:15:29.907669889+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-33 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYIrzLeAUTzYZEfjyirsgWPJW07M= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.867215702+05:30 - ResTimestampMock: 2026-05-11T15:15:29.907718546+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-34 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETres2lCD6qj6CWNaiz48TbC1iRs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.866356565+05:30 - ResTimestampMock: 2026-05-11T15:15:29.907724577+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-35 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUeAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfoeVd8un+Ruyu1/RbStzNIpB4i8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.866304227+05:30 - ResTimestampMock: 2026-05-11T15:15:29.908714829+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-36 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEgtypEIIP2pJn1ELAXabfAb24JGk= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.869137153+05:30 - ResTimestampMock: 2026-05-11T15:15:29.909605505+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-37 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEfCxw5iFpLedvWrNf/Jcq2UtWHPU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.86891949+05:30 - ResTimestampMock: 2026-05-11T15:15:29.910637256+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-38 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEktDyftO1+p/jx06GYn+eAiE9Qos= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.870869484+05:30 - ResTimestampMock: 2026-05-11T15:15:29.911941749+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-39 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEaZBs4AGhoU7luWwEni90LxgWPM0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.869772678+05:30 - ResTimestampMock: 2026-05-11T15:15:29.912030839+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-40 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEknpy17QJxd6R+UIoxfw5uiOJAhI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.870661253+05:30 - ResTimestampMock: 2026-05-11T15:15:29.912035619+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-41 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUbAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkxDg97mW8wzTJku+YctR+hSR7pE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.870052993+05:30 - ResTimestampMock: 2026-05-11T15:15:29.912049249+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-42 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEUaTnYhEbMCoV4lSftpOW6L8oZ30= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.872246584+05:30 - ResTimestampMock: 2026-05-11T15:15:29.913829455+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-43 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUdAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcCSkDCRS7ntdSxqs9rrh3xpFWuY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.871212315+05:30 - ResTimestampMock: 2026-05-11T15:15:29.913924238+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-44 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUcAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwrVFuoSqePBd4HGZDdQJEBGzvck= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.877871183+05:30 - ResTimestampMock: 2026-05-11T15:15:29.918747761+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-45 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHUQAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEthZJrs97U1So2VXs2/TJZNZllQs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.878089942+05:30 - ResTimestampMock: 2026-05-11T15:15:29.919602684+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-46 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FiEAAAAAAAAAAAAAAAAAAHURAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEAIdgviivFMWUmbxGWHtXOmwGwt8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAACAAAAAAAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:29.87852394+05:30 - ResTimestampMock: 2026-05-11T15:15:29.92062949+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-47 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.928178684+05:30 - ResTimestampMock: 2026-05-11T15:15:29.969889375+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-48 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:15:29.970014711+05:30 - ResTimestampMock: 2026-05-11T15:15:30.01229099+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-49 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.020563239+05:30 - ResTimestampMock: 2026-05-11T15:15:30.062974387+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-50 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.063211308+05:30 - ResTimestampMock: 2026-05-11T15:15:30.104543579+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-51 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:15:30.104922291+05:30 - ResTimestampMock: 2026-05-11T15:15:30.146743869+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-52 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.148335303+05:30 - ResTimestampMock: 2026-05-11T15:15:30.190426944+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-53 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.190921023+05:30 - ResTimestampMock: 2026-05-11T15:15:30.232078239+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-54 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.242118109+05:30 - ResTimestampMock: 2026-05-11T15:15:30.284962884+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-55 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.285526102+05:30 - ResTimestampMock: 2026-05-11T15:15:30.327136814+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-56 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.334940646+05:30 - ResTimestampMock: 2026-05-11T15:15:30.375740521+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-57 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.376266584+05:30 - ResTimestampMock: 2026-05-11T15:15:30.419341349+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-58 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:15:30.419760729+05:30 - ResTimestampMock: 2026-05-11T15:15:30.462528259+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-59 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.463904477+05:30 - ResTimestampMock: 2026-05-11T15:15:30.505708361+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-60 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.491253932+05:30 - ResTimestampMock: 2026-05-11T15:15:30.53321712+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-61 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.506057482+05:30 - ResTimestampMock: 2026-05-11T15:15:30.548434329+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-62 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.533727285+05:30 - ResTimestampMock: 2026-05-11T15:15:30.575285444+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-63 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.554898139+05:30 - ResTimestampMock: 2026-05-11T15:15:30.595827394+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-64 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.596068213+05:30 - ResTimestampMock: 2026-05-11T15:15:30.637574574+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-65 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.645338349+05:30 - ResTimestampMock: 2026-05-11T15:15:30.686891389+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-66 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.68702088+05:30 - ResTimestampMock: 2026-05-11T15:15:30.728346233+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-67 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:15:30.728521056+05:30 - ResTimestampMock: 2026-05-11T15:15:30.771337755+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-68 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.77313175+05:30 - ResTimestampMock: 2026-05-11T15:15:30.814276595+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-69 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.814387925+05:30 - ResTimestampMock: 2026-05-11T15:15:30.855047804+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-70 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.861367676+05:30 - ResTimestampMock: 2026-05-11T15:15:30.902723452+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-71 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.902802624+05:30 - ResTimestampMock: 2026-05-11T15:15:30.945510562+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-72 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:30.953094514+05:30 - ResTimestampMock: 2026-05-11T15:15:30.995784685+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-73 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:30.99618096+05:30 - ResTimestampMock: 2026-05-11T15:15:31.038351282+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-74 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:15:31.038528379+05:30 - ResTimestampMock: 2026-05-11T15:15:31.080042684+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-75 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:31.081468235+05:30 - ResTimestampMock: 2026-05-11T15:15:31.124255505+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-76 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:31.124392765+05:30 - ResTimestampMock: 2026-05-11T15:15:31.166668377+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-77 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:31.232907416+05:30 - ResTimestampMock: 2026-05-11T15:15:31.274741113+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-78 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:31.275080416+05:30 - ResTimestampMock: 2026-05-11T15:15:31.317249838+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-79 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:31.54988015+05:30 - ResTimestampMock: 2026-05-11T15:15:31.593891658+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-80 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:31.576180158+05:30 - ResTimestampMock: 2026-05-11T15:15:31.618716477+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-81 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:31.59438367+05:30 - ResTimestampMock: 2026-05-11T15:15:31.637667086+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-82 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:31.619013087+05:30 - ResTimestampMock: 2026-05-11T15:15:31.659961735+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-83 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:31.856090276+05:30 - ResTimestampMock: 2026-05-11T15:15:31.898535234+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-84 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:31.898789601+05:30 - ResTimestampMock: 2026-05-11T15:15:31.941163524+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-85 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:32.167810941+05:30 - ResTimestampMock: 2026-05-11T15:15:32.209104035+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-86 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:32.209206294+05:30 - ResTimestampMock: 2026-05-11T15:15:32.251503825+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-87 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:32.318292985+05:30 - ResTimestampMock: 2026-05-11T15:15:32.361516953+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-88 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:32.361983274+05:30 - ResTimestampMock: 2026-05-11T15:15:32.404340709+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-89 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:32.638986649+05:30 - ResTimestampMock: 2026-05-11T15:15:32.68091948+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-90 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:32.661335707+05:30 - ResTimestampMock: 2026-05-11T15:15:32.703217661+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-91 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:32.681065053+05:30 - ResTimestampMock: 2026-05-11T15:15:32.7231327+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-92 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:32.703746546+05:30 - ResTimestampMock: 2026-05-11T15:15:32.746040735+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-93 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:32.941984041+05:30 - ResTimestampMock: 2026-05-11T15:15:32.983569753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-94 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:32.983790585+05:30 - ResTimestampMock: 2026-05-11T15:15:33.025355007+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-95 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:33.252967234+05:30 - ResTimestampMock: 2026-05-11T15:15:33.295082392+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-96 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:33.295544068+05:30 - ResTimestampMock: 2026-05-11T15:15:33.338731962+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-97 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:33.405769512+05:30 - ResTimestampMock: 2026-05-11T15:15:33.447476864+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-98 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:33.447788595+05:30 - ResTimestampMock: 2026-05-11T15:15:33.489375596+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-99 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:33.724034509+05:30 - ResTimestampMock: 2026-05-11T15:15:33.766445824+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-100 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:33.747250611+05:30 - ResTimestampMock: 2026-05-11T15:15:33.789539549+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-101 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:33.766636793+05:30 - ResTimestampMock: 2026-05-11T15:15:33.80830842+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-102 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:33.789741022+05:30 - ResTimestampMock: 2026-05-11T15:15:33.83128544+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-103 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:34.025824003+05:30 - ResTimestampMock: 2026-05-11T15:15:34.067511575+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-104 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:34.067624216+05:30 - ResTimestampMock: 2026-05-11T15:15:34.109755903+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-105 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:34.339803608+05:30 - ResTimestampMock: 2026-05-11T15:15:34.382427077+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-106 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:34.382957761+05:30 - ResTimestampMock: 2026-05-11T15:15:34.42430765+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-107 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:34.489981408+05:30 - ResTimestampMock: 2026-05-11T15:15:34.531368746+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-108 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:34.531685725+05:30 - ResTimestampMock: 2026-05-11T15:15:34.573250822+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-109 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:34.809741884+05:30 - ResTimestampMock: 2026-05-11T15:15:34.850972784+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-110 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:34.832257816+05:30 - ResTimestampMock: 2026-05-11T15:15:34.875473198+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-111 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:34.851367571+05:30 - ResTimestampMock: 2026-05-11T15:15:34.892978822+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-112 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:34.875599313+05:30 - ResTimestampMock: 2026-05-11T15:15:34.918070836+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-113 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:35.110981319+05:30 - ResTimestampMock: 2026-05-11T15:15:35.153224033+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-114 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:35.1535781+05:30 - ResTimestampMock: 2026-05-11T15:15:35.19627662+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-115 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:35.424926429+05:30 - ResTimestampMock: 2026-05-11T15:15:35.466272558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-116 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:35.466726703+05:30 - ResTimestampMock: 2026-05-11T15:15:35.50811035+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-117 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:35.574403448+05:30 - ResTimestampMock: 2026-05-11T15:15:35.61650918+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-118 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:35.616866687+05:30 - ResTimestampMock: 2026-05-11T15:15:35.658297585+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-119 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:35.895021351+05:30 - ResTimestampMock: 2026-05-11T15:15:35.936616464+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-120 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:35.919515443+05:30 - ResTimestampMock: 2026-05-11T15:15:35.961385704+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-121 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:35.936757003+05:30 - ResTimestampMock: 2026-05-11T15:15:35.979447308+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-122 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:35.961901+05:30 - ResTimestampMock: 2026-05-11T15:15:36.003303871+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-123 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:36.197791144+05:30 - ResTimestampMock: 2026-05-11T15:15:36.23967374+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-124 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:36.239975675+05:30 - ResTimestampMock: 2026-05-11T15:15:36.283284298+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-125 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:36.508989352+05:30 - ResTimestampMock: 2026-05-11T15:15:36.551226155+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-126 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:36.551382126+05:30 - ResTimestampMock: 2026-05-11T15:15:36.593380053+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-127 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:36.65903285+05:30 - ResTimestampMock: 2026-05-11T15:15:36.700427352+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-128 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:36.700831211+05:30 - ResTimestampMock: 2026-05-11T15:15:36.743466288+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-129 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:36.980999785+05:30 - ResTimestampMock: 2026-05-11T15:15:37.02218717+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-130 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:37.004203395+05:30 - ResTimestampMock: 2026-05-11T15:15:37.04541429+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-131 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:37.022509398+05:30 - ResTimestampMock: 2026-05-11T15:15:37.063975042+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-132 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:37.045613807+05:30 - ResTimestampMock: 2026-05-11T15:15:37.087101291+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-133 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:37.28370431+05:30 - ResTimestampMock: 2026-05-11T15:15:37.326200651+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-134 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:37.326320327+05:30 - ResTimestampMock: 2026-05-11T15:15:37.368267612+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-135 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:37.594792224+05:30 - ResTimestampMock: 2026-05-11T15:15:37.637229801+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-136 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:37.637783931+05:30 - ResTimestampMock: 2026-05-11T15:15:37.681220149+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-137 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:37.744724548+05:30 - ResTimestampMock: 2026-05-11T15:15:37.787193782+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-138 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:37.787431199+05:30 - ResTimestampMock: 2026-05-11T15:15:37.829417822+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-139 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:38.06552548+05:30 - ResTimestampMock: 2026-05-11T15:15:38.107646724+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-140 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:38.087928545+05:30 - ResTimestampMock: 2026-05-11T15:15:38.131624342+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-141 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:38.10816108+05:30 - ResTimestampMock: 2026-05-11T15:15:38.150170168+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-142 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:38.132071959+05:30 - ResTimestampMock: 2026-05-11T15:15:38.175142258+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-143 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:38.369227583+05:30 - ResTimestampMock: 2026-05-11T15:15:38.41062469+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-144 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:38.410942705+05:30 - ResTimestampMock: 2026-05-11T15:15:38.454343431+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-145 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:38.682039643+05:30 - ResTimestampMock: 2026-05-11T15:15:38.724564472+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-146 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:38.725111353+05:30 - ResTimestampMock: 2026-05-11T15:15:38.768021284+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-147 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:38.830723156+05:30 - ResTimestampMock: 2026-05-11T15:15:38.873206113+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-148 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:38.873550317+05:30 - ResTimestampMock: 2026-05-11T15:15:38.915192555+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-149 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:39.150918557+05:30 - ResTimestampMock: 2026-05-11T15:15:39.192760824+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-150 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:39.176466636+05:30 - ResTimestampMock: 2026-05-11T15:15:39.218540035+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-151 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:39.192977454+05:30 - ResTimestampMock: 2026-05-11T15:15:39.235361718+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-152 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:39.218657155+05:30 - ResTimestampMock: 2026-05-11T15:15:39.26034964+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-153 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:39.455733311+05:30 - ResTimestampMock: 2026-05-11T15:15:39.497091189+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-154 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:39.497633085+05:30 - ResTimestampMock: 2026-05-11T15:15:39.539282556+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-155 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:39.768654803+05:30 - ResTimestampMock: 2026-05-11T15:15:39.810156745+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-156 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:39.810555621+05:30 - ResTimestampMock: 2026-05-11T15:15:39.85240864+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-157 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:39.916460681+05:30 - ResTimestampMock: 2026-05-11T15:15:39.95847233+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-158 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:39.958583142+05:30 - ResTimestampMock: 2026-05-11T15:15:39.999905272+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-159 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:40.236054493+05:30 - ResTimestampMock: 2026-05-11T15:15:40.277846944+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-160 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:40.261156933+05:30 - ResTimestampMock: 2026-05-11T15:15:40.303902769+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-161 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:40.277912838+05:30 - ResTimestampMock: 2026-05-11T15:15:40.319062855+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-162 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:40.3043195+05:30 - ResTimestampMock: 2026-05-11T15:15:40.346370588+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-163 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:40.53991905+05:30 - ResTimestampMock: 2026-05-11T15:15:40.581646877+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-164 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:40.581840181+05:30 - ResTimestampMock: 2026-05-11T15:15:40.623062938+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-165 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:40.853976108+05:30 - ResTimestampMock: 2026-05-11T15:15:40.896230759+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-166 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:40.896332939+05:30 - ResTimestampMock: 2026-05-11T15:15:40.938570422+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-167 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:41.000405164+05:30 - ResTimestampMock: 2026-05-11T15:15:41.043339406+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-168 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:41.043678772+05:30 - ResTimestampMock: 2026-05-11T15:15:41.085627841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-169 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:41.320051129+05:30 - ResTimestampMock: 2026-05-11T15:15:41.361556151+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-170 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:41.347826361+05:30 - ResTimestampMock: 2026-05-11T15:15:41.39125167+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-171 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:41.361633109+05:30 - ResTimestampMock: 2026-05-11T15:15:41.404002532+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-172 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:41.391822447+05:30 - ResTimestampMock: 2026-05-11T15:15:41.433217206+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-173 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:41.623929413+05:30 - ResTimestampMock: 2026-05-11T15:15:41.665917175+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-174 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:41.666291886+05:30 - ResTimestampMock: 2026-05-11T15:15:41.708778547+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-175 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:41.939856277+05:30 - ResTimestampMock: 2026-05-11T15:15:41.981539102+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-176 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:41.981940299+05:30 - ResTimestampMock: 2026-05-11T15:15:42.023856817+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-177 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:42.086547757+05:30 - ResTimestampMock: 2026-05-11T15:15:42.127553885+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-178 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:42.127667941+05:30 - ResTimestampMock: 2026-05-11T15:15:42.17072984+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-179 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:42.405566705+05:30 - ResTimestampMock: 2026-05-11T15:15:42.44864621+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-180 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:42.434189876+05:30 - ResTimestampMock: 2026-05-11T15:15:42.475466732+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-181 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:42.448852284+05:30 - ResTimestampMock: 2026-05-11T15:15:42.489904986+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-182 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:42.476081757+05:30 - ResTimestampMock: 2026-05-11T15:15:42.517592757+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-183 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:42.710148038+05:30 - ResTimestampMock: 2026-05-11T15:15:42.75129018+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-184 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:42.751638586+05:30 - ResTimestampMock: 2026-05-11T15:15:42.793412794+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-185 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:43.025130856+05:30 - ResTimestampMock: 2026-05-11T15:15:43.067310502+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-186 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:43.068120389+05:30 - ResTimestampMock: 2026-05-11T15:15:43.110192174+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-187 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:43.171362748+05:30 - ResTimestampMock: 2026-05-11T15:15:43.213069712+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-188 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:43.213222855+05:30 - ResTimestampMock: 2026-05-11T15:15:43.254828076+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-189 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:43.490817339+05:30 - ResTimestampMock: 2026-05-11T15:15:43.532775704+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-190 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:43.518095053+05:30 - ResTimestampMock: 2026-05-11T15:15:43.560667494+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-191 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:43.532993654+05:30 - ResTimestampMock: 2026-05-11T15:15:43.574337697+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-192 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:43.561024395+05:30 - ResTimestampMock: 2026-05-11T15:15:43.604315822+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-193 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:43.794288438+05:30 - ResTimestampMock: 2026-05-11T15:15:43.836684333+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-194 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:43.837046039+05:30 - ResTimestampMock: 2026-05-11T15:15:43.878487215+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-195 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:44.111128271+05:30 - ResTimestampMock: 2026-05-11T15:15:44.1534783+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-196 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:44.153853747+05:30 - ResTimestampMock: 2026-05-11T15:15:44.195478418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-197 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:44.255588825+05:30 - ResTimestampMock: 2026-05-11T15:15:44.29708048+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-198 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:44.297541064+05:30 - ResTimestampMock: 2026-05-11T15:15:44.338877894+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-199 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:44.575968451+05:30 - ResTimestampMock: 2026-05-11T15:15:44.618597316+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-200 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:44.605403018+05:30 - ResTimestampMock: 2026-05-11T15:15:44.647445176+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-201 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:44.619031728+05:30 - ResTimestampMock: 2026-05-11T15:15:44.661404601+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-202 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:44.647889109+05:30 - ResTimestampMock: 2026-05-11T15:15:44.689098744+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-203 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:44.87981454+05:30 - ResTimestampMock: 2026-05-11T15:15:44.922105351+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-204 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:44.92245484+05:30 - ResTimestampMock: 2026-05-11T15:15:44.964541877+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-205 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:45.196957344+05:30 - ResTimestampMock: 2026-05-11T15:15:45.239554085+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-206 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:45.239955874+05:30 - ResTimestampMock: 2026-05-11T15:15:45.281620976+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-207 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:45.339644556+05:30 - ResTimestampMock: 2026-05-11T15:15:45.38155727+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-208 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:45.381847088+05:30 - ResTimestampMock: 2026-05-11T15:15:45.423505664+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-209 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:45.662931702+05:30 - ResTimestampMock: 2026-05-11T15:15:45.704977133+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-210 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:45.69032478+05:30 - ResTimestampMock: 2026-05-11T15:15:45.732468408+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-211 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:45.705241706+05:30 - ResTimestampMock: 2026-05-11T15:15:45.747616625+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-212 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:45.732857929+05:30 - ResTimestampMock: 2026-05-11T15:15:45.774270452+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-213 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:45.966145508+05:30 - ResTimestampMock: 2026-05-11T15:15:46.009035412+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-214 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:46.009166737+05:30 - ResTimestampMock: 2026-05-11T15:15:46.051402388+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-215 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:46.283096795+05:30 - ResTimestampMock: 2026-05-11T15:15:46.324591313+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-216 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:46.325041183+05:30 - ResTimestampMock: 2026-05-11T15:15:46.366283361+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-217 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:46.425030541+05:30 - ResTimestampMock: 2026-05-11T15:15:46.467117946+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-218 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:46.46771804+05:30 - ResTimestampMock: 2026-05-11T15:15:46.509059983+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-219 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:46.749551792+05:30 - ResTimestampMock: 2026-05-11T15:15:46.79122578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-220 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:46.774962498+05:30 - ResTimestampMock: 2026-05-11T15:15:46.817724028+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-221 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:46.79156676+05:30 - ResTimestampMock: 2026-05-11T15:15:46.834666841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-222 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:46.818181937+05:30 - ResTimestampMock: 2026-05-11T15:15:46.859193094+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-223 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:47.052873606+05:30 - ResTimestampMock: 2026-05-11T15:15:47.095322686+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-224 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:47.095614695+05:30 - ResTimestampMock: 2026-05-11T15:15:47.137474749+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-225 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:47.366754762+05:30 - ResTimestampMock: 2026-05-11T15:15:47.409415563+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-226 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:47.409790025+05:30 - ResTimestampMock: 2026-05-11T15:15:47.451070222+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-227 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:47.51076079+05:30 - ResTimestampMock: 2026-05-11T15:15:47.552484841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-228 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:47.552630895+05:30 - ResTimestampMock: 2026-05-11T15:15:47.595151645+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-229 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:47.836042574+05:30 - ResTimestampMock: 2026-05-11T15:15:47.877069612+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-230 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:47.860205074+05:30 - ResTimestampMock: 2026-05-11T15:15:47.902140891+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-231 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:47.877317516+05:30 - ResTimestampMock: 2026-05-11T15:15:47.918693843+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-232 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:47.902569364+05:30 - ResTimestampMock: 2026-05-11T15:15:47.944291253+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-233 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:48.138826734+05:30 - ResTimestampMock: 2026-05-11T15:15:48.181385495+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-234 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:48.181505323+05:30 - ResTimestampMock: 2026-05-11T15:15:48.224255741+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-235 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:48.452549837+05:30 - ResTimestampMock: 2026-05-11T15:15:48.494170599+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-236 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:48.494317503+05:30 - ResTimestampMock: 2026-05-11T15:15:48.536231818+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-237 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:48.595774392+05:30 - ResTimestampMock: 2026-05-11T15:15:48.637866639+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-238 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:48.638160516+05:30 - ResTimestampMock: 2026-05-11T15:15:48.679990072+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-239 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:48.919992096+05:30 - ResTimestampMock: 2026-05-11T15:15:48.962236588+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-240 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:48.945673347+05:30 - ResTimestampMock: 2026-05-11T15:15:48.988354342+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-241 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:48.962308587+05:30 - ResTimestampMock: 2026-05-11T15:15:49.003426062+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-242 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:48.988514574+05:30 - ResTimestampMock: 2026-05-11T15:15:49.031131517+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-243 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:49.224966194+05:30 - ResTimestampMock: 2026-05-11T15:15:49.266790713+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-244 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:49.266914152+05:30 - ResTimestampMock: 2026-05-11T15:15:49.308374603+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-245 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:49.536938604+05:30 - ResTimestampMock: 2026-05-11T15:15:49.578005455+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-246 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:49.578469024+05:30 - ResTimestampMock: 2026-05-11T15:15:49.620503639+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-247 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:49.680932622+05:30 - ResTimestampMock: 2026-05-11T15:15:49.722659725+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-248 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:49.723106875+05:30 - ResTimestampMock: 2026-05-11T15:15:49.76510935+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-249 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:50.004988272+05:30 - ResTimestampMock: 2026-05-11T15:15:50.047150384+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-250 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:50.032359684+05:30 - ResTimestampMock: 2026-05-11T15:15:50.074604794+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-251 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:50.047542382+05:30 - ResTimestampMock: 2026-05-11T15:15:50.090363274+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-252 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:50.074977572+05:30 - ResTimestampMock: 2026-05-11T15:15:50.11758933+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-253 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:50.308774301+05:30 - ResTimestampMock: 2026-05-11T15:15:50.350363368+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-254 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:50.350485549+05:30 - ResTimestampMock: 2026-05-11T15:15:50.393299341+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-255 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:50.621857206+05:30 - ResTimestampMock: 2026-05-11T15:15:50.665185069+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-256 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:50.665866239+05:30 - ResTimestampMock: 2026-05-11T15:15:50.708162428+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-257 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:50.766294503+05:30 - ResTimestampMock: 2026-05-11T15:15:50.809592893+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-258 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:50.810038942+05:30 - ResTimestampMock: 2026-05-11T15:15:50.85265666+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-259 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:51.091289852+05:30 - ResTimestampMock: 2026-05-11T15:15:51.133281287+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-260 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:51.11792199+05:30 - ResTimestampMock: 2026-05-11T15:15:51.159963791+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-261 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:51.133490447+05:30 - ResTimestampMock: 2026-05-11T15:15:51.175078827+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-262 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:51.160136151+05:30 - ResTimestampMock: 2026-05-11T15:15:51.201892993+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-263 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:51.393941753+05:30 - ResTimestampMock: 2026-05-11T15:15:51.435372704+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-264 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:51.435476909+05:30 - ResTimestampMock: 2026-05-11T15:15:51.477189544+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-265 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:51.709033787+05:30 - ResTimestampMock: 2026-05-11T15:15:51.750444847+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-266 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:51.750657873+05:30 - ResTimestampMock: 2026-05-11T15:15:51.793565627+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-267 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:51.853478597+05:30 - ResTimestampMock: 2026-05-11T15:15:51.895614399+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-268 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:51.89615748+05:30 - ResTimestampMock: 2026-05-11T15:15:51.937428994+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-269 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:52.175990357+05:30 - ResTimestampMock: 2026-05-11T15:15:52.217150306+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-270 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:52.203541518+05:30 - ResTimestampMock: 2026-05-11T15:15:52.245522757+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-271 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:52.217453563+05:30 - ResTimestampMock: 2026-05-11T15:15:52.259374455+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-272 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:52.245727965+05:30 - ResTimestampMock: 2026-05-11T15:15:52.287087604+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-273 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:52.478315647+05:30 - ResTimestampMock: 2026-05-11T15:15:52.520588523+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-274 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:52.520758747+05:30 - ResTimestampMock: 2026-05-11T15:15:52.562111644+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-275 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEol4pUGVTiYONebE6bmoNJ7fRVCUAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.578534491+05:30 - ResTimestampMock: 2026-05-11T15:15:52.620107286+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-276 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjaD4kxhYJ8kDxrvTjXmaDtMJUQAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.578146598+05:30 - ResTimestampMock: 2026-05-11T15:15:52.620107311+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-277 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7u21MFpAukucPgyasDzdTc8s0AEAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.578567602+05:30 - ResTimestampMock: 2026-05-11T15:15:52.62010729+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-278 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkMnm3rdGGz9VPE4yIoERBoXIC8EAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.578643388+05:30 - ResTimestampMock: 2026-05-11T15:15:52.620137668+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-279 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE7u21MFpAukucPgyasDzdTc8s0AE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.620274026+05:30 - ResTimestampMock: 2026-05-11T15:15:52.662456246+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-280 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEol4pUGVTiYONebE6bmoNJ7fRVCU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.620272849+05:30 - ResTimestampMock: 2026-05-11T15:15:52.662454232+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-281 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFjaD4kxhYJ8kDxrvTjXmaDtMJUQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.620285779+05:30 - ResTimestampMock: 2026-05-11T15:15:52.66280578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-282 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkMnm3rdGGz9VPE4yIoERBoXIC8E= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:52.62025354+05:30 - ResTimestampMock: 2026-05-11T15:15:52.663025359+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-283 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:52.795051448+05:30 - ResTimestampMock: 2026-05-11T15:15:52.836301755+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-284 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:52.836399775+05:30 - ResTimestampMock: 2026-05-11T15:15:52.878526436+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-285 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:52.938998869+05:30 - ResTimestampMock: 2026-05-11T15:15:52.980461091+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-286 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:52.980760998+05:30 - ResTimestampMock: 2026-05-11T15:15:53.022122791+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-287 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:53.260861825+05:30 - ResTimestampMock: 2026-05-11T15:15:53.302046044+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-288 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:53.288192431+05:30 - ResTimestampMock: 2026-05-11T15:15:53.330118924+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-289 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:53.302113236+05:30 - ResTimestampMock: 2026-05-11T15:15:53.343077339+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-290 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:53.330453494+05:30 - ResTimestampMock: 2026-05-11T15:15:53.371527202+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-291 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:53.56287822+05:30 - ResTimestampMock: 2026-05-11T15:15:53.60475836+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-292 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:53.605310522+05:30 - ResTimestampMock: 2026-05-11T15:15:53.648068547+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-293 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:53.879619224+05:30 - ResTimestampMock: 2026-05-11T15:15:53.922551734+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-294 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:53.923026633+05:30 - ResTimestampMock: 2026-05-11T15:15:53.96527238+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-295 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:54.023200111+05:30 - ResTimestampMock: 2026-05-11T15:15:54.065787556+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-296 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:54.0664263+05:30 - ResTimestampMock: 2026-05-11T15:15:54.108154676+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-297 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:54.344648344+05:30 - ResTimestampMock: 2026-05-11T15:15:54.386224709+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-298 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:54.37213432+05:30 - ResTimestampMock: 2026-05-11T15:15:54.413075065+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-299 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:54.386292275+05:30 - ResTimestampMock: 2026-05-11T15:15:54.428815867+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-300 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:54.41314744+05:30 - ResTimestampMock: 2026-05-11T15:15:54.455174844+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-301 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:54.64910052+05:30 - ResTimestampMock: 2026-05-11T15:15:54.690514925+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-302 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEg7Q/XqKUnp1DD+SfchP00tC2yvoAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.673893583+05:30 - ResTimestampMock: 2026-05-11T15:15:54.715455003+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-303 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEbTk+kqm7BNJcGX1XsuLj/TR472AAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.673457013+05:30 - ResTimestampMock: 2026-05-11T15:15:54.715559036+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-304 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBmTXL7hgC7aqoD4kv1RHAkrH1JQAAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.67342463+05:30 - ResTimestampMock: 2026-05-11T15:15:54.718871511+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-305 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP1L4XD4nOIA4knv8KLpkqaGGHxUAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.673823096+05:30 - ResTimestampMock: 2026-05-11T15:15:54.721718389+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-306 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcPPMWyMnblH7LK4YfjRloW8rGl4AAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.683422849+05:30 - ResTimestampMock: 2026-05-11T15:15:54.72465054+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-307 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEEF4H/XLHMdvHccMDMnzBz0IFrmcAAAAPAgEAA2lkeAAAAAAAAAAGAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.683482347+05:30 - ResTimestampMock: 2026-05-11T15:15:54.724768111+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-308 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFfw2XnvmialBZ3bOAvpzBYL9AWEAAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.683140405+05:30 - ResTimestampMock: 2026-05-11T15:15:54.724816284+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-309 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtCdYHDFDrQrtnwZ++JDWOar8APQAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.683482353+05:30 - ResTimestampMock: 2026-05-11T15:15:54.724907476+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-310 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:54.690929848+05:30 - ResTimestampMock: 2026-05-11T15:15:54.734564753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-311 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEbTk+kqm7BNJcGX1XsuLj/TR472A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.715738287+05:30 - ResTimestampMock: 2026-05-11T15:15:54.757562+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-312 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEg7Q/XqKUnp1DD+SfchP00tC2yvo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.715705067+05:30 - ResTimestampMock: 2026-05-11T15:15:54.75774504+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-313 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBmTXL7hgC7aqoD4kv1RHAkrH1JQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.719249316+05:30 - ResTimestampMock: 2026-05-11T15:15:54.760830985+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-314 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEP1L4XD4nOIA4knv8KLpkqaGGHxU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.722189459+05:30 - ResTimestampMock: 2026-05-11T15:15:54.762794945+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-315 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcPPMWyMnblH7LK4YfjRloW8rGl4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.724726926+05:30 - ResTimestampMock: 2026-05-11T15:15:54.766796772+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-316 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEEF4H/XLHMdvHccMDMnzBz0IFrmc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.726309447+05:30 - ResTimestampMock: 2026-05-11T15:15:54.767816092+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-317 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtCdYHDFDrQrtnwZ++JDWOar8APQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.726308636+05:30 - ResTimestampMock: 2026-05-11T15:15:54.768013777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-318 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEFfw2XnvmialBZ3bOAvpzBYL9AWE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ21jMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:54.726319483+05:30 - ResTimestampMock: 2026-05-11T15:15:54.768077152+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-319 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:54.965764156+05:30 - ResTimestampMock: 2026-05-11T15:15:55.00833787+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-320 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:55.008632967+05:30 - ResTimestampMock: 2026-05-11T15:15:55.050342295+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-321 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:55.10912317+05:30 - ResTimestampMock: 2026-05-11T15:15:55.151754236+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-322 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:55.151983876+05:30 - ResTimestampMock: 2026-05-11T15:15:55.194240936+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-323 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:55.430606033+05:30 - ResTimestampMock: 2026-05-11T15:15:55.47260675+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-324 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:55.455733197+05:30 - ResTimestampMock: 2026-05-11T15:15:55.497298101+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-325 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:55.472864845+05:30 - ResTimestampMock: 2026-05-11T15:15:55.515203025+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-326 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:55.497835221+05:30 - ResTimestampMock: 2026-05-11T15:15:55.539231617+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-327 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:55.735205315+05:30 - ResTimestampMock: 2026-05-11T15:15:55.777409882+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-328 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:55.777668668+05:30 - ResTimestampMock: 2026-05-11T15:15:55.819456032+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-329 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:56.050873896+05:30 - ResTimestampMock: 2026-05-11T15:15:56.092285889+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-330 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:56.092441796+05:30 - ResTimestampMock: 2026-05-11T15:15:56.134470911+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-331 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:56.195267431+05:30 - ResTimestampMock: 2026-05-11T15:15:56.238298944+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-332 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:56.238410381+05:30 - ResTimestampMock: 2026-05-11T15:15:56.282363687+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-333 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:56.517028463+05:30 - ResTimestampMock: 2026-05-11T15:15:56.558525329+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-334 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:56.540562797+05:30 - ResTimestampMock: 2026-05-11T15:15:56.582740476+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-335 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:56.558672144+05:30 - ResTimestampMock: 2026-05-11T15:15:56.601011815+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-336 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:56.583145378+05:30 - ResTimestampMock: 2026-05-11T15:15:56.625366729+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-337 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUExb9LzEJ6bbVCx446a8xbbdlLI1AAAAAPAgEAA2lkeAAAAAAAAAAJAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779458903+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821146305+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-338 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AtU4sD3VP8Mgw17mf1oYxTtBK4AAAAPAgEAA2lkeAAAAAAAAAALAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779379807+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821276544+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-339 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIPW9B3UUh/cbG+MdGxSN7ykXAOIAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779515964+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821276549+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-340 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9kr9HbZKLRyiNgW8TXq3BFj9e0UAAAAPAgEAA2lkeAAAAAAAAAAIAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779540726+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821279021+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-341 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWatu2U3LOr9wqs9j0FKY8DhiCIcAAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779478226+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821297409+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-342 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEk4hvuZQGJmXSlqLd0YeY6ovFmCYAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779418172+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821348034+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-343 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUElhW4v4BgZzVBRJfVg4XxH3Ze2P4AAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779457419+05:30 - ResTimestampMock: 2026-05-11T15:15:56.821611348+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-344 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtZ9TSzURfsD71Rw/vsEpGr6mvl0AAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.779439638+05:30 - ResTimestampMock: 2026-05-11T15:15:56.82170531+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-345 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJyv28xpt+SZjrrpxBg886Kb1RiMAAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.789567044+05:30 - ResTimestampMock: 2026-05-11T15:15:56.830962699+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-346 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUExei3UEj5JdDW5AFjvVTxCTyd41sAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.789906671+05:30 - ResTimestampMock: 2026-05-11T15:15:56.830965789+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-347 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzwI9nhTqNdZkW3Aqbq3tcbnJAD4AAAAKAgMAA3RhZ21jMwAAAA8CAQADaWR4AAAAAAAAAAc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.791004488+05:30 - ResTimestampMock: 2026-05-11T15:15:56.831641805+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-348 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEByhCKauhZC6qZwnTmgYtgd6TdioAAAAPAgEAA2lkeAAAAAAAAAAGAAAACgIDAAN0YWdtYzM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.7899237+05:30 - ResTimestampMock: 2026-05-11T15:15:56.831576768+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-349 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE8AtU4sD3VP8Mgw17mf1oYxTtBK4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821322843+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862215708+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-350 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEk4hvuZQGJmXSlqLd0YeY6ovFmCY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821371731+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862407468+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-351 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEIPW9B3UUh/cbG+MdGxSN7ykXAOI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821340506+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862701165+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-352 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:56.820796222+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862827261+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-353 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE9kr9HbZKLRyiNgW8TXq3BFj9e0U= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.82133856+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862937131+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-354 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUElhW4v4BgZzVBRJfVg4XxH3Ze2P4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821667306+05:30 - ResTimestampMock: 2026-05-11T15:15:56.862977521+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-355 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEtZ9TSzURfsD71Rw/vsEpGr6mvl0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAABA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821739056+05:30 - ResTimestampMock: 2026-05-11T15:15:56.863190551+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-356 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUExb9LzEJ6bbVCx446a8xbbdlLI1A= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821223466+05:30 - ResTimestampMock: 2026-05-11T15:15:56.863235274+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-357 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWatu2U3LOr9wqs9j0FKY8DhiCIc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAACg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.821391215+05:30 - ResTimestampMock: 2026-05-11T15:15:56.863251766+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-358 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEByhCKauhZC6qZwnTmgYtgd6Tdio= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAYAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.831678378+05:30 - ResTimestampMock: 2026-05-11T15:15:56.872821866+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-359 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEJyv28xpt+SZjrrpxBg886Kb1RiM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAAAQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.831199684+05:30 - ResTimestampMock: 2026-05-11T15:15:56.872940667+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-360 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUExei3UEj5JdDW5AFjvVTxCTyd41s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jMw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.831193735+05:30 - ResTimestampMock: 2026-05-11T15:15:56.872969378+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-361 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzwI9nhTqNdZkW3Aqbq3tcbnJAD4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWMzAAAADwEBAANpZHgAAAAAAAAABw== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:56.831796255+05:30 - ResTimestampMock: 2026-05-11T15:15:56.874084743+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-362 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:56.863007309+05:30 - ResTimestampMock: 2026-05-11T15:15:56.904229389+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-363 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:57.136150754+05:30 - ResTimestampMock: 2026-05-11T15:15:57.177150587+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-364 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:57.177281807+05:30 - ResTimestampMock: 2026-05-11T15:15:57.219398176+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-365 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:57.283310661+05:30 - ResTimestampMock: 2026-05-11T15:15:57.325970507+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-366 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:57.326361482+05:30 - ResTimestampMock: 2026-05-11T15:15:57.368776756+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-367 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:57.602907662+05:30 - ResTimestampMock: 2026-05-11T15:15:57.644435164+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-368 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:57.626024116+05:30 - ResTimestampMock: 2026-05-11T15:15:57.6689313+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-369 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:57.644538652+05:30 - ResTimestampMock: 2026-05-11T15:15:57.687632627+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-370 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:57.669587265+05:30 - ResTimestampMock: 2026-05-11T15:15:57.711090396+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-371 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:57.905095407+05:30 - ResTimestampMock: 2026-05-11T15:15:57.948768164+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-372 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:57.949180379+05:30 - ResTimestampMock: 2026-05-11T15:15:57.991070821+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-373 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:58.220738193+05:30 - ResTimestampMock: 2026-05-11T15:15:58.263618094+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-374 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:58.263749201+05:30 - ResTimestampMock: 2026-05-11T15:15:58.306251641+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-375 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:58.370360887+05:30 - ResTimestampMock: 2026-05-11T15:15:58.412583862+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-376 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:58.412948728+05:30 - ResTimestampMock: 2026-05-11T15:15:58.455211772+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-377 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:58.689033365+05:30 - ResTimestampMock: 2026-05-11T15:15:58.731119738+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-378 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:58.712203952+05:30 - ResTimestampMock: 2026-05-11T15:15:58.755881969+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-379 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:58.731569634+05:30 - ResTimestampMock: 2026-05-11T15:15:58.774368152+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-380 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:58.7565998+05:30 - ResTimestampMock: 2026-05-11T15:15:58.799724959+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-381 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUENOPuBgbSnblnAyIHR1eUWZ82Ru0AAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884458008+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926407986+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-382 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+U5P636ziHWN3/TKsarN/qAILNsAAAAPAgEAA2lkeAAAAAAAAAAOAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884453072+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926574416+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-383 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEukTS0kXDOnDUhWTYlWH4DFBFQmYAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884478058+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926574104+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-384 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6nDpQJu4e++EkV7sjQ17NRjvfygAAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884592132+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926857153+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-385 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEXLX/yMackbjOKbaRd1LmIkpBM7oAAAAPAgEAA2lkeAAAAAAAAAALAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884422061+05:30 - ResTimestampMock: 2026-05-11T15:15:58.92695013+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-386 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkvLhNnyghi5bWusLUIlK+7cLRbgAAAAPAgEAA2lkeAAAAAAAAAANAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884531353+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926955552+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-387 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBhQ96WawPqt1aKOkrCtttxsngnYAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.88440416+05:30 - ResTimestampMock: 2026-05-11T15:15:58.926998363+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-388 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdBJFmptpjSLNyJojdGUlxxzSzXcAAAAPAgEAA2lkeAAAAAAAAAAXAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884364466+05:30 - ResTimestampMock: 2026-05-11T15:15:58.927009219+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-389 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu7CWZAE4TpOjif6/ZOs1FLzXTWYAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884590944+05:30 - ResTimestampMock: 2026-05-11T15:15:58.927032274+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-390 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpQb8oqjTm8Nr34sA1iEG8xRbeDQAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884557379+05:30 - ResTimestampMock: 2026-05-11T15:15:58.927044151+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-391 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGf0TNWn/0de87Bu78n9Bip+gGUMAAAAPAgEAA2lkeAAAAAAAAAAKAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884502546+05:30 - ResTimestampMock: 2026-05-11T15:15:58.927051344+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-392 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUvAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMeKQs5rz5/m30N0yNJQmF1UYRFwAAAAPAgEAA2lkeAAAAAAAAAAFAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.884611498+05:30 - ResTimestampMock: 2026-05-11T15:15:58.927528992+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-393 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/66MAck5CxsRBuZweSEn+a0NLyQAAAAPAgEAA2lkeAAAAAAAAAAWAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.896640971+05:30 - ResTimestampMock: 2026-05-11T15:15:58.937840272+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-394 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEB8HiI+CW0HhQQ1ArABjB/+dMgCwAAAAPAgEAA2lkeAAAAAAAAAAQAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.895432307+05:30 - ResTimestampMock: 2026-05-11T15:15:58.937846204+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-395 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm6+j2yvdF5pyyS5dCp4whNf0sUAAAAPAgEAA2lkeAAAAAAAAAAPAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.895667385+05:30 - ResTimestampMock: 2026-05-11T15:15:58.937889367+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-396 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYUOf/s0oNXa0zQKacUddedNASF4AAAAPAgEAA2lkeAAAAAAAAAAUAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.896924088+05:30 - ResTimestampMock: 2026-05-11T15:15:58.93827155+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-397 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2VNae/x1Xl4gDpSiBXm04tN9QZ8AAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.899390539+05:30 - ResTimestampMock: 2026-05-11T15:15:58.940703508+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-398 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUlAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWeEfmvw6EQingr+4ixSd3/s5O/sAAAAKAgMAA3RhZ21jNAAAAA8CAQADaWR4AAAAAAAAAAY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.900656636+05:30 - ResTimestampMock: 2026-05-11T15:15:58.943076821+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-399 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUkAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmoOSMquiMMRcyCuMBtzoWfS94KsAAAAPAgEAA2lkeAAAAAAAAAAIAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.900675727+05:30 - ResTimestampMock: 2026-05-11T15:15:58.94307664+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-400 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUlAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEOOAy4D/MU3mbjYMq0a7WxJQ20J4AAAAPAgEAA2lkeAAAAAAAAAATAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.900700568+05:30 - ResTimestampMock: 2026-05-11T15:15:58.94308263+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-401 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5FOaNfb4SOhMx7am29eNJr7evvIAAAAPAgEAA2lkeAAAAAAAAAAJAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.902459454+05:30 - ResTimestampMock: 2026-05-11T15:15:58.943672932+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-402 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE1KqREddauKC1AJ7H6aEne9Z0GQ0AAAAPAgEAA2lkeAAAAAAAAAARAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.902713344+05:30 - ResTimestampMock: 2026-05-11T15:15:58.94367266+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-403 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUiAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwZkBh2MTCGBlN84Sw6wY5EArL/gAAAAPAgEAA2lkeAAAAAAAAAASAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.90208188+05:30 - ResTimestampMock: 2026-05-11T15:15:58.943741247+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-404 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVBWqNh0vxyIkyC3l+VBtgz4mxH8AAAAPAgEAA2lkeAAAAAAAAAAVAAAACgIDAAN0YWdtYzQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.90478441+05:30 - ResTimestampMock: 2026-05-11T15:15:58.94668085+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-405 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE+U5P636ziHWN3/TKsarN/qAILNs= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA4AAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.926887036+05:30 - ResTimestampMock: 2026-05-11T15:15:58.967917466+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-406 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUENOPuBgbSnblnAyIHR1eUWZ82Ru0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.926534328+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968036101+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-407 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE6nDpQJu4e++EkV7sjQ17NRjvfyg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.92696317+05:30 - ResTimestampMock: 2026-05-11T15:15:58.96808384+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-408 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEpQb8oqjTm8Nr34sA1iEG8xRbeDQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAAAg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927165641+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968085155+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-409 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEkvLhNnyghi5bWusLUIlK+7cLRbg= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA0AAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927021101+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968097874+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-410 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBhQ96WawPqt1aKOkrCtttxsngnY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAADA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927140585+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968103999+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-411 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEukTS0kXDOnDUhWTYlWH4DFBFQmY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.926741963+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968110848+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-412 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEXLX/yMackbjOKbaRd1LmIkpBM7o= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAsAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927161084+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968740829+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-413 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEdBJFmptpjSLNyJojdGUlxxzSzXc= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABcAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927045014+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968815383+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-414 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEMeKQs5rz5/m30N0yNJQmF1UYRFw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAUAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927606948+05:30 - ResTimestampMock: 2026-05-11T15:15:58.968826204+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-415 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEu7CWZAE4TpOjif6/ZOs1FLzXTWY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927083508+05:30 - ResTimestampMock: 2026-05-11T15:15:58.969053494+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-416 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEGf0TNWn/0de87Bu78n9Bip+gGUM= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAoAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.927130337+05:30 - ResTimestampMock: 2026-05-11T15:15:58.970412849+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-417 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEB8HiI+CW0HhQQ1ArABjB/+dMgCw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABAAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.938241398+05:30 - ResTimestampMock: 2026-05-11T15:15:58.978874283+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-418 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEBm6+j2yvdF5pyyS5dCp4whNf0sU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAA8AAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.938233468+05:30 - ResTimestampMock: 2026-05-11T15:15:58.979056164+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-419 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE/66MAck5CxsRBuZweSEn+a0NLyQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABYAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.93824281+05:30 - ResTimestampMock: 2026-05-11T15:15:58.979106083+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-420 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEYUOf/s0oNXa0zQKacUddedNASF4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABQAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.938306693+05:30 - ResTimestampMock: 2026-05-11T15:15:58.980666673+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-421 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE2VNae/x1Xl4gDpSiBXm04tN9QZ8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.940862102+05:30 - ResTimestampMock: 2026-05-11T15:15:58.981881558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-422 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEOOAy4D/MU3mbjYMq0a7WxJQ20J4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABMAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943175397+05:30 - ResTimestampMock: 2026-05-11T15:15:58.983942803+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-423 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEmoOSMquiMMRcyCuMBtzoWfS94Ks= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAgAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943218404+05:30 - ResTimestampMock: 2026-05-11T15:15:58.984129077+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-424 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEWeEfmvw6EQingr+4ixSd3/s5O/s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnbWM0AAAADwEBAANpZHgAAAAAAAAABg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943199952+05:30 - ResTimestampMock: 2026-05-11T15:15:58.985967978+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-425 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE5FOaNfb4SOhMx7am29eNJr7evvI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAkAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943909753+05:30 - ResTimestampMock: 2026-05-11T15:15:58.986019486+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-426 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE1KqREddauKC1AJ7H6aEne9Z0GQ0= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABEAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943905131+05:30 - ResTimestampMock: 2026-05-11T15:15:58.986666601+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-427 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEwZkBh2MTCGBlN84Sw6wY5EArL/g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABIAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.943863808+05:30 - ResTimestampMock: 2026-05-11T15:15:58.986839301+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-428 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEVBWqNh0vxyIkyC3l+VBtgz4mxH8= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAABUAAAAKAQMAA3RhZ21jNA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:15:58.946764488+05:30 - ResTimestampMock: 2026-05-11T15:15:58.988885727+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-429 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:58.991646106+05:30 - ResTimestampMock: 2026-05-11T15:15:59.032846767+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-430 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:59.033068372+05:30 - ResTimestampMock: 2026-05-11T15:15:59.074201123+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-431 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:59.30676515+05:30 - ResTimestampMock: 2026-05-11T15:15:59.348118926+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-432 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:59.348535908+05:30 - ResTimestampMock: 2026-05-11T15:15:59.392135444+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-433 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:59.456246116+05:30 - ResTimestampMock: 2026-05-11T15:15:59.496977831+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-434 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:59.497050539+05:30 - ResTimestampMock: 2026-05-11T15:15:59.53921285+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-435 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:59.775977185+05:30 - ResTimestampMock: 2026-05-11T15:15:59.818371752+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-436 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:15:59.80073005+05:30 - ResTimestampMock: 2026-05-11T15:15:59.842982687+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-437 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:59.819139596+05:30 - ResTimestampMock: 2026-05-11T15:15:59.861536282+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-438 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:15:59.843191282+05:30 - ResTimestampMock: 2026-05-11T15:15:59.885418221+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-439 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:00.074657569+05:30 - ResTimestampMock: 2026-05-11T15:16:00.116440133+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-440 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:00.11657413+05:30 - ResTimestampMock: 2026-05-11T15:16:00.158523477+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-441 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:00.393120426+05:30 - ResTimestampMock: 2026-05-11T15:16:00.434363975+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-442 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:00.434514142+05:30 - ResTimestampMock: 2026-05-11T15:16:00.476692178+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-443 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:00.540317536+05:30 - ResTimestampMock: 2026-05-11T15:16:00.58215081+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-444 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:00.582263553+05:30 - ResTimestampMock: 2026-05-11T15:16:00.623069303+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-445 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:00.8627612+05:30 - ResTimestampMock: 2026-05-11T15:16:00.905816853+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-446 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:00.886155929+05:30 - ResTimestampMock: 2026-05-11T15:16:00.927107686+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-447 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:00.906530427+05:30 - ResTimestampMock: 2026-05-11T15:16:00.949701679+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-448 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:00.927543605+05:30 - ResTimestampMock: 2026-05-11T15:16:00.96929283+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-449 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:01.159964202+05:30 - ResTimestampMock: 2026-05-11T15:16:01.20117712+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-450 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:01.201375547+05:30 - ResTimestampMock: 2026-05-11T15:16:01.243382062+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-451 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:01.478161173+05:30 - ResTimestampMock: 2026-05-11T15:16:01.520044221+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-452 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:01.520599499+05:30 - ResTimestampMock: 2026-05-11T15:16:01.561588322+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-453 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:01.623656864+05:30 - ResTimestampMock: 2026-05-11T15:16:01.666336075+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-454 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:01.666463209+05:30 - ResTimestampMock: 2026-05-11T15:16:01.708587178+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-455 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:01.950964532+05:30 - ResTimestampMock: 2026-05-11T15:16:01.992700186+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-456 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:01.970223675+05:30 - ResTimestampMock: 2026-05-11T15:16:02.010995035+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-457 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:01.993243439+05:30 - ResTimestampMock: 2026-05-11T15:16:02.036668254+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-458 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.006901469+05:30 - ResTimestampMock: 2026-05-11T15:16:02.048001068+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-459 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.006901505+05:30 - ResTimestampMock: 2026-05-11T15:16:02.048066289+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-460 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.005446622+05:30 - ResTimestampMock: 2026-05-11T15:16:02.048083383+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-461 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.006574233+05:30 - ResTimestampMock: 2026-05-11T15:16:02.048185838+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-462 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.011158868+05:30 - ResTimestampMock: 2026-05-11T15:16:02.052005171+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-463 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.048278087+05:30 - ResTimestampMock: 2026-05-11T15:16:02.089748439+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-464 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.04807545+05:30 - ResTimestampMock: 2026-05-11T15:16:02.0897501+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-465 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.048246748+05:30 - ResTimestampMock: 2026-05-11T15:16:02.089756109+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-466 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.04812282+05:30 - ResTimestampMock: 2026-05-11T15:16:02.089781266+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-467 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.098328513+05:30 - ResTimestampMock: 2026-05-11T15:16:02.140380605+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-468 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.098555477+05:30 - ResTimestampMock: 2026-05-11T15:16:02.140380549+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-469 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.098605791+05:30 - ResTimestampMock: 2026-05-11T15:16:02.140631428+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-470 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.098785201+05:30 - ResTimestampMock: 2026-05-11T15:16:02.140628279+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-471 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.140730321+05:30 - ResTimestampMock: 2026-05-11T15:16:02.182185776+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-472 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.140564838+05:30 - ResTimestampMock: 2026-05-11T15:16:02.182196697+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-473 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.140769003+05:30 - ResTimestampMock: 2026-05-11T15:16:02.182401494+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-474 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.140685535+05:30 - ResTimestampMock: 2026-05-11T15:16:02.182565505+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-475 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:02.182562777+05:30 - ResTimestampMock: 2026-05-11T15:16:02.224442306+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-476 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:02.18268728+05:30 - ResTimestampMock: 2026-05-11T15:16:02.22451795+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-477 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:02.182531414+05:30 - ResTimestampMock: 2026-05-11T15:16:02.224482966+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-478 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:02.182505873+05:30 - ResTimestampMock: 2026-05-11T15:16:02.224517182+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-479 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.22597784+05:30 - ResTimestampMock: 2026-05-11T15:16:02.26743199+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-480 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.225951751+05:30 - ResTimestampMock: 2026-05-11T15:16:02.267906413+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-481 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.225887562+05:30 - ResTimestampMock: 2026-05-11T15:16:02.267954218+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-482 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.226107855+05:30 - ResTimestampMock: 2026-05-11T15:16:02.267991822+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-483 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.244507661+05:30 - ResTimestampMock: 2026-05-11T15:16:02.286241996+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-484 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.267673695+05:30 - ResTimestampMock: 2026-05-11T15:16:02.309232215+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-485 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.267990308+05:30 - ResTimestampMock: 2026-05-11T15:16:02.309656065+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-486 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.2680769+05:30 - ResTimestampMock: 2026-05-11T15:16:02.310800809+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-487 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.268060445+05:30 - ResTimestampMock: 2026-05-11T15:16:02.311692928+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-488 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.286362139+05:30 - ResTimestampMock: 2026-05-11T15:16:02.328241418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-489 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3smb5joTF2kRQgsk6eBPYGGh34QAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdmYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.321803505+05:30 - ResTimestampMock: 2026-05-11T15:16:02.363003386+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-490 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi8aaJ0cxMpVePhwGjutZKwUAWKEAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdmYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.322659592+05:30 - ResTimestampMock: 2026-05-11T15:16:02.363785745+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-491 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi2ZMNTTV0CN8AXdfvS5KjqL1I6gAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdmYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.325004015+05:30 - ResTimestampMock: 2026-05-11T15:16:02.36577053+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-492 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUE66pGBU5KUB9bGk97z2aMgA2dtToAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdmYzE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.325004074+05:30 - ResTimestampMock: 2026-05-11T15:16:02.366911777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-493 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE3smb5joTF2kRQgsk6eBPYGGh34Q= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ2ZjMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.363239108+05:30 - ResTimestampMock: 2026-05-11T15:16:02.405327612+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-494 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi8aaJ0cxMpVePhwGjutZKwUAWKE= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ2ZjMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.364036998+05:30 - ResTimestampMock: 2026-05-11T15:16:02.405894192+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-495 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEi2ZMNTTV0CN8AXdfvS5KjqL1I6g= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ2ZjMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.366020254+05:30 - ResTimestampMock: 2026-05-11T15:16:02.407962176+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-496 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUE66pGBU5KUB9bGk97z2aMgA2dtTo= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ2ZjMQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:02.368995897+05:30 - ResTimestampMock: 2026-05-11T15:16:02.41155246+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-497 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.562198257+05:30 - ResTimestampMock: 2026-05-11T15:16:02.603580965+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-498 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.603740813+05:30 - ResTimestampMock: 2026-05-11T15:16:02.645563198+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-499 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:02.709996956+05:30 - ResTimestampMock: 2026-05-11T15:16:02.751989853+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-500 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:02.752443873+05:30 - ResTimestampMock: 2026-05-11T15:16:02.795417998+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-501 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:03.037762259+05:30 - ResTimestampMock: 2026-05-11T15:16:03.080847627+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-502 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:03.053021799+05:30 - ResTimestampMock: 2026-05-11T15:16:03.095226195+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-503 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:03.080981703+05:30 - ResTimestampMock: 2026-05-11T15:16:03.122371217+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-504 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:03.095564494+05:30 - ResTimestampMock: 2026-05-11T15:16:03.138118679+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-505 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:03.329396216+05:30 - ResTimestampMock: 2026-05-11T15:16:03.371207451+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-506 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:03.371343709+05:30 - ResTimestampMock: 2026-05-11T15:16:03.413923565+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-507 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:03.64721014+05:30 - ResTimestampMock: 2026-05-11T15:16:03.689386091+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-508 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:03.689486422+05:30 - ResTimestampMock: 2026-05-11T15:16:03.732209423+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-509 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:03.796746888+05:30 - ResTimestampMock: 2026-05-11T15:16:03.838619582+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-510 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:03.838710973+05:30 - ResTimestampMock: 2026-05-11T15:16:03.881876581+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-511 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:04.123424+05:30 - ResTimestampMock: 2026-05-11T15:16:04.165532505+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-512 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:04.138966619+05:30 - ResTimestampMock: 2026-05-11T15:16:04.183324074+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-513 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:04.165787251+05:30 - ResTimestampMock: 2026-05-11T15:16:04.207322077+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-514 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:04.184039234+05:30 - ResTimestampMock: 2026-05-11T15:16:04.226199563+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-515 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:04.415051027+05:30 - ResTimestampMock: 2026-05-11T15:16:04.456427641+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-516 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:04.456674319+05:30 - ResTimestampMock: 2026-05-11T15:16:04.499059211+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-517 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:04.733281302+05:30 - ResTimestampMock: 2026-05-11T15:16:04.774342753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-518 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:04.774419995+05:30 - ResTimestampMock: 2026-05-11T15:16:04.817240574+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-519 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:04.882169839+05:30 - ResTimestampMock: 2026-05-11T15:16:04.923132435+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-520 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:04.923547383+05:30 - ResTimestampMock: 2026-05-11T15:16:04.965554927+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-521 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.208980648+05:30 - ResTimestampMock: 2026-05-11T15:16:05.250511965+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-522 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.22748439+05:30 - ResTimestampMock: 2026-05-11T15:16:05.270959839+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-523 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.251026654+05:30 - ResTimestampMock: 2026-05-11T15:16:05.294080498+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-524 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.271094198+05:30 - ResTimestampMock: 2026-05-11T15:16:05.313506843+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-525 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.429095551+05:30 - ResTimestampMock: 2026-05-11T15:16:05.469875367+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-526 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.428668561+05:30 - ResTimestampMock: 2026-05-11T15:16:05.469987305+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-527 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.428668555+05:30 - ResTimestampMock: 2026-05-11T15:16:05.469993444+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-528 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.428674156+05:30 - ResTimestampMock: 2026-05-11T15:16:05.470069088+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-529 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.470301785+05:30 - ResTimestampMock: 2026-05-11T15:16:05.511846159+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-530 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.470349912+05:30 - ResTimestampMock: 2026-05-11T15:16:05.51214818+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-531 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.470233157+05:30 - ResTimestampMock: 2026-05-11T15:16:05.51240364+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-532 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.470383999+05:30 - ResTimestampMock: 2026-05-11T15:16:05.512426787+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-533 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.500824774+05:30 - ResTimestampMock: 2026-05-11T15:16:05.542520988+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-534 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.518913868+05:30 - ResTimestampMock: 2026-05-11T15:16:05.560968448+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-535 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.519699348+05:30 - ResTimestampMock: 2026-05-11T15:16:05.561576058+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-536 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.520715778+05:30 - ResTimestampMock: 2026-05-11T15:16:05.561630137+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-537 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.520362209+05:30 - ResTimestampMock: 2026-05-11T15:16:05.562854157+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-538 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.542851258+05:30 - ResTimestampMock: 2026-05-11T15:16:05.584306461+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-539 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.561067917+05:30 - ResTimestampMock: 2026-05-11T15:16:05.602504199+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-540 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.561672848+05:30 - ResTimestampMock: 2026-05-11T15:16:05.603965759+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-541 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.561655492+05:30 - ResTimestampMock: 2026-05-11T15:16:05.604434539+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-542 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.563364141+05:30 - ResTimestampMock: 2026-05-11T15:16:05.606933435+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-543 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:05.602614578+05:30 - ResTimestampMock: 2026-05-11T15:16:05.645269174+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-544 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:05.604047979+05:30 - ResTimestampMock: 2026-05-11T15:16:05.64616638+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-545 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:05.605851222+05:30 - ResTimestampMock: 2026-05-11T15:16:05.648247666+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-546 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:05.607317344+05:30 - ResTimestampMock: 2026-05-11T15:16:05.650082709+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-547 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.647518195+05:30 - ResTimestampMock: 2026-05-11T15:16:05.689557296+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-548 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.648364404+05:30 - ResTimestampMock: 2026-05-11T15:16:05.690643655+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-549 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.649533496+05:30 - ResTimestampMock: 2026-05-11T15:16:05.6909382+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-550 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.651531569+05:30 - ResTimestampMock: 2026-05-11T15:16:05.693734393+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-551 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.68970261+05:30 - ResTimestampMock: 2026-05-11T15:16:05.731187233+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-552 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.690724649+05:30 - ResTimestampMock: 2026-05-11T15:16:05.73206748+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-553 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.690996543+05:30 - ResTimestampMock: 2026-05-11T15:16:05.732281182+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-554 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.693957413+05:30 - ResTimestampMock: 2026-05-11T15:16:05.735619075+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-555 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEY/nUHM7KmmNev4pgGXL9wCY87QUAAAAPAgEAA2lkeAAAAAAAAAAAAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.741682115+05:30 - ResTimestampMock: 2026-05-11T15:16:05.784299991+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-556 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUETf0wqtcDzNBYG7yznG0a7s9KBrQAAAAPAgEAA2lkeAAAAAAAAAAHAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.74193508+05:30 - ResTimestampMock: 2026-05-11T15:16:05.784319739+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-557 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzmGjaMxKYbGi8vieBlEKjuLTU+sAAAAPAgEAA2lkeAAAAAAAAAADAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.741935835+05:30 - ResTimestampMock: 2026-05-11T15:16:05.784319712+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-558 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeftghePRbJlJ3rdktpK54q8cEiwAAAAPAgEAA2lkeAAAAAAAAAACAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.746790005+05:30 - ResTimestampMock: 2026-05-11T15:16:05.789364675+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-559 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEzmGjaMxKYbGi8vieBlEKjuLTU+s= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAMAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.784804969+05:30 - ResTimestampMock: 2026-05-11T15:16:05.826902772+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-560 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUETf0wqtcDzNBYG7yznG0a7s9KBrQ= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAcAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.784813819+05:30 - ResTimestampMock: 2026-05-11T15:16:05.826981144+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-561 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEY/nUHM7KmmNev4pgGXL9wCY87QU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAAAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.784805278+05:30 - ResTimestampMock: 2026-05-11T15:16:05.826994091+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-562 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEeftghePRbJlJ3rdktpK54q8cEiw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAIAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:05.78945179+05:30 - ResTimestampMock: 2026-05-11T15:16:05.831080463+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-563 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.819009034+05:30 - ResTimestampMock: 2026-05-11T15:16:05.861541558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-564 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.837066013+05:30 - ResTimestampMock: 2026-05-11T15:16:05.878854352+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-565 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.838732008+05:30 - ResTimestampMock: 2026-05-11T15:16:05.879646292+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-566 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.837429117+05:30 - ResTimestampMock: 2026-05-11T15:16:05.879680727+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-567 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 6 - packet_type: Info - meta: - info_command: build - info_kind: discovery - raw_body: YnVpbGQK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 14 - packet_type: Info - meta: - info_command: "build\t7.2.0.1" - info_kind: unknown - raw_body: YnVpbGQJNy4yLjAuMQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.837574968+05:30 - ResTimestampMock: 2026-05-11T15:16:05.879678154+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-568 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.86190795+05:30 - ResTimestampMock: 2026-05-11T15:16:05.90419152+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-569 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.879063218+05:30 - ResTimestampMock: 2026-05-11T15:16:05.91999309+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-570 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.880005412+05:30 - ResTimestampMock: 2026-05-11T15:16:05.921794551+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-571 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.879988897+05:30 - ResTimestampMock: 2026-05-11T15:16:05.921880361+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-572 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 35 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwYXJ0aXRpb24tZ2VuZXJhdGlvbgpmZWF0dXJlcwo= - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 278 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGFydGl0aW9uLWdlbmVyYXRpb24JMApmZWF0dXJlcwliYXRjaC1hbnk7YmF0Y2gtaW5kZXg7YmxvYi1iaXRzO2NkdC1pbmRleDtjZHQtbGlzdDtjZHQtbWFwO2NsdXN0ZXItc3RhYmxlO2Zsb2F0O2dlbztzaW5kZXgtZXhpc3RzO3BlZXJzO3BpcGVsaW5pbmc7cHF1ZXJ5O3BzY2FucztxdWVyeS1zaG93O3JlbGF4ZWQtc2M7cmVwbGljYXM7cmVwbGljYXMtYWxsO3JlcGxpY2FzLW1hc3RlcjtyZXBsaWNhcy1tYXg7dHJ1bmNhdGUtbmFtZXNwYWNlO3VkZgo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.879992782+05:30 - ResTimestampMock: 2026-05-11T15:16:05.921959636+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-573 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.926864765+05:30 - ResTimestampMock: 2026-05-11T15:16:05.969146174+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-574 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.928697912+05:30 - ResTimestampMock: 2026-05-11T15:16:05.969626719+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-575 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.930128334+05:30 - ResTimestampMock: 2026-05-11T15:16:05.970653722+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-576 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.929760442+05:30 - ResTimestampMock: 2026-05-11T15:16:05.970656601+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-577 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:05.966377177+05:30 - ResTimestampMock: 2026-05-11T15:16:06.009635753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-578 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.969303552+05:30 - ResTimestampMock: 2026-05-11T15:16:06.011397578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-579 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.969962148+05:30 - ResTimestampMock: 2026-05-11T15:16:06.011463484+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-580 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.970717656+05:30 - ResTimestampMock: 2026-05-11T15:16:06.012082207+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-581 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:05.970763454+05:30 - ResTimestampMock: 2026-05-11T15:16:06.012225712+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-582 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.009810438+05:30 - ResTimestampMock: 2026-05-11T15:16:06.052116778+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-583 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:06.011827652+05:30 - ResTimestampMock: 2026-05-11T15:16:06.054194348+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-584 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:06.011860608+05:30 - ResTimestampMock: 2026-05-11T15:16:06.054194338+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-585 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:06.012144074+05:30 - ResTimestampMock: 2026-05-11T15:16:06.054206775+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-586 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 30 - packet_type: Info - meta: - info_command: partition-generation - info_kind: partition - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24KcmVwbGljYXMK - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 726 - packet_type: Info - meta: - info_command: "partition-generation\t0" - info_kind: unknown - raw_body: cGFydGl0aW9uLWdlbmVyYXRpb24JMApyZXBsaWNhcwl0ZXN0OjAsMSwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vOD0K - message: null - ReqTimestampMock: 2026-05-11T15:16:06.012293566+05:30 - ResTimestampMock: 2026-05-11T15:16:06.054277128+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-587 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.056222896+05:30 - ResTimestampMock: 2026-05-11T15:16:06.096943126+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-588 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.055698905+05:30 - ResTimestampMock: 2026-05-11T15:16:06.097969234+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-589 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.056222624+05:30 - ResTimestampMock: 2026-05-11T15:16:06.098280989+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-590 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.056224684+05:30 - ResTimestampMock: 2026-05-11T15:16:06.098338015+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-591 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.097164943+05:30 - ResTimestampMock: 2026-05-11T15:16:06.13867593+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-592 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.09818939+05:30 - ResTimestampMock: 2026-05-11T15:16:06.139599623+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-593 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.098633271+05:30 - ResTimestampMock: 2026-05-11T15:16:06.14114526+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-594 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.098518154+05:30 - ResTimestampMock: 2026-05-11T15:16:06.141139453+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-595 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEooWWr26zzvTRppMjJAV9rJfMsHwAAAAPAgEAA2lkeAAAAAAAAAABAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.150676173+05:30 - ResTimestampMock: 2026-05-11T15:16:06.193114627+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-596 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEc70Z1e2gAZs7rYTl1gcoiZPEzaoAAAAKAgMAA3RhZ2ZjMgAAAA8CAQADaWR4AAAAAAAAAAY= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.152228525+05:30 - ResTimestampMock: 2026-05-11T15:16:06.193115847+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-597 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUpAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcd7CswyqY+geeRdw3ZuPH8UhtY4AAAAKAgMAA3RhZ2ZjMgAAAA8CAQADaWR4AAAAAAAAAAU= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.151026378+05:30 - ResTimestampMock: 2026-05-11T15:16:06.193195029+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-598 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 98 - packet_type: Message - meta: - namespace: test - raw_body: FgABAAAAAAAAAAAAAAAAAHUqAAMAAgAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZAkvoW/VlRmuvUwVs9CJGsqiIS4AAAAPAgEAA2lkeAAAAAAAAAAEAAAACgIDAAN0YWdmYzI= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 22 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAA== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.152698998+05:30 - ResTimestampMock: 2026-05-11T15:16:06.193705632+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-599 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEc70Z1e2gAZs7rYTl1gcoiZPEzao= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnZmMyAAAADwEBAANpZHgAAAAAAAAABg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.19328036+05:30 - ResTimestampMock: 2026-05-11T15:16:06.234299014+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-600 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEooWWr26zzvTRppMjJAV9rJfMsHw= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAEAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.193288835+05:30 - ResTimestampMock: 2026-05-11T15:16:06.234910683+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-601 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEcd7CswyqY+geeRdw3ZuPH8UhtY4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAoBAwADdGFnZmMyAAAADwEBAANpZHgAAAAAAAAABQ== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.193319454+05:30 - ResTimestampMock: 2026-05-11T15:16:06.234942424+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-602 -spec: - metadata: - protocol: aerospike - reqType: Message - respType: Message - type: mocks - requests: - - header: - header: - version: 2 - type: 3 - length: 65 - packet_type: Message - meta: - namespace: test - raw_body: FgMAAAAAAAAAAAAAAAAAAHUvAAMAAAAAAAUAdGVzdAAAAAUBZGVtbwAAABUEZAkvoW/VlRmuvUwVs9CJGsqiIS4= - set: demo - message: null - responses: - - header: - header: - version: 2 - type: 3 - length: 55 - packet_type: Message - meta: - namespace: "" - raw_body: FgAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAA8BAQADaWR4AAAAAAAAAAQAAAAKAQMAA3RhZ2ZjMg== - set: "" - message: null - ReqTimestampMock: 2026-05-11T15:16:06.193807233+05:30 - ResTimestampMock: 2026-05-11T15:16:06.237169003+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-603 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.294780554+05:30 - ResTimestampMock: 2026-05-11T15:16:06.336988052+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-604 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.313871472+05:30 - ResTimestampMock: 2026-05-11T15:16:06.355004271+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-605 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.337132576+05:30 - ResTimestampMock: 2026-05-11T15:16:06.379361497+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-606 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.355157305+05:30 - ResTimestampMock: 2026-05-11T15:16:06.398199472+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-607 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.584818642+05:30 - ResTimestampMock: 2026-05-11T15:16:06.627035793+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-608 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.627155501+05:30 - ResTimestampMock: 2026-05-11T15:16:06.669372542+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-609 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:06.906153278+05:30 - ResTimestampMock: 2026-05-11T15:16:06.94865473+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-610 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:06.949379835+05:30 - ResTimestampMock: 2026-05-11T15:16:06.992216761+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-611 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:07.053222206+05:30 - ResTimestampMock: 2026-05-11T15:16:07.094472895+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-612 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:07.094595146+05:30 - ResTimestampMock: 2026-05-11T15:16:07.136995768+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-613 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:07.381018519+05:30 - ResTimestampMock: 2026-05-11T15:16:07.423282305+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-614 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:07.399289427+05:30 - ResTimestampMock: 2026-05-11T15:16:07.441167566+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-615 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:07.423356867+05:30 - ResTimestampMock: 2026-05-11T15:16:07.464198313+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-616 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:07.441249688+05:30 - ResTimestampMock: 2026-05-11T15:16:07.482540327+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-617 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:07.671027597+05:30 - ResTimestampMock: 2026-05-11T15:16:07.713441861+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-618 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:07.713762756+05:30 - ResTimestampMock: 2026-05-11T15:16:07.755247339+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-619 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:07.993138384+05:30 - ResTimestampMock: 2026-05-11T15:16:08.034222996+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-620 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:08.034491636+05:30 - ResTimestampMock: 2026-05-11T15:16:08.077418578+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-621 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:08.138035305+05:30 - ResTimestampMock: 2026-05-11T15:16:08.180769112+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-622 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:08.181175224+05:30 - ResTimestampMock: 2026-05-11T15:16:08.222220143+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-623 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:08.465761676+05:30 - ResTimestampMock: 2026-05-11T15:16:08.508188981+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-624 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:08.483236664+05:30 - ResTimestampMock: 2026-05-11T15:16:08.526546437+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-625 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:08.508675368+05:30 - ResTimestampMock: 2026-05-11T15:16:08.551000863+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-626 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:08.526765619+05:30 - ResTimestampMock: 2026-05-11T15:16:08.568145422+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-627 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:08.755978874+05:30 - ResTimestampMock: 2026-05-11T15:16:08.798501838+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-628 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:08.798769124+05:30 - ResTimestampMock: 2026-05-11T15:16:08.841222287+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-629 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:09.077771072+05:30 - ResTimestampMock: 2026-05-11T15:16:09.119052566+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-630 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:09.119178794+05:30 - ResTimestampMock: 2026-05-11T15:16:09.161049299+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-631 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:09.223570329+05:30 - ResTimestampMock: 2026-05-11T15:16:09.266214857+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-632 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:09.266356593+05:30 - ResTimestampMock: 2026-05-11T15:16:09.308081913+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-633 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:09.551818617+05:30 - ResTimestampMock: 2026-05-11T15:16:09.59281558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-634 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:09.569177382+05:30 - ResTimestampMock: 2026-05-11T15:16:09.610904053+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-635 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:09.592957374+05:30 - ResTimestampMock: 2026-05-11T15:16:09.634152381+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-636 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:09.611335238+05:30 - ResTimestampMock: 2026-05-11T15:16:09.653087364+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-637 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:09.842528641+05:30 - ResTimestampMock: 2026-05-11T15:16:09.884613615+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-638 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:09.884990167+05:30 - ResTimestampMock: 2026-05-11T15:16:09.926554883+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-639 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:10.161869022+05:30 - ResTimestampMock: 2026-05-11T15:16:10.203427579+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-640 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:10.203735913+05:30 - ResTimestampMock: 2026-05-11T15:16:10.245465416+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-641 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:10.309463817+05:30 - ResTimestampMock: 2026-05-11T15:16:10.352616993+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-642 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:10.352743988+05:30 - ResTimestampMock: 2026-05-11T15:16:10.395082986+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-643 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:10.63584935+05:30 - ResTimestampMock: 2026-05-11T15:16:10.678689793+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-644 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:10.654145859+05:30 - ResTimestampMock: 2026-05-11T15:16:10.696012095+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-645 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:10.679070503+05:30 - ResTimestampMock: 2026-05-11T15:16:10.720591213+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-646 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:10.696339519+05:30 - ResTimestampMock: 2026-05-11T15:16:10.737481922+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-647 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:10.927929347+05:30 - ResTimestampMock: 2026-05-11T15:16:10.969854899+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-648 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:10.970503749+05:30 - ResTimestampMock: 2026-05-11T15:16:11.013318518+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-649 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:11.247174301+05:30 - ResTimestampMock: 2026-05-11T15:16:11.289564316+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-650 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:11.289693698+05:30 - ResTimestampMock: 2026-05-11T15:16:11.331262096+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-651 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:11.3970696+05:30 - ResTimestampMock: 2026-05-11T15:16:11.438107956+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-652 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:11.438295389+05:30 - ResTimestampMock: 2026-05-11T15:16:11.479724888+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-653 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:11.72183655+05:30 - ResTimestampMock: 2026-05-11T15:16:11.764498752+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-654 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:11.738018942+05:30 - ResTimestampMock: 2026-05-11T15:16:11.779188553+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-655 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:11.76460304+05:30 - ResTimestampMock: 2026-05-11T15:16:11.80695178+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-656 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:11.779291275+05:30 - ResTimestampMock: 2026-05-11T15:16:11.821506621+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-657 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:12.014960766+05:30 - ResTimestampMock: 2026-05-11T15:16:12.056526953+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-658 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:12.056694258+05:30 - ResTimestampMock: 2026-05-11T15:16:12.099206153+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-659 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:12.331690375+05:30 - ResTimestampMock: 2026-05-11T15:16:12.374846387+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-660 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:12.375361984+05:30 - ResTimestampMock: 2026-05-11T15:16:12.417845137+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-661 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:12.480517777+05:30 - ResTimestampMock: 2026-05-11T15:16:12.522739423+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-662 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:12.523008399+05:30 - ResTimestampMock: 2026-05-11T15:16:12.564697988+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-663 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:12.808267535+05:30 - ResTimestampMock: 2026-05-11T15:16:12.849274929+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-664 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:12.822208812+05:30 - ResTimestampMock: 2026-05-11T15:16:12.864096375+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-665 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:12.849654973+05:30 - ResTimestampMock: 2026-05-11T15:16:12.891353137+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-666 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:12.86415916+05:30 - ResTimestampMock: 2026-05-11T15:16:12.905390522+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-667 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:13.100095254+05:30 - ResTimestampMock: 2026-05-11T15:16:13.141549013+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-668 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:13.141728163+05:30 - ResTimestampMock: 2026-05-11T15:16:13.183115546+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-669 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:13.419252349+05:30 - ResTimestampMock: 2026-05-11T15:16:13.461651843+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-670 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:13.461759944+05:30 - ResTimestampMock: 2026-05-11T15:16:13.504691721+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-671 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:13.565740002+05:30 - ResTimestampMock: 2026-05-11T15:16:13.607458318+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-672 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:13.607617583+05:30 - ResTimestampMock: 2026-05-11T15:16:13.649908745+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-673 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:13.891710933+05:30 - ResTimestampMock: 2026-05-11T15:16:13.934517029+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-674 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:13.90617078+05:30 - ResTimestampMock: 2026-05-11T15:16:13.94818841+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-675 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:13.934987543+05:30 - ResTimestampMock: 2026-05-11T15:16:13.976960756+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-676 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:13.948323327+05:30 - ResTimestampMock: 2026-05-11T15:16:13.990739672+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-677 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:14.184073846+05:30 - ResTimestampMock: 2026-05-11T15:16:14.225067292+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-678 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:14.225483283+05:30 - ResTimestampMock: 2026-05-11T15:16:14.267344034+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-679 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:14.505804556+05:30 - ResTimestampMock: 2026-05-11T15:16:14.548239765+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-680 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:14.54838762+05:30 - ResTimestampMock: 2026-05-11T15:16:14.591098891+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-681 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:14.65099795+05:30 - ResTimestampMock: 2026-05-11T15:16:14.693708251+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-682 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:14.693995446+05:30 - ResTimestampMock: 2026-05-11T15:16:14.73727379+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-683 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:14.978571343+05:30 - ResTimestampMock: 2026-05-11T15:16:15.021232024+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-684 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:14.991692297+05:30 - ResTimestampMock: 2026-05-11T15:16:15.034311081+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-685 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:15.021866734+05:30 - ResTimestampMock: 2026-05-11T15:16:15.063211763+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-686 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:15.034413859+05:30 - ResTimestampMock: 2026-05-11T15:16:15.075816157+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-687 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:15.269297569+05:30 - ResTimestampMock: 2026-05-11T15:16:15.312266044+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-688 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:15.312472683+05:30 - ResTimestampMock: 2026-05-11T15:16:15.35436046+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-689 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:15.592174884+05:30 - ResTimestampMock: 2026-05-11T15:16:15.634213815+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-690 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:15.63443884+05:30 - ResTimestampMock: 2026-05-11T15:16:15.676732759+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-691 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:15.737659463+05:30 - ResTimestampMock: 2026-05-11T15:16:15.780581248+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-692 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:15.781116741+05:30 - ResTimestampMock: 2026-05-11T15:16:15.822656308+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-693 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:16.064169712+05:30 - ResTimestampMock: 2026-05-11T15:16:16.106069819+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-694 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:16.076597735+05:30 - ResTimestampMock: 2026-05-11T15:16:16.119872413+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-695 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:16.106534896+05:30 - ResTimestampMock: 2026-05-11T15:16:16.148535461+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-696 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:16.120214788+05:30 - ResTimestampMock: 2026-05-11T15:16:16.161827561+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-697 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:16.355034778+05:30 - ResTimestampMock: 2026-05-11T15:16:16.396657188+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-698 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:16.396812937+05:30 - ResTimestampMock: 2026-05-11T15:16:16.438606814+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-699 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:16.678006596+05:30 - ResTimestampMock: 2026-05-11T15:16:16.719311476+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-700 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:16.719456921+05:30 - ResTimestampMock: 2026-05-11T15:16:16.761578168+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-701 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:16.823240662+05:30 - ResTimestampMock: 2026-05-11T15:16:16.865277039+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-702 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:16.865840595+05:30 - ResTimestampMock: 2026-05-11T15:16:16.908014005+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-703 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:17.150012661+05:30 - ResTimestampMock: 2026-05-11T15:16:17.191677146+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-704 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:17.163175914+05:30 - ResTimestampMock: 2026-05-11T15:16:17.205469909+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-705 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:17.192446972+05:30 - ResTimestampMock: 2026-05-11T15:16:17.234279127+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-706 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:17.205689162+05:30 - ResTimestampMock: 2026-05-11T15:16:17.247655478+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-707 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:17.43985023+05:30 - ResTimestampMock: 2026-05-11T15:16:17.482298293+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-708 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:17.482437487+05:30 - ResTimestampMock: 2026-05-11T15:16:17.524476806+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-709 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:17.762842132+05:30 - ResTimestampMock: 2026-05-11T15:16:17.804293609+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-710 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:17.804711003+05:30 - ResTimestampMock: 2026-05-11T15:16:17.846356918+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-711 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:17.908752729+05:30 - ResTimestampMock: 2026-05-11T15:16:17.951019953+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-712 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:17.951182754+05:30 - ResTimestampMock: 2026-05-11T15:16:17.992659153+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-713 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:18.235006897+05:30 - ResTimestampMock: 2026-05-11T15:16:18.276524934+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-714 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:18.248427346+05:30 - ResTimestampMock: 2026-05-11T15:16:18.290579248+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-715 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:18.276773295+05:30 - ResTimestampMock: 2026-05-11T15:16:18.318231123+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-716 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:18.290702333+05:30 - ResTimestampMock: 2026-05-11T15:16:18.332038777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-717 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:18.5249215+05:30 - ResTimestampMock: 2026-05-11T15:16:18.566193484+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-718 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:18.56651817+05:30 - ResTimestampMock: 2026-05-11T15:16:18.607804895+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-719 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:18.847709955+05:30 - ResTimestampMock: 2026-05-11T15:16:18.889772772+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-720 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:18.889921765+05:30 - ResTimestampMock: 2026-05-11T15:16:18.93225575+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-721 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:18.993915347+05:30 - ResTimestampMock: 2026-05-11T15:16:19.035777799+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-722 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:19.036140838+05:30 - ResTimestampMock: 2026-05-11T15:16:19.080384075+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-723 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:19.318851277+05:30 - ResTimestampMock: 2026-05-11T15:16:19.360009371+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-724 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:19.333315067+05:30 - ResTimestampMock: 2026-05-11T15:16:19.374323352+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-725 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:19.360362439+05:30 - ResTimestampMock: 2026-05-11T15:16:19.402928912+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-726 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:19.374450534+05:30 - ResTimestampMock: 2026-05-11T15:16:19.41626267+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-727 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:19.608826512+05:30 - ResTimestampMock: 2026-05-11T15:16:19.650034473+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-728 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:19.650316442+05:30 - ResTimestampMock: 2026-05-11T15:16:19.692108197+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-729 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:19.933464286+05:30 - ResTimestampMock: 2026-05-11T15:16:19.976107489+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-730 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:19.976316498+05:30 - ResTimestampMock: 2026-05-11T15:16:20.018928969+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-731 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:20.080743838+05:30 - ResTimestampMock: 2026-05-11T15:16:20.123121149+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-732 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:20.123252814+05:30 - ResTimestampMock: 2026-05-11T15:16:20.166892071+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-733 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:20.404683186+05:30 - ResTimestampMock: 2026-05-11T15:16:20.446828327+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-734 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:20.41707498+05:30 - ResTimestampMock: 2026-05-11T15:16:20.460293721+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-735 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:20.446957748+05:30 - ResTimestampMock: 2026-05-11T15:16:20.488605072+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-736 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:20.460617114+05:30 - ResTimestampMock: 2026-05-11T15:16:20.503192605+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-737 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:20.69367266+05:30 - ResTimestampMock: 2026-05-11T15:16:20.736479868+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-738 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:20.736903679+05:30 - ResTimestampMock: 2026-05-11T15:16:20.779401114+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-739 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:21.019995234+05:30 - ResTimestampMock: 2026-05-11T15:16:21.061331275+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-740 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:21.061676644+05:30 - ResTimestampMock: 2026-05-11T15:16:21.103586408+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-741 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:21.167323531+05:30 - ResTimestampMock: 2026-05-11T15:16:21.209702016+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-742 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:21.210093318+05:30 - ResTimestampMock: 2026-05-11T15:16:21.251021341+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-743 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:21.490318794+05:30 - ResTimestampMock: 2026-05-11T15:16:21.532594378+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-744 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:21.504334816+05:30 - ResTimestampMock: 2026-05-11T15:16:21.546242777+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-745 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:21.533073788+05:30 - ResTimestampMock: 2026-05-11T15:16:21.576180459+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-746 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:21.546359477+05:30 - ResTimestampMock: 2026-05-11T15:16:21.589552817+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-747 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:21.78008349+05:30 - ResTimestampMock: 2026-05-11T15:16:21.82251371+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-748 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:21.823257108+05:30 - ResTimestampMock: 2026-05-11T15:16:21.86535923+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-749 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:22.104843+05:30 - ResTimestampMock: 2026-05-11T15:16:22.147032914+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-750 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:22.147148597+05:30 - ResTimestampMock: 2026-05-11T15:16:22.188847856+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-751 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:22.252675674+05:30 - ResTimestampMock: 2026-05-11T15:16:22.294270145+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-752 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:22.294418742+05:30 - ResTimestampMock: 2026-05-11T15:16:22.336245703+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-753 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:22.577930515+05:30 - ResTimestampMock: 2026-05-11T15:16:22.620525753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-754 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:22.591243309+05:30 - ResTimestampMock: 2026-05-11T15:16:22.63569507+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-755 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:22.620783875+05:30 - ResTimestampMock: 2026-05-11T15:16:22.663827158+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-756 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:22.636089589+05:30 - ResTimestampMock: 2026-05-11T15:16:22.678581969+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-757 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:22.866912579+05:30 - ResTimestampMock: 2026-05-11T15:16:22.908827192+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-758 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:22.90943224+05:30 - ResTimestampMock: 2026-05-11T15:16:22.951219893+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-759 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:23.19002207+05:30 - ResTimestampMock: 2026-05-11T15:16:23.232344353+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-760 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:23.232533161+05:30 - ResTimestampMock: 2026-05-11T15:16:23.275880094+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-761 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:23.336756888+05:30 - ResTimestampMock: 2026-05-11T15:16:23.380008219+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-762 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:23.380413187+05:30 - ResTimestampMock: 2026-05-11T15:16:23.424165932+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-763 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:23.664967394+05:30 - ResTimestampMock: 2026-05-11T15:16:23.706319579+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-764 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:23.679404076+05:30 - ResTimestampMock: 2026-05-11T15:16:23.722832619+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-765 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:23.706546404+05:30 - ResTimestampMock: 2026-05-11T15:16:23.748639114+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-766 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:23.722984844+05:30 - ResTimestampMock: 2026-05-11T15:16:23.764784138+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-767 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:23.951947233+05:30 - ResTimestampMock: 2026-05-11T15:16:23.993259422+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-768 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:23.993710238+05:30 - ResTimestampMock: 2026-05-11T15:16:24.035320762+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-769 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:24.277562109+05:30 - ResTimestampMock: 2026-05-11T15:16:24.319602064+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-770 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:24.319673353+05:30 - ResTimestampMock: 2026-05-11T15:16:24.361317485+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-771 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:24.424925376+05:30 - ResTimestampMock: 2026-05-11T15:16:24.466547333+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-772 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:24.466903439+05:30 - ResTimestampMock: 2026-05-11T15:16:24.509443649+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-773 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:24.750328803+05:30 - ResTimestampMock: 2026-05-11T15:16:24.792387976+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-774 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:24.765842801+05:30 - ResTimestampMock: 2026-05-11T15:16:24.808334818+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-775 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:24.7926394+05:30 - ResTimestampMock: 2026-05-11T15:16:24.834373128+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-776 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:24.808662165+05:30 - ResTimestampMock: 2026-05-11T15:16:24.851418364+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-777 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:25.036215196+05:30 - ResTimestampMock: 2026-05-11T15:16:25.077331308+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-778 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:25.077963291+05:30 - ResTimestampMock: 2026-05-11T15:16:25.119575171+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-779 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:25.362698146+05:30 - ResTimestampMock: 2026-05-11T15:16:25.40466852+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-780 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:25.405153841+05:30 - ResTimestampMock: 2026-05-11T15:16:25.447316741+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-781 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:25.510351791+05:30 - ResTimestampMock: 2026-05-11T15:16:25.552741618+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-782 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:25.552857235+05:30 - ResTimestampMock: 2026-05-11T15:16:25.595787004+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-783 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:25.835546236+05:30 - ResTimestampMock: 2026-05-11T15:16:25.878037137+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-784 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:25.852397258+05:30 - ResTimestampMock: 2026-05-11T15:16:25.895332834+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-785 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:25.87832907+05:30 - ResTimestampMock: 2026-05-11T15:16:25.919269933+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-786 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:25.896922356+05:30 - ResTimestampMock: 2026-05-11T15:16:25.938568292+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-787 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:26.120950299+05:30 - ResTimestampMock: 2026-05-11T15:16:26.16238418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-788 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:26.162672534+05:30 - ResTimestampMock: 2026-05-11T15:16:26.204673403+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-789 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:26.44809327+05:30 - ResTimestampMock: 2026-05-11T15:16:26.490976591+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-790 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:26.491301614+05:30 - ResTimestampMock: 2026-05-11T15:16:26.533127418+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-791 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:26.596938657+05:30 - ResTimestampMock: 2026-05-11T15:16:26.639644809+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-792 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:26.639798758+05:30 - ResTimestampMock: 2026-05-11T15:16:26.682062236+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-793 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:26.920717426+05:30 - ResTimestampMock: 2026-05-11T15:16:26.962634022+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-794 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:26.938921758+05:30 - ResTimestampMock: 2026-05-11T15:16:26.981311753+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-795 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:26.963107603+05:30 - ResTimestampMock: 2026-05-11T15:16:27.005044219+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-796 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:26.981814183+05:30 - ResTimestampMock: 2026-05-11T15:16:27.023146474+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-797 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:27.206039173+05:30 - ResTimestampMock: 2026-05-11T15:16:27.247437154+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-798 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:27.247577102+05:30 - ResTimestampMock: 2026-05-11T15:16:27.290660802+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-799 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:27.534775434+05:30 - ResTimestampMock: 2026-05-11T15:16:27.576991809+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-800 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:27.577668721+05:30 - ResTimestampMock: 2026-05-11T15:16:27.619539043+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-801 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:27.683688619+05:30 - ResTimestampMock: 2026-05-11T15:16:27.727138222+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-802 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:27.727342586+05:30 - ResTimestampMock: 2026-05-11T15:16:27.768065912+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-803 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:28.006251608+05:30 - ResTimestampMock: 2026-05-11T15:16:28.048875294+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-804 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:28.023984784+05:30 - ResTimestampMock: 2026-05-11T15:16:28.065672068+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-805 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:28.049265303+05:30 - ResTimestampMock: 2026-05-11T15:16:28.090943322+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-806 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:28.06590623+05:30 - ResTimestampMock: 2026-05-11T15:16:28.108010214+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-807 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:28.292022211+05:30 - ResTimestampMock: 2026-05-11T15:16:28.334805558+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-808 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:28.335453952+05:30 - ResTimestampMock: 2026-05-11T15:16:28.377441104+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-809 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:28.621408135+05:30 - ResTimestampMock: 2026-05-11T15:16:28.6633149+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-810 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:28.663742399+05:30 - ResTimestampMock: 2026-05-11T15:16:28.705596884+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-811 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:28.768663528+05:30 - ResTimestampMock: 2026-05-11T15:16:28.810747073+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-812 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:28.810884334+05:30 - ResTimestampMock: 2026-05-11T15:16:28.853036485+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-813 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:29.091718331+05:30 - ResTimestampMock: 2026-05-11T15:16:29.133943776+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-814 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:29.109141757+05:30 - ResTimestampMock: 2026-05-11T15:16:29.152323444+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-815 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:29.134021547+05:30 - ResTimestampMock: 2026-05-11T15:16:29.176988467+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-816 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:29.152545364+05:30 - ResTimestampMock: 2026-05-11T15:16:29.19431926+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-817 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:29.378996519+05:30 - ResTimestampMock: 2026-05-11T15:16:29.42035222+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-818 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:29.420552276+05:30 - ResTimestampMock: 2026-05-11T15:16:29.462091553+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-819 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:29.706292293+05:30 - ResTimestampMock: 2026-05-11T15:16:29.74969898+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-820 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:29.750392357+05:30 - ResTimestampMock: 2026-05-11T15:16:29.793404778+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-821 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:29.854688058+05:30 - ResTimestampMock: 2026-05-11T15:16:29.897491086+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-822 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:29.898222393+05:30 - ResTimestampMock: 2026-05-11T15:16:29.939199642+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-823 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:30.178011592+05:30 - ResTimestampMock: 2026-05-11T15:16:30.220567979+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-824 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:30.195394803+05:30 - ResTimestampMock: 2026-05-11T15:16:30.23831103+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-825 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:30.220752436+05:30 - ResTimestampMock: 2026-05-11T15:16:30.262326666+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-826 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:30.238547015+05:30 - ResTimestampMock: 2026-05-11T15:16:30.281945588+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-827 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:30.462875155+05:30 - ResTimestampMock: 2026-05-11T15:16:30.504612036+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-828 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:30.504953029+05:30 - ResTimestampMock: 2026-05-11T15:16:30.546651177+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-829 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:30.795261278+05:30 - ResTimestampMock: 2026-05-11T15:16:30.836323462+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-830 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:30.836429178+05:30 - ResTimestampMock: 2026-05-11T15:16:30.879126271+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-831 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:30.940596493+05:30 - ResTimestampMock: 2026-05-11T15:16:30.981923601+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-832 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:30.982343313+05:30 - ResTimestampMock: 2026-05-11T15:16:31.025276905+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-833 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:31.263824488+05:30 - ResTimestampMock: 2026-05-11T15:16:31.305538268+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-834 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:31.283185374+05:30 - ResTimestampMock: 2026-05-11T15:16:31.324425436+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-835 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:31.305869698+05:30 - ResTimestampMock: 2026-05-11T15:16:31.348344349+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-836 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:31.32456908+05:30 - ResTimestampMock: 2026-05-11T15:16:31.367622962+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-837 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:31.54793301+05:30 - ResTimestampMock: 2026-05-11T15:16:31.589373307+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-838 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:31.589709868+05:30 - ResTimestampMock: 2026-05-11T15:16:31.631338186+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-839 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:31.880986754+05:30 - ResTimestampMock: 2026-05-11T15:16:31.924002635+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-840 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:31.924542423+05:30 - ResTimestampMock: 2026-05-11T15:16:31.966581023+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-841 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:32.026341848+05:30 - ResTimestampMock: 2026-05-11T15:16:32.069469911+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-842 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:32.07014415+05:30 - ResTimestampMock: 2026-05-11T15:16:32.114316216+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-843 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:32.349755599+05:30 - ResTimestampMock: 2026-05-11T15:16:32.39188686+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-844 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:32.368192318+05:30 - ResTimestampMock: 2026-05-11T15:16:32.409859401+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-845 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:32.391986817+05:30 - ResTimestampMock: 2026-05-11T15:16:32.43399438+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-846 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:32.410092766+05:30 - ResTimestampMock: 2026-05-11T15:16:32.451332007+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-847 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:32.632033962+05:30 - ResTimestampMock: 2026-05-11T15:16:32.673543293+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-848 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:32.673847461+05:30 - ResTimestampMock: 2026-05-11T15:16:32.715637356+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-849 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:32.968112593+05:30 - ResTimestampMock: 2026-05-11T15:16:33.010432096+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-850 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:33.010567545+05:30 - ResTimestampMock: 2026-05-11T15:16:33.053230005+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-851 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 43 - packet_type: Info - meta: - info_command: node - info_kind: discovery - raw_body: bm9kZQpwZWVycy1nZW5lcmF0aW9uCnBhcnRpdGlvbi1nZW5lcmF0aW9uCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 63 - packet_type: Info - meta: - info_command: "node\tBB90009D298873E" - info_kind: unknown - raw_body: bm9kZQlCQjkwMDA5RDI5ODg3M0UKcGVlcnMtZ2VuZXJhdGlvbgkwCnBhcnRpdGlvbi1nZW5lcmF0aW9uCTAK - message: null - ReqTimestampMock: 2026-05-11T15:16:33.115449883+05:30 - ResTimestampMock: 2026-05-11T15:16:33.157636009+05:30 ---- -version: api.keploy.io/v1beta1 -kind: Aerospike -name: mock-852 -spec: - metadata: - protocol: aerospike - reqType: Info - respType: Info - type: config - requests: - - header: - header: - version: 2 - type: 1 - length: 16 - packet_type: Info - meta: - info_command: peers-clear-std - info_kind: discovery - raw_body: cGVlcnMtY2xlYXItc3RkCg== - message: null - responses: - - header: - header: - version: 2 - type: 1 - length: 26 - packet_type: Info - meta: - info_command: "peers-clear-std\t0,3000,[]" - info_kind: unknown - raw_body: cGVlcnMtY2xlYXItc3RkCTAsMzAwMCxbXQo= - message: null - ReqTimestampMock: 2026-05-11T15:16:33.158189526+05:30 - ResTimestampMock: 2026-05-11T15:16:33.20039901+05:30 diff --git a/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml b/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml deleted file mode 100644 index 03f19f17..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/get-health-1.yaml +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: get-health-1 -spec: - metadata: {} - req: - method: GET - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/health - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:15:50.555704136+05:30 - resp: - status_code: 200 - header: - Content-Length: "32" - Content-Type: application/json - Date: Mon, 11 May 2026 09:45:50 GMT - body: | - {"namespaces":"test","nodes":1} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:15:50.556615223+05:30 - objects: [] - assertions: - noise: - header.Date: [] - created: 1778492750 - app_port: 8090 -curl: | - curl --request GET \ - --url http://127.0.0.1:8090/health \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml deleted file mode 100644 index a4e851b5..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-1.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-freshclient-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/freshclient?n=4&prefix=fc1 - url_params: - "n": "4" - prefix: fc1 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:16:01.999103113+05:30 - resp: - status_code: 200 - header: - Content-Length: "263" - Content-Type: application/json - Date: Mon, 11 May 2026 09:46:02 GMT - body: | - {"concurrency":4,"duration":"412.236727ms","prefix":"fc1","results":[{"key":"fc1-0","bins":{"idx":0,"tag":"fc1"}},{"key":"fc1-1","bins":{"idx":1,"tag":"fc1"}},{"key":"fc1-2","bins":{"idx":2,"tag":"fc1"}},{"key":"fc1-3","bins":{"idx":3,"tag":"fc1"}}],"workers":4} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:16:02.411880367+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492762 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/freshclient?n=4&prefix=fc1 \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml b/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml deleted file mode 100644 index 382caa6a..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-freshclient-2.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-freshclient-2 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/freshclient?n=8&prefix=fc2 - url_params: - "n": "8" - prefix: fc2 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:16:05.4210859+05:30 - resp: - status_code: 200 - header: - Content-Length: "443" - Content-Type: application/json - Date: Mon, 11 May 2026 09:46:06 GMT - body: | - {"concurrency":4,"duration":"815.933891ms","prefix":"fc2","results":[{"key":"fc2-0","bins":{"idx":0,"tag":"fc2"}},{"key":"fc2-1","bins":{"idx":1,"tag":"fc2"}},{"key":"fc2-2","bins":{"idx":2,"tag":"fc2"}},{"key":"fc2-3","bins":{"idx":3,"tag":"fc2"}},{"key":"fc2-4","bins":{"idx":4,"tag":"fc2"}},{"key":"fc2-5","bins":{"idx":5,"tag":"fc2"}},{"key":"fc2-6","bins":{"idx":6,"tag":"fc2"}},{"key":"fc2-7","bins":{"idx":7,"tag":"fc2"}}],"workers":8} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:16:06.237781077+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492766 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/freshclient?n=8&prefix=fc2 \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml deleted file mode 100644 index 3a8e493a..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-1.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-multiclient-1 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/multiclient?n=4&prefix=mc1 - url_params: - "n": "4" - prefix: mc1 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:15:52.567028786+05:30 - resp: - status_code: 200 - header: - Content-Length: "258" - Content-Type: application/json - Date: Mon, 11 May 2026 09:45:52 GMT - body: | - {"clients":4,"duration":"95.639593ms","prefix":"mc1","results":[{"key":"mc1-0","bins":{"idx":0,"tag":"mc1"}},{"key":"mc1-1","bins":{"idx":1,"tag":"mc1"}},{"key":"mc1-2","bins":{"idx":2,"tag":"mc1"}},{"key":"mc1-3","bins":{"idx":3,"tag":"mc1"}}],"workers":4} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:15:52.663574359+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492752 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/multiclient?n=4&prefix=mc1 \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml deleted file mode 100644 index 8ef5b94b..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-2.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-multiclient-2 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/multiclient?n=8&prefix=mc2 - url_params: - "n": "8" - prefix: mc2 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:15:54.6732111+05:30 - resp: - status_code: 200 - header: - Content-Length: "438" - Content-Type: application/json - Date: Mon, 11 May 2026 09:45:54 GMT - body: | - {"clients":4,"duration":"94.903299ms","prefix":"mc2","results":[{"key":"mc2-0","bins":{"idx":0,"tag":"mc2"}},{"key":"mc2-1","bins":{"idx":1,"tag":"mc2"}},{"key":"mc2-2","bins":{"idx":2,"tag":"mc2"}},{"key":"mc2-3","bins":{"idx":3,"tag":"mc2"}},{"key":"mc2-4","bins":{"idx":4,"tag":"mc2"}},{"key":"mc2-5","bins":{"idx":5,"tag":"mc2"}},{"key":"mc2-6","bins":{"idx":6,"tag":"mc2"}},{"key":"mc2-7","bins":{"idx":7,"tag":"mc2"}}],"workers":8} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:15:54.768687513+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492754 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/multiclient?n=8&prefix=mc2 \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml deleted file mode 100644 index c6146ea2..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-3.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-multiclient-3 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/multiclient?n=12&prefix=mc3 - url_params: - "n": "12" - prefix: mc3 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:15:56.779207301+05:30 - resp: - status_code: 200 - header: - Content-Length: "623" - Content-Type: application/json - Date: Mon, 11 May 2026 09:45:56 GMT - body: | - {"clients":4,"duration":"94.817758ms","prefix":"mc3","results":[{"key":"mc3-0","bins":{"idx":0,"tag":"mc3"}},{"key":"mc3-1","bins":{"idx":1,"tag":"mc3"}},{"key":"mc3-2","bins":{"idx":2,"tag":"mc3"}},{"key":"mc3-3","bins":{"idx":3,"tag":"mc3"}},{"key":"mc3-4","bins":{"idx":4,"tag":"mc3"}},{"key":"mc3-5","bins":{"idx":5,"tag":"mc3"}},{"key":"mc3-6","bins":{"idx":6,"tag":"mc3"}},{"key":"mc3-7","bins":{"idx":7,"tag":"mc3"}},{"key":"mc3-8","bins":{"idx":8,"tag":"mc3"}},{"key":"mc3-9","bins":{"idx":9,"tag":"mc3"}},{"key":"mc3-10","bins":{"idx":10,"tag":"mc3"}},{"key":"mc3-11","bins":{"idx":11,"tag":"mc3"}}],"workers":12} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:15:56.874364014+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492756 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/multiclient?n=12&prefix=mc3 \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ - --header 'Host: 127.0.0.1:8090' \ diff --git a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml b/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml deleted file mode 100644 index e54b91bd..00000000 --- a/aerospike-tls/keploy/test-set-2/tests/post-multiclient-4.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Generated by Keploy (3-dev) -version: api.keploy.io/v1beta1 -kind: Http -name: post-multiclient-4 -spec: - metadata: {} - req: - method: POST - proto_major: 1 - proto_minor: 1 - url: http://127.0.0.1:8090/multiclient?n=24&prefix=mc4 - url_params: - "n": "24" - prefix: mc4 - header: - Accept: '*/*' - Host: 127.0.0.1:8090 - User-Agent: curl/8.18.0 - body: "" - timestamp: 2026-05-11T15:15:58.883957184+05:30 - resp: - status_code: 200 - header: - Content-Length: "1188" - Content-Type: application/json - Date: Mon, 11 May 2026 09:45:58 GMT - body: | - {"clients":4,"duration":"104.681216ms","prefix":"mc4","results":[{"key":"mc4-0","bins":{"idx":0,"tag":"mc4"}},{"key":"mc4-1","bins":{"idx":1,"tag":"mc4"}},{"key":"mc4-2","bins":{"idx":2,"tag":"mc4"}},{"key":"mc4-3","bins":{"idx":3,"tag":"mc4"}},{"key":"mc4-4","bins":{"idx":4,"tag":"mc4"}},{"key":"mc4-5","bins":{"idx":5,"tag":"mc4"}},{"key":"mc4-6","bins":{"idx":6,"tag":"mc4"}},{"key":"mc4-7","bins":{"idx":7,"tag":"mc4"}},{"key":"mc4-8","bins":{"idx":8,"tag":"mc4"}},{"key":"mc4-9","bins":{"idx":9,"tag":"mc4"}},{"key":"mc4-10","bins":{"idx":10,"tag":"mc4"}},{"key":"mc4-11","bins":{"idx":11,"tag":"mc4"}},{"key":"mc4-12","bins":{"idx":12,"tag":"mc4"}},{"key":"mc4-13","bins":{"idx":13,"tag":"mc4"}},{"key":"mc4-14","bins":{"idx":14,"tag":"mc4"}},{"key":"mc4-15","bins":{"idx":15,"tag":"mc4"}},{"key":"mc4-16","bins":{"idx":16,"tag":"mc4"}},{"key":"mc4-17","bins":{"idx":17,"tag":"mc4"}},{"key":"mc4-18","bins":{"idx":18,"tag":"mc4"}},{"key":"mc4-19","bins":{"idx":19,"tag":"mc4"}},{"key":"mc4-20","bins":{"idx":20,"tag":"mc4"}},{"key":"mc4-21","bins":{"idx":21,"tag":"mc4"}},{"key":"mc4-22","bins":{"idx":22,"tag":"mc4"}},{"key":"mc4-23","bins":{"idx":23,"tag":"mc4"}}],"workers":24} - status_message: OK - proto_major: 0 - proto_minor: 0 - timestamp: 2026-05-11T15:15:58.989266689+05:30 - objects: [] - assertions: - noise: - header.Date: [] - body.duration: [] - created: 1778492758 - app_port: 8090 -curl: | - curl --request POST \ - --url http://127.0.0.1:8090/multiclient?n=24&prefix=mc4 \ - --header 'Host: 127.0.0.1:8090' \ - --header 'User-Agent: curl/8.18.0' \ - --header 'Accept: */*' \ diff --git a/aerospike-tls/main.go b/aerospike-tls/main.go index 15971ad3..b750e325 100644 --- a/aerospike-tls/main.go +++ b/aerospike-tls/main.go @@ -1,40 +1,31 @@ -// Sample Aerospike-Go application that exercises the parser over a -// TLS-protected wire. It mirrors e2e-run/main.go endpoint-for-endpoint -// but talks to Aerospike on port 3001 with a *tls.Conn underneath. +// Sample Aerospike-Go application recorded and replayed end-to-end +// with Keploy. The service exposes a flat HTTP API over a single +// shared *as.Client (and two additional handlers that exercise +// multi-client and per-request-fresh-client shapes) so a single +// `keploy record` session captures the full range of Aerospike op +// types — Info, single-record AS_MSG, BATCH_READ/WRITE, SCAN, +// QUERY, UDF, CDT, TOUCH, DELETE. // -// The point of this binary is to confirm two claims about the parser: +// Endpoints: // -// 1. The Aerospike parser is TLS-blind: it imports no crypto/tls and -// does not branch on PortClear/PortTLS/PortXDR. With this app -// pointed at port 3001 over TLS, the parser still receives plain -// Aerospike wire bytes — because Keploy's proxy terminates TLS -// upstream and hands the parser a transport that already speaks -// decrypted bytes. -// -// 2. Proxy TLS detection is byte-pattern driven, not port driven. -// This client sends a real TLS ClientHello on a non-3306, non-443 -// port; the proxy still recognises it via Peek(5) → IsTLSHandshake -// and MITMs the connection. Port 3001 is incidental. -// -// Endpoints (identical contract to e2e-run): -// -// GET /health — info "build" + "namespaces" -// POST /put — single-record PUT -// GET /get/{key} — single-record GET -// POST /batch/put — BATCH_WRITE -// GET /batch/get — BATCH_READ -// POST /scan — full namespace scan -// POST /query — secondary-index range query -// POST /udf — UDF_EXECUTE -// POST /cdt/list/append — CDT list append -// POST /cdt/map/put — CDT map put -// POST /touch/{key} — TOUCH -// DELETE /key/{key} — DELETE +// GET /health — info "build" + "namespaces" +// POST /put — single-record PUT +// GET /get/{key} — single-record GET +// POST /batch/put — sequential write loop +// GET /batch/get?k=a&k=b — BATCH_READ +// POST /scan — full namespace scan +// POST /query — secondary-index range query +// POST /udf — UDF_EXECUTE +// POST /cdt/list/append — CDT list append +// POST /cdt/map/put — CDT map put +// POST /touch/{key} — TOUCH +// DELETE /key/{key} — DELETE +// POST /parallel?n=N&prefix=P — N goroutines, one shared client +// POST /multiclient?n=N&... — N goroutines round-robined over 4 clients +// POST /freshclient?n=N&... — N goroutines, each builds its own client package main import ( - "crypto/tls" - "crypto/x509" "encoding/json" "flag" "fmt" @@ -52,53 +43,30 @@ import ( func main() { host := flag.String("aerospike-host", env("AEROSPIKE_HOST", "127.0.0.1"), "aerospike server host") - port := flag.Int("aerospike-port", envInt("AEROSPIKE_PORT", 3001), "aerospike server port (TLS service)") - tlsName := flag.String("tls-name", env("AEROSPIKE_TLS_NAME", "aerospike.local"), "TLS hostname expected on the server certificate") - caFile := flag.String("tls-ca", env("AEROSPIKE_TLS_CA", "certs/ca.pem"), "PEM file containing CA cert(s) that signed the server cert") - certFile := flag.String("tls-cert", env("AEROSPIKE_TLS_CERT", ""), "optional client cert PEM (mutual TLS)") - keyFile := flag.String("tls-key", env("AEROSPIKE_TLS_KEY", ""), "optional client key PEM (mutual TLS)") - insecure := flag.Bool("tls-insecure", envBool("AEROSPIKE_TLS_INSECURE", false), "skip server cert verification (debug only)") + port := flag.Int("aerospike-port", envInt("AEROSPIKE_PORT", 3000), "aerospike server port") listen := flag.String("listen", env("LISTEN", ":8080"), "http listen address") flag.Parse() aslog.Logger.SetLevel(aslog.DEBUG) - tlsCfg, err := buildTLSConfig(*caFile, *certFile, *keyFile, *tlsName, *insecure) - if err != nil { - log.Fatalf("build tls config: %v", err) - } - policy := as.NewClientPolicy() - policy.TlsConfig = tlsCfg - // Aerospike CE only advertises clear-text peer addresses - // (peers-clear-std); behind a TLS terminator like stunnel those - // addresses are unreachable. Pin the client to the seed so it - // doesn't try to open clear-text connections to peers. + // Aerospike CE only advertises a single seed in single-node + // docker setups; pin the client to that seed so it doesn't try + // to discover peers that don't exist. policy.SeedOnlyCluster = true // Pool sizing for the parallel handler: a single /parallel?n=N // curl fans out N goroutines, each grabbing its own pooled // connection. The default queue size (256) is fine, but the open - // path is the real bottleneck under TLS-MITM replay — limit how - // many fresh TLS dials race the pool's connect-or-wait latch by - // pinning a generous concurrent-open budget. ConnectionQueueSize - // is set explicitly so it survives a future default-tuning drift. + // path is the real bottleneck under Keploy replay — pin a + // generous concurrent-open budget. ConnectionQueueSize is set + // explicitly so it survives a future default-tuning drift. policy.ConnectionQueueSize = 256 - // Hold OpeningConnectionThreshold low: stunnel's fork model on - // the docker side forks one child per accepted connection, and - // fork() is slow enough that a burst of 64+ concurrent dials - // can outpace the kernel's accept-queue + stunnel's fork rate - // at record time, producing EOFs on the proxy's upstream dial. - // 16 is a comfortable number for stunnel and big enough that - // /parallel?n=24 still fans out usefully. policy.OpeningConnectionThreshold = 16 - // Without TLSName on the Host, the client will not negotiate TLS - // for this host even with TlsConfig set. - h := as.NewHost(*host, *port) - h.TLSName = *tlsName + h := as.NewHost(*host, *port) client, err := as.NewClientWithPolicyAndHost(policy, h) if err != nil { - log.Fatalf("connect aerospike (tls): %v", err) + log.Fatalf("connect aerospike: %v", err) } defer client.Close() @@ -135,11 +103,9 @@ func main() { // per credential profile. // // We deliberately do NOT call warmupPool here. Five clients each - // warming up in parallel produces hundreds of concurrent TLS - // dials at startup, which the stunnel/socat fork model in the - // compose stack can't accept fast enough — record then dies with - // EOFs on the upstream dial path before any test runs. The - // /multiclient handler instead uses parallelDo (10ms backoff, + // warming up in parallel produces a hundred-plus concurrent dials + // at startup, which a record-time proxy can choke on. The + // /multiclient handler instead uses parallelDo (10 ms backoff, // 5 attempts) to ride out a cold pool on first contact, and the // per-op SleepBetweenRetries inside the policy gives the pool // time to recycle between attempts. @@ -174,41 +140,13 @@ func main() { mux.HandleFunc("/multiclient", multiClientHandler(multiClients)) mux.HandleFunc("/freshclient", freshClientHandler(policy, h)) - log.Printf("aerospike-tls sample listening on %s (server %s:%d tls-name=%s)", - *listen, *host, *port, *tlsName) + log.Printf("aerospike sample listening on %s (server %s:%d)", *listen, *host, *port) srv := &http.Server{Addr: *listen, Handler: mux, ReadHeaderTimeout: 5 * time.Second} if err := srv.ListenAndServe(); err != nil { log.Fatal(err) } } -func buildTLSConfig(caFile, certFile, keyFile, tlsName string, insecure bool) (*tls.Config, error) { - cfg := &tls.Config{ - ServerName: tlsName, - MinVersion: tls.VersionTLS12, - InsecureSkipVerify: insecure, - } - if caFile != "" { - caPEM, err := os.ReadFile(caFile) - if err != nil { - return nil, fmt.Errorf("read CA %q: %w", caFile, err) - } - pool := x509.NewCertPool() - if !pool.AppendCertsFromPEM(caPEM) { - return nil, fmt.Errorf("CA %q: no certs parsed", caFile) - } - cfg.RootCAs = pool - } - if certFile != "" && keyFile != "" { - pair, err := tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return nil, fmt.Errorf("load client keypair: %w", err) - } - cfg.Certificates = []tls.Certificate{pair} - } - return cfg, nil -} - func env(k, def string) string { if v := os.Getenv(k); v != "" { return v @@ -228,20 +166,6 @@ func envInt(k string, def int) int { return n } -func envBool(k string, def bool) bool { - v := os.Getenv(k) - if v == "" { - return def - } - switch strings.ToLower(v) { - case "1", "t", "true", "y", "yes": - return true - case "0", "f", "false", "n", "no": - return false - } - return def -} - func healthHandler(c *as.Client) http.HandlerFunc { return func(w http.ResponseWriter, _ *http.Request) { nodes := c.GetNodes() diff --git a/aerospike-tls/scripts/common.sh b/aerospike-tls/scripts/common.sh new file mode 100755 index 00000000..d37f7f3f --- /dev/null +++ b/aerospike-tls/scripts/common.sh @@ -0,0 +1,165 @@ +#!/usr/bin/env bash +# Shared helpers for scripts/script-*.sh. +# +# Each script-N.sh sources this file and then calls: +# run_test_set +# where is a shell function that fires the HTTP requests +# the test-set should capture. +# +# Layered behaviour: +# - Boots Aerospike CE via docker compose if not already up. +# - Builds the sample binary. +# - Starts `keploy record` in the background; waits for the app to +# answer /health before firing the curls. +# - SIGINTs keploy when curls are done. +# - Normalises the recorded test-set path to ./keploy/. +# - Adds `body.duration: []` to noise on any /parallel, /multiclient +# or /freshclient test in the set (the response carries wall-clock +# duration that drifts every run). +# - Replays the test-set and exits non-zero if any case fails. + +set -euo pipefail + +# -- knobs that pipelines can override ------------------------------ +: "${KEPLOY:=sudo keploy}" # binary + auth invocation +: "${PORT:=8090}" # HTTP port the sample listens on +: "${LOG_DIR:=/tmp}" # where to drop keploy log output +: "${SKIP_DOCKER:=}" # set=1 to skip docker compose up +: "${SKIP_BUILD:=}" # set=1 to skip go build + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$ROOT" + +bring_up_aerospike() { + [ -n "${SKIP_DOCKER:-}" ] && return 0 + echo "==> docker compose up -d aerospike" + docker compose up -d aerospike + # Wait for the healthcheck. + for _ in $(seq 1 30); do + if docker compose ps aerospike --format '{{.Health}}' 2>/dev/null | grep -q healthy; then + return 0 + fi + sleep 2 + done + echo "ERROR: aerospike never reported healthy" >&2 + docker compose logs aerospike | tail -30 >&2 + return 1 +} + +build_app() { + [ -n "${SKIP_BUILD:-}" ] && return 0 + echo "==> go build -o ./aerospike-tls ." + go build -o ./aerospike-tls . +} + +wait_for_app_ready() { + echo "==> waiting for the sample to answer on :$PORT" + for _ in $(seq 1 60); do + if curl -sf -o /dev/null --max-time 1 "http://127.0.0.1:$PORT/health"; then + sleep 3 # extra grace for ingress forwarding to be wired + return 0 + fi + sleep 1 + done + echo "ERROR: app never answered /health" >&2 + return 1 +} + +stop_keploy() { + sudo pkill -SIGINT keploy 2>/dev/null || true + # Give keploy time to flush captured tests + shut down cleanly. + for _ in $(seq 1 15); do + if ! pgrep -af "keploy record" >/dev/null 2>&1; then return 0; fi + sleep 1 + done + echo "WARN: keploy didn't exit on SIGINT, killing" + sudo pkill -KILL keploy 2>/dev/null || true +} + +# Two kinds of fixups can be required after a fresh recording: +# +# 1. Some keploy invocations write to ./keploy/keploy/test-set-N +# (nested) instead of ./keploy/test-set-N (flat). Flatten that. +# +# 2. Keploy auto-numbers fresh recordings as the next available +# test-set-N when the target dir doesn't exist yet. So +# script-2.sh asks for test-set-1, but if ./keploy/ is empty at +# record time, keploy will create test-set-0. Rename whichever +# fresh dir landed under ./keploy/ to the requested target. +normalise_recording() { + local target="$1" + if [ -d "./keploy/keploy" ]; then + sudo chown -R "$(id -u):$(id -g)" ./keploy/keploy + for d in ./keploy/keploy/test-set-*; do + [ -d "$d" ] || continue + mv "$d" "./keploy/" + done + rmdir ./keploy/keploy 2>/dev/null || true + fi + [ -d "./keploy/$target" ] && return 0 + + local newest="" newest_mtime=0 + for d in ./keploy/test-set-*; do + [ -d "$d" ] || continue + local m + m=$(stat -c %Y "$d") + if [ "$m" -gt "$newest_mtime" ]; then + newest="$d"; newest_mtime="$m" + fi + done + if [ -n "$newest" ]; then + mv "$newest" "./keploy/$target" + return 0 + fi + echo "ERROR: $target was not recorded — check $LOG_DIR/keploy-record-$target.log" >&2 + return 1 +} + +apply_duration_noise() { + local target="$1" + local applied=0 + for f in ./keploy/"$target"/tests/post-parallel-*.yaml \ + ./keploy/"$target"/tests/post-multiclient-*.yaml \ + ./keploy/"$target"/tests/post-freshclient-*.yaml; do + [ -e "$f" ] || continue + if ! grep -q "body.duration:" "$f"; then + sed -i 's|header.Date: \[\]|header.Date: []\n body.duration: []|' "$f" + applied=$((applied+1)) + fi + done + [ "$applied" -gt 0 ] && echo "==> applied body.duration noise to $applied test(s)" + return 0 +} + +run_test_set() { + local target="$1" # e.g. test-set-0 + local curl_fn="$2" # shell function that fires the requests + + bring_up_aerospike + build_app + + echo "==> clearing any stale ./keploy/$target" + sudo rm -rf "./keploy/$target" + + local log="$LOG_DIR/keploy-record-$target.log" + echo "==> starting keploy record (logging to $log)" + $KEPLOY record > "$log" 2>&1 & + local keploy_pid=$! + trap 'stop_keploy' EXIT + + wait_for_app_ready + echo "==> firing curls for $target" + $curl_fn + sleep 3 + + echo "==> stopping keploy record" + stop_keploy + trap - EXIT + wait "$keploy_pid" 2>/dev/null || true + + normalise_recording "$target" + apply_duration_noise "$target" + + echo "==> $KEPLOY test --test-sets $target" + $KEPLOY test --test-sets "$target" +} diff --git a/aerospike-tls/scripts/script-1.sh b/aerospike-tls/scripts/script-1.sh new file mode 100755 index 00000000..25fbdf54 --- /dev/null +++ b/aerospike-tls/scripts/script-1.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# script-1.sh — record + replay test-set-0. +# +# Captures the single-endpoint CRUD coverage: +# GET /health POST /put GET /get POST /batch/put GET /batch/get +# POST /touch DELETE /key +# +# Output: writes keploy/test-set-0/, then runs `keploy test` +# against it and exits non-zero if any case fails. + +set -euo pipefail +source "$(dirname "$0")/common.sh" + +curls_test_set_0() { + curl -sf -o /dev/null "http://127.0.0.1:$PORT/health" + sleep 1 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/put" \ + -H 'Content-Type: application/json' \ + -d '{"key":"alice","bins":{"age":30,"name":"Alice"}}' + sleep 1 + curl -sf -o /dev/null "http://127.0.0.1:$PORT/get/alice" + sleep 1 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/batch/put" \ + -H 'Content-Type: application/json' \ + -d '[{"key":"a","bins":{"n":1}},{"key":"b","bins":{"n":2}}]' + sleep 1 + curl -s -o /dev/null "http://127.0.0.1:$PORT/batch/get?k=a&k=b" || true + sleep 1 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/touch/alice" + sleep 1 + curl -sf -o /dev/null -XDELETE "http://127.0.0.1:$PORT/key/alice" +} + +run_test_set test-set-0 curls_test_set_0 diff --git a/aerospike-tls/scripts/script-2.sh b/aerospike-tls/scripts/script-2.sh new file mode 100755 index 00000000..51418dde --- /dev/null +++ b/aerospike-tls/scripts/script-2.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# script-2.sh — record + replay test-set-1. +# +# Captures /parallel at four concurrency levels (n = 4, 8, 12, 24) so +# the replay path exercises bursts of concurrent goroutines sharing a +# single *as.Client. + +set -euo pipefail +source "$(dirname "$0")/common.sh" + +curls_test_set_1() { + curl -sf -o /dev/null "http://127.0.0.1:$PORT/health" + sleep 1 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/parallel?n=4&prefix=run1" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/parallel?n=8&prefix=run2" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/parallel?n=12&prefix=run3" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/parallel?n=24&prefix=run4" +} + +run_test_set test-set-1 curls_test_set_1 diff --git a/aerospike-tls/scripts/script-3.sh b/aerospike-tls/scripts/script-3.sh new file mode 100755 index 00000000..40324b95 --- /dev/null +++ b/aerospike-tls/scripts/script-3.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# script-3.sh — record + replay test-set-2. +# +# Captures /multiclient (4 pre-built *as.Client, round-robined) and +# /freshclient (per-request *as.Client construction). Demonstrates +# that Keploy replay stays deterministic across more elaborate +# client-shape patterns. + +set -euo pipefail +source "$(dirname "$0")/common.sh" + +curls_test_set_2() { + curl -sf -o /dev/null "http://127.0.0.1:$PORT/health" + sleep 1 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/multiclient?n=4&prefix=mc1" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/multiclient?n=8&prefix=mc2" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/multiclient?n=12&prefix=mc3" + sleep 2 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/multiclient?n=24&prefix=mc4" + sleep 3 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/freshclient?n=4&prefix=fc1" + sleep 3 + curl -sf -o /dev/null -XPOST "http://127.0.0.1:$PORT/freshclient?n=8&prefix=fc2" +} + +run_test_set test-set-2 curls_test_set_2 diff --git a/aerospike-tls/stunnel/stunnel.conf b/aerospike-tls/stunnel/stunnel.conf deleted file mode 100644 index 80a05ef5..00000000 --- a/aerospike-tls/stunnel/stunnel.conf +++ /dev/null @@ -1,9 +0,0 @@ -foreground = yes -debug = 4 -output = /dev/stdout - -[aerospike-tls] -accept = 0.0.0.0:3001 -connect = aerospike:3000 -cert = /etc/stunnel/server.pem -key = /etc/stunnel/server.key From 5bf96ad2156bc0765c086f5ae63b87ab0e2135a5 Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 16:44:47 +0530 Subject: [PATCH 5/8] ci(aerospike-tls): add record/replay pipeline for the new sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A GitHub Actions workflow that records and replays each of the three test-sets in sequence (script-1 → script-2 → script-3), gated on changes under aerospike-tls/ or the workflow file itself. Pipeline stages: 1. Check out samples-go and set up Go. 2. Clone keploy + integrations from feat/aerospike-parser (siblings on disk so keploy's `replace github.com/keploy/integrations => ../integrations` resolves), then `go build` keploy and drop the binary at /usr/local/bin/keploy. This step shrinks to a one-line install once the Aerospike parser merges to a stable release. 3. Seed an installation-id so keploy doesn't prompt on first run. 4. docker compose up -d aerospike — wait for the healthcheck. 5. go build the sample binary once and reuse it across all three scripts (SKIP_DOCKER + SKIP_BUILD env vars short-circuit the bootstrap inside common.sh). 6. Run script-1, script-2, script-3 in order. Each does its own record + replay end-to-end and exits non-zero on any replay miss, so a red step pinpoints which set regressed. 7. On failure, upload /tmp/keploy-record-*.log and the partial keploy/ tree as build artifacts. 8. Tear compose down with -v. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/aerospike-tls.yml | 134 ++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 .github/workflows/aerospike-tls.yml diff --git a/.github/workflows/aerospike-tls.yml b/.github/workflows/aerospike-tls.yml new file mode 100644 index 00000000..2eb98416 --- /dev/null +++ b/.github/workflows/aerospike-tls.yml @@ -0,0 +1,134 @@ +name: aerospike-tls record/replay + +on: + push: + branches: [main] + paths: + - 'aerospike-tls/**' + - '.github/workflows/aerospike-tls.yml' + pull_request: + paths: + - 'aerospike-tls/**' + - '.github/workflows/aerospike-tls.yml' + workflow_dispatch: {} + +# The pipeline drives one job that records each of the three +# test-sets in order via the bundled scripts under aerospike-tls/ +# scripts/ and replays them against the captured mocks. Scripts MUST +# run 1 → 2 → 3 in this order: keploy auto-numbers a fresh recording +# off whatever already exists under ./keploy/, so script-1 produces +# test-set-0, script-2 produces test-set-1, script-3 produces +# test-set-2. The shared common.sh sources noise filters + dir +# normalisation; we keep the sequence here so a single failure +# pinpoints which set regressed. + +jobs: + record-replay: + runs-on: ubuntu-latest + timeout-minutes: 25 + + steps: + - name: Checkout samples-go + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.26' + + # The keploy binary on the stable release stream does not yet + # carry the Aerospike parser. Until it does, build keploy from + # source against the open `feat/aerospike-parser` branches in + # both keploy/keploy and keploy/integrations. keploy's go.mod + # has a `replace github.com/keploy/integrations => ../integrations` + # so the two checkouts must end up as siblings on disk. + - name: Clone keploy + integrations (feat/aerospike-parser) + run: | + set -euxo pipefail + mkdir -p /tmp/build + git clone --depth 1 --branch feat/aerospike-parser \ + https://github.com/keploy/keploy.git /tmp/build/keploy + git clone --depth 1 --branch feat/aerospike-parser \ + https://github.com/keploy/integrations.git /tmp/build/integrations + + - name: Build keploy with the Aerospike parser + run: | + set -euxo pipefail + cd /tmp/build/keploy + go build -o /tmp/keploy . + sudo mv /tmp/keploy /usr/local/bin/keploy + keploy --version || true + + # Seed an installation-id so keploy doesn't try to register the + # CI runner on first run. Mirrors the helper that the keploy + # repo uses for its own sample CI scripts. + - name: Seed installation id + run: | + set -eux + sudo mkdir -p /root/.keploy + echo "ObjectID('ci-aerospike-tls')" | \ + sudo tee /root/.keploy/installation-id.yaml >/dev/null + + - name: Bring up Aerospike CE + working-directory: aerospike-tls + run: | + set -eux + docker compose up -d aerospike + for _ in $(seq 1 60); do + status=$(docker compose ps aerospike --format '{{.Health}}' 2>/dev/null || true) + if [ "$status" = "healthy" ]; then + echo "aerospike: healthy" + exit 0 + fi + sleep 2 + done + echo "aerospike never reported healthy" >&2 + docker compose logs aerospike | tail -50 >&2 + exit 1 + + - name: Build the sample binary + working-directory: aerospike-tls + run: go build -o aerospike-tls . + + # Each script does its own record + replay end-to-end and exits + # non-zero on any replay miss, so the CI step turns red on the + # exact set that regressed. SKIP_DOCKER + SKIP_BUILD reuse the + # boot + build we did above instead of repeating per script. + - name: script-1 — test-set-0 (CRUD) + working-directory: aerospike-tls + env: + KEPLOY: sudo keploy + SKIP_DOCKER: '1' + SKIP_BUILD: '1' + run: ./scripts/script-1.sh + + - name: script-2 — test-set-1 (/parallel n = 4..24) + working-directory: aerospike-tls + env: + KEPLOY: sudo keploy + SKIP_DOCKER: '1' + SKIP_BUILD: '1' + run: ./scripts/script-2.sh + + - name: script-3 — test-set-2 (/multiclient + /freshclient) + working-directory: aerospike-tls + env: + KEPLOY: sudo keploy + SKIP_DOCKER: '1' + SKIP_BUILD: '1' + run: ./scripts/script-3.sh + + - name: Upload keploy logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: keploy-logs + path: | + /tmp/keploy-record-*.log + aerospike-tls/keploy/** + if-no-files-found: ignore + + - name: Tear down + if: always() + working-directory: aerospike-tls + run: docker compose down -v || true From b3bff3ec4e8d7cf864af8b901c580c181782b158 Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 17:07:20 +0530 Subject: [PATCH 6/8] ci: drop aerospike-tls workflow, pipeline now lives in integrations The record/replay pipeline for aerospike-tls moves to keploy/integrations on the feat/aerospike-parser branch: it gates the Aerospike parser PR itself, so the workflow belongs next to the parser source. The integrations workflow clones samples-go to fetch this sample + the scripts, so nothing on the samples-go side needs to change to keep CI green. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/aerospike-tls.yml | 134 ---------------------------- 1 file changed, 134 deletions(-) delete mode 100644 .github/workflows/aerospike-tls.yml diff --git a/.github/workflows/aerospike-tls.yml b/.github/workflows/aerospike-tls.yml deleted file mode 100644 index 2eb98416..00000000 --- a/.github/workflows/aerospike-tls.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: aerospike-tls record/replay - -on: - push: - branches: [main] - paths: - - 'aerospike-tls/**' - - '.github/workflows/aerospike-tls.yml' - pull_request: - paths: - - 'aerospike-tls/**' - - '.github/workflows/aerospike-tls.yml' - workflow_dispatch: {} - -# The pipeline drives one job that records each of the three -# test-sets in order via the bundled scripts under aerospike-tls/ -# scripts/ and replays them against the captured mocks. Scripts MUST -# run 1 → 2 → 3 in this order: keploy auto-numbers a fresh recording -# off whatever already exists under ./keploy/, so script-1 produces -# test-set-0, script-2 produces test-set-1, script-3 produces -# test-set-2. The shared common.sh sources noise filters + dir -# normalisation; we keep the sequence here so a single failure -# pinpoints which set regressed. - -jobs: - record-replay: - runs-on: ubuntu-latest - timeout-minutes: 25 - - steps: - - name: Checkout samples-go - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.26' - - # The keploy binary on the stable release stream does not yet - # carry the Aerospike parser. Until it does, build keploy from - # source against the open `feat/aerospike-parser` branches in - # both keploy/keploy and keploy/integrations. keploy's go.mod - # has a `replace github.com/keploy/integrations => ../integrations` - # so the two checkouts must end up as siblings on disk. - - name: Clone keploy + integrations (feat/aerospike-parser) - run: | - set -euxo pipefail - mkdir -p /tmp/build - git clone --depth 1 --branch feat/aerospike-parser \ - https://github.com/keploy/keploy.git /tmp/build/keploy - git clone --depth 1 --branch feat/aerospike-parser \ - https://github.com/keploy/integrations.git /tmp/build/integrations - - - name: Build keploy with the Aerospike parser - run: | - set -euxo pipefail - cd /tmp/build/keploy - go build -o /tmp/keploy . - sudo mv /tmp/keploy /usr/local/bin/keploy - keploy --version || true - - # Seed an installation-id so keploy doesn't try to register the - # CI runner on first run. Mirrors the helper that the keploy - # repo uses for its own sample CI scripts. - - name: Seed installation id - run: | - set -eux - sudo mkdir -p /root/.keploy - echo "ObjectID('ci-aerospike-tls')" | \ - sudo tee /root/.keploy/installation-id.yaml >/dev/null - - - name: Bring up Aerospike CE - working-directory: aerospike-tls - run: | - set -eux - docker compose up -d aerospike - for _ in $(seq 1 60); do - status=$(docker compose ps aerospike --format '{{.Health}}' 2>/dev/null || true) - if [ "$status" = "healthy" ]; then - echo "aerospike: healthy" - exit 0 - fi - sleep 2 - done - echo "aerospike never reported healthy" >&2 - docker compose logs aerospike | tail -50 >&2 - exit 1 - - - name: Build the sample binary - working-directory: aerospike-tls - run: go build -o aerospike-tls . - - # Each script does its own record + replay end-to-end and exits - # non-zero on any replay miss, so the CI step turns red on the - # exact set that regressed. SKIP_DOCKER + SKIP_BUILD reuse the - # boot + build we did above instead of repeating per script. - - name: script-1 — test-set-0 (CRUD) - working-directory: aerospike-tls - env: - KEPLOY: sudo keploy - SKIP_DOCKER: '1' - SKIP_BUILD: '1' - run: ./scripts/script-1.sh - - - name: script-2 — test-set-1 (/parallel n = 4..24) - working-directory: aerospike-tls - env: - KEPLOY: sudo keploy - SKIP_DOCKER: '1' - SKIP_BUILD: '1' - run: ./scripts/script-2.sh - - - name: script-3 — test-set-2 (/multiclient + /freshclient) - working-directory: aerospike-tls - env: - KEPLOY: sudo keploy - SKIP_DOCKER: '1' - SKIP_BUILD: '1' - run: ./scripts/script-3.sh - - - name: Upload keploy logs on failure - if: failure() - uses: actions/upload-artifact@v4 - with: - name: keploy-logs - path: | - /tmp/keploy-record-*.log - aerospike-tls/keploy/** - if-no-files-found: ignore - - - name: Tear down - if: always() - working-directory: aerospike-tls - run: docker compose down -v || true From 0c5f280a0551e562ef66f819bd8a42df31b1777e Mon Sep 17 00:00:00 2001 From: Aditya-eddy Date: Mon, 11 May 2026 17:33:50 +0530 Subject: [PATCH 7/8] ci: add aerospike-tls to golangci-lint matrix The samples-go lint workflow drives golangci-lint v1.63.4 across a per-sample matrix. aerospike-tls was the only new sample missing from the list; this slot exercises main.go + the scripts module under the same gate every other sample uses. Verified locally with the matching golangci-lint version: clean, no findings. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/golangci-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 1661bfa2..a5084c25 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -26,6 +26,7 @@ jobs: fail-fast: false matrix: working-directory: + - aerospike-tls - book-store-inventory - connect-tunnel - dns-dedup From d8560379c4736f1801a6931994128dcbf6f02645 Mon Sep 17 00:00:00 2001 From: Gaurav Singh Date: Fri, 29 May 2026 16:42:41 +0530 Subject: [PATCH 8/8] fix(aerospike-tls): noise body.duration and disable strictMockWindow Signed-off-by: Gaurav Singh --- aerospike-tls/keploy.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aerospike-tls/keploy.yml b/aerospike-tls/keploy.yml index 73ec1994..68dd55b5 100755 --- a/aerospike-tls/keploy.yml +++ b/aerospike-tls/keploy.yml @@ -20,7 +20,8 @@ buildDelay: 30 test: selectedTests: {} globalNoise: - global: {} + global: + body.duration: [] test-sets: {} replaceWith: global: @@ -66,7 +67,7 @@ test: schemaMatch: false updateTestMapping: false disableAutoHeaderNoise: false - strictMockWindow: true + strictMockWindow: false record: filters: [] basePath: ""