├── .asf.yaml ├── .clang-format ├── .clang-tidy ├── .devcontainer └── devcontainer.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature-request.md │ └── general_question.md ├── actions │ ├── build_pegasus │ │ └── action.yaml │ ├── download_artifact │ │ └── action.yaml │ ├── rebuild_thirdparty_if_needed │ │ └── action.yaml │ ├── run_server_tests │ │ └── action.yaml │ ├── unpack_prebuilt_thirdparties │ │ └── action.yaml │ └── upload_artifact │ │ └── action.yaml ├── pull_request_template.md └── workflows │ ├── build-push-env-docker.yml │ ├── free_disk_space.sh │ ├── labeler.yml │ ├── lint_and_test_admin-cli.yml │ ├── lint_and_test_admin-cli_always_pass.yml │ ├── lint_and_test_collector.yml │ ├── lint_and_test_cpp.yaml │ ├── lint_and_test_go-client.yml │ ├── lint_and_test_java-client.yml │ ├── lint_and_test_pegic.yml │ ├── lint_and_test_pegic_always_pass.yml │ ├── lint_and_test_scala-client.yml │ ├── module_labeler_conf.yml │ ├── regular-build.yml │ ├── standardization_lint.yaml │ ├── test_nodejs-client.yml │ ├── test_python-client.yml │ └── thirdparty-regular-push.yml ├── .gitignore ├── .golangci.yml ├── .licenserc.yaml ├── .rat-excludes ├── CMakeLists.txt ├── DISCLAIMER ├── HISTORY.md ├── LICENSE ├── NOTICE ├── README.md ├── admin-cli ├── .goreleaser.yml ├── Makefile ├── README.md ├── check_and_format.sh ├── client │ ├── fake_cluster_test.go │ ├── fake_meta_test.go │ ├── meta.go │ ├── migrate_node.go │ ├── migrate_node_test.go │ ├── options.go │ ├── remote_command.go │ ├── replica_health.go │ └── replica_health_test.go ├── cmd │ ├── backup_restore.go │ ├── bulk_load.go │ ├── cluster_info.go │ ├── compaction.go │ ├── create_table.go │ ├── disk_balance.go │ ├── disk_info.go │ ├── drop_table.go │ ├── duplication.go │ ├── init.go │ ├── list_nodes.go │ ├── list_tables.go │ ├── manual_compaction.go │ ├── meta_level.go │ ├── node_stat.go │ ├── nodes_balancer.go │ ├── nodes_migrator.go │ ├── partition_split.go │ ├── partition_stat.go │ ├── recall_table.go │ ├── remote_command.go │ ├── server_config.go │ ├── server_info.go │ ├── table_env.go │ ├── table_migrator.go │ ├── table_partition.go │ ├── table_stat.go │ ├── table_version.go │ ├── use_table.go │ └── utils.go ├── executor │ ├── backup_restore.go │ ├── bulk_load.go │ ├── client.go │ ├── cluster_info.go │ ├── compaction.go │ ├── create_table.go │ ├── disk_info.go │ ├── disk_migrate.go │ ├── drop_table.go │ ├── duplication.go │ ├── list_nodes.go │ ├── list_tables.go │ ├── manual_compaction.go │ ├── meta_level.go │ ├── nodes_stat.go │ ├── partition_split.go │ ├── partition_stat.go │ ├── recall_table.go │ ├── remote_command.go │ ├── server_config.go │ ├── server_info.go │ ├── table_env.go │ ├── table_partitions.go │ ├── table_stat.go │ ├── table_version.go │ ├── toolkits │ │ ├── diskbalancer │ │ │ ├── balancer.go │ │ │ └── migrator.go │ │ ├── log.go │ │ ├── nodesbalancer │ │ │ ├── balancer.go │ │ │ └── migrator.go │ │ ├── nodesmigrator │ │ │ ├── action.go │ │ │ ├── manager.go │ │ │ ├── migrator.go │ │ │ └── nodes.go │ │ └── tablemigrator │ │ │ ├── README.md │ │ │ ├── migrator.go │ │ │ └── switcher.go │ └── use_table.go ├── go.mod ├── go.sum ├── main.go ├── shell │ ├── context.go │ └── shell.go ├── tabular │ ├── printer.go │ └── template.go └── util │ ├── common_utils.go │ ├── http_client.go │ ├── pegasus_node.go │ └── perf_counter.go ├── admin_tools ├── clear_zk.sh ├── config_hdfs.sh ├── downgrade_node.sh ├── download_hadoop.sh ├── download_package.sh ├── download_zk.sh ├── learn_stat.py ├── migrate_node.sh ├── minos_common.sh ├── pegasus_add_node_list.sh ├── pegasus_bench_run.sh ├── pegasus_check_arguments.sh ├── pegasus_kill_test.sh ├── pegasus_manual_compact.sh ├── pegasus_migrate_zookeeper.sh ├── pegasus_offline_node.sh ├── pegasus_offline_node_list.sh ├── pegasus_rebalance_cluster.sh ├── pegasus_replica_thread.sh ├── pegasus_restart_node.sh ├── pegasus_rolling_update.sh ├── pegasus_set_usage_scenario.sh ├── pegasus_stat_available.sh ├── pegasus_update_ingest_behind.sh ├── sendmail.sh ├── start_zk.sh └── stop_zk.sh ├── build_tools ├── bump_version.sh ├── check_license.py ├── clang_tidy.py ├── collector_table_counter_gen.py ├── compile_thrift.py ├── format_files.sh ├── pack_client.sh ├── pack_common.sh ├── pack_server.sh ├── pack_tools.sh ├── recompile_thrift.sh ├── redis_proto_check.py └── run-clang-format.py ├── cmake_modules ├── BaseFunctions.cmake ├── CompilerInfo.cmake ├── FindDL.cmake ├── FindJemalloc.cmake ├── FindRT.cmake └── ThriftUtils.cmake ├── collector ├── Makefile ├── README.md ├── aggregate │ ├── aggregatable.go │ ├── aggregator.go │ ├── aggregator_test.go │ ├── history.go │ ├── history_test.go │ ├── hook.go │ ├── hook_test.go │ ├── perf_client.go │ ├── perf_client_test.go │ ├── perf_counter_decoder.go │ ├── perf_counter_decoder_test.go │ ├── perf_session.go │ └── table_stats.go ├── avail │ └── detector.go ├── config.yml ├── go.mod ├── go.sum ├── hotspot │ └── partition_detector.go ├── main.go ├── metrics │ ├── meta_server_metrics.go │ ├── metric_collector.go │ └── replica_server_metrics.go ├── sink │ ├── falcon_sink.go │ ├── prometheus_sink.go │ └── sink.go ├── templates │ └── index.html ├── usage │ └── usage_recorder.go └── webui │ ├── index.go │ ├── tables.go │ └── webserver.go ├── docker ├── README.md ├── bcc-centos7 │ └── Dockerfile ├── pegasus-build-env │ ├── README.md │ ├── centos7 │ │ └── Dockerfile │ ├── go │ │ └── Dockerfile │ ├── rockylinux9 │ │ └── Dockerfile │ ├── ubuntu1804 │ │ └── Dockerfile │ ├── ubuntu2004 │ │ └── Dockerfile │ └── ubuntu2204 │ │ └── Dockerfile ├── pegasus-docker-compose │ ├── README.md │ ├── build_docker.sh │ ├── clear_onebox.sh │ ├── cluster_args.sh │ ├── config.min.ini │ ├── docker-compose.yml │ ├── image_for_prebuilt_bin │ │ ├── Dockerfile │ │ └── entrypoint.sh │ ├── prepare.sh │ └── start_onebox.sh ├── thirdparties-bin │ └── Dockerfile └── thirdparties-src │ └── Dockerfile ├── docs ├── CONTRIBUTING.md ├── rdsn-README.md └── resources │ ├── arch.png │ ├── config.png │ ├── rdsn-layer1.jpg │ ├── rdsn-layer2.jpg │ ├── rdsn-layer3.jpg │ ├── rdsn-state-all.jpg │ ├── rdsn.jpg │ └── viz.png ├── go-client ├── .golangci.yml ├── Makefile ├── README.md ├── admin │ ├── client.go │ ├── client_test.go │ ├── remote_cmd_client.go │ └── remote_cmd_client_test.go ├── codecov.yml ├── docs │ └── how_to_add_new_interface.md ├── example │ ├── full_scan.md │ ├── main.go │ └── pegasus-client-config.json ├── generator │ ├── admin.csv │ ├── main.go │ └── radmin.csv ├── go.mod ├── go.sum ├── idl │ ├── admin │ │ ├── GoUnusedProtection__.go │ │ ├── backup-consts.go │ │ ├── backup.go │ │ ├── bulk_load-consts.go │ │ ├── bulk_load.go │ │ ├── duplication-consts.go │ │ ├── duplication.go │ │ ├── meta_admin-consts.go │ │ ├── meta_admin.go │ │ ├── metadata-consts.go │ │ ├── metadata.go │ │ ├── partition_split-consts.go │ │ └── partition_split.go │ ├── base │ │ ├── GoUnusedProtection__.go │ │ ├── blob.go │ │ ├── dsn_err_string.go │ │ ├── error_code.go │ │ ├── gpid.go │ │ ├── gpid_test.go │ │ ├── host_port.go │ │ ├── host_port_test.go │ │ ├── rocskdb_err_string.go │ │ ├── rpc_address.go │ │ └── rpc_address_test.go │ ├── cmd │ │ ├── GoUnusedProtection__.go │ │ ├── command-consts.go │ │ └── command.go │ ├── radmin │ │ ├── GoUnusedProtection__.go │ │ ├── replica_admin-consts.go │ │ └── replica_admin.go │ ├── replication │ │ ├── GoUnusedProtection__.go │ │ ├── dsn.layer2-consts.go │ │ └── dsn.layer2.go │ ├── rrdb │ │ ├── GoUnusedProtection__.go │ │ ├── meta-remote │ │ │ └── meta-remote.go │ │ ├── rrdb-consts.go │ │ ├── rrdb-remote │ │ │ └── rrdb-remote.go │ │ └── rrdb.go │ └── utils │ │ ├── GoUnusedProtection__.go │ │ ├── utils-consts.go │ │ └── utils.go ├── integration │ └── failover-test │ │ └── main.go ├── pegalog │ ├── logger.go │ └── logrus_logger.go ├── pegasus │ ├── check_and_set.go │ ├── client.go │ ├── client_test.go │ ├── config.go │ ├── error.go │ ├── error_test.go │ ├── filter.go │ ├── main_test.go │ ├── op │ │ ├── check_and_set.go │ │ ├── del.go │ │ ├── get.go │ │ ├── incr.go │ │ ├── multidel.go │ │ ├── multiget.go │ │ ├── multiset.go │ │ ├── op.go │ │ ├── set.go │ │ ├── sortkey_count.go │ │ ├── ttl.go │ │ └── utils.go │ ├── retry_failover.go │ ├── retry_failover_test.go │ ├── scan_test.go │ ├── scanner.go │ ├── table_connector.go │ ├── table_connector_leak_test.go │ ├── table_connector_test.go │ └── util.go ├── rpc │ ├── codec.go │ ├── main │ │ └── echo.go │ ├── main_test.go │ ├── rpc_conn.go │ ├── rpc_conn_test.go │ ├── stream_in.go │ ├── stream_out.go │ ├── stream_test.go │ └── utils.go └── session │ ├── addr.go │ ├── addr_test.go │ ├── admin_rpc_types.go │ ├── codec.go │ ├── codec_test.go │ ├── header.go │ ├── main_test.go │ ├── meta_call.go │ ├── meta_session.go │ ├── meta_session_test.go │ ├── radmin_rpc_types.go │ ├── replica_session.go │ ├── replica_session_test.go │ ├── session.go │ ├── session_test.go │ └── session_timeout_test.go ├── idl ├── backup.thrift ├── bulk_load.thrift ├── command.thrift ├── dsn.layer2.thrift ├── dsn.thrift ├── duplication.thrift ├── meta_admin.thrift ├── metadata.thrift ├── partition_split.thrift ├── replica_admin.thrift ├── rrdb.thrift ├── security.thrift └── utils.thrift ├── java-client ├── README.md ├── dev-support │ ├── checkstyle-suppressions.xml │ ├── findbugs-exclude.xml │ ├── google-checks.xml │ └── license-header.txt ├── pom.xml ├── scripts │ └── download_thrift.sh └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── pegasus │ │ ├── base │ │ ├── blob.java │ │ ├── error_code.java │ │ ├── gpid.java │ │ ├── host_port.java │ │ ├── rpc_address.java │ │ └── task_code.java │ │ ├── client │ │ ├── CheckAndMutateOptions.java │ │ ├── CheckAndSetOptions.java │ │ ├── CheckType.java │ │ ├── ClientOptions.java │ │ ├── DelRangeOptions.java │ │ ├── FilterType.java │ │ ├── FutureGroup.java │ │ ├── HashKeyData.java │ │ ├── ListAppInfoType.java │ │ ├── MultiGetOptions.java │ │ ├── Mutations.java │ │ ├── PConfigUtil.java │ │ ├── PException.java │ │ ├── PegasusAbstractClient.java │ │ ├── PegasusAdminClient.java │ │ ├── PegasusAdminClientFactory.java │ │ ├── PegasusAdminClientInterface.java │ │ ├── PegasusClient.java │ │ ├── PegasusClientFactory.java │ │ ├── PegasusClientInterface.java │ │ ├── PegasusScanner.java │ │ ├── PegasusScannerInterface.java │ │ ├── PegasusTable.java │ │ ├── PegasusTableInterface.java │ │ ├── ScanOptions.java │ │ ├── SetItem.java │ │ ├── TableOptions.java │ │ ├── request │ │ │ ├── AbstractBatch.java │ │ │ ├── Batch.java │ │ │ ├── BatchWithResponse.java │ │ │ ├── Delete.java │ │ │ ├── DeleteBatch.java │ │ │ ├── Get.java │ │ │ ├── GetBatch.java │ │ │ ├── MultiDelete.java │ │ │ ├── MultiDeleteBatch.java │ │ │ ├── MultiGet.java │ │ │ ├── MultiGetBatch.java │ │ │ ├── MultiSet.java │ │ │ ├── MultiSetBatch.java │ │ │ ├── Set.java │ │ │ └── SetBatch.java │ │ └── retry │ │ │ ├── DefaultRetryPolicy.java │ │ │ ├── ExponentialBackoffRetryPolicy.java │ │ │ ├── RetryPolicies.java │ │ │ └── RetryPolicy.java │ │ ├── example │ │ ├── BatchSample.java │ │ └── FullScanSample.java │ │ ├── metrics │ │ ├── MetricsManager.java │ │ ├── MetricsPool.java │ │ └── MetricsReporter.java │ │ ├── operator │ │ ├── batch_get_operator.java │ │ ├── client_operator.java │ │ ├── create_app_operator.java │ │ ├── drop_app_operator.java │ │ ├── list_apps_operator.java │ │ ├── negotiation_operator.java │ │ ├── query_cfg_operator.java │ │ ├── read_operator.java │ │ ├── rrdb_check_and_mutate_operator.java │ │ ├── rrdb_check_and_set_operator.java │ │ ├── rrdb_clear_scanner_operator.java │ │ ├── rrdb_get_operator.java │ │ ├── rrdb_get_scanner_operator.java │ │ ├── rrdb_incr_operator.java │ │ ├── rrdb_multi_get_operator.java │ │ ├── rrdb_multi_put_operator.java │ │ ├── rrdb_multi_remove_operator.java │ │ ├── rrdb_put_operator.java │ │ ├── rrdb_remove_operator.java │ │ ├── rrdb_scan_operator.java │ │ ├── rrdb_sortkey_count_operator.java │ │ └── rrdb_ttl_operator.java │ │ ├── rpc │ │ ├── Cluster.java │ │ ├── InternalTableOptions.java │ │ ├── KeyHasher.java │ │ ├── Meta.java │ │ ├── ReplicationException.java │ │ ├── Table.java │ │ ├── ThriftHeader.java │ │ ├── async │ │ │ ├── ClientRequestRound.java │ │ │ ├── ClusterManager.java │ │ │ ├── HostNameResolver.java │ │ │ ├── MetaHandler.java │ │ │ ├── MetaSession.java │ │ │ ├── ReplicaSession.java │ │ │ ├── TByteBufTransport.java │ │ │ ├── TableHandler.java │ │ │ ├── ThriftFrameDecoder.java │ │ │ └── ThriftFrameEncoder.java │ │ └── interceptor │ │ │ ├── BackupRequestInterceptor.java │ │ │ ├── CompressionInterceptor.java │ │ │ ├── ReplicaSessionInterceptor.java │ │ │ ├── ReplicaSessionInterceptorManager.java │ │ │ ├── TableInterceptor.java │ │ │ └── TableInterceptorManager.java │ │ ├── security │ │ ├── AuthProtocol.java │ │ ├── AuthReplicaSessionInterceptor.java │ │ ├── Credential.java │ │ ├── KerberosCredential.java │ │ ├── KerberosProtocol.java │ │ ├── Negotiation.java │ │ └── SaslWrapper.java │ │ ├── tools │ │ ├── FlowController.java │ │ ├── Tools.java │ │ ├── WriteLimiter.java │ │ └── ZstdWrapper.java │ │ └── util │ │ └── PropertyUtils.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── pegasus │ │ ├── base │ │ ├── TestHostPort.java │ │ └── TestRpcAddress.java │ │ ├── client │ │ ├── PegasusScannerTest.java │ │ ├── TestAdminClient.java │ │ ├── TestBasic.java │ │ ├── TestBatch.java │ │ ├── TestBatchGetByPartitions.java │ │ ├── TestBench.java │ │ ├── TestCheckAndMutate.java │ │ ├── TestCheckAndSet.java │ │ ├── TestFutureGroup.java │ │ ├── TestIncr.java │ │ ├── TestMultiThread.java │ │ ├── TestNoOperate.java │ │ ├── TestPException.java │ │ ├── TestPing.java │ │ ├── TestPingZK.java │ │ ├── TestTimeout.java │ │ └── retry │ │ │ ├── TestDefaultRetryPolicy.java │ │ │ └── TestExponentialBackoffRetryPolicy.java │ │ ├── metrics │ │ └── MetricsPoolTest.java │ │ ├── operator │ │ └── ClientOperatorTest.java │ │ ├── rpc │ │ └── async │ │ │ ├── ClusterManagerTest.java │ │ │ ├── InterceptorTest.java │ │ │ ├── MetaSessionTest.java │ │ │ ├── ReplicaSessionTest.java │ │ │ ├── TableHandlerTest.java │ │ │ └── TimeoutBenchmark.java │ │ ├── security │ │ └── NegotiationTest.java │ │ └── tools │ │ ├── TestZstdWrapper.java │ │ └── Toollet.java │ └── resources │ ├── pegasus.properties │ └── simplelogger.properties ├── nodejs-client ├── .eslintrc.js ├── .npmigonre ├── README.md ├── index.js ├── log_config.js ├── package.json ├── recompile_thrift.sh ├── src │ ├── client.js │ ├── connection.js │ ├── dsn │ │ └── dsn_types.js │ ├── errors.js │ ├── operator.js │ ├── session.js │ ├── table_handler.js │ └── tools.js └── test │ └── client.test.js ├── pegic ├── .goreleaser.yml ├── Makefile ├── README.md ├── check_and_format.sh ├── executor │ ├── context.go │ ├── del.go │ ├── get.go │ ├── partition_index.go │ ├── scan.go │ ├── set.go │ └── util │ │ ├── asciihex.go │ │ ├── compression.go │ │ ├── encoding.go │ │ └── javabytes.go ├── go.mod ├── go.sum ├── interactive │ ├── cmd │ │ ├── compression.go │ │ ├── del.go │ │ ├── encoding.go │ │ ├── get.go │ │ ├── init.go │ │ ├── partition_index.go │ │ ├── scan.go │ │ ├── set.go │ │ └── use.go │ └── run.go ├── main.go └── shell │ ├── app.go │ └── convert.go ├── python-client ├── README.md ├── __init__.py ├── pypegasus │ ├── __init__.py │ ├── base │ │ ├── __init__.py │ │ ├── constants.py │ │ └── ttypes.py │ ├── logger.conf │ ├── operate │ │ ├── __init__.py │ │ └── packet.py │ ├── pgclient.py │ ├── transport │ │ ├── __init__.py │ │ ├── compat.py │ │ └── protocol.py │ └── utils │ │ ├── __init__.py │ │ └── tools.py ├── requirement.txt ├── sample.py ├── setup.py └── tests │ ├── __init__.py │ ├── test_basics.py │ ├── test_benchmark.py │ └── test_integration.py ├── rfcs ├── 2020-08-27-metric-api.md ├── 2020-10-09-data-version-v3.md ├── 2020-12-15-meta-proxy.md ├── 2021-02-22-disk-migrator.md └── 2021-05-27-user-specified-compaction.md ├── run.sh ├── scala-client ├── README.md ├── build.sbt ├── project │ ├── build.properties │ └── plugins.sbt └── src │ ├── main │ └── scala │ │ └── org │ │ └── apache │ │ └── pegasus │ │ └── scalaclient │ │ ├── Models.scala │ │ ├── PegasusUtil.scala │ │ ├── ScalaPegasusAsyncTable.scala │ │ ├── ScalaPegasusClient.scala │ │ ├── ScalaPegasusClientFactory.scala │ │ ├── ScalaPegasusTable.scala │ │ ├── Serializer.scala │ │ └── package.scala │ └── test │ ├── resources │ ├── log4j.properties │ └── pegasus.properties │ └── scala │ └── org │ └── apache │ └── pegasus │ └── scalaclient │ └── TableSpec.scala ├── src ├── CMakeLists.txt ├── aio │ ├── CMakeLists.txt │ ├── aio_provider.cpp │ ├── aio_provider.h │ ├── aio_task.cpp │ ├── aio_task.h │ ├── disk_engine.cpp │ ├── disk_engine.h │ ├── file_io.cpp │ ├── file_io.h │ ├── native_linux_aio_provider.cpp │ ├── native_linux_aio_provider.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── aio.cpp │ │ ├── clear.sh │ │ ├── config.ini │ │ ├── copy_source.txt │ │ ├── main.cpp │ │ └── run.sh ├── base │ ├── CMakeLists.txt │ ├── idl_utils.h │ ├── meta_store.cpp │ ├── meta_store.h │ ├── pegasus_key_schema.h │ ├── pegasus_rpc_types.h │ ├── pegasus_utils.cpp │ ├── pegasus_utils.h │ ├── pegasus_value_schema.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── main.cpp │ │ ├── redact_sensitive_string_test.cpp │ │ ├── run.sh │ │ ├── utils_test.cpp │ │ ├── value_manager_test.cpp │ │ └── value_schema_test.cpp │ ├── value_field.h │ ├── value_schema_manager.cpp │ ├── value_schema_manager.h │ ├── value_schema_v0.cpp │ ├── value_schema_v0.h │ ├── value_schema_v1.cpp │ ├── value_schema_v1.h │ ├── value_schema_v2.cpp │ └── value_schema_v2.h ├── block_service │ ├── CMakeLists.txt │ ├── block_service.h │ ├── block_service_manager.cpp │ ├── block_service_manager.h │ ├── hdfs │ │ ├── CMakeLists.txt │ │ ├── hdfs_service.cpp │ │ └── hdfs_service.h │ ├── local │ │ ├── CMakeLists.txt │ │ ├── local_service.cpp │ │ └── local_service.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── block_service_manager_test.cpp │ │ ├── block_service_mock.h │ │ ├── clear.sh │ │ ├── config-test.ini │ │ ├── hdfs_service_test.cpp │ │ ├── local_service_test.cpp │ │ ├── main.cpp │ │ └── run.sh ├── client │ ├── CMakeLists.txt │ ├── partition_resolver.cpp │ ├── partition_resolver.h │ ├── partition_resolver_manager.cpp │ ├── partition_resolver_manager.h │ ├── partition_resolver_simple.cpp │ ├── partition_resolver_simple.h │ ├── replication_ddl_client.cpp │ ├── replication_ddl_client.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── ddl_client_test.cpp │ │ ├── main.cpp │ │ └── run.sh ├── client_lib │ ├── CMakeLists.txt │ ├── client_factory.cpp │ ├── mutation.cpp │ ├── pegasus_client_factory_impl.cpp │ ├── pegasus_client_factory_impl.h │ ├── pegasus_client_impl.cpp │ ├── pegasus_client_impl.h │ └── pegasus_scanner_impl.cpp ├── common │ ├── CMakeLists.txt │ ├── backup_common.cpp │ ├── backup_common.h │ ├── bulk_load_common.cpp │ ├── bulk_load_common.h │ ├── common.cpp │ ├── common.h │ ├── consensus.thrift │ ├── duplication_common.cpp │ ├── duplication_common.h │ ├── duplication_internal.thrift │ ├── fs_manager.cpp │ ├── fs_manager.h │ ├── gpid.h │ ├── json_helper.h │ ├── manual_compact.h │ ├── partition_split_common.h │ ├── replica_envs.cpp │ ├── replica_envs.h │ ├── replication.codes.h │ ├── replication_common.cpp │ ├── replication_common.h │ ├── replication_enums.h │ ├── replication_other_types.h │ ├── serialization_helper │ │ ├── dsn_types.h │ │ └── thrift_helper.h │ ├── storage_serverlet.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── common_test.cpp │ │ ├── config-test.ini │ │ ├── duplication_common_test.cpp │ │ ├── fs_manager_test.cpp │ │ ├── main.cpp │ │ ├── replication_common_test.cpp │ │ └── run.sh ├── failure_detector │ ├── CMakeLists.txt │ ├── failure_detector.cpp │ ├── failure_detector.h │ ├── failure_detector_multimaster.cpp │ ├── failure_detector_multimaster.h │ ├── fd.client.h │ ├── fd.code.definition.h │ ├── fd.server.h │ ├── fd.thrift │ └── test │ │ ├── CMakeLists.txt │ │ ├── clear.sh │ │ ├── config-test.ini │ │ ├── config-whitelist-test-failed.ini │ │ ├── config-whitelist-test.ini │ │ ├── failure_detector.cpp │ │ ├── gtest.filter │ │ ├── main.cpp │ │ └── run.sh ├── geo │ ├── CMakeLists.txt │ ├── bench │ │ ├── CMakeLists.txt │ │ ├── bench.cpp │ │ └── config.ini │ ├── lib │ │ ├── CMakeLists.txt │ │ ├── geo_client.cpp │ │ ├── geo_client.h │ │ ├── latlng_codec.cpp │ │ └── latlng_codec.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── geo_test.cpp │ │ ├── latlng_codec_test.cpp │ │ ├── main.cpp │ │ └── run.sh ├── gutil │ ├── CMakeLists.txt │ ├── map_traits.h │ ├── map_util.h │ ├── no_destructor.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── map_traits_test.cpp │ │ ├── map_util_test.h │ │ ├── map_util_unittest.cpp │ │ ├── no_destructor_test.cpp │ │ └── run.sh ├── http │ ├── CMakeLists.txt │ ├── builtin_http_calls.cpp │ ├── builtin_http_calls.h │ ├── config_http_service.cpp │ ├── http_call_registry.h │ ├── http_client.cpp │ ├── http_client.h │ ├── http_message_parser.cpp │ ├── http_message_parser.h │ ├── http_method.h │ ├── http_server.cpp │ ├── http_server.h │ ├── http_server_impl.h │ ├── http_status_code.cpp │ ├── http_status_code.h │ ├── pprof_http_service.cpp │ ├── pprof_http_service.h │ ├── service_version.cpp │ ├── service_version.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── config-test.ini │ │ ├── http_client_test.cpp │ │ ├── http_server_test.cpp │ │ ├── http_status_code_test.cpp │ │ ├── main.cpp │ │ ├── run.sh │ │ └── uri_decoder_test.cpp │ ├── uri_decoder.cpp │ └── uri_decoder.h ├── include │ ├── pegasus │ │ ├── client.h │ │ ├── error.h │ │ ├── error_def.h │ │ └── version.h │ └── rrdb │ │ ├── rrdb.client.h │ │ └── rrdb.code.definition.h ├── meta │ ├── CMakeLists.txt │ ├── app_balance_policy.cpp │ ├── app_balance_policy.h │ ├── app_env_validator.cpp │ ├── app_env_validator.h │ ├── backup_engine.cpp │ ├── backup_engine.h │ ├── cluster_balance_policy.cpp │ ├── cluster_balance_policy.h │ ├── distributed_lock_service_simple.cpp │ ├── distributed_lock_service_simple.h │ ├── dump_file.h │ ├── duplication │ │ ├── duplication_info.cpp │ │ ├── duplication_info.h │ │ ├── meta_duplication_service.cpp │ │ └── meta_duplication_service.h │ ├── greedy_load_balancer.cpp │ ├── greedy_load_balancer.h │ ├── load_balance_policy.cpp │ ├── load_balance_policy.h │ ├── meta_backup_service.cpp │ ├── meta_backup_service.h │ ├── meta_bulk_load_ingestion_context.cpp │ ├── meta_bulk_load_ingestion_context.h │ ├── meta_bulk_load_service.cpp │ ├── meta_bulk_load_service.h │ ├── meta_data.cpp │ ├── meta_data.h │ ├── meta_http_service.cpp │ ├── meta_http_service.h │ ├── meta_options.cpp │ ├── meta_options.h │ ├── meta_rpc_types.h │ ├── meta_server_failure_detector.cpp │ ├── meta_server_failure_detector.h │ ├── meta_service.cpp │ ├── meta_service.h │ ├── meta_service_app.cpp │ ├── meta_service_app.h │ ├── meta_split_service.cpp │ ├── meta_split_service.h │ ├── meta_state_service.h │ ├── meta_state_service_simple.cpp │ ├── meta_state_service_simple.h │ ├── meta_state_service_utils.cpp │ ├── meta_state_service_utils.h │ ├── meta_state_service_utils_impl.h │ ├── meta_state_service_zookeeper.cpp │ ├── meta_state_service_zookeeper.h │ ├── partition_guardian.cpp │ ├── partition_guardian.h │ ├── server_load_balancer.cpp │ ├── server_load_balancer.h │ ├── server_state.cpp │ ├── server_state.h │ ├── server_state_restore.cpp │ ├── table_metrics.cpp │ ├── table_metrics.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── backup_test.cpp │ │ ├── balancer_simulator │ │ ├── CMakeLists.txt │ │ └── balancer_simulator.cpp │ │ ├── balancer_validator.cpp │ │ ├── clear.sh │ │ ├── cluster_balance_policy_test.cpp │ │ ├── config-test.ini │ │ ├── copy_replica_operation_test.cpp │ │ ├── dummy_balancer.h │ │ ├── dump_file.cpp │ │ ├── duplication_info_test.cpp │ │ ├── ford_fulkerson_test.cpp │ │ ├── json_compacity.cpp │ │ ├── main.cpp │ │ ├── meta_app_envs_test.cpp │ │ ├── meta_app_operation_test.cpp │ │ ├── meta_backup_test.cpp │ │ ├── meta_bulk_load_ingestion_test.cpp │ │ ├── meta_bulk_load_service_test.cpp │ │ ├── meta_data.cpp │ │ ├── meta_duplication_service_test.cpp │ │ ├── meta_http_service_test.cpp │ │ ├── meta_mauanl_compaction_test.cpp │ │ ├── meta_partition_guardian_test.cpp │ │ ├── meta_service_test.cpp │ │ ├── meta_service_test_app.h │ │ ├── meta_split_service_test.cpp │ │ ├── meta_state │ │ ├── CMakeLists.txt │ │ ├── clear.sh │ │ ├── config-test.ini │ │ ├── gtest.filter │ │ ├── main.cpp │ │ ├── meta_state_service.cpp │ │ └── run.sh │ │ ├── meta_state_service_utils_test.cpp │ │ ├── meta_test_base.cpp │ │ ├── meta_test_base.h │ │ ├── misc │ │ ├── misc.cpp │ │ └── misc.h │ │ ├── run.sh │ │ ├── server_state_restore_test.cpp │ │ ├── server_state_test.cpp │ │ ├── state_sync_test.cpp │ │ ├── suite1 │ │ ├── suite2 │ │ └── update_configuration_test.cpp ├── nfs │ ├── CMakeLists.txt │ ├── nfs.thrift │ ├── nfs_client_impl.cpp │ ├── nfs_client_impl.h │ ├── nfs_code_definition.h │ ├── nfs_node.cpp │ ├── nfs_node.h │ ├── nfs_node_simple.cpp │ ├── nfs_node_simple.h │ ├── nfs_server_impl.cpp │ ├── nfs_server_impl.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── clear.sh │ │ ├── config.ini │ │ ├── main.cpp │ │ ├── nfs_test_file1 │ │ ├── nfs_test_file2 │ │ └── run.sh ├── perf_counter │ ├── CMakeLists.txt │ ├── perf_counter.cpp │ ├── perf_counter.h │ ├── perf_counter_atomic.cpp │ ├── perf_counter_atomic.h │ ├── perf_counter_utils.h │ ├── perf_counter_wrapper.h │ ├── perf_counters.cpp │ ├── perf_counters.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── clear.sh │ │ ├── main.cpp │ │ ├── perf_counter_test.cpp │ │ ├── perf_counters_test.cpp │ │ └── run.sh ├── ranger │ ├── CMakeLists.txt │ ├── access_type.h │ ├── ranger_resource_policy.cpp │ ├── ranger_resource_policy.h │ ├── ranger_resource_policy_manager.cpp │ ├── ranger_resource_policy_manager.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── main.cpp │ │ ├── ranger_resource_policy_manager_test.cpp │ │ ├── ranger_resource_policy_test.cpp │ │ └── run.sh ├── redis_protocol │ ├── CMakeLists.txt │ ├── proxy │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ └── main.cpp │ ├── proxy_lib │ │ ├── CMakeLists.txt │ │ ├── proxy_layer.cpp │ │ ├── proxy_layer.h │ │ ├── redis_parser.cpp │ │ └── redis_parser.h │ └── proxy_ut │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── redis_proxy_test.cpp │ │ └── run.sh ├── remote_cmd │ ├── CMakeLists.txt │ ├── remote_command.cpp │ └── remote_command.h ├── replica │ ├── CMakeLists.txt │ ├── backup │ │ ├── cold_backup_context.cpp │ │ ├── cold_backup_context.h │ │ ├── replica_backup_manager.cpp │ │ ├── replica_backup_manager.h │ │ ├── replica_backup_server.cpp │ │ ├── replica_backup_server.h │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── config-test.ini │ │ │ ├── main.cpp │ │ │ ├── replica_backup_manager_test.cpp │ │ │ └── run.sh │ ├── bulk_load │ │ ├── replica_bulk_loader.cpp │ │ ├── replica_bulk_loader.h │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── config-test.ini │ │ │ ├── main.cpp │ │ │ ├── replica_bulk_loader_test.cpp │ │ │ └── run.sh │ ├── disk_cleaner.cpp │ ├── disk_cleaner.h │ ├── duplication │ │ ├── duplication_pipeline.cpp │ │ ├── duplication_pipeline.h │ │ ├── duplication_sync_timer.cpp │ │ ├── duplication_sync_timer.h │ │ ├── load_from_private_log.cpp │ │ ├── load_from_private_log.h │ │ ├── mutation_batch.cpp │ │ ├── mutation_batch.h │ │ ├── mutation_duplicator.h │ │ ├── replica_duplicator.cpp │ │ ├── replica_duplicator.h │ │ ├── replica_duplicator_manager.cpp │ │ ├── replica_duplicator_manager.h │ │ ├── replica_follower.cpp │ │ ├── replica_follower.h │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── config-test.ini │ │ │ ├── dup_replica_http_service_test.cpp │ │ │ ├── duplication_sync_timer_test.cpp │ │ │ ├── duplication_test_base.h │ │ │ ├── load_from_private_log_test.cpp │ │ │ ├── log.1.0.all_loaded_are_write_empties │ │ │ ├── log.1.0.handle_real_private_log │ │ │ ├── log.1.0.handle_real_private_log2 │ │ │ ├── main.cpp │ │ │ ├── mutation_batch_test.cpp │ │ │ ├── replica_duplicator_manager_test.cpp │ │ │ ├── replica_duplicator_test.cpp │ │ │ ├── replica_follower_test.cpp │ │ │ ├── run.sh │ │ │ └── ship_mutation_test.cpp │ ├── kms_key_provider.cpp │ ├── kms_key_provider.h │ ├── log_block.cpp │ ├── log_block.h │ ├── log_file.cpp │ ├── log_file.h │ ├── log_file_stream.h │ ├── mutation.cpp │ ├── mutation.h │ ├── mutation_cache.cpp │ ├── mutation_cache.h │ ├── mutation_log.cpp │ ├── mutation_log.h │ ├── mutation_log_replay.cpp │ ├── mutation_log_utils.cpp │ ├── mutation_log_utils.h │ ├── prepare_list.cpp │ ├── prepare_list.h │ ├── replica.cpp │ ├── replica.h │ ├── replica_2pc.cpp │ ├── replica_backup.cpp │ ├── replica_base.cpp │ ├── replica_base.h │ ├── replica_check.cpp │ ├── replica_chkpt.cpp │ ├── replica_config.cpp │ ├── replica_context.cpp │ ├── replica_context.h │ ├── replica_disk_migrator.cpp │ ├── replica_disk_migrator.h │ ├── replica_failover.cpp │ ├── replica_http_service.cpp │ ├── replica_http_service.h │ ├── replica_init.cpp │ ├── replica_learn.cpp │ ├── replica_restore.cpp │ ├── replica_stub.cpp │ ├── replica_stub.h │ ├── replica_throttle.cpp │ ├── replication_app_base.cpp │ ├── replication_app_base.h │ ├── replication_service_app.cpp │ ├── replication_service_app.h │ ├── split │ │ ├── replica_split_manager.cpp │ │ ├── replica_split_manager.h │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── config-test.ini │ │ │ ├── main.cpp │ │ │ ├── replica_split_test.cpp │ │ │ └── run.sh │ ├── storage │ │ ├── CMakeLists.txt │ │ └── simple_kv │ │ │ ├── CMakeLists.txt │ │ │ ├── clear.sh │ │ │ ├── config.ini │ │ │ ├── run.sh │ │ │ ├── simple_kv.app.example.h │ │ │ ├── simple_kv.client.h │ │ │ ├── simple_kv.code.definition.h │ │ │ ├── simple_kv.main.cpp │ │ │ ├── simple_kv.server.h │ │ │ ├── simple_kv.server.impl.cpp │ │ │ ├── simple_kv.server.impl.h │ │ │ ├── simple_kv.thrift │ │ │ └── test │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── addcase.sh │ │ │ ├── case-000.act │ │ │ ├── case-000.ini │ │ │ ├── case-001.act │ │ │ ├── case-001.ini │ │ │ ├── case-002.act │ │ │ ├── case-002.ini │ │ │ ├── case-003.act │ │ │ ├── case-003.ini │ │ │ ├── case-004.act │ │ │ ├── case-004.ini │ │ │ ├── case-005.act │ │ │ ├── case-005.ini │ │ │ ├── case-006.act │ │ │ ├── case-006.ini │ │ │ ├── case-100.act │ │ │ ├── case-100.ini │ │ │ ├── case-101.act │ │ │ ├── case-101.ini │ │ │ ├── case-102.act │ │ │ ├── case-102.ini │ │ │ ├── case-103.act │ │ │ ├── case-103.ini │ │ │ ├── case-104.act │ │ │ ├── case-104.ini │ │ │ ├── case-105.act │ │ │ ├── case-105.ini │ │ │ ├── case-106.act │ │ │ ├── case-106.ini │ │ │ ├── case-107.act │ │ │ ├── case-107.ini │ │ │ ├── case-108.act │ │ │ ├── case-108.ini │ │ │ ├── case-109.act │ │ │ ├── case-109.ini │ │ │ ├── case-200.act │ │ │ ├── case-200.ini │ │ │ ├── case-201.act │ │ │ ├── case-201.ini │ │ │ ├── case-202-0.act │ │ │ ├── case-202-0.ini │ │ │ ├── case-202-1.act │ │ │ ├── case-202-1.ini │ │ │ ├── case-203-0.act │ │ │ ├── case-203-0.ini │ │ │ ├── case-204.act │ │ │ ├── case-204.ini │ │ │ ├── case-205.act │ │ │ ├── case-205.ini │ │ │ ├── case-206.act │ │ │ ├── case-206.ini │ │ │ ├── case-207.act │ │ │ ├── case-207.ini │ │ │ ├── case-208.act │ │ │ ├── case-208.ini │ │ │ ├── case-209.act │ │ │ ├── case-209.ini │ │ │ ├── case-210.act │ │ │ ├── case-210.ini │ │ │ ├── case-211.act │ │ │ ├── case-211.ini │ │ │ ├── case-212.act │ │ │ ├── case-212.ini │ │ │ ├── case-213.act │ │ │ ├── case-213.ini │ │ │ ├── case-214.act │ │ │ ├── case-214.ini │ │ │ ├── case-215.act │ │ │ ├── case-215.ini │ │ │ ├── case-216.act │ │ │ ├── case-216.ini │ │ │ ├── case-300-0.act │ │ │ ├── case-300-0.ini │ │ │ ├── case-300-1.act │ │ │ ├── case-300-1.ini │ │ │ ├── case-300-2.act │ │ │ ├── case-300-2.ini │ │ │ ├── case-301.act │ │ │ ├── case-301.ini │ │ │ ├── case-302.act │ │ │ ├── case-302.ini │ │ │ ├── case-303.act │ │ │ ├── case-303.ini │ │ │ ├── case-304.act │ │ │ ├── case-304.ini │ │ │ ├── case-305.act │ │ │ ├── case-305.ini │ │ │ ├── case-306.act │ │ │ ├── case-306.ini │ │ │ ├── case-307.act │ │ │ ├── case-307.ini │ │ │ ├── case-400.act │ │ │ ├── case-400.ini │ │ │ ├── case-401.act │ │ │ ├── case-401.ini │ │ │ ├── case-402.act │ │ │ ├── case-402.ini │ │ │ ├── case-600.act │ │ │ ├── case-600.ini │ │ │ ├── case-601.act │ │ │ ├── case-601.ini │ │ │ ├── case-602.act │ │ │ ├── case-602.ini │ │ │ ├── case-603.act │ │ │ ├── case-603.ini │ │ │ ├── case.cpp │ │ │ ├── case.h │ │ │ ├── checker.cpp │ │ │ ├── checker.h │ │ │ ├── clear.sh │ │ │ ├── client.cpp │ │ │ ├── client.h │ │ │ ├── common.cpp │ │ │ ├── common.h │ │ │ ├── config.ini │ │ │ ├── injector.cpp │ │ │ ├── injector.h │ │ │ ├── rep_tests.pdf │ │ │ ├── run.sh │ │ │ ├── simple_kv.main.cpp │ │ │ ├── simple_kv.server.impl.cpp │ │ │ └── simple_kv.server.impl.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── backup_block_service_mock.h │ │ ├── clear.sh │ │ ├── cold_backup_context_test.cpp │ │ ├── config-test.ini │ │ ├── load_replicas_test.cpp │ │ ├── log_block_test.cpp │ │ ├── log_file_test.cpp │ │ ├── main.cpp │ │ ├── mock_utils.h │ │ ├── mutation_log_learn_test.cpp │ │ ├── mutation_log_test.cpp │ │ ├── open_replica_test.cpp │ │ ├── replica_dir_test.cpp │ │ ├── replica_disk_migrate_test.cpp │ │ ├── replica_disk_test.cpp │ │ ├── replica_disk_test_base.h │ │ ├── replica_http_service_test.cpp │ │ ├── replica_learn_test.cpp │ │ ├── replica_test.cpp │ │ ├── replica_test_base.h │ │ ├── replication_service_test_app.h │ │ ├── run.sh │ │ └── throttling_controller_test.cpp ├── rpc │ ├── CMakeLists.txt │ ├── asio_net_provider.cpp │ ├── asio_net_provider.h │ ├── asio_rpc_session.cpp │ ├── asio_rpc_session.h │ ├── dns_resolver.cpp │ ├── dns_resolver.h │ ├── dsn_message_parser.cpp │ ├── dsn_message_parser.h │ ├── group_address.h │ ├── group_host_port.h │ ├── message_parser.cpp │ ├── message_parser.h │ ├── message_parser_manager.h │ ├── network.cpp │ ├── network.h │ ├── network.sim.cpp │ ├── network.sim.h │ ├── raw_message_parser.cpp │ ├── raw_message_parser.h │ ├── request_meta.thrift │ ├── rpc_address.cpp │ ├── rpc_address.h │ ├── rpc_engine.cpp │ ├── rpc_engine.h │ ├── rpc_holder.h │ ├── rpc_host_port.cpp │ ├── rpc_host_port.h │ ├── rpc_message.cpp │ ├── rpc_message.h │ ├── rpc_stream.h │ ├── rpc_task.cpp │ ├── serialization.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── address_test.cpp │ │ ├── config.ini │ │ ├── corrupt_message_test.cpp │ │ ├── host_port_test.cpp │ │ ├── main.cpp │ │ ├── message_reader_test.cpp │ │ ├── message_utils_test.cpp │ │ ├── net_provider_test.cpp │ │ ├── rpc_holder_test.cpp │ │ ├── rpc_message_test.cpp │ │ ├── rpc_test.cpp │ │ ├── run.sh │ │ └── thrift_message_parser_test.cpp │ ├── thrift_message_parser.cpp │ └── thrift_message_parser.h ├── runtime │ ├── CMakeLists.txt │ ├── api_layer1.h │ ├── api_task.h │ ├── app_model.h │ ├── build_config.h │ ├── core_main.cpp │ ├── env.sim.cpp │ ├── env.sim.h │ ├── env_provider.h │ ├── fault_injector.cpp │ ├── fault_injector.h │ ├── global_config.cpp │ ├── global_config.h │ ├── message_utils.h │ ├── nativerun.cpp │ ├── nativerun.h │ ├── node_scoper.h │ ├── pipeline.h │ ├── profiler.cpp │ ├── profiler.h │ ├── profiler_header.h │ ├── providers.common.cpp │ ├── providers.common.h │ ├── scheduler.cpp │ ├── scheduler.h │ ├── serverlet.h │ ├── service_api_c.cpp │ ├── service_app.h │ ├── service_engine.cpp │ ├── service_engine.h │ ├── sim_clock.h │ ├── simulator.cpp │ ├── simulator.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── clear.sh │ │ ├── command.txt │ │ ├── config-test-sim.ini │ │ ├── config-test.ini │ │ ├── dns_resolver_test.cpp │ │ ├── main.cpp │ │ ├── pipeline_test.cpp │ │ ├── run.sh │ │ ├── service_api_c.cpp │ │ └── sim_lock.cpp │ ├── test_utils.h │ ├── threadpool_code.cpp │ ├── tool_api.cpp │ ├── tool_api.h │ ├── tracer.cpp │ ├── tracer.h │ └── zlocks.cpp ├── sample │ ├── CMakeLists.txt │ ├── README.md │ ├── config.ini │ ├── main.cpp │ └── run.sh ├── security │ ├── CMakeLists.txt │ ├── access_controller.cpp │ ├── access_controller.h │ ├── client_negotiation.cpp │ ├── client_negotiation.h │ ├── init.cpp │ ├── init.h │ ├── kinit_context.cpp │ ├── kinit_context.h │ ├── kms_client.cpp │ ├── kms_client.h │ ├── meta_access_controller.cpp │ ├── meta_access_controller.h │ ├── negotiation.cpp │ ├── negotiation.h │ ├── negotiation_manager.cpp │ ├── negotiation_manager.h │ ├── negotiation_utils.h │ ├── replica_access_controller.cpp │ ├── replica_access_controller.h │ ├── sasl_client_wrapper.cpp │ ├── sasl_client_wrapper.h │ ├── sasl_init.cpp │ ├── sasl_init.h │ ├── sasl_server_wrapper.cpp │ ├── sasl_server_wrapper.h │ ├── sasl_wrapper.cpp │ ├── sasl_wrapper.h │ ├── server_negotiation.cpp │ ├── server_negotiation.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── client_negotiation_test.cpp │ │ ├── config.ini │ │ ├── main.cpp │ │ ├── meta_access_controller_test.cpp │ │ ├── negotiation_manager_test.cpp │ │ ├── replica_access_controller_test.cpp │ │ ├── run.sh │ │ └── server_negotiation_test.cpp ├── server │ ├── CMakeLists.txt │ ├── available_detector.cpp │ ├── available_detector.h │ ├── capacity_unit_calculator.cpp │ ├── capacity_unit_calculator.h │ ├── collector │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── compaction_filter_rule.cpp │ ├── compaction_filter_rule.h │ ├── compaction_operation.cpp │ ├── compaction_operation.h │ ├── config.ini │ ├── config.min.ini │ ├── hashkey_transform.h │ ├── hotkey_collector.cpp │ ├── hotkey_collector.h │ ├── hotkey_collector_state.h │ ├── hotspot_partition_calculator.cpp │ ├── hotspot_partition_calculator.h │ ├── hotspot_partition_stat.h │ ├── info_collector.cpp │ ├── info_collector.h │ ├── info_collector_app.cpp │ ├── info_collector_app.h │ ├── key_ttl_compaction_filter.h │ ├── logging_utils.h │ ├── main.cpp │ ├── meta_server │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── pegasus_event_listener.cpp │ ├── pegasus_event_listener.h │ ├── pegasus_manual_compact_service.cpp │ ├── pegasus_manual_compact_service.h │ ├── pegasus_mutation_duplicator.cpp │ ├── pegasus_mutation_duplicator.h │ ├── pegasus_read_service.h │ ├── pegasus_scan_context.h │ ├── pegasus_server_impl.cpp │ ├── pegasus_server_impl.h │ ├── pegasus_server_impl_init.cpp │ ├── pegasus_server_write.cpp │ ├── pegasus_server_write.h │ ├── pegasus_service_app.h │ ├── pegasus_write_service.cpp │ ├── pegasus_write_service.h │ ├── pegasus_write_service_impl.h │ ├── range_read_limiter.h │ ├── replica_server │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── result_writer.cpp │ ├── result_writer.h │ ├── rocksdb_wrapper.cpp │ ├── rocksdb_wrapper.h │ ├── server_utils.cpp │ ├── server_utils.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── capacity_unit_calculator_test.cpp │ │ ├── compaction_filter_rule_test.cpp │ │ ├── compaction_operation_test.cpp │ │ ├── config.ini │ │ ├── hashkey_transform_test.cpp │ │ ├── hotkey_collector_test.cpp │ │ ├── hotspot_partition_test.cpp │ │ ├── main.cpp │ │ ├── manual_compact_service_test.cpp │ │ ├── message_utils.h │ │ ├── pegasus_compression_options_test.cpp │ │ ├── pegasus_mutation_duplicator_test.cpp │ │ ├── pegasus_server_impl_test.cpp │ │ ├── pegasus_server_test_base.h │ │ ├── pegasus_server_write_test.cpp │ │ ├── pegasus_value_schema_test.cpp │ │ ├── pegasus_write_service_impl_test.cpp │ │ ├── pegasus_write_service_test.cpp │ │ ├── rocksdb_wrapper_test.cpp │ │ └── run.sh ├── shell │ ├── CMakeLists.txt │ ├── argh.h │ ├── args.h │ ├── command_executor.h │ ├── command_helper.h │ ├── command_output.h │ ├── command_utils.cpp │ ├── command_utils.h │ ├── commands.h │ ├── commands │ │ ├── bulk_load.cpp │ │ ├── cold_backup.cpp │ │ ├── data_operations.cpp │ │ ├── debugger.cpp │ │ ├── detect_hotkey.cpp │ │ ├── duplication.cpp │ │ ├── global_properties.cpp │ │ ├── local_partition_split.cpp │ │ ├── misc.cpp │ │ ├── node_management.cpp │ │ ├── rebalance.cpp │ │ ├── recovery.cpp │ │ └── table_management.cpp │ ├── config.ini │ ├── linenoise │ │ ├── LICENSE │ │ ├── linenoise.c │ │ └── linenoise.h │ ├── main.cpp │ └── sds │ │ ├── LICENSE │ │ ├── sds.c │ │ ├── sds.h │ │ └── sdsalloc.h ├── task │ ├── CMakeLists.txt │ ├── async_calls.h │ ├── future_types.h │ ├── hpc_task_queue.cpp │ ├── hpc_task_queue.h │ ├── simple_task_queue.cpp │ ├── simple_task_queue.h │ ├── task.cpp │ ├── task.h │ ├── task_code.cpp │ ├── task_code.h │ ├── task_engine.cpp │ ├── task_engine.h │ ├── task_engine.sim.cpp │ ├── task_engine.sim.h │ ├── task_queue.cpp │ ├── task_queue.h │ ├── task_spec.cpp │ ├── task_spec.h │ ├── task_tracker.cpp │ ├── task_tracker.h │ ├── task_worker.cpp │ ├── task_worker.h │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── async_call_test.cpp │ │ ├── config-test-sim.ini │ │ ├── config-test.ini │ │ ├── lpc_test.cpp │ │ ├── main.cpp │ │ ├── run.sh │ │ ├── task_engine_test.cpp │ │ └── task_test.cpp │ └── timer_service.h ├── test │ ├── bench_test │ │ ├── CMakeLists.txt │ │ ├── benchmark.cpp │ │ ├── benchmark.h │ │ ├── config.cpp │ │ ├── config.h │ │ ├── config.ini │ │ ├── main.cpp │ │ ├── rand.cpp │ │ ├── rand.h │ │ ├── statistics.cpp │ │ ├── statistics.h │ │ └── utils.h │ ├── function_test │ │ ├── CMakeLists.txt │ │ ├── backup_restore │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_backup_and_restore.cpp │ │ ├── base_api │ │ │ ├── CMakeLists.txt │ │ │ ├── integration_test.cpp │ │ │ ├── main.cpp │ │ │ ├── test_basic.cpp │ │ │ ├── test_batch_get.cpp │ │ │ ├── test_check_and_mutate.cpp │ │ │ ├── test_check_and_set.cpp │ │ │ ├── test_copy.cpp │ │ │ ├── test_incr.cpp │ │ │ ├── test_range_read.cpp │ │ │ ├── test_recall.cpp │ │ │ ├── test_scan.cpp │ │ │ └── test_ttl.cpp │ │ ├── bulk_load │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_bulk_load.cpp │ │ ├── config.ini │ │ ├── detect_hotspot │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_detect_hotspot.cpp │ │ ├── partition_split │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_split.cpp │ │ ├── recovery │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_recovery.cpp │ │ ├── restore │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_restore.cpp │ │ ├── run.sh │ │ ├── security │ │ │ ├── CMakeLists.txt │ │ │ ├── config.ini │ │ │ ├── main.cpp │ │ │ └── test_kms_client.cpp │ │ ├── throttle │ │ │ ├── CMakeLists.txt │ │ │ ├── main.cpp │ │ │ └── test_throttle.cpp │ │ └── utils │ │ │ ├── CMakeLists.txt │ │ │ ├── global_env.cpp │ │ │ ├── global_env.h │ │ │ ├── test_util.cpp │ │ │ ├── test_util.h │ │ │ └── utils.h │ ├── kill_test │ │ ├── CMakeLists.txt │ │ ├── config.ini │ │ ├── data_verifier.cpp │ │ ├── data_verifier.h │ │ ├── job.cpp │ │ ├── job.h │ │ ├── kill_testor.cpp │ │ ├── kill_testor.h │ │ ├── killer_handler.h │ │ ├── killer_handler_shell.cpp │ │ ├── killer_handler_shell.h │ │ ├── killer_registry.cpp │ │ ├── killer_registry.h │ │ ├── main.cpp │ │ ├── partition_kill_testor.cpp │ │ ├── partition_kill_testor.h │ │ ├── process_kill_testor.cpp │ │ └── process_kill_testor.h │ └── pressure_test │ │ ├── CMakeLists.txt │ │ ├── config-pressure.ini │ │ └── main.cpp ├── test_util │ ├── CMakeLists.txt │ ├── test_util.cpp │ └── test_util.h ├── tools │ ├── CMakeLists.txt │ ├── mutation_log_tool.cpp │ └── mutation_log_tool.h ├── utils │ ├── CMakeLists.txt │ ├── TokenBucket.h │ ├── alloc.cpp │ ├── alloc.h │ ├── api_utilities.h │ ├── autoref_ptr.h │ ├── binary_reader.cpp │ ├── binary_reader.h │ ├── binary_writer.cpp │ ├── binary_writer.h │ ├── blob.h │ ├── builtin_metrics.cpp │ ├── builtin_metrics.h │ ├── bytes.h │ ├── casts.h │ ├── checksum.cpp │ ├── checksum.h │ ├── chrono_literals.h │ ├── clock.cpp │ ├── clock.h │ ├── command_manager.cpp │ ├── command_manager.h │ ├── config_api.cpp │ ├── config_api.h │ ├── config_helper.h │ ├── configuration.cpp │ ├── configuration.h │ ├── coredump.h │ ├── coredump.posix.cpp │ ├── crc.cpp │ ├── crc.h │ ├── customizable_id.h │ ├── defer.h │ ├── distributed_lock_service.h │ ├── endians.h │ ├── enum_helper.h │ ├── env.cpp │ ├── env.h │ ├── error_code.cpp │ ├── error_code.h │ ├── errors.h │ ├── exp_delay.h │ ├── extensible_object.h │ ├── factory_store.h │ ├── fail_point.cpp │ ├── fail_point.h │ ├── fail_point_impl.h │ ├── filesystem.cpp │ ├── filesystem.h │ ├── fixed_size_buffer_pool.h │ ├── flags.cpp │ ├── flags.h │ ├── fmt_logging.h │ ├── fmt_utils.h │ ├── function_traits.h │ ├── gpid.cpp │ ├── hpc_locks │ │ ├── autoresetevent.h │ │ ├── autoreseteventcondvar.h │ │ ├── benaphore.h │ │ ├── bitfield.h │ │ ├── readme.txt │ │ ├── rwlock.h │ │ └── sema.h │ ├── je_ctl.cpp │ ├── je_ctl.h │ ├── join_point.h │ ├── latency_tracer.cpp │ ├── latency_tracer.h │ ├── link.h │ ├── load_dump_object.h │ ├── lockp.std.h │ ├── logging.cpp │ ├── logging_provider.h │ ├── long_adder.cpp │ ├── long_adder.h │ ├── long_adder_bench │ │ ├── CMakeLists.txt │ │ └── long_adder_bench.cpp │ ├── macros.h │ ├── math.cpp │ ├── math.h │ ├── metrics.cpp │ ├── metrics.h │ ├── nth_element.h │ ├── optional.h │ ├── output_utils.cpp │ ├── output_utils.h │ ├── ports.h │ ├── preloadable.h │ ├── priority_queue.h │ ├── process_utils.cpp │ ├── process_utils.h │ ├── rand.cpp │ ├── rand.h │ ├── safe_strerror_posix.cpp │ ├── safe_strerror_posix.h │ ├── shared_io_service.cpp │ ├── shared_io_service.h │ ├── simple_logger.cpp │ ├── simple_logger.h │ ├── singleton.h │ ├── singleton_store.h │ ├── string_conv.h │ ├── string_splitter.h │ ├── strings.cpp │ ├── strings.h │ ├── synchronize.h │ ├── sys_exit_hook.h │ ├── test │ │ ├── CMakeLists.txt │ │ ├── TokenBucketTest.cpp │ │ ├── TokenBucketTest.h │ │ ├── autoref_ptr_test.cpp │ │ ├── binary_reader_test.cpp │ │ ├── blob_test.cpp │ │ ├── checksum_test.cpp │ │ ├── clear.sh │ │ ├── command_manager_test.cpp │ │ ├── config-bad-section.ini │ │ ├── config-dup-key.ini │ │ ├── config-dup-section.ini │ │ ├── config-empty.ini │ │ ├── config-no-key.ini │ │ ├── config-no-section.ini │ │ ├── config-null-section.ini │ │ ├── config-sample.ini │ │ ├── config-unmatch-section.ini │ │ ├── configuration.cpp │ │ ├── endian_test.cpp │ │ ├── enum_helper_test.cpp │ │ ├── env.cpp │ │ ├── fail_point_test.cpp │ │ ├── file_system_test.cpp │ │ ├── file_utils.cpp │ │ ├── flag_test.cpp │ │ ├── fmt_logging_test.cpp │ │ ├── je_ctl_test.cpp │ │ ├── join_point_test.cpp │ │ ├── json_helper_test.cpp │ │ ├── latency_tracer_test.cpp │ │ ├── load_dump_object_test.cpp │ │ ├── lock.std.cpp │ │ ├── logger.cpp │ │ ├── logging.cpp │ │ ├── long_adder_test.cpp │ │ ├── main.cpp │ │ ├── metrics_test.cpp │ │ ├── nth_element_bench │ │ │ ├── CMakeLists.txt │ │ │ └── nth_element_bench.cpp │ │ ├── nth_element_test.cpp │ │ ├── nth_element_utils.h │ │ ├── output_utils_test.cpp │ │ ├── percentile_utils.h │ │ ├── priority_queue.cpp │ │ ├── rand_test.cpp │ │ ├── run.sh │ │ ├── sema.cpp │ │ ├── string_conv_test.cpp │ │ ├── time_utils_test.cpp │ │ ├── token_bucket_throttling_controller_test.cpp │ │ ├── token_buckets_test.cpp │ │ └── utils.cpp │ ├── test_macros.h │ ├── thread_access_checker.cpp │ ├── thread_access_checker.h │ ├── threadpool_code.h │ ├── threadpool_spec.h │ ├── throttling_controller.cpp │ ├── throttling_controller.h │ ├── time_utils.cpp │ ├── time_utils.h │ ├── timer.h │ ├── token_bucket_throttling_controller.cpp │ ├── token_bucket_throttling_controller.h │ ├── token_buckets.cpp │ ├── token_buckets.h │ ├── uniq_timestamp_us.h │ ├── utils.h │ ├── work_queue.h │ ├── zlock_provider.h │ └── zlocks.h └── zookeeper │ ├── CMakeLists.txt │ ├── distributed_lock_service_zookeeper.cpp │ ├── distributed_lock_service_zookeeper.h │ ├── lock_struct.cpp │ ├── lock_struct.h │ ├── lock_types.h │ ├── test │ ├── CMakeLists.txt │ ├── clear.sh │ ├── config-test.ini │ ├── distributed_lock_zookeeper.cpp │ ├── main.cpp │ └── run.sh │ ├── zookeeper_error.cpp │ ├── zookeeper_error.h │ ├── zookeeper_session.cpp │ ├── zookeeper_session.h │ ├── zookeeper_session_mgr.cpp │ └── zookeeper_session_mgr.h └── thirdparty ├── CMakeLists.txt ├── fix_absl_build_on_macos_arm64.patch ├── fix_hdfs_native_client.patch ├── fix_jemalloc_for_m1_on_macos.patch ├── fix_libevent_for_macos.patch ├── fix_rocksdb-cmake-PORTABLE-option.patch ├── fix_s2_build_with_absl_and_gtest.patch ├── fix_snappy-Wsign-compare-warning.patch └── fix_thrift_build_and_link_errors.patch /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "apache/pegasus:build-env-ubuntu2004", 3 | "customizations": { 4 | "vscode": { 5 | "extensions": [ 6 | "ms-vscode.cpptools-extension-pack", 7 | "eamodio.gitlens" 8 | ] 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Something isn't working as expected. 4 | title: '' 5 | labels: type/bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Bug Report 11 | 12 | Please answer these questions before submitting your issue. Thanks! 13 | 14 | 1. What did you do? 15 | If possible, provide a recipe for reproducing the error. 16 | 17 | 2. What did you expect to see? 18 | 19 | 3. What did you see instead? 20 | 21 | 4. What version of Pegasus are you using? 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F680 Feature Request" 3 | about: I have a suggestion 4 | labels: type/enhancement 5 | --- 6 | 7 | ## Feature Request 8 | 9 | **Is your feature request related to a problem? Please describe:** 10 | 11 | 12 | **Describe the feature you'd like:** 13 | 14 | 15 | **Describe alternatives you've considered:** 16 | 17 | 18 | **Teachability, Documentation, Adoption, Migration Strategy:** 19 | 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general_question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F914 General Question" 3 | about: General question that isn't answered in docs 4 | 5 | --- 6 | 7 | ## General Question 8 | 9 | Before asking a question, make sure you have: 10 | 11 | - Searched open and closed [GitHub issues](https://github.com/apache/incubator-pegasus/issues) 12 | - Read the documentation: 13 | - [Pegasus Doc](https://pegasus.apache.org) 14 | -------------------------------------------------------------------------------- /.github/actions/run_server_tests/action.yaml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | name: Run server tests 19 | runs: 20 | using: composite 21 | steps: 22 | - name: Unit Testing 23 | run: | 24 | export LD_LIBRARY_PATH=$(pwd)/thirdparty/output/lib:${JAVA_HOME}/jre/lib/amd64/server 25 | ulimit -s unlimited 26 | ./run.sh test --onebox_opts "$ONEBOX_OPTS" --test_opts "$TEST_OPTS" -m ${{ matrix.test_module }} 27 | shell: bash 28 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### What problem does this PR solve? 2 | 3 | 4 | ### What is changed and how does it work? 5 | 6 | 7 | ### Checklist 8 | 9 | ##### Tests 10 | 11 | - Unit test 12 | - Integration test 13 | - Manual test (add detailed scripts or steps below) 14 | - No code 15 | 16 | ##### Code changes 17 | 18 | - Has exported function/method change 19 | - Has exported variable/fields change 20 | - Has interface methods change 21 | - Has persistent data change 22 | 23 | ##### Side effects 24 | 25 | - Possible performance regression 26 | - Increased code complexity 27 | - Breaking backward compatibility 28 | 29 | ##### Related changes 30 | 31 | - Need to cherry-pick to the release branch 32 | - Need to update the documentation 33 | - Need to be included in the release note 34 | -------------------------------------------------------------------------------- /.rat-excludes: -------------------------------------------------------------------------------- 1 | .*go.sum 2 | .*csv 3 | .*npmigonre 4 | .*gtest.filter 5 | FindRT.cmake 6 | FindDL.cmake 7 | dsn_err_string.go 8 | rocskdb_err_string.go 9 | safe_strerror_posix.h 10 | autoresetevent.h 11 | autoreseteventcondvar.h 12 | benaphore.h 13 | bitfield.h 14 | rwlock.h 15 | sema.h 16 | copy_source.txt 17 | suite.* 18 | nfs_test_file.* 19 | build_config.h 20 | command.txt 21 | safe_strerror_posix.cpp 22 | autoref_ptr_test.cpp 23 | config-empty.ini 24 | argh.h 25 | linenoise/* 26 | sds/* 27 | .*patch 28 | DISCLAIMER 29 | .rat-excludes 30 | -------------------------------------------------------------------------------- /DISCLAIMER: -------------------------------------------------------------------------------- 1 | Apache Pegasus (incubating) is an effort undergoing incubation at The Apache 2 | Software Foundation (ASF), sponsored by the Apache Incubator PMC. 3 | 4 | Incubation is required of all newly accepted projects until a further review 5 | indicates that the infrastructure, communications, and decision making process 6 | have stabilized in a manner consistent with other successful ASF projects. 7 | 8 | While incubation status is not necessarily a reflection of the completeness 9 | or stability of the code, it does indicate that the project has yet to be 10 | fully endorsed by the ASF. 11 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache Pegasus 2 | Copyright 2023 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /admin-cli/.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | builds: 19 | - goos: 20 | - linux 21 | - darwin 22 | - windows 23 | goarch: 24 | - amd64 25 | - arm64 26 | goarm: 27 | - 7 28 | main: ./main.go 29 | binary: admin-cli 30 | -------------------------------------------------------------------------------- /admin-cli/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | build: 19 | go mod verify 20 | go mod tidy 21 | go build -o bin/admin-cli main.go 22 | 23 | fmt: 24 | go fmt ./... 25 | 26 | test: 27 | go test -race -v -failfast -test.timeout 5m ./... 28 | -------------------------------------------------------------------------------- /admin-cli/check_and_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | # 21 | 22 | PROJECT_DIR=$(dirname "${SCRIPT_DIR}") 23 | cd "${PROJECT_DIR}" || exit 1 24 | 25 | if [ ! -f "${PROJECT_DIR}"/golangci-lint-1.35.2-linux-amd64/golangci-lint ]; then 26 | wget https://github.com/golangci/golangci-lint/releases/download/v1.35.2/golangci-lint-1.35.2-linux-amd64.tar.gz 27 | tar -xzvf golangci-lint-1.35.2-linux-amd64.tar.gz 28 | fi 29 | 30 | gofmt -l -w . 31 | go mod tidy 32 | golangci-lint-1.35.2-linux-amd64/golangci-lint run -v -E gofmt -E golint 33 | -------------------------------------------------------------------------------- /admin-cli/client/options.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package client 21 | 22 | import "time" 23 | 24 | var rpcTimeout = time.Second * 10 25 | 26 | // SetRPCTimeout is the global timeout setting of RPC. 27 | func SetRPCTimeout(d time.Duration) { 28 | rpcTimeout = d 29 | } 30 | -------------------------------------------------------------------------------- /admin-cli/cmd/cluster_info.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | 26 | "github.com/desertbit/grumble" 27 | ) 28 | 29 | func init() { 30 | shell.AddCommand(&grumble.Command{ 31 | Name: "cluster-info", 32 | Help: "displays the overall cluster information", 33 | Run: func(c *grumble.Context) error { 34 | return executor.ClusterInfo(pegasusClient) 35 | }, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /admin-cli/cmd/init.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "os" 24 | 25 | "github.com/apache/incubator-pegasus/admin-cli/executor" 26 | ) 27 | 28 | // globalMetaList is the user-input MetaServer IP:Port addresses 29 | var globalMetaList []string 30 | 31 | var pegasusClient *executor.Client 32 | 33 | // Init all commands to the shell app. 34 | func Init(metaList []string) { 35 | globalMetaList = metaList 36 | 37 | pegasusClient, _ = executor.NewClient(os.Stdout, globalMetaList, true) 38 | } 39 | -------------------------------------------------------------------------------- /admin-cli/cmd/list_nodes.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | "github.com/desertbit/grumble" 26 | ) 27 | 28 | func init() { 29 | shell.AddCommand(&grumble.Command{ 30 | Name: "nodes", 31 | Help: "displays the nodes overall status", 32 | Run: func(c *grumble.Context) error { 33 | return executor.ListNodes(pegasusClient) 34 | }, 35 | }) 36 | } 37 | -------------------------------------------------------------------------------- /admin-cli/cmd/node_stat.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | "github.com/desertbit/grumble" 26 | ) 27 | 28 | func init() { 29 | shell.AddCommand(&grumble.Command{ 30 | Name: "node-stat", 31 | Help: "query all nodes perf stat in the cluster", 32 | Run: func(c *grumble.Context) error { 33 | return executor.ShowNodesStat( 34 | pegasusClient, 35 | ) 36 | }, 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /admin-cli/cmd/server_info.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | 26 | "github.com/desertbit/grumble" 27 | ) 28 | 29 | func init() { 30 | shell.AddCommand(&grumble.Command{ 31 | Name: "server-info", 32 | Help: "displays the overall server information", 33 | Run: func(c *grumble.Context) error { 34 | return executor.ServerInfo(pegasusClient) 35 | }, 36 | }) 37 | 38 | } 39 | -------------------------------------------------------------------------------- /admin-cli/cmd/table_stat.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | 26 | "github.com/desertbit/grumble" 27 | ) 28 | 29 | func init() { 30 | shell.AddCommand(&grumble.Command{ 31 | Name: "table-stat", 32 | Help: "displays tables performance metrics", 33 | Run: func(c *grumble.Context) error { 34 | return executor.TableStat(pegasusClient) 35 | }, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /admin-cli/cmd/table_version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import ( 23 | "github.com/apache/incubator-pegasus/admin-cli/executor" 24 | "github.com/apache/incubator-pegasus/admin-cli/shell" 25 | "github.com/desertbit/grumble" 26 | ) 27 | 28 | func init() { 29 | shell.AddCommand(&grumble.Command{ 30 | Name: "data-version", 31 | Help: "query data version", 32 | Run: shell.RequireUseTable(func(c *shell.Context) error { 33 | return executor.QueryTableVersion(pegasusClient, c.UseTable) 34 | }), 35 | }) 36 | } 37 | -------------------------------------------------------------------------------- /admin-cli/cmd/utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package cmd 21 | 22 | import "strings" 23 | 24 | // filterStringWithPrefix returns strings with the same prefix. 25 | // This function is commonly used for the auto-completion of commands. 26 | func filterStringWithPrefix(strs []string, prefix string) []string { 27 | var result []string 28 | for _, s := range strs { 29 | if strings.HasPrefix(s, prefix) { 30 | result = append(result, s) 31 | } 32 | } 33 | return result 34 | } 35 | -------------------------------------------------------------------------------- /admin-cli/executor/cluster_info.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package executor 21 | 22 | import ( 23 | "encoding/json" 24 | "fmt" 25 | ) 26 | 27 | // ClusterInfo command 28 | func ClusterInfo(client *Client) error { 29 | clusterInfoMap, err := client.Meta.QueryClusterInfo() 30 | if err != nil { 31 | return err 32 | } 33 | 34 | // formats into JSON 35 | outputBytes, _ := json.MarshalIndent(clusterInfoMap, "", " ") 36 | fmt.Fprintln(client, string(outputBytes)) 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /admin-cli/executor/drop_table.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package executor 21 | 22 | import ( 23 | "fmt" 24 | ) 25 | 26 | // DropTable command 27 | func DropTable(c *Client, tableName string, reservePeriod int64) error { 28 | err := c.Meta.DropApp(tableName, reservePeriod) 29 | if err != nil { 30 | return err 31 | } 32 | 33 | fmt.Fprintf(c, "Dropped table \"%s\"\n", tableName) 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /admin-cli/executor/toolkits/log.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package toolkits 21 | 22 | import ( 23 | "fmt" 24 | 25 | "github.com/sirupsen/logrus" 26 | ) 27 | 28 | func LogInfo(log string) { 29 | fmt.Printf("INFO: %s\n", log) 30 | logrus.Info(log) 31 | } 32 | 33 | func LogWarn(log string) { 34 | fmt.Printf("WARN: %s\n", log) 35 | logrus.Warn(log) 36 | } 37 | 38 | func LogDebug(log string) { 39 | logrus.Debug(log) 40 | } 41 | 42 | func LogPanic(log string) { 43 | fmt.Println(log) 44 | logrus.Panic(log) 45 | } 46 | -------------------------------------------------------------------------------- /admin_tools/download_zk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | 20 | set -e 21 | 22 | CWD=$(cd $(dirname $0) && pwd) 23 | 24 | if [ $# -lt 1 ]; then 25 | echo "Invalid arguments !" 26 | echo "USAGE: $0 " 27 | exit 1 28 | fi 29 | 30 | ZOOKEEPER_BIN_PATH=$1 31 | 32 | ZOOKEEPER_VERSION=3.7.0 33 | ZOOKEEPER_DIR_NAME=apache-zookeeper-${ZOOKEEPER_VERSION}-bin 34 | ZOOKEEPER_PACKAGE_MD5="8ffa97e7e6b0b2cf1d022e5156a7561a" 35 | ${CWD}/download_package.sh ${ZOOKEEPER_DIR_NAME} ${ZOOKEEPER_PACKAGE_MD5} ${ZOOKEEPER_BIN_PATH} 36 | -------------------------------------------------------------------------------- /build_tools/bump_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | set -e 20 | 21 | if [ $# -ne 1 ]; then 22 | echo "USAGE: $0 " 23 | exit 1 24 | fi 25 | 26 | pwd="$(cd "$(dirname "$0")" && pwd)" 27 | shell_dir="$(cd "$pwd"/.. && pwd)" 28 | cd "$shell_dir" || exit 1 29 | 30 | VERSION=$1 31 | sed -i "s/^#define PEGASUS_VERSION .*/#define PEGASUS_VERSION \"$VERSION\"/" src/include/pegasus/version.h 32 | 33 | echo "Files modified successfully, version bumped to $VERSION" 34 | -------------------------------------------------------------------------------- /collector/Makefile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | build: 19 | go mod tidy 20 | go mod verify 21 | go build -o collector 22 | 23 | fmt: 24 | go fmt ./... 25 | -------------------------------------------------------------------------------- /collector/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | # Pegasus Collector 21 | 22 | [中文文档] 23 | 24 | Collector is a part of the Pegasus ecosystem that serves as: 25 | 26 | 1. the service availability detector 27 | 2. the hotkey detector 28 | 3. the capacity units recorder 29 | 30 | ## Requirement 31 | 32 | - Go1.18+ 33 | 34 | ## Development 35 | 36 | Build the collector: 37 | ```bash 38 | make build 39 | ``` 40 | 41 | Format the code: 42 | ```bash 43 | make fmt 44 | ``` 45 | -------------------------------------------------------------------------------- /collector/metrics/meta_server_metrics.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package metrics 19 | 20 | func NewMetaServerMetricCollector() MetricCollector { 21 | // Set detect interval and timeout 10s. 22 | return NewMetricCollector(MetaServer, 10000000000, 10000000000) 23 | } 24 | -------------------------------------------------------------------------------- /collector/metrics/replica_server_metrics.go: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | package metrics 19 | 20 | func NewReplicaServerMetricCollector() MetricCollector { 21 | // Set detect interval and timeout 10s. 22 | return NewMetricCollector(ReplicaServer, 10000000000, 10000000000) 23 | } 24 | -------------------------------------------------------------------------------- /docker/pegasus-build-env/README.md: -------------------------------------------------------------------------------- 1 | 19 | # pegasus-build-env 20 | 21 | This is the building environment of pegasus. Please read the manual here: http://pegasus.apache.org/docs/build/compile-by-docker/. 22 | -------------------------------------------------------------------------------- /docker/pegasus-docker-compose/clear_onebox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | #!/usr/bin/env bash 20 | 21 | cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1 22 | 23 | source cluster_args.sh 24 | 25 | if ! [[ -d "${DOCKER_DIR}" ]]; then 26 | echo "Cleared ${DOCKER_DIR} already" 27 | exit 0 28 | fi 29 | cd "${DOCKER_DIR}" || exit 1 30 | pwd 31 | 32 | docker-compose kill 33 | docker-compose rm -f -v 34 | docker network prune -f 35 | 36 | cd "${ROOT}" || exit 1 37 | 38 | sudo rm -rf "${DOCKER_DIR}" 39 | -------------------------------------------------------------------------------- /docker/pegasus-docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | version: "3.3" 19 | 20 | networks: 21 | frontend: 22 | ipam: 23 | config: 24 | - subnet: @META_IP_PREFIX@.255/24 25 | services: 26 | zookeeper: 27 | image: zookeeper:3.4 28 | ports: 29 | - "2181" 30 | restart: on-failure 31 | hostname: zookeeper 32 | environment: 33 | ZOO_MY_ID: 1 34 | ZOO_SERVERS: server.1=zookeeper:2888:3888 35 | networks: 36 | frontend: 37 | -------------------------------------------------------------------------------- /docker/pegasus-docker-compose/image_for_prebuilt_bin/Dockerfile: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | ARG GITHUB_BRANCH=master 19 | FROM apache/pegasus:build-env-ubuntu2004-${GITHUB_BRANCH} 20 | 21 | ARG SERVER_PKG_NAME 22 | 23 | COPY ./$SERVER_PKG_NAME.tar.gz / 24 | RUN cd / \ 25 | && tar xvf /$SERVER_PKG_NAME.tar.gz \ 26 | && mv $SERVER_PKG_NAME pegasus \ 27 | && rm /$SERVER_PKG_NAME.tar.gz 28 | 29 | COPY ./entrypoint.sh / 30 | RUN chmod +x /entrypoint.sh 31 | 32 | ENV LD_LIBRARY_PATH=/pegasus/bin 33 | 34 | ENTRYPOINT ["/entrypoint.sh"] 35 | -------------------------------------------------------------------------------- /docker/pegasus-docker-compose/image_for_prebuilt_bin/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | #!/bin/bash 20 | 21 | if [ -f /pegasus/bin/config_hdfs.sh ]; then 22 | source /pegasus/bin/config_hdfs.sh 23 | fi 24 | 25 | /pegasus/bin/pegasus_server /pegasus/bin/config.ini -app_list "$1" 26 | -------------------------------------------------------------------------------- /docker/pegasus-docker-compose/start_onebox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | #!/usr/bin/env bash 20 | 21 | set -e 22 | 23 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 24 | 25 | source cluster_args.sh 26 | 27 | cd "${ROOT}" || exit 1 28 | 29 | "${ROOT}"/clear_onebox.sh 30 | "${ROOT}"/prepare.sh 31 | 32 | cd "${DOCKER_DIR}" || exit 1 33 | pwd 34 | 35 | docker-compose up -d 36 | 37 | function print_nodes() { 38 | cd "${DOCKER_DIR}" || exit 1 39 | echo "" 40 | docker-compose ps 41 | echo "" 42 | cd - || exit 1 43 | } 44 | 45 | print_nodes 46 | -------------------------------------------------------------------------------- /docs/resources/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/arch.png -------------------------------------------------------------------------------- /docs/resources/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/config.png -------------------------------------------------------------------------------- /docs/resources/rdsn-layer1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/rdsn-layer1.jpg -------------------------------------------------------------------------------- /docs/resources/rdsn-layer2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/rdsn-layer2.jpg -------------------------------------------------------------------------------- /docs/resources/rdsn-layer3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/rdsn-layer3.jpg -------------------------------------------------------------------------------- /docs/resources/rdsn-state-all.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/rdsn-state-all.jpg -------------------------------------------------------------------------------- /docs/resources/rdsn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/rdsn.jpg -------------------------------------------------------------------------------- /docs/resources/viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/docs/resources/viz.png -------------------------------------------------------------------------------- /go-client/admin/remote_cmd_client_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package admin 21 | 22 | import ( 23 | "context" 24 | "testing" 25 | 26 | "github.com/stretchr/testify/assert" 27 | 28 | "github.com/apache/incubator-pegasus/go-client/session" 29 | ) 30 | 31 | func TestAdmin_RemoteCommandCall(t *testing.T) { 32 | 33 | c := NewRemoteCmdClient("127.0.0.1:34801", session.NodeTypeReplica) 34 | resp, err := c.Call(context.Background(), "help", []string{}) 35 | assert.Nil(t, err) 36 | assert.NotEmpty(t, resp) 37 | } 38 | -------------------------------------------------------------------------------- /go-client/codecov.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | ignore: 19 | - "session/admin_rpc_types.go" 20 | - "session/radmin_rpc_types.go" 21 | - "idl/**" 22 | -------------------------------------------------------------------------------- /go-client/example/pegasus-client-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta_servers": [ 3 | "127.0.0.1:34601", 4 | "127.0.0.1:34602", 5 | "127.0.0.1:34603" 6 | ] 7 | } -------------------------------------------------------------------------------- /go-client/generator/radmin.csv: -------------------------------------------------------------------------------- 1 | RPC_QUERY_DISK_INFO,QueryDiskInfo,QueryDiskInfoRequest,QueryDiskInfoResponse 2 | RPC_REPLICA_DISK_MIGRATE,DiskMigrate,ReplicaDiskMigrateRequest,ReplicaDiskMigrateResponse 3 | RPC_DETECT_HOTKEY,DetectHotkey,DetectHotkeyRequest,DetectHotkeyResponse 4 | RPC_ADD_NEW_DISK,AddDisk,AddNewDiskRequest,AddNewDiskResponse 5 | -------------------------------------------------------------------------------- /go-client/idl/admin/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/admin/backup-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | var _ = base.GoUnusedProtection__ 24 | var _ = replication.GoUnusedProtection__ 25 | 26 | func init() { 27 | } 28 | -------------------------------------------------------------------------------- /go-client/idl/admin/bulk_load-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | var _ = base.GoUnusedProtection__ 24 | var _ = replication.GoUnusedProtection__ 25 | 26 | func init() { 27 | } 28 | -------------------------------------------------------------------------------- /go-client/idl/admin/duplication-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/incubator-pegasus/go-client/idl/utils" 13 | "github.com/apache/thrift/lib/go/thrift" 14 | "reflect" 15 | ) 16 | 17 | // (needed to ensure safety because of naive import list construction.) 18 | var _ = thrift.ZERO 19 | var _ = fmt.Printf 20 | var _ = context.Background 21 | var _ = reflect.DeepEqual 22 | var _ = bytes.Equal 23 | 24 | var _ = base.GoUnusedProtection__ 25 | var _ = replication.GoUnusedProtection__ 26 | var _ = utils.GoUnusedProtection__ 27 | 28 | func init() { 29 | } 30 | -------------------------------------------------------------------------------- /go-client/idl/admin/meta_admin-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/incubator-pegasus/go-client/idl/utils" 13 | "github.com/apache/thrift/lib/go/thrift" 14 | "reflect" 15 | ) 16 | 17 | // (needed to ensure safety because of naive import list construction.) 18 | var _ = thrift.ZERO 19 | var _ = fmt.Printf 20 | var _ = context.Background 21 | var _ = reflect.DeepEqual 22 | var _ = bytes.Equal 23 | 24 | var _ = base.GoUnusedProtection__ 25 | var _ = replication.GoUnusedProtection__ 26 | var _ = utils.GoUnusedProtection__ 27 | 28 | func init() { 29 | } 30 | -------------------------------------------------------------------------------- /go-client/idl/admin/metadata-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | var _ = base.GoUnusedProtection__ 24 | var _ = replication.GoUnusedProtection__ 25 | 26 | func init() { 27 | } 28 | -------------------------------------------------------------------------------- /go-client/idl/admin/partition_split-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package admin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | var _ = base.GoUnusedProtection__ 24 | var _ = replication.GoUnusedProtection__ 25 | 26 | func init() { 27 | } 28 | -------------------------------------------------------------------------------- /go-client/idl/base/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package base 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/cmd/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package cmd 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/cmd/command-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package cmd 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/thrift/lib/go/thrift" 11 | "reflect" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | func init() { 22 | } 23 | -------------------------------------------------------------------------------- /go-client/idl/radmin/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package radmin 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/radmin/replica_admin-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package radmin 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/admin" 11 | "github.com/apache/incubator-pegasus/go-client/idl/base" 12 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 13 | "github.com/apache/thrift/lib/go/thrift" 14 | "reflect" 15 | ) 16 | 17 | // (needed to ensure safety because of naive import list construction.) 18 | var _ = thrift.ZERO 19 | var _ = fmt.Printf 20 | var _ = context.Background 21 | var _ = reflect.DeepEqual 22 | var _ = bytes.Equal 23 | 24 | var _ = base.GoUnusedProtection__ 25 | var _ = replication.GoUnusedProtection__ 26 | var _ = admin.GoUnusedProtection__ 27 | 28 | func init() { 29 | } 30 | -------------------------------------------------------------------------------- /go-client/idl/replication/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package replication 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/replication/dsn.layer2-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package replication 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/thrift/lib/go/thrift" 12 | "reflect" 13 | ) 14 | 15 | // (needed to ensure safety because of naive import list construction.) 16 | var _ = thrift.ZERO 17 | var _ = fmt.Printf 18 | var _ = context.Background 19 | var _ = reflect.DeepEqual 20 | var _ = bytes.Equal 21 | 22 | var _ = base.GoUnusedProtection__ 23 | 24 | func init() { 25 | } 26 | -------------------------------------------------------------------------------- /go-client/idl/rrdb/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package rrdb 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/rrdb/rrdb-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package rrdb 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/incubator-pegasus/go-client/idl/base" 11 | "github.com/apache/incubator-pegasus/go-client/idl/replication" 12 | "github.com/apache/thrift/lib/go/thrift" 13 | "reflect" 14 | ) 15 | 16 | // (needed to ensure safety because of naive import list construction.) 17 | var _ = thrift.ZERO 18 | var _ = fmt.Printf 19 | var _ = context.Background 20 | var _ = reflect.DeepEqual 21 | var _ = bytes.Equal 22 | 23 | var _ = replication.GoUnusedProtection__ 24 | var _ = base.GoUnusedProtection__ 25 | 26 | func init() { 27 | } 28 | -------------------------------------------------------------------------------- /go-client/idl/utils/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package utils 5 | 6 | var GoUnusedProtection__ int 7 | -------------------------------------------------------------------------------- /go-client/idl/utils/utils-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (0.13.0) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package utils 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "fmt" 10 | "github.com/apache/thrift/lib/go/thrift" 11 | "reflect" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | func init() { 22 | } 23 | -------------------------------------------------------------------------------- /go-client/pegasus/config.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package pegasus 21 | 22 | // Config is the configuration of pegasus client. 23 | type Config struct { 24 | MetaServers []string `json:"meta_servers"` 25 | } 26 | -------------------------------------------------------------------------------- /go-client/pegasus/main_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package pegasus 21 | 22 | import ( 23 | "os" 24 | "testing" 25 | 26 | "github.com/apache/incubator-pegasus/go-client/pegalog" 27 | ) 28 | 29 | func TestMain(m *testing.M) { 30 | pegalog.SetLogger(pegalog.StderrLogger) 31 | retc := m.Run() 32 | os.Exit(retc) 33 | } 34 | -------------------------------------------------------------------------------- /go-client/pegasus/op/op.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package op 21 | 22 | import ( 23 | "context" 24 | 25 | "github.com/apache/incubator-pegasus/go-client/idl/base" 26 | "github.com/apache/incubator-pegasus/go-client/session" 27 | ) 28 | 29 | // Request is the generic interface of all Pegasus operations. 30 | type Request interface { 31 | Validate() error 32 | 33 | Run(ctx context.Context, gpid *base.Gpid, partitionHash uint64, rs *session.ReplicaSession) (interface{}, error) 34 | } 35 | -------------------------------------------------------------------------------- /go-client/rpc/main_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package rpc 21 | 22 | import ( 23 | "os" 24 | "testing" 25 | 26 | "github.com/apache/incubator-pegasus/go-client/pegalog" 27 | ) 28 | 29 | func TestMain(m *testing.M) { 30 | pegalog.SetLogger(pegalog.StderrLogger) 31 | retc := m.Run() 32 | os.Exit(retc) 33 | } 34 | -------------------------------------------------------------------------------- /go-client/session/main_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package session 21 | 22 | import ( 23 | "os" 24 | "testing" 25 | 26 | "github.com/apache/incubator-pegasus/go-client/pegalog" 27 | ) 28 | 29 | func TestMain(m *testing.M) { 30 | pegalog.SetLogger(pegalog.StderrLogger) 31 | retc := m.Run() 32 | os.Exit(retc) 33 | } 34 | -------------------------------------------------------------------------------- /java-client/dev-support/license-header.txt: -------------------------------------------------------------------------------- 1 | Licensed to the Apache Software Foundation (ASF) under one 2 | or more contributor license agreements. See the NOTICE file 3 | distributed with this work for additional information 4 | regarding copyright ownership. The ASF licenses this file 5 | to you under the Apache License, Version 2.0 (the 6 | "License"); you may not use this file except in compliance 7 | with the License. You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, 12 | software distributed under the License is distributed on an 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | KIND, either express or implied. See the License for the 15 | specific language governing permissions and limitations 16 | under the License. -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/client/CheckAndMutateOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.client; 20 | 21 | /** 22 | * @author huangwei 23 | *

check_and_mutate options. 24 | */ 25 | public class CheckAndMutateOptions { 26 | public boolean returnCheckValue = false; // whether return the check value in results. 27 | 28 | public CheckAndMutateOptions() {} 29 | 30 | public CheckAndMutateOptions(CheckAndMutateOptions o) { 31 | returnCheckValue = o.returnCheckValue; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/client/ListAppInfoType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.client; 20 | 21 | public enum ListAppInfoType { 22 | LT_AVAILABLE_APPS(0), 23 | LT_ALL_APPS(1); 24 | 25 | private final int value; 26 | 27 | private ListAppInfoType(int value) { 28 | this.value = value; 29 | } 30 | 31 | public int getValue() { 32 | return value; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/client/request/Delete.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.client.request; 20 | 21 | import java.io.Serializable; 22 | 23 | public class Delete implements Serializable { 24 | 25 | private static final long serialVersionUID = 7472471005807908575L; 26 | 27 | public final byte[] hashKey; 28 | public final byte[] sortKey; 29 | 30 | public Delete(byte[] hashKey, byte[] sortKey) { 31 | this.hashKey = hashKey; 32 | this.sortKey = sortKey; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/client/request/Get.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.client.request; 20 | 21 | import java.io.Serializable; 22 | 23 | public class Get implements Serializable { 24 | 25 | private static final long serialVersionUID = 5022721155142508979L; 26 | 27 | public final byte[] hashKey; 28 | public final byte[] sortKey; 29 | 30 | public Get(byte[] hashKey, byte[] sortKey) { 31 | this.hashKey = hashKey; 32 | this.sortKey = sortKey; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/operator/read_operator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.operator; 20 | 21 | import org.apache.pegasus.base.gpid; 22 | 23 | /** Identifies that an RPC is a pure read-operation. */ 24 | abstract class read_operator extends client_operator { 25 | public read_operator(gpid gpid, String tableName, long partitionHash) { 26 | super(gpid, tableName, partitionHash); 27 | } 28 | 29 | @Override 30 | public boolean supportBackupRequest() { 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/rpc/KeyHasher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.rpc; 20 | 21 | import org.apache.pegasus.tools.Tools; 22 | 23 | /** Created by weijiesun on 16-11-11. */ 24 | public interface KeyHasher { 25 | KeyHasher DEFAULT = 26 | new KeyHasher() { 27 | @Override 28 | public long hash(byte[] key) { 29 | return Tools.dsn_crc64(key); 30 | } 31 | }; 32 | 33 | long hash(byte[] key); 34 | } 35 | -------------------------------------------------------------------------------- /java-client/src/main/java/org/apache/pegasus/rpc/Meta.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.pegasus.rpc; 20 | 21 | import org.apache.pegasus.base.error_code; 22 | import org.apache.pegasus.operator.client_operator; 23 | 24 | public abstract class Meta { 25 | public abstract error_code.error_types operate(client_operator op, int retryCount); 26 | } 27 | -------------------------------------------------------------------------------- /java-client/src/test/resources/pegasus.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | meta_servers = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603 21 | operation_timeout = 5000 22 | async_workers = 4 23 | enable_perf_counter = false 24 | perf_counter_tags = cluster=onebox,app=unit_test 25 | push_counter_interval_secs = 10 26 | meta_query_timeout = 5000 27 | auth_protocol = 28 | kerberos_service_name = 29 | kerberos_service_fqdn = 30 | kerberos_keytab = 31 | kerberos_principal = 32 | -------------------------------------------------------------------------------- /java-client/src/test/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | org.slf4j.simpleLogger.defaultLogLevel=info 21 | org.slf4j.simpleLogger.showDateTime=true 22 | org.slf4j.simpleLogger.dateTimeFormat=yyyy/MM/dd HH:mm:ss.SSS 23 | -------------------------------------------------------------------------------- /nodejs-client/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | module.exports = { 21 | extends: 'eslint:recommended', 22 | env : { 23 | node : true, 24 | es6 : true, 25 | mocha : true, 26 | }, 27 | plugins: [ 28 | 'promise', 29 | 'mocha', 30 | ], 31 | rules : { 32 | 'no-console' : 'off', 33 | 'indent': [ 'error', 4 ], 34 | "mocha/no-exclusive-tests": "error", 35 | }, 36 | }; 37 | -------------------------------------------------------------------------------- /nodejs-client/.npmigonre: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | -------------------------------------------------------------------------------- /nodejs-client/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | "use strict"; 21 | 22 | exports.Client = require('./src/client'); 23 | 24 | exports.create = exports.Client.create; -------------------------------------------------------------------------------- /nodejs-client/log_config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | "use strict"; 21 | 22 | let filename = "./logs/"+process.pid+"/pegasus-nodejs-client.log"; 23 | let logConfig = { 24 | appenders: { pegasus: {type: "file", filename: filename, maxLogSize: 104857600, backups: 10} }, 25 | categories: { default: { appenders: ["pegasus"], level: "INFO" } } 26 | }; 27 | module.exports = logConfig; -------------------------------------------------------------------------------- /nodejs-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pegasus-nodejs-client", 3 | "version": "2.6.0", 4 | "description": "offical pegasus nodejs client", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "mocha" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/apache/incubator-pegasus/nodejs-client" 12 | }, 13 | "keywords": [ 14 | "pegasus" 15 | ], 16 | "author": "heyuchen", 17 | "license": "Apache-2.0", 18 | "bugs": { 19 | "url": "https://github.com/apache/incubator-pegasus/issues" 20 | }, 21 | "homepage": "https://github.com/apache/incubator-pegasus/nodejs-client#readme", 22 | "dependencies": { 23 | "bunyan": "^1.8.12", 24 | "deasync": "^0.1.14", 25 | "log4js": "^2.11.0", 26 | "long": "^4.0.0", 27 | "node-int64": "^0.4.0", 28 | "thrift": "^0.10.0" 29 | }, 30 | "devDependencies": { 31 | "assert": "^1.4.1", 32 | "eslint": "^4.19.1", 33 | "eslint-plugin-mocha": "^4.12.1", 34 | "eslint-plugin-promise": "^3.8.0", 35 | "mocha": "^5.2.0", 36 | "sinon": "^4.5.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /pegic/.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | --- 18 | builds: 19 | - goos: 20 | - linux 21 | - darwin 22 | - windows 23 | goarch: 24 | - amd64 25 | - arm64 26 | goarm: 27 | - 7 28 | main: ./main.go 29 | binary: pegic 30 | -------------------------------------------------------------------------------- /pegic/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | build: 19 | go mod verify && go mod tidy 20 | go build -o bin/pegic main.go 21 | 22 | fmt: 23 | go fmt ./... 24 | -------------------------------------------------------------------------------- /pegic/check_and_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | # 21 | 22 | PROJECT_DIR=$(dirname "${SCRIPT_DIR}") 23 | cd "${PROJECT_DIR}" || exit 1 24 | 25 | if [ ! -f "${PROJECT_DIR}"/golangci-lint-1.35.2-linux-amd64/golangci-lint ]; then 26 | wget https://github.com/golangci/golangci-lint/releases/download/v1.35.2/golangci-lint-1.35.2-linux-amd64.tar.gz 27 | tar -xzvf golangci-lint-1.35.2-linux-amd64.tar.gz 28 | fi 29 | 30 | gofmt -l -w . 31 | go mod tidy 32 | golangci-lint-1.35.2-linux-amd64/golangci-lint run -v -E gofmt -E golint 33 | -------------------------------------------------------------------------------- /python-client/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | -------------------------------------------------------------------------------- /python-client/pypegasus/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | 21 | __version__ = '2.6.0' 22 | -------------------------------------------------------------------------------- /python-client/pypegasus/base/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ['ttypes', 'constants'] 19 | -------------------------------------------------------------------------------- /python-client/pypegasus/base/constants.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException 19 | from thrift.protocol.TProtocol import TProtocolException 20 | from thrift.TRecursive import fix_spec 21 | 22 | import sys 23 | from .ttypes import * 24 | -------------------------------------------------------------------------------- /python-client/pypegasus/logger.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | 20 | [loggers] 21 | keys=root 22 | [logger_root] 23 | level=INFO 24 | handlers=hand01 25 | propagate=0 26 | [handlers] 27 | keys=hand01 28 | [handler_hand01] 29 | class=handlers.RotatingFileHandler 30 | formatter=form01 31 | args=('pegasus.log', 'a', 100*1024*1024, 10) 32 | [formatters] 33 | keys=form01 34 | [formatter_form01] 35 | format=%(asctime)s [%(thread)d] [%(levelname)s] %(filename)s:%(lineno)d %(message)s 36 | datefmt=%Y-%m-%d %H:%M:%S 37 | -------------------------------------------------------------------------------- /python-client/pypegasus/operate/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ['packet'] -------------------------------------------------------------------------------- /python-client/pypegasus/transport/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ['transport'] -------------------------------------------------------------------------------- /python-client/pypegasus/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | __all__ = ['tools'] -------------------------------------------------------------------------------- /python-client/requirement.txt: -------------------------------------------------------------------------------- 1 | Twisted==21.2.0 2 | aenum==3.0.0 3 | thrift==0.13.0 4 | pyOpenSSL==24.2.1 5 | cryptography==43.0.1 6 | -------------------------------------------------------------------------------- /python-client/tests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | -------------------------------------------------------------------------------- /scala-client/project/build.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | sbt.version=1.2.8 20 | -------------------------------------------------------------------------------- /scala-client/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1") 21 | -------------------------------------------------------------------------------- /scala-client/src/test/resources/pegasus.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | meta_servers=127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603 20 | operation_timeout=1000 21 | async_workers=4 22 | enable_perf_counter=false 23 | perf_counter_tags=cluster=onebox,app=unit_test 24 | push_counter_interval_secs=10 25 | -------------------------------------------------------------------------------- /src/aio/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf data dsn_aio_test.xml copy_dest.txt 28 | -------------------------------------------------------------------------------- /src/aio/test/copy_source.txt: -------------------------------------------------------------------------------- 1 | 2 | help 3 | help engine 4 | help unexist-cmd 5 | engine 6 | task-code 7 | config-dump config-dump.ini 8 | test-cmd this is test argument 9 | unexist-cmd arg1 arg2 10 | 11 | -------------------------------------------------------------------------------- /src/aio/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | 20 | #include "runtime/app_model.h" 21 | 22 | GTEST_API_ int main(int argc, char **argv) 23 | { 24 | testing::InitGoogleTest(&argc, argv); 25 | dsn_run_config("config.ini", false); 26 | int g_test_ret = RUN_ALL_TESTS(); 27 | #ifndef ENABLE_GCOV 28 | dsn_exit(g_test_ret); 29 | #endif 30 | return g_test_ret; 31 | } 32 | -------------------------------------------------------------------------------- /src/base/test/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | int ret = RUN_ALL_TESTS(); 28 | dsn_exit(ret); 29 | } 30 | -------------------------------------------------------------------------------- /src/base/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | exit_if_fail() { 20 | if [ $1 != 0 ]; then 21 | echo $2 22 | exit 1 23 | fi 24 | } 25 | 26 | ./base_test 27 | 28 | exit_if_fail $? "run unit test failed" 29 | -------------------------------------------------------------------------------- /src/block_service/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################## 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | ############################################################################## 20 | 21 | rm -rf log.* *.log data dsn_block_service_test.xml randomfile* rename_dir* test_dir 22 | -------------------------------------------------------------------------------- /src/block_service/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################## 4 | # Licensed to the Apache Software Foundation (ASF) under one 5 | # or more contributor license agreements. See the NOTICE file 6 | # distributed with this work for additional information 7 | # regarding copyright ownership. The ASF licenses this file 8 | # to you under the Apache License, Version 2.0 (the 9 | # "License"); you may not use this file except in compliance 10 | # with the License. You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, 15 | # software distributed under the License is distributed on an 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | # KIND, either express or implied. See the License for the 18 | # specific language governing permissions and limitations 19 | # under the License. 20 | ############################################################################## 21 | 22 | if [ -z "${REPORT_DIR}" ]; then 23 | REPORT_DIR="." 24 | fi 25 | 26 | ./clear.sh 27 | output_xml="${REPORT_DIR}/dsn_block_service_test.xml" 28 | GTEST_OUTPUT="xml:${output_xml}" ./dsn_block_service_test 29 | -------------------------------------------------------------------------------- /src/client/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | 20 | #include "runtime/app_model.h" 21 | 22 | GTEST_API_ int main(int argc, char **argv) 23 | { 24 | testing::InitGoogleTest(&argc, argv); 25 | dsn_run_config("config.ini", false); 26 | dsn_exit(RUN_ALL_TESTS()); 27 | } 28 | -------------------------------------------------------------------------------- /src/client/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | if [ -z "${REPORT_DIR}" ]; then 20 | REPORT_DIR="." 21 | fi 22 | 23 | output_xml="${REPORT_DIR}/dsn_client_test.xml" 24 | GTEST_OUTPUT="xml:${output_xml}" ./dsn_client_test 25 | -------------------------------------------------------------------------------- /src/client_lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # TODO(yingchun): should export shared lib too!!! 19 | set(MY_PROJ_NAME "pegasus_client_static") 20 | 21 | add_definitions(-fPIC) 22 | 23 | set(MY_SRC_SEARCH_MODE "GLOB") 24 | 25 | set(MY_PROJ_SRC "") 26 | 27 | dsn_add_static_library() 28 | 29 | target_link_libraries(pegasus_client_static PUBLIC pegasus_base dsn_runtime dsn_client dsn_replication_common) 30 | -------------------------------------------------------------------------------- /src/common/manual_compact.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "meta_admin_types.h" 21 | #include "rpc/rpc_holder.h" 22 | 23 | namespace dsn { 24 | namespace replication { 25 | typedef rpc_holder 26 | start_manual_compact_rpc; 27 | typedef rpc_holder 28 | query_manual_compact_rpc; 29 | } // namespace replication 30 | } // namespace dsn 31 | -------------------------------------------------------------------------------- /src/failure_detector/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf log.* *.log data 28 | -------------------------------------------------------------------------------- /src/failure_detector/test/gtest.filter: -------------------------------------------------------------------------------- 1 | config-test.ini -fd.not_in_whitelist 2 | config-whitelist-test.ini -fd.not_in_whitelist 3 | config-whitelist-test-failed.ini fd.not_in_whitelist 4 | -------------------------------------------------------------------------------- /src/geo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | add_subdirectory(lib) 19 | add_subdirectory(test) 20 | add_subdirectory(bench) 21 | -------------------------------------------------------------------------------- /src/geo/test/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/geo/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | exit_if_fail() { 20 | if [ $1 != 0 ]; then 21 | echo $2 22 | exit 1 23 | fi 24 | } 25 | 26 | ./pegasus_geo_test 27 | 28 | exit_if_fail $? "run pegasus_geo_test failed" 29 | -------------------------------------------------------------------------------- /src/gutil/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # TODO(yingchun): add the project after new *.cpp files have been added. 19 | #set(MY_PROJ_NAME pgs_gutil) 20 | 21 | add_subdirectory(test) 22 | -------------------------------------------------------------------------------- /src/gutil/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME pgs_gutil_test) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | absl::btree 23 | absl::flat_hash_map 24 | absl::node_hash_map 25 | dsn_runtime 26 | dsn_utils 27 | rocksdb 28 | lz4 29 | zstd 30 | snappy 31 | gmock 32 | gtest) 33 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 34 | set(MY_BINPLACES 35 | run.sh) 36 | dsn_add_test() 37 | -------------------------------------------------------------------------------- /src/gutil/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | 20 | #include "runtime/app_model.h" 21 | 22 | GTEST_API_ int main(int argc, char **argv) 23 | { 24 | testing::InitGoogleTest(&argc, argv); 25 | dsn_exit(RUN_ALL_TESTS()); 26 | } 27 | -------------------------------------------------------------------------------- /src/gutil/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | ./pgs_gutil_test 20 | -------------------------------------------------------------------------------- /src/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_http) 19 | 20 | set(MY_PROJ_SRC ${THIRDPARTY_ROOT}/build/Source/http-parser/http_parser.c) 21 | 22 | set(MY_SRC_SEARCH_MODE "GLOB") 23 | 24 | set(MY_PROJ_LIBS "") 25 | 26 | dsn_add_static_library() 27 | 28 | add_subdirectory(test) 29 | -------------------------------------------------------------------------------- /src/http/http_method.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "utils/enum_helper.h" 21 | 22 | namespace dsn { 23 | 24 | enum class http_method 25 | { 26 | GET = 1, 27 | POST = 2, 28 | INVALID = 100, 29 | }; 30 | 31 | enum class http_auth_type 32 | { 33 | NONE, 34 | BASIC, 35 | DIGEST, 36 | SPNEGO, 37 | }; 38 | 39 | ENUM_BEGIN(http_method, http_method::INVALID) 40 | ENUM_REG2(http_method, GET) 41 | ENUM_REG2(http_method, POST) 42 | ENUM_END(http_method) 43 | 44 | } // namespace dsn 45 | -------------------------------------------------------------------------------- /src/http/http_server_impl.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "rpc/rpc_message.h" 21 | #include "runtime/serverlet.h" 22 | #include "http_server.h" 23 | 24 | namespace dsn { 25 | 26 | class http_server : public serverlet 27 | { 28 | public: 29 | http_server(); 30 | 31 | ~http_server() override = default; 32 | 33 | void serve(message_ex *msg); 34 | }; 35 | 36 | extern void http_response_reply(const http_response &resp, message_ex *req); 37 | 38 | } // namespace dsn 39 | -------------------------------------------------------------------------------- /src/http/service_version.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include "service_version.h" 19 | 20 | namespace dsn { 21 | 22 | service_version app_version; 23 | 24 | } // namespace dsn 25 | -------------------------------------------------------------------------------- /src/http/service_version.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace dsn { 23 | 24 | struct service_version 25 | { 26 | std::string version; 27 | std::string git_commit; 28 | }; 29 | 30 | extern service_version app_version; 31 | 32 | } // namespace dsn 33 | -------------------------------------------------------------------------------- /src/http/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_http_test) 19 | 20 | set(MY_PROJ_SRC "") 21 | 22 | set(MY_SRC_SEARCH_MODE "GLOB") 23 | 24 | set(MY_PROJ_LIBS 25 | dsn_http 26 | dsn_runtime 27 | curl 28 | gtest 29 | rocksdb 30 | lz4 31 | zstd 32 | snappy) 33 | 34 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 35 | 36 | set(MY_BINPLACES 37 | "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" 38 | "${CMAKE_CURRENT_SOURCE_DIR}/config-test.ini" 39 | ) 40 | 41 | dsn_add_test() 42 | -------------------------------------------------------------------------------- /src/http/uri_decoder.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #include "utils/errors.h" 23 | #include 24 | 25 | namespace dsn { 26 | namespace uri { 27 | 28 | /// \brief Decodes a sequence according to the percent decoding rules. 29 | /// \returns the decoded uri path 30 | error_with decode(const std::string_view &encoded_uri); 31 | 32 | } // namespace uri 33 | } // namespace dsn 34 | -------------------------------------------------------------------------------- /src/include/pegasus/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | namespace pegasus { 23 | 24 | #define PEGASUS_ERR_CODE(x, y, z) static const int x = y 25 | #include 26 | #undef PEGASUS_ERR_CODE 27 | 28 | } // namespace pegasus 29 | -------------------------------------------------------------------------------- /src/include/pegasus/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | #define PEGASUS_VERSION "2.6.0-SNAPSHOT" 22 | -------------------------------------------------------------------------------- /src/meta/test/meta_state/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf client core* log.* *.log data 28 | -------------------------------------------------------------------------------- /src/meta/test/meta_state/gtest.filter: -------------------------------------------------------------------------------- 1 | config-test.ini * 2 | -------------------------------------------------------------------------------- /src/meta/test/suite1: -------------------------------------------------------------------------------- 1 | 4 2 | 127.0.0.1:1 3 | 127.0.0.1:2 4 | 127.0.0.1:3 5 | 127.0.0.1:4 6 | 2 7 | 1 6 8 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 9 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 10 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 11 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 12 | 3 127.0.0.1:2 127.0.0.1:1 127.0.0.1:3 13 | 3 127.0.0.1:3 127.0.0.1:1 127.0.0.1:2 14 | 2 5 15 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 16 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 17 | 3 127.0.0.1:2 127.0.0.1:1 127.0.0.1:3 18 | 3 127.0.0.1:3 127.0.0.1:2 127.0.0.1:1 19 | 3 127.0.0.1:4 127.0.0.1:1 127.0.0.1:2 20 | -------------------------------------------------------------------------------- /src/meta/test/suite2: -------------------------------------------------------------------------------- 1 | 4 2 | 127.0.0.1:1 3 | 127.0.0.1:2 4 | 127.0.0.1:3 5 | 127.0.0.1:4 6 | 2 7 | 1 7 8 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 9 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 10 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 11 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 12 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 13 | 3 127.0.0.1:2 127.0.0.1:1 127.0.0.1:3 14 | 3 127.0.0.1:3 127.0.0.1:1 127.0.0.1:2 15 | 2 5 16 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 17 | 3 127.0.0.1:1 127.0.0.1:2 127.0.0.1:3 18 | 3 127.0.0.1:2 127.0.0.1:1 127.0.0.1:3 19 | 3 127.0.0.1:3 127.0.0.1:2 127.0.0.1:1 20 | 3 127.0.0.1:4 127.0.0.1:1 127.0.0.1:2 21 | -------------------------------------------------------------------------------- /src/nfs/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf data nfs_test_dir nfs_test_dir_copy dsn_nfs_test.xml 28 | -------------------------------------------------------------------------------- /src/perf_counter/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf data dsn_perf_counter_test.xml 28 | -------------------------------------------------------------------------------- /src/perf_counter/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | 20 | GTEST_API_ int main(int argc, char **argv) 21 | { 22 | testing::InitGoogleTest(&argc, argv); 23 | return RUN_ALL_TESTS(); 24 | } 25 | -------------------------------------------------------------------------------- /src/ranger/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_ranger) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | dsn_meta_server 23 | dsn_replication_common 24 | dsn_utils) 25 | dsn_add_static_library() 26 | add_subdirectory(test) 27 | -------------------------------------------------------------------------------- /src/ranger/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_ranger_tests) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | dsn_ranger 23 | dsn_runtime 24 | dsn_meta_server 25 | dsn_replication_common 26 | dsn_utils 27 | gtest) 28 | set(MY_BINPLACES 29 | run.sh) 30 | dsn_add_test() 31 | -------------------------------------------------------------------------------- /src/ranger/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | 20 | #include "runtime/app_model.h" 21 | 22 | GTEST_API_ int main(int argc, char **argv) 23 | { 24 | testing::InitGoogleTest(&argc, argv); 25 | 26 | int ret = RUN_ALL_TESTS(); 27 | dsn_exit(ret); 28 | } 29 | -------------------------------------------------------------------------------- /src/ranger/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | if [ -z "${REPORT_DIR}" ]; then 20 | REPORT_DIR="." 21 | fi 22 | 23 | rm -rf data dsn_ranger_tests.xml 24 | output_xml="${REPORT_DIR}/dsn_ranger_tests.xml" 25 | GTEST_OUTPUT="xml:${output_xml}" ./dsn_ranger_tests 26 | -------------------------------------------------------------------------------- /src/redis_protocol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | add_subdirectory(proxy) 19 | add_subdirectory(proxy_lib) 20 | add_subdirectory(proxy_ut) 21 | 22 | -------------------------------------------------------------------------------- /src/redis_protocol/proxy_ut/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | if [ -z $REPORT_DIR ]; then 20 | REPORT_DIR="./" 21 | fi 22 | 23 | test_case=pegasus_rproxy_test 24 | GTEST_OUTPUT="xml:$REPORT_DIR/$test_case.xml" ./$test_case 25 | -------------------------------------------------------------------------------- /src/replica/duplication/test/log.1.0.all_loaded_are_write_empties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/src/replica/duplication/test/log.1.0.all_loaded_are_write_empties -------------------------------------------------------------------------------- /src/replica/duplication/test/log.1.0.handle_real_private_log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/src/replica/duplication/test/log.1.0.handle_real_private_log -------------------------------------------------------------------------------- /src/replica/duplication/test/log.1.0.handle_real_private_log2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/src/replica/duplication/test/log.1.0.handle_real_private_log2 -------------------------------------------------------------------------------- /src/replica/split/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_replica_split_test) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | dsn_meta_server 23 | dsn_ranger 24 | dsn_replica_server 25 | dsn_replication_common 26 | dsn_runtime 27 | hashtable 28 | gtest) 29 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 30 | set(MY_BINPLACES 31 | config-test.ini 32 | run.sh) 33 | dsn_add_test() 34 | -------------------------------------------------------------------------------- /src/replica/storage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2015 Microsoft Corporation 4 | # 5 | # -=- Robust Distributed System Nucleus (rDSN) -=- 6 | # 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be included in 15 | # all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | # THE SOFTWARE. 24 | 25 | add_subdirectory(simple_kv) 26 | -------------------------------------------------------------------------------- /src/replica/storage/simple_kv/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf data core* out 28 | 29 | -------------------------------------------------------------------------------- /src/replica/storage/simple_kv/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf data core* 28 | 29 | -------------------------------------------------------------------------------- /src/replica/storage/simple_kv/test/rep_tests.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/src/replica/storage/simple_kv/test/rep_tests.pdf -------------------------------------------------------------------------------- /src/replica/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | 20 | rm -rf *.err core.* data/ log.* replica.* tag* test* test_cluster/ 21 | -------------------------------------------------------------------------------- /src/rpc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_rpc) 19 | set(MY_SRC_SEARCH_MODE "GLOB") 20 | thrift_generate_cpp( 21 | REQUEST_META_THRIFT_SRCS 22 | REQUEST_META_THRIFT_HDRS 23 | ${PROJECT_ROOT}/src/rpc/request_meta.thrift) 24 | set(MY_PROJ_SRC ${REQUEST_META_THRIFT_SRCS}) 25 | set(MY_PROJ_LIBS 26 | dsn_meta_server 27 | dsn_replication_common 28 | dsn_utils) 29 | dsn_add_static_library() 30 | 31 | add_subdirectory(test) 32 | -------------------------------------------------------------------------------- /src/rpc/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_rpc_tests) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | dsn_meta_server 23 | dsn_replication_common 24 | dsn_runtime 25 | dsn_utils 26 | gtest) 27 | set(MY_BINPLACES 28 | config.ini 29 | run.sh) 30 | dsn_add_test() 31 | -------------------------------------------------------------------------------- /src/rpc/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | if [ -z "${REPORT_DIR}" ]; then 20 | REPORT_DIR="." 21 | fi 22 | 23 | rm -rf data dsn_rpc_tests.xml 24 | output_xml="${REPORT_DIR}/dsn_rpc_tests.xml" 25 | GTEST_OUTPUT="xml:${output_xml}" ./dsn_rpc_tests config.ini 26 | -------------------------------------------------------------------------------- /src/runtime/sim_clock.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "utils/clock.h" 21 | #include "scheduler.h" 22 | 23 | namespace dsn { 24 | namespace tools { 25 | 26 | class sim_clock : public utils::clock 27 | { 28 | public: 29 | sim_clock() = default; 30 | virtual ~sim_clock() = default; 31 | 32 | // Gets simulated time in nanoseconds. 33 | virtual uint64_t now_ns() const { return scheduler::instance().now_ns(); } 34 | }; 35 | 36 | } // namespace tools 37 | } // namespace dsn 38 | -------------------------------------------------------------------------------- /src/runtime/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf core* log.* nfs_test_dir* *.tmp data 28 | 29 | -------------------------------------------------------------------------------- /src/runtime/test/command.txt: -------------------------------------------------------------------------------- 1 | 2 | help 3 | help engine 4 | help unexist-cmd 5 | engine 6 | task-code 7 | config-dump config-dump.ini 8 | test-cmd this is test argument 9 | unexist-cmd arg1 arg2 10 | 11 | -------------------------------------------------------------------------------- /src/sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME "sample") 19 | 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | 22 | set(MY_PROJ_LIBS 23 | pegasus_client_static 24 | rocksdb 25 | lz4 26 | zstd 27 | snappy) 28 | 29 | set(MY_BOOST_LIBS Boost::filesystem Boost::system) 30 | 31 | set(MY_BINPLACES config.ini run.sh) 32 | 33 | dsn_add_executable() 34 | dsn_install_executable() 35 | -------------------------------------------------------------------------------- /src/sample/README.md: -------------------------------------------------------------------------------- 1 | 19 | 20 | Run 21 | === 22 | ./run.sh 23 | 24 | For example: 25 | ./run.sh onebox temp 26 | 27 | To change cluster, please modify the last line of `config.ini'. 28 | -------------------------------------------------------------------------------- /src/security/init.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "utils/errors.h" 21 | 22 | namespace dsn { 23 | namespace security { 24 | // init security(kerberos and sasl) 25 | bool init(bool is_server); 26 | 27 | // init security only for zookeeper client(kerberos and sasl) 28 | bool init_for_zookeeper_client(); 29 | } // namespace security 30 | } // namespace dsn 31 | -------------------------------------------------------------------------------- /src/security/kinit_context.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #include "utils/errors.h" 23 | 24 | namespace dsn { 25 | namespace security { 26 | extern error_s run_kinit(); 27 | extern error_s run_get_principal_without_kinit(); 28 | extern const std::string &get_username(); 29 | } // namespace security 30 | } // namespace dsn 31 | -------------------------------------------------------------------------------- /src/security/sasl_init.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "utils/errors.h" 21 | 22 | namespace dsn { 23 | namespace security { 24 | // you must have already initialized kerberos before call init_sasl 25 | error_s init_sasl(bool is_server); 26 | } // namespace security 27 | } // namespace dsn 28 | -------------------------------------------------------------------------------- /src/security/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_security_tests) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | absl::strings 23 | dsn_http 24 | curl 25 | dsn_security 26 | dsn_meta_server 27 | dsn_replication_common 28 | dsn_runtime 29 | dsn_utils 30 | gtest 31 | rocksdb) 32 | set(MY_BINPLACES 33 | config.ini 34 | run.sh) 35 | dsn_add_test() 36 | -------------------------------------------------------------------------------- /src/security/test/config.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [apps.client] 19 | type = test 20 | arguments = localhost 20101 21 | pools = THREAD_POOL_DEFAULT 22 | 23 | [core] 24 | tool = nativerun 25 | -------------------------------------------------------------------------------- /src/security/test/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | if [ -z "${REPORT_DIR}" ]; then 20 | REPORT_DIR="." 21 | fi 22 | 23 | rm -rf data dsn_security_tests.xml 24 | output_xml="${REPORT_DIR}/dsn_security_tests.xml" 25 | GTEST_OUTPUT="xml:${output_xml}" ./dsn_security_tests config.ini 26 | -------------------------------------------------------------------------------- /src/server/collector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME "pegasus_collector") 19 | 20 | set(MY_PROJ_SRC ${COLLECTOR_SRC}) 21 | set(MY_SRC_SEARCH_MODE "GLOB") 22 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") 23 | set(MY_PROJ_LIBS ${COLLECTOR_LIBS}) 24 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 25 | SET(CMAKE_INSTALL_RPATH ".") 26 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 27 | 28 | dsn_add_executable() 29 | dsn_install_executable() 30 | -------------------------------------------------------------------------------- /src/server/logging_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "utils/fmt_logging.h" 23 | 24 | /// Utilities for logging the operation on rocksdb. 25 | 26 | #define LOG_ERROR_ROCKSDB(op, error, ...) \ 27 | LOG_ERROR_PREFIX("rocksdb {} failed: error = {} [{}]", op, error, fmt::format(__VA_ARGS__)) 28 | 29 | #define LOG_INFO_ROCKSDB(op, ...) LOG_INFO_PREFIX("rocksdb {}: [{}]", op, fmt::format(__VA_ARGS__)) 30 | -------------------------------------------------------------------------------- /src/server/meta_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME "pegasus_meta_server") 19 | 20 | set(MY_PROJ_SRC ${META_SERVER_SRC}) 21 | set(MY_SRC_SEARCH_MODE "GLOB") 22 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") 23 | set(MY_PROJ_LIBS ${META_SERVER_LIBS}) 24 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 25 | SET(CMAKE_INSTALL_RPATH ".") 26 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 27 | 28 | dsn_add_executable() 29 | dsn_install_executable() 30 | -------------------------------------------------------------------------------- /src/server/replica_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME "pegasus_replica_server") 19 | 20 | set(MY_PROJ_SRC ${REPLICA_SERVER_SRC}) 21 | set(MY_SRC_SEARCH_MODE "GLOB") 22 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../") 23 | set(MY_PROJ_LIBS ${REPLICA_SERVER_LIBS}) 24 | set(MY_BOOST_LIBS Boost::system Boost::filesystem) 25 | SET(CMAKE_INSTALL_RPATH ".") 26 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) 27 | 28 | dsn_add_executable() 29 | dsn_install_executable() 30 | -------------------------------------------------------------------------------- /src/server/server_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | #include "utils/macros.h" 25 | 26 | #ifndef DSN_BUILD_TYPE 27 | #define PEGASUS_BUILD_TYPE "" 28 | #else 29 | #define PEGASUS_BUILD_TYPE STRINGIFY(DSN_BUILD_TYPE) 30 | #endif 31 | 32 | namespace dsn { 33 | class command_deregister; 34 | } 35 | 36 | bool help(int argc, char **argv, const char *app_name); 37 | 38 | std::unique_ptr register_server_info_cmd(); 39 | 40 | const char *pegasus_server_rcsid(); 41 | -------------------------------------------------------------------------------- /src/task/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME dsn_task_tests) 19 | set(MY_PROJ_SRC "") 20 | set(MY_SRC_SEARCH_MODE "GLOB") 21 | set(MY_PROJ_LIBS 22 | dsn_task 23 | dsn_runtime 24 | dsn_meta_server 25 | dsn_replication_common 26 | dsn_utils 27 | gtest) 28 | set(MY_BINPLACES 29 | config-test.ini 30 | config-test-sim.ini 31 | run.sh) 32 | dsn_add_test() 33 | -------------------------------------------------------------------------------- /src/task/tests/config-test-sim.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [apps..default] 19 | type = test 20 | run = true 21 | count = 1 22 | pools = THREAD_POOL_DEFAULT, THREAD_POOL_TEST_SERVER 23 | 24 | [apps.client] 25 | arguments = localhost 20101 26 | ports = 27 | delay_seconds = 1 28 | 29 | [apps.server_group] 30 | arguments = 31 | ports = 20201 32 | count = 3 33 | 34 | [core] 35 | tool = simulator 36 | pause_on_start = false 37 | logging_start_level = LOG_LEVEL_DEBUG 38 | logging_factory_name = dsn::tools::screen_logger 39 | -------------------------------------------------------------------------------- /src/test/bench_test/config.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include "utils/env.h" 23 | 24 | namespace pegasus { 25 | namespace test { 26 | 27 | config::config() { env = dsn::utils::PegasusEnv(dsn::utils::FileDataType::kSensitive); } 28 | } // namespace test 29 | } // namespace pegasus 30 | -------------------------------------------------------------------------------- /src/test/bench_test/rand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | namespace pegasus { 23 | namespace test { 24 | // Reseeds the RNG of current thread. 25 | extern void reseed_thread_local_rng(uint64_t seed); 26 | extern uint64_t next_u64(); 27 | extern std::string generate_string(uint64_t len); 28 | } // namespace test 29 | } // namespace pegasus 30 | -------------------------------------------------------------------------------- /src/test/bench_test/utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | namespace pegasus { 23 | namespace test { 24 | enum operation_type 25 | { 26 | kUnknown = 0, 27 | kRead, 28 | kWrite, 29 | kDelete, 30 | kMultiGet, 31 | kMultiSet 32 | }; 33 | } // namespace test 34 | } // namespace pegasus 35 | -------------------------------------------------------------------------------- /src/test/function_test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | add_subdirectory(utils) 19 | add_subdirectory(backup_restore) 20 | add_subdirectory(base_api) 21 | add_subdirectory(bulk_load) 22 | add_subdirectory(detect_hotspot) 23 | add_subdirectory(partition_split) 24 | add_subdirectory(recovery) 25 | add_subdirectory(restore) 26 | add_subdirectory(security) 27 | add_subdirectory(throttle) 28 | -------------------------------------------------------------------------------- /src/test/function_test/backup_restore/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/base_api/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/bulk_load/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/detect_hotspot/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/partition_split/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/recovery/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/restore/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | int ret = RUN_ALL_TESTS(); 28 | dsn_exit(ret); 29 | } 30 | -------------------------------------------------------------------------------- /src/test/function_test/security/config.ini: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. You may obtain a copy of the License at 8 | ; 9 | ; http://www.apache.org/licenses/LICENSE-2.0 10 | ; 11 | ; Unless required by applicable law or agreed to in writing, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | 18 | [apps.mimic] 19 | type = dsn.app.mimic 20 | pools = THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER 21 | 22 | [core] 23 | tool = nativerun 24 | logging_start_level = LOG_LEVEL_INFO 25 | 26 | [replication] 27 | cluster_name = pegasus_cluster_key 28 | 29 | [pegasus.clusters] 30 | onebox = 127.0.0.1:34601,127.0.0.1:34602,127.0.0.1:34603 31 | 32 | [pegasus.server] 33 | encrypt_data_at_rest = true 34 | hadoop_kms_url = 35 | 36 | [security] 37 | enable_acl = true 38 | super_users = pegasus 39 | -------------------------------------------------------------------------------- /src/test/function_test/security/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/throttle/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include 21 | 22 | #include "runtime/app_model.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | dsn_run_config("config.ini", false); 28 | int ret = RUN_ALL_TESTS(); 29 | dsn_exit(ret); 30 | } 31 | -------------------------------------------------------------------------------- /src/test/function_test/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME "function_test_utils") 19 | set(MY_SRC_SEARCH_MODE "GLOB") 20 | set(MY_PROJ_SRC "") 21 | set(MY_PROJ_LIBS 22 | dsn_client 23 | dsn_replication_common 24 | pegasus_base 25 | pegasus_client_static 26 | gtest 27 | ) 28 | 29 | dsn_add_static_library() 30 | -------------------------------------------------------------------------------- /src/test/kill_test/data_verifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | namespace pegasus { 23 | namespace test { 24 | void verifier_initialize(const char *config_file); 25 | void verifier_start(); 26 | } // namespace test 27 | } // namespace pegasus 28 | -------------------------------------------------------------------------------- /src/test/kill_test/killer_registry.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include "killer_registry.h" 21 | #include "killer_handler.h" 22 | #include "killer_handler_shell.h" 23 | 24 | using namespace pegasus::test; 25 | 26 | void register_kill_handlers() { killer_handler::register_factory("shell"); } 27 | -------------------------------------------------------------------------------- /src/test/kill_test/killer_registry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #pragma once 21 | 22 | void register_kill_handlers(); 23 | -------------------------------------------------------------------------------- /src/test/kill_test/partition_kill_testor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #include "kill_testor.h" 21 | 22 | namespace pegasus { 23 | namespace test { 24 | class partition_kill_testor : public kill_testor 25 | { 26 | public: 27 | partition_kill_testor(const char *config_file); 28 | ~partition_kill_testor(); 29 | 30 | virtual void Run(); 31 | 32 | private: 33 | void run(); 34 | }; 35 | } // namespace test 36 | } // namespace pegasus 37 | -------------------------------------------------------------------------------- /src/test_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | set(MY_PROJ_NAME test_utils) 19 | 20 | # Search mode for source files under CURRENT project directory? 21 | # "GLOB_RECURSE" for recursive search 22 | # "GLOB" for non-recursive search 23 | set(MY_SRC_SEARCH_MODE "GLOB") 24 | 25 | set(MY_PROJ_LIBS 26 | gtest 27 | rocksdb 28 | lz4 29 | zstd 30 | snappy) 31 | 32 | dsn_add_static_library() 33 | -------------------------------------------------------------------------------- /src/utils/bytes.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | // Utility functions related to bytes. 23 | namespace dsn::bytes { 24 | 25 | // Convert a value in bytes to megabytes. 26 | template ::value>::type> 27 | inline TNum to_mb(TNum bytes) 28 | { 29 | return bytes / static_cast(1U << 20U); 30 | } 31 | 32 | } // namespace dsn::bytes 33 | -------------------------------------------------------------------------------- /src/utils/hpc_locks/readme.txt: -------------------------------------------------------------------------------- 1 | from: https://github.com/imzhenyu/cpp11-on-multicore 2 | originally from: https://github.com/preshing/cpp11-on-multicore with certain changes 3 | -------------------------------------------------------------------------------- /src/utils/macros.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | // Suppose there is a macro defined as: 21 | // #define FOO 123 22 | // 23 | // Once we need the value represented by FOO to be a string, i.e. "123", just do: 24 | // STRINGIFY(FOO) 25 | // 26 | // See https://gcc.gnu.org/onlinedocs/gcc-4.8.5/cpp/Stringification.html for details. 27 | #define STRINGIFY_HELPER(x) #x 28 | #define STRINGIFY(x) STRINGIFY_HELPER(x) 29 | -------------------------------------------------------------------------------- /src/utils/preloadable.h: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #pragma once 19 | 20 | #include "utils/ports.h" 21 | 22 | namespace dsn { 23 | namespace utils { 24 | 25 | template 26 | class preloadable 27 | { 28 | protected: 29 | preloadable() {} 30 | DISALLOW_COPY_AND_ASSIGN(preloadable); 31 | 32 | public: 33 | static T s_instance; 34 | }; 35 | 36 | template 37 | T preloadable::s_instance; 38 | } // namespace utils 39 | } // namespace dsn 40 | -------------------------------------------------------------------------------- /src/utils/rand.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include "utils/rand.h" 19 | #include 20 | 21 | namespace dsn { 22 | namespace rand { 23 | 24 | thread_local std::ranlux48_base g_thread_local_rng(std::random_device{}()); 25 | 26 | /*extern*/ uint64_t next_u64(uint64_t min, uint64_t max) 27 | { 28 | return std::uniform_int_distribution(min, max)(g_thread_local_rng); 29 | } 30 | 31 | /*extern*/ void reseed_thread_local_rng(uint64_t seed) { g_thread_local_rng.seed(seed); } 32 | 33 | } // namespace rand 34 | } // namespace dsn 35 | -------------------------------------------------------------------------------- /src/utils/test/TokenBucketTest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | namespace folly { 23 | 24 | struct TokenBucketTest : public ::testing::TestWithParam> 25 | { 26 | }; 27 | 28 | } // namespace folly 29 | -------------------------------------------------------------------------------- /src/utils/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf dsn.utils.tests.xml pegasus*.txt 28 | -------------------------------------------------------------------------------- /src/utils/test/config-empty.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/incubator-pegasus/c11158d2c960fd66323806b477aa0b45af644b90/src/utils/test/config-empty.ini -------------------------------------------------------------------------------- /src/utils/test/main.cpp: -------------------------------------------------------------------------------- 1 | // Licensed to the Apache Software Foundation (ASF) under one 2 | // or more contributor license agreements. See the NOTICE file 3 | // distributed with this work for additional information 4 | // regarding copyright ownership. The ASF licenses this file 5 | // to you under the Apache License, Version 2.0 (the 6 | // "License"); you may not use this file except in compliance 7 | // with the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, 12 | // software distributed under the License is distributed on an 13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | // KIND, either express or implied. See the License for the 15 | // specific language governing permissions and limitations 16 | // under the License. 17 | 18 | #include 19 | #include 20 | 21 | #include "utils/flags.h" 22 | #include "utils/logging_provider.h" 23 | 24 | GTEST_API_ int main(int argc, char **argv) 25 | { 26 | testing::InitGoogleTest(&argc, argv); 27 | 28 | dsn_log_init("dsn::tools::simple_logger", "./", "test", nullptr); 29 | 30 | dsn::flags_initialize(); 31 | 32 | return RUN_ALL_TESTS(); 33 | } 34 | -------------------------------------------------------------------------------- /src/zookeeper/test/clear.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # The MIT License (MIT) 3 | # 4 | # Copyright (c) 2015 Microsoft Corporation 5 | # 6 | # -=- Robust Distributed System Nucleus (rDSN) -=- 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy 9 | # of this software and associated documentation files (the "Software"), to deal 10 | # in the Software without restriction, including without limitation the rights 11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | # copies of the Software, and to permit persons to whom the Software is 13 | # furnished to do so, subject to the following conditions: 14 | # 15 | # The above copyright notice and this permission notice shall be included in 16 | # all copies or substantial portions of the Software. 17 | # 18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | # THE SOFTWARE. 25 | 26 | 27 | rm -rf core* log.* *.log data 28 | -------------------------------------------------------------------------------- /thirdparty/fix_absl_build_on_macos_arm64.patch: -------------------------------------------------------------------------------- 1 | diff --git a/absl/copts/AbseilConfigureCopts.cmake b/absl/copts/AbseilConfigureCopts.cmake 2 | index 3f737c81..8b0c3240 100644 3 | --- a/absl/copts/AbseilConfigureCopts.cmake 4 | +++ b/absl/copts/AbseilConfigureCopts.cmake 5 | @@ -42,7 +42,7 @@ if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES [[Clang]]) 6 | string(TOUPPER "${_arch}" _arch_uppercase) 7 | string(REPLACE "X86_64" "X64" _arch_uppercase ${_arch_uppercase}) 8 | foreach(_flag IN LISTS ABSL_RANDOM_HWAES_${_arch_uppercase}_FLAGS) 9 | - list(APPEND ABSL_RANDOM_RANDEN_COPTS "-Xarch_${_arch}" "${_flag}") 10 | + list(APPEND ABSL_RANDOM_RANDEN_COPTS "SHELL:-Xarch_${_arch} ${_flag}") 11 | endforeach() 12 | endforeach() 13 | # If a compiler happens to deal with an argument for a currently unused 14 | -------------------------------------------------------------------------------- /thirdparty/fix_jemalloc_for_m1_on_macos.patch: -------------------------------------------------------------------------------- 1 | --- configure 2022-02-16 01:43:33.470553518 +0000 2 | +++ configure.new 2022-02-16 01:43:24.149733186 +0000 3 | @@ -7175,6 +7175,7 @@ 4 | fi 5 | 6 | fi 7 | +if test "x${je_cv_lg_vaddr}" = "x0" ; then je_cv_lg_vaddr=48 ;fi # For podman/docker/qemu on macos dev build 8 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_lg_vaddr" >&5 9 | $as_echo "$je_cv_lg_vaddr" >&6; } 10 | if test "x${je_cv_lg_vaddr}" != "x" ; then 11 | -------------------------------------------------------------------------------- /thirdparty/fix_snappy-Wsign-compare-warning.patch: -------------------------------------------------------------------------------- 1 | From 27f34a580be4a3becf5f8c0cba13433f53c21337 Mon Sep 17 00:00:00 2001 2 | From: Richard O'Grady 3 | Date: Wed, 12 Jul 2023 10:12:01 -0700 4 | Subject: [PATCH] Fix -Wsign-compare warning 5 | 6 | PiperOrigin-RevId: 547529709 7 | --- 8 | snappy.cc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/snappy.cc b/snappy.cc 12 | index 688065b..6473123 100644 13 | --- a/snappy.cc 14 | +++ b/snappy.cc 15 | @@ -1289,7 +1289,7 @@ std::pair DecompressBranchless( 16 | DeferMemCopy(&deferred_src, &deferred_length, from, len); 17 | } 18 | } while (ip < ip_limit_min_slop && 19 | - (op + deferred_length) < op_limit_min_slop); 20 | + static_cast(op + deferred_length) < op_limit_min_slop); 21 | exit: 22 | ip--; 23 | assert(ip <= ip_limit); 24 | -- 25 | 2.42.1 26 | 27 | --------------------------------------------------------------------------------